arina-ielchiieva commented on a change in pull request #1436: DRILL-6696:
Improving of operators metrics registry
URL: https://github.com/apache/drill/pull/1436#discussion_r210896426
##########
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:
Do you know the case when enum constants are null?
----------------------------------------------------------------
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