@Test public void encode() { DictionaryForWrite dfw = new DictionaryForWrite(); int lastStr = dfw.getStringTable().getOrCreate("foobar"); int lastPath = dfw.getPathTable().getOrCreate(Arrays.asList("foo", "bar")); int lastTags = dfw.getTagsTable().getOrCreate(Tags.valueOf(singletonMap("baz", MetricValue.fromStrValue("baz")))); DictionaryDelta dd = new DictionaryDelta(dfw.encode()); assertEquals(dfw.asDictionaryDelta(), dd); dfw.reset(); assertEquals(dfw, new DictionaryForWrite(dd)); }
public dictionary_delta encode() { dictionary_delta dd = new dictionary_delta(); dd.pdd = encodePaths(pathTable, stringTable); dd.tdd = encodeTags(tagsTable, stringTable); dd.sdd = encodeStrings(stringTable); return dd; }
DictionaryForWrite implements Cloneable { public dictionary_delta encode() { dictionary_delta dd = new dictionary_delta(); dd.pdd = encodePaths(pathTable, stringTable); dd.tdd = encodeTags(tagsTable, stringTable); dd.sdd = encodeStrings(stringTable); return dd; } }
DictionaryForWrite implements Cloneable { public dictionary_delta encode() { dictionary_delta dd = new dictionary_delta(); dd.pdd = encodePaths(pathTable, stringTable); dd.tdd = encodeTags(tagsTable, stringTable); dd.sdd = encodeStrings(stringTable); return dd; } DictionaryForWrite();  DictionaryForWrite(DictionaryDelta input); }
DictionaryForWrite implements Cloneable { public dictionary_delta encode() { dictionary_delta dd = new dictionary_delta(); dd.pdd = encodePaths(pathTable, stringTable); dd.tdd = encodeTags(tagsTable, stringTable); dd.sdd = encodeStrings(stringTable); return dd; } DictionaryForWrite();  DictionaryForWrite(DictionaryDelta input); boolean isEmpty(); DictionaryDelta asDictionaryDelta(); void reset(); dictionary_delta encode(); @Override DictionaryForWrite clone(); }
DictionaryForWrite implements Cloneable { public dictionary_delta encode() { dictionary_delta dd = new dictionary_delta(); dd.pdd = encodePaths(pathTable, stringTable); dd.tdd = encodeTags(tagsTable, stringTable); dd.sdd = encodeStrings(stringTable); return dd; } DictionaryForWrite();  DictionaryForWrite(DictionaryDelta input); boolean isEmpty(); DictionaryDelta asDictionaryDelta(); void reset(); dictionary_delta encode(); @Override DictionaryForWrite clone();  }