@Test public void testSuperLongStringValue() { String longPrefix = "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" + "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"; TrieDictionaryBuilder<String> b = new TrieDictionaryBuilder<String>(new StringBytesConverter()); String v1 = longPrefix + "xyz"; b.addValue(v1); String strLen200 = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghid"; b.addValue(strLen200); StringBuilder sb = new StringBuilder(); for (int i = 0; i < 25; i++) { sb.append(strLen200); } String strLen5000 = sb.toString(); b.addValue(strLen5000); TrieDictionary<String> dict = b.build(0); dict.dump(System.out); sb.setLength(0); for (int j = 0; j < 7; j++) { sb.append(strLen5000); } String strLen35000 = sb.toString(); b.addValue(strLen35000); Exception ex = null; try { b.build(0); } catch (Exception e) { ex = e; } Assert.assertNotNull(ex); }
@Override public void dump(PrintStream out) { out.println("Total " + nValues + " values"); for (int i = 0; i < nValues; i++) { int id = calcIdFromSeqNo(i); T value = getValueFromId(id); out.println(id + " (" + Integer.toHexString(id) + "): " + value); } }
TrieDictionary extends CacheDictionary<T> { @Override public void dump(PrintStream out) { out.println("Total " + nValues + " values"); for (int i = 0; i < nValues; i++) { int id = calcIdFromSeqNo(i); T value = getValueFromId(id); out.println(id + " (" + Integer.toHexString(id) + "): " + value); } } }
TrieDictionary extends CacheDictionary<T> { @Override public void dump(PrintStream out) { out.println("Total " + nValues + " values"); for (int i = 0; i < nValues; i++) { int id = calcIdFromSeqNo(i); T value = getValueFromId(id); out.println(id + " (" + Integer.toHexString(id) + "): " + value); } } TrieDictionary();  TrieDictionary(byte[] trieBytes); }
TrieDictionary extends CacheDictionary<T> { @Override public void dump(PrintStream out) { out.println("Total " + nValues + " values"); for (int i = 0; i < nValues; i++) { int id = calcIdFromSeqNo(i); T value = getValueFromId(id); out.println(id + " (" + Integer.toHexString(id) + "): " + value); } } TrieDictionary();  TrieDictionary(byte[] trieBytes); @Override int getMinId(); @Override int getMaxId(); @Override int getSizeOfId(); @Override int getSizeOfValue(); int getStorageSizeInBytes(); @Override void write(DataOutput out); @Override void readFields(DataInput in); @Override List<T> enumeratorValues(); @Override void dump(PrintStream out); @Override int hashCode(); @Override boolean equals(Object o); @Override boolean contains(Dictionary other); static void main(String[] args); }
TrieDictionary extends CacheDictionary<T> { @Override public void dump(PrintStream out) { out.println("Total " + nValues + " values"); for (int i = 0; i < nValues; i++) { int id = calcIdFromSeqNo(i); T value = getValueFromId(id); out.println(id + " (" + Integer.toHexString(id) + "): " + value); } } TrieDictionary();  TrieDictionary(byte[] trieBytes); @Override int getMinId(); @Override int getMaxId(); @Override int getSizeOfId(); @Override int getSizeOfValue(); int getStorageSizeInBytes(); @Override void write(DataOutput out); @Override void readFields(DataInput in); @Override List<T> enumeratorValues(); @Override void dump(PrintStream out); @Override int hashCode(); @Override boolean equals(Object o); @Override boolean contains(Dictionary other); static void main(String[] args); static final byte[] MAGIC; static final int MAGIC_SIZE_I; static final int BIT_IS_LAST_CHILD; static final int BIT_IS_END_OF_VALUE; }