99import io .opentelemetry .exporter .internal .marshal .MarshalerWithSize ;
1010import io .opentelemetry .exporter .internal .marshal .ProtoEnumInfo ;
1111import io .opentelemetry .exporter .internal .marshal .Serializer ;
12- import io .opentelemetry .proto .profiles .v1development .internal .AggregationTemporality ;
1312import io .opentelemetry .proto .profiles .v1development .internal .ValueType ;
1413import java .io .IOException ;
1514import java .util .List ;
@@ -21,25 +20,11 @@ final class ValueTypeMarshaler extends MarshalerWithSize {
2120
2221 private final int typeStringIndex ;
2322 private final int unitStringIndex ;
24- private final ProtoEnumInfo aggregationTemporality ;
2523
2624 static ValueTypeMarshaler create (ValueTypeData valueTypeData ) {
27- ProtoEnumInfo aggregationTemporality =
28- AggregationTemporality .AGGREGATION_TEMPORALITY_UNSPECIFIED ;
29- if (valueTypeData .getAggregationTemporality () != null ) {
30- switch (valueTypeData .getAggregationTemporality ()) {
31- case DELTA :
32- aggregationTemporality = AggregationTemporality .AGGREGATION_TEMPORALITY_DELTA ;
33- break ;
34- case CUMULATIVE :
35- aggregationTemporality = AggregationTemporality .AGGREGATION_TEMPORALITY_CUMULATIVE ;
36- break ;
37- }
38- }
3925 return new ValueTypeMarshaler (
4026 valueTypeData .getTypeStringIndex (),
41- valueTypeData .getUnitStringIndex (),
42- aggregationTemporality );
27+ valueTypeData .getUnitStringIndex ());
4328 }
4429
4530 static ValueTypeMarshaler [] createRepeated (List <ValueTypeData > items ) {
@@ -60,28 +45,23 @@ public void accept(ValueTypeData valueTypeData) {
6045 return valueTypeMarshalers ;
6146 }
6247
63- private ValueTypeMarshaler (
64- int typeStringIndex , int unitStringIndex , ProtoEnumInfo aggregationTemporality ) {
65- super (calculateSize (typeStringIndex , unitStringIndex , aggregationTemporality ));
48+ private ValueTypeMarshaler (int typeStringIndex , int unitStringIndex ) {
49+ super (calculateSize (typeStringIndex , unitStringIndex ));
6650 this .typeStringIndex = typeStringIndex ;
6751 this .unitStringIndex = unitStringIndex ;
68- this .aggregationTemporality = aggregationTemporality ;
6952 }
7053
7154 @ Override
7255 protected void writeTo (Serializer output ) throws IOException {
7356 output .serializeInt64 (ValueType .TYPE_STRINDEX , typeStringIndex );
7457 output .serializeInt64 (ValueType .UNIT_STRINDEX , unitStringIndex );
75- output .serializeEnum (ValueType .AGGREGATION_TEMPORALITY , aggregationTemporality );
7658 }
7759
78- private static int calculateSize (
79- int typeStringIndex , int unitStringIndex , ProtoEnumInfo aggregationTemporality ) {
60+ private static int calculateSize (int typeStringIndex , int unitStringIndex ) {
8061 int size ;
8162 size = 0 ;
8263 size += MarshalerUtil .sizeInt32 (ValueType .TYPE_STRINDEX , typeStringIndex );
8364 size += MarshalerUtil .sizeInt32 (ValueType .UNIT_STRINDEX , unitStringIndex );
84- size += MarshalerUtil .sizeEnum (ValueType .AGGREGATION_TEMPORALITY , aggregationTemporality );
8565 return size ;
8666 }
8767}
0 commit comments