public Builder mergeFrom(com.dremio.exec.proto.UserBitShared.MetricsDef other) { if (other == com.dremio.exec.proto.UserBitShared.MetricsDef.getDefaultInstance()) return this; if (metricDefBuilder_ == null) { if (!other.metricDef_.isEmpty()) { this.mergeUnknownFields(other.getUnknownFields()); return this;
/** * @param coreOperatorTypeMetricsMap * @param operatorType * @return Array of Metric names if operator type is present in the map else empty list */ public static String[] getMetricNames(CoreOperatorTypeMetricsMap coreOperatorTypeMetricsMap, int operatorType) { Optional<MetricsDef> metricsDef = getMetricsDef(coreOperatorTypeMetricsMap, operatorType); return metricsDef.map((metricDef) -> metricDef.getMetricDefList().stream().map(UserBitShared.MetricDef::getName).toArray(String[]::new)).orElse(ArrayUtils.EMPTY_STRING_ARRAY); }
public com.dremio.exec.proto.UserBitShared.MetricsDef buildPartial() { com.dremio.exec.proto.UserBitShared.MetricsDef result = new com.dremio.exec.proto.UserBitShared.MetricsDef(this); int from_bitField0_ = bitField0_; if (metricDefBuilder_ == null) { if (((bitField0_ & 0x00000001) == 0x00000001)) { metricDef_ = java.util.Collections.unmodifiableList(metricDef_); bitField0_ = (bitField0_ & ~0x00000001); } result.metricDef_ = metricDef_; } else { result.metricDef_ = metricDefBuilder_.build(); } onBuilt(); return result; }
com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { initFields(); int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = break; default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { done = true; makeExtensionsImmutable();
/** * <code>repeated .exec.shared.MetricsDef metrics_def = 1;</code> * * <pre> * underlying data structure is list with index as operator type and value as MetricsDef * </pre> */ public com.dremio.exec.proto.UserBitShared.MetricsDef.Builder addMetricsDefBuilder( int index) { return getMetricsDefFieldBuilder().addBuilder( index, com.dremio.exec.proto.UserBitShared.MetricsDef.getDefaultInstance()); } /**
/** * @param coreOperatorTypeMetricsMap * @param operatorType * @param metricId * @return Optional<MetricDef> containing metric defination if present in the map */ public static Optional<UserBitShared.MetricDef> getMetricById(CoreOperatorTypeMetricsMap coreOperatorTypeMetricsMap, int operatorType, int metricId) { Optional<MetricsDef> metricsDef = getMetricsDef(coreOperatorTypeMetricsMap, operatorType); if (metricsDef.isPresent() && metricId < metricsDef.get().getMetricDefCount()) { return Optional.ofNullable(metricsDef.get().getMetricDef(metricId)); } return Optional.empty(); }
public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; size = 0; for (int i = 0; i < metricDef_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, metricDef_.get(i)); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; }
public com.dremio.exec.proto.UserBitShared.MetricsDef build() { com.dremio.exec.proto.UserBitShared.MetricsDef result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
public boolean isInitialized(com.dremio.exec.proto.UserBitShared.MetricsDef message) { return message.isInitialized(); } public java.lang.String getFieldName(int number)
public void writeTo(io.protostuff.Output output, com.dremio.exec.proto.UserBitShared.MetricsDef message) throws java.io.IOException { for(com.dremio.exec.proto.UserBitShared.MetricDef metricDef : message.getMetricDefList()) output.writeObject(1, metricDef, com.dremio.exec.proto.SchemaUserBitShared.MetricDef.WRITE, true); } public boolean isInitialized(com.dremio.exec.proto.UserBitShared.MetricsDef message)
/** * @param coreOperatorTypeMetricsMap * @param operatorType * @return Array of Metric Ids if operator type is present in the map else empty list */ public static Integer[] getMetricIds(CoreOperatorTypeMetricsMap coreOperatorTypeMetricsMap, int operatorType) { Optional<MetricsDef> metricsDef = getMetricsDef(coreOperatorTypeMetricsMap, operatorType); return metricsDef.map((metricDef) -> metricDef.getMetricDefList().stream().map(UserBitShared.MetricDef::getId).toArray(Integer[]::new)).orElse(ArrayUtils.EMPTY_INTEGER_OBJECT_ARRAY); }
public com.dremio.exec.proto.UserBitShared.MetricsDef getDefaultInstanceForType() { return com.dremio.exec.proto.UserBitShared.MetricsDef.getDefaultInstance(); }
/** * <code>repeated .exec.shared.MetricsDef metrics_def = 1;</code> * * <pre> * underlying data structure is list with index as operator type and value as MetricsDef * </pre> */ public com.dremio.exec.proto.UserBitShared.MetricsDef.Builder addMetricsDefBuilder() { return getMetricsDefFieldBuilder().addBuilder( com.dremio.exec.proto.UserBitShared.MetricsDef.getDefaultInstance()); } /**
private static CoreOperatorTypeMetricsMap.Builder getMapBuilder() { CoreOperatorTypeMetricsMap.Builder builder = CoreOperatorTypeMetricsMap.newBuilder(); for (int i = 0; i < CoreOperatorType.values().length; i++) { // Initalizing with metricsdef object with empty list => This can be modified later at the time of registration builder.addMetricsDef(MetricsDef.getDefaultInstance()); } return builder; }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); for (int i = 0; i < metricDef_.size(); i++) { output.writeMessage(1, metricDef_.get(i)); } getUnknownFields().writeTo(output); }