-
Notifications
You must be signed in to change notification settings - Fork 152
In the installation doc it is stated we should include some --add-opens to the JVM, however, in my scenario, is impossible to add those flags as I cannot control how the JVM is launched.
Currently, my application dont even start, because the MemoryUtil class is not loaded because an Exception in the static scope.
If instead of throwing an exception in the case the --add-opens is not set, we catch it as the other exceptions, we'll be able to load the class, and use arrow in our system
final Object maybeDirectBufferConstructor = AccessController.doPrivileged( new PrivilegedAction<Object>() { @Override public Object run() { try { final Constructor<?> constructor = (majorVersion >= 21) ? direct.getClass().getDeclaredConstructor(long.class, long.class) : direct.getClass().getDeclaredConstructor(long.class, int.class); constructor.setAccessible(true); logger.debug("Constructor for direct buffer found and made accessible"); return constructor; } catch (NoSuchMethodException e) { logger.debug("Cannot get constructor for direct buffer allocation", e); return e; } catch (SecurityException e) { logger.debug("Cannot get constructor for direct buffer allocation", e); return e; } catch (InaccessibleObjectException e) { // <-- new added exception case logger.debug("Cannot get constructor for direct buffer allocation", e); return e; } } });
Currently, I'm forced to fork arrow because of this limitation. The proposed change is something acceptable ? I can propose a PR for it, but I dont know the full implications in all Arrow, but in my scenario is enough to use it for my purpose, and I would like to continue to use it without maintaining a fork.
Thanks