Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kamal-narayan committed Mar 21, 2023
1 parent e896053 commit 348c0be
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import org.apache.druid.data.input.MapBasedInputRow;
import org.apache.druid.data.input.impl.ByteEntity;
import org.apache.druid.data.input.impl.DimensionsSpec;
import org.apache.druid.data.input.opentelemetry.protobuf.OpenXProtobufReader;
import org.apache.druid.data.input.opentelemetry.protobuf.AbstractProtobufReader;
import org.apache.druid.indexing.seekablestream.SettableByteEntity;
import org.apache.druid.utils.CollectionUtils;

Expand All @@ -44,7 +44,7 @@
import java.util.Map;
import java.util.Set;

public class OpenCensusProtobufReader extends OpenXProtobufReader
public class OpenCensusProtobufReader extends AbstractProtobufReader
{
private static final String SEPARATOR = "-";
private static final String VALUE_COLUMN = "value";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@
import java.util.Map;


public abstract class OpenXProtobufReader implements InputEntityReader
public abstract class AbstractProtobufReader implements InputEntityReader
{

protected final SettableByteEntity<? extends ByteEntity> source;
protected final DimensionsSpec dimensionsSpec;

public OpenXProtobufReader(DimensionsSpec dimensionsSpec,
SettableByteEntity<? extends ByteEntity> source)
public AbstractProtobufReader(DimensionsSpec dimensionsSpec,
SettableByteEntity<? extends ByteEntity> source)
{
this.dimensionsSpec = dimensionsSpec;
this.source = source;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import org.apache.druid.data.input.InputRow;
import org.apache.druid.data.input.impl.ByteEntity;
import org.apache.druid.data.input.impl.DimensionsSpec;
import org.apache.druid.data.input.opentelemetry.protobuf.OpenXProtobufReader;
import org.apache.druid.data.input.opentelemetry.protobuf.AbstractProtobufReader;
import org.apache.druid.data.input.opentelemetry.protobuf.Utils;
import org.apache.druid.indexing.seekablestream.SettableByteEntity;
import org.apache.druid.java.util.common.logger.Logger;
Expand All @@ -40,7 +40,7 @@
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;

public class OpenTelemetryMetricsProtobufReader extends OpenXProtobufReader
public class OpenTelemetryMetricsProtobufReader extends AbstractProtobufReader
{
private static final Logger log = new Logger(OpenTelemetryMetricsProtobufReader.class);
private final String metricDimension;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,12 @@ private String validateDimensionName(String input, String dimensionName)

if (!resourceAttributePrefix.isEmpty()) {
Preconditions.checkArgument(!input.startsWith(resourceAttributePrefix),
" dimension name cannot start with resourceAttributePrefix");
" cannot start with resourceAttributePrefix");
}

if (!spanAttributePrefix.isEmpty()) {
Preconditions.checkArgument(!input.startsWith(spanAttributePrefix),
" dimension name cannot start with spanAttributePrefix");
" cannot start with spanAttributePrefix");
}
return input;
}
Expand All @@ -150,21 +150,21 @@ public OpenTelemetryTracesProtobufInputFormat(
this.resourceAttributePrefix = resourceAttributePrefix == null ? DEFAULT_RESOURCE_ATTR_PREFIX : resourceAttributePrefix;

this.spanNameDimension = spanNameDimension == null ? DEFAULT_SPAN_NAME_DIMENSION :
validateDimensionName(spanNameDimension, "Span Name");
validateDimensionName(spanNameDimension, "spanNameDimension");
this.spanIdDimension = spanIdDimension == null ? DEFAULT_SPAN_ID_DIMENSION :
validateDimensionName(spanIdDimension, "Span Id");
validateDimensionName(spanIdDimension, "spanIdDimension");
this.parentSpanIdDimension = parentSpanIdDimension == null ? DEFAULT_PARENT_SPAN_ID_DIMENSION :
validateDimensionName(parentSpanIdDimension, "Parent Span Id");
validateDimensionName(parentSpanIdDimension, "parentSpanIdDimension");
this.traceIdDimension = traceIdDimension == null ? DEFAULT_TRACE_ID_DIMENSION :
validateDimensionName(traceIdDimension, "Trace Id");
validateDimensionName(traceIdDimension, "traceIdDimension");
this.endTimeDimension = endTimeDimension == null ? DEFAULT_END_TIME_DIMENSION :
validateDimensionName(endTimeDimension, "End Time");
validateDimensionName(endTimeDimension, "endTimeDimension");
this.statusCodeDimension = statusCodeDimension == null ? DEFAULT_STATUS_CODE_DIMENSION :
validateDimensionName(statusCodeDimension, "Status Code");
validateDimensionName(statusCodeDimension, "statusCodeDimension");
this.statusMessageDimension = statusMessageDimension == null ? DEFAULT_STATUS_MESSAGE_DIMENSION :
validateDimensionName(statusMessageDimension, "Status Message");
validateDimensionName(statusMessageDimension, "statusMessageDimension");
this.kindDimension = kindDimension == null ? DEFAULT_KIND_DIMENSION :
validateDimensionName(kindDimension, "Kind");
validateDimensionName(kindDimension, "kindDimension");

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import org.apache.druid.data.input.InputRow;
import org.apache.druid.data.input.impl.ByteEntity;
import org.apache.druid.data.input.impl.DimensionsSpec;
import org.apache.druid.data.input.opentelemetry.protobuf.OpenXProtobufReader;
import org.apache.druid.data.input.opentelemetry.protobuf.AbstractProtobufReader;
import org.apache.druid.data.input.opentelemetry.protobuf.Utils;
import org.apache.druid.indexing.seekablestream.SettableByteEntity;

Expand All @@ -37,7 +37,7 @@
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;

public class OpenTelemetryTracesProtobufReader extends OpenXProtobufReader
public class OpenTelemetryTracesProtobufReader extends AbstractProtobufReader
{
private final String spanAttributePrefix;
private final String resourceAttributePrefix;
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,9 @@
<module>extensions-contrib/aliyun-oss-extensions</module>
<module>extensions-contrib/prometheus-emitter</module>
<module>extensions-contrib/opentelemetry-emitter</module>
<module>extensions-contrib/opentelemetry-extensions</module>
<module>extensions-contrib/opencensus-extensions</module>
<module>extensions-contrib/confluent-extensions</module>
<module>extensions-contrib/opentelemetry-extensions</module>
<!-- distribution packaging -->
<module>distribution</module>
<!-- Revised integration tests -->
Expand Down

0 comments on commit 348c0be

Please sign in to comment.