move usages of StringCompressor to outside of TagsBuilder
This commit is contained in:
@@ -25,10 +25,9 @@ public class TagsBuilder {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TagsBuilder add(final String key, final String value) {
|
public TagsBuilder add(final Tag tag) {
|
||||||
final int keyAsInt = Tags.STRING_COMPRESSOR.getIfPresent(key);
|
tags.add(tag);
|
||||||
final int valueAsInt = Tags.STRING_COMPRESSOR.getIfPresent(value);
|
return this;
|
||||||
return add(keyAsInt, valueAsInt);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public TagsBuilder addAndAddToDictionary(final String key, final String value) {
|
public TagsBuilder addAndAddToDictionary(final String key, final String value) {
|
||||||
|
|||||||
@@ -89,13 +89,14 @@ public class MemoryScale {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static Object createTags6() {
|
private static Object createTags6() {
|
||||||
TagsBuilder result = TagsBuilder.create();
|
final TagsBuilder result = TagsBuilder.create();
|
||||||
result = result.add("k1", "v1");
|
|
||||||
result = result.add("k2", "v2");
|
result.add(Tags.STRING_COMPRESSOR.createTag("k1", "v1"));
|
||||||
result = result.add("k3", "v3");
|
result.add(Tags.STRING_COMPRESSOR.createTag("k2", "v2"));
|
||||||
result = result.add("k4", "v4");
|
result.add(Tags.STRING_COMPRESSOR.createTag("k3", "v3"));
|
||||||
result = result.add("k5", "v5");
|
result.add(Tags.STRING_COMPRESSOR.createTag("k4", "v4"));
|
||||||
result = result.add("k6", "v6");
|
result.add(Tags.STRING_COMPRESSOR.createTag("k5", "v5"));
|
||||||
|
result.add(Tags.STRING_COMPRESSOR.createTag("k6", "v6"));
|
||||||
return result.build();
|
return result.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user