rdblue commented on code in PR #1084: URL: https://github.com/apache/parquet-mr/pull/1084#discussion_r1182862929
########## parquet-hadoop/src/main/java/org/apache/parquet/hadoop/util/HadoopStreams.java: ########## @@ -37,6 +41,39 @@ public class HadoopStreams { private static final Logger LOG = LoggerFactory.getLogger(HadoopStreams.class); + private static final Class<?> byteBufferReadableClass = getReadableClass(); + static final Constructor<SeekableInputStream> h2SeekableConstructor = getH2SeekableConstructor(); Review Comment: Rather than using two static methods, you can use `DynConstructors` instead to make this one expression and reduce error handling code: ```java private static final DynConstructors.Ctor<SeekableInputStream> h2streamCtor = DynConstructors.Builder(SeekableInputStream.class) .impl("org.apache.parquet.hadoop.util.H2SeekableInputStream", FSDataInputStream.class) .orNull() .build() ... if (h2streamCtor != null) { return h2streamCtor.newInstance(stream); } ``` -- 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: dev-unsubscr...@parquet.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org