bbeaudreault commented on code in PR #5488:
URL: https://github.com/apache/hbase/pull/5488#discussion_r1384840873
##########
hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java:
##########
@@ -304,6 +305,24 @@ public static boolean isClassLoaderLoaded() {
return classLoaderLoaded;
}
+ private static final String PARSE_FROM = "parseFrom";
+
+ // We don't bother using the dynamic CLASS_LOADER above, because currently
we can't support
+ // optimizing dynamically loaded classes. We can do it once we build for
java9+, see the todo
+ // in ReflectedFunctionCache
+ private static final ReflectedFunctionCache<byte[], Filter> FILTERS =
ReflectedFunctionCache
+ .create(ProtobufUtil.class.getClassLoader(), Filter.class, byte[].class,
PARSE_FROM);
+ private static final ReflectedFunctionCache<byte[], ByteArrayComparable>
COMPARATORS =
+ ReflectedFunctionCache.create(ProtobufUtil.class.getClassLoader(),
ByteArrayComparable.class,
+ byte[].class, PARSE_FROM);
+
+ private static volatile boolean ALLOW_FAST_REFLECTION_FALLTHROUGH = true;
Review Comment:
I don't think so. It's explicitly better on all supported versions of Java,
with no downside. It seems like one of those unnecessary configs that hangs
around forever. Also it'd be complicated to pipe a config in there since it's
multiple levels of static only methods (for example recursive toFilter calls in
FilterList.parsefrom)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]