vdiravka commented on a change in pull request #1436: DRILL-6696: IOBE in
Operator Metric Registry
URL: https://github.com/apache/drill/pull/1436#discussion_r210902302
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/ops/OperatorMetricRegistry.java
##########
@@ -61,14 +66,11 @@
private static void register(final int operatorType, final Class<? extends
MetricDef> metricDef) {
// Currently registers a metric def that has enum constants
- final MetricDef[] enumConstants = metricDef.getEnumConstants();
- if (enumConstants != null) {
- final String[] names = new String[enumConstants.length];
- for (int i = 0; i < enumConstants.length; i++) {
- names[i] = enumConstants[i].name();
- }
- OPERATOR_METRICS[operatorType] = names;
- }
+ String[] names = Arrays.stream(metricDef.getEnumConstants())
Review comment:
My bad, not right `null` check. EnumConstants array should be checked.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services