@@ -34,7 +34,7 @@ final class ProfileMarshaler extends MarshalerWithSize {
3434 private final List <Integer > comment ;
3535 private final int defaultSampleType ;
3636 private final byte [] profileId ;
37- private final KeyValueMarshaler [] attributeMarshalers ;
37+ private final List < Integer > attributeIndices ;
3838 private final int droppedAttributesCount ;
3939 private final byte [] originalPayloadFormatUtf8 ;
4040 private final ByteBuffer originalPayload ;
@@ -50,8 +50,8 @@ static ProfileMarshaler create(ProfileData profileData) {
5050 LocationMarshaler .createRepeated (profileData .getLocationTable ());
5151 FunctionMarshaler [] functionMarshalers =
5252 FunctionMarshaler .createRepeated (profileData .getFunctionTable ());
53- KeyValueMarshaler [] attributeMarshalers =
54- KeyValueMarshaler .createForAttributes (profileData .getAttributes ());
53+ KeyValueMarshaler [] attributeTableMarshalers =
54+ KeyValueMarshaler .createForAttributes (profileData .getAttributeTable ());
5555 AttributeUnitMarshaler [] attributeUnitsMarshalers =
5656 AttributeUnitMarshaler .createRepeated (profileData .getAttributeUnits ());
5757 LinkMarshaler [] linkMarshalers = LinkMarshaler .createRepeated (profileData .getLinkTable ());
@@ -63,7 +63,7 @@ static ProfileMarshaler create(ProfileData profileData) {
6363 }
6464
6565 int droppedAttributesCount =
66- profileData .getTotalAttributeCount () - profileData .getAttributes ().size ();
66+ profileData .getTotalAttributeCount () - profileData .getAttributeIndices ().size ();
6767
6868 return new ProfileMarshaler (
6969 sampleTypeMarshalers ,
@@ -72,7 +72,7 @@ static ProfileMarshaler create(ProfileData profileData) {
7272 locationMarshalers ,
7373 profileData .getLocationIndices (),
7474 functionMarshalers ,
75- attributeMarshalers ,
75+ attributeTableMarshalers ,
7676 attributeUnitsMarshalers ,
7777 linkMarshalers ,
7878 convertedStrings ,
@@ -83,7 +83,7 @@ static ProfileMarshaler create(ProfileData profileData) {
8383 profileData .getCommentStrIndices (),
8484 profileData .getDefaultSampleTypeStringIndex (),
8585 profileData .getProfileIdBytes (),
86- KeyValueMarshaler . createForAttributes ( profileData .getAttributes () ),
86+ profileData .getAttributeIndices ( ),
8787 droppedAttributesCount ,
8888 MarshalerUtil .toBytes (profileData .getOriginalPayloadFormat ()),
8989 profileData .getOriginalPayload ());
@@ -107,7 +107,7 @@ private ProfileMarshaler(
107107 List <Integer > comment ,
108108 int defaultSampleType ,
109109 byte [] profileId ,
110- KeyValueMarshaler [] attributeMarshalers ,
110+ List < Integer > attributeIndices ,
111111 int droppedAttributesCount ,
112112 byte [] originalPayloadFormat ,
113113 ByteBuffer originalPayload ) {
@@ -130,7 +130,7 @@ private ProfileMarshaler(
130130 comment ,
131131 defaultSampleType ,
132132 profileId ,
133- attributeMarshalers ,
133+ attributeIndices ,
134134 droppedAttributesCount ,
135135 originalPayloadFormat ,
136136 originalPayload ));
@@ -151,7 +151,7 @@ private ProfileMarshaler(
151151 this .comment = comment ;
152152 this .defaultSampleType = defaultSampleType ;
153153 this .profileId = profileId ;
154- this .attributeMarshalers = attributeMarshalers ;
154+ this .attributeIndices = attributeIndices ;
155155 this .droppedAttributesCount = droppedAttributesCount ;
156156 this .originalPayloadFormatUtf8 = originalPayloadFormat ;
157157 this .originalPayload = originalPayload ;
@@ -177,7 +177,7 @@ protected void writeTo(Serializer output) throws IOException {
177177 output .serializeInt32 (Profile .DEFAULT_SAMPLE_TYPE_STRINDEX , defaultSampleType );
178178
179179 output .serializeBytes (Profile .PROFILE_ID , profileId );
180- output .serializeRepeatedMessage (Profile .ATTRIBUTES , attributeMarshalers );
180+ output .serializeRepeatedInt32 (Profile .ATTRIBUTE_INDICES , attributeIndices );
181181 output .serializeUInt32 (Profile .DROPPED_ATTRIBUTES_COUNT , droppedAttributesCount );
182182 output .serializeString (Profile .ORIGINAL_PAYLOAD_FORMAT , originalPayloadFormatUtf8 );
183183 output .serializeByteBuffer (Profile .ORIGINAL_PAYLOAD , originalPayload );
@@ -201,7 +201,7 @@ private static int calculateSize(
201201 List <Integer > comment ,
202202 int defaultSampleType ,
203203 byte [] profileId ,
204- KeyValueMarshaler [] attributeMarshalers ,
204+ List < Integer > attributeIndices ,
205205 int droppedAttributesCount ,
206206 byte [] originalPayloadFormat ,
207207 ByteBuffer originalPayload ) {
@@ -225,7 +225,7 @@ private static int calculateSize(
225225 size += MarshalerUtil .sizeInt64 (Profile .DEFAULT_SAMPLE_TYPE_STRINDEX , defaultSampleType );
226226
227227 size += MarshalerUtil .sizeBytes (Profile .PROFILE_ID , profileId );
228- size += MarshalerUtil .sizeRepeatedMessage (Profile .ATTRIBUTES , attributeMarshalers );
228+ size += MarshalerUtil .sizeRepeatedInt32 (Profile .ATTRIBUTE_INDICES , attributeIndices );
229229 size += MarshalerUtil .sizeInt32 (Profile .DROPPED_ATTRIBUTES_COUNT , droppedAttributesCount );
230230 size += MarshalerUtil .sizeBytes (Profile .ORIGINAL_PAYLOAD_FORMAT , originalPayloadFormat );
231231 size += MarshalerUtil .sizeByteBuffer (Profile .ORIGINAL_PAYLOAD , originalPayload );
0 commit comments