Limit HashLookup slot size with 4 or 8 bytes, back

This commit is contained in:
leventov
2015-09-22 23:07:54 +03:00
parent d9c771bedc
commit b113118707
5 changed files with 158 additions and 46 deletions
@@ -255,7 +255,14 @@ public abstract class VanillaChronicleHash<K, KI, MKI extends MetaBytesInterop<K
private void ownInitTransients() {
keyReaderProvider = Provider.of((Class) originalKeyReader.getClass());
keyInteropProvider = Provider.of((Class) originalKeyInterop.getClass());
hashLookup = new CompactOffHeapLinearHashTable(this);
if (segmentHashLookupEntrySize == 4) {
hashLookup = new IntCompactOffHeapLinearHashTable(this);
} else if (segmentHashLookupEntrySize == 8) {
hashLookup = new LongCompactOffHeapLinearHashTable(this);
} else {
throw new AssertionError("hash lookup slot size could be 4 or 8, " +
segmentHashLookupEntrySize + " observed");
}
}
public final void createMappedStoreAndSegments(BytesStore bytesStore) throws IOException {