mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
cluster tuning
This commit is contained in:
@@ -60,7 +60,7 @@ class Int24Int24MultiMap implements MultiMap {
|
||||
capacityMask = capacity - 1L;
|
||||
capacityInBytes = indexToPos(capacity);
|
||||
this.bytes = multiMapBytes;
|
||||
positions = new ATSDirectBitSet(multiMapBitSetBytes);
|
||||
positions = ATSDirectBitSet.wrap(multiMapBitSetBytes);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -80,16 +80,6 @@ class Int24Int24MultiMap implements MultiMap {
|
||||
return (key &= MASK) != UNSET_KEY ? key : HASH_INSTEAD_OF_UNSET_KEY;
|
||||
}
|
||||
|
||||
private void checkValueForPut(long value) {
|
||||
assert (value & ~MASK) == 0L : "Value out of range, was " + value;
|
||||
assert positions.isClear(value) : "Shouldn't put existing value";
|
||||
}
|
||||
|
||||
private void checkValueForRemove(long value) {
|
||||
assert (value & ~MASK) == 0L : "Value out of range, was " + value;
|
||||
assert positions.isSet(value) : "Shouldn't remove absent value";
|
||||
}
|
||||
|
||||
private static long key(long entry) {
|
||||
return entry >>> 24;
|
||||
}
|
||||
@@ -102,6 +92,16 @@ class Int24Int24MultiMap implements MultiMap {
|
||||
return (key << 24) | (value & MASK);
|
||||
}
|
||||
|
||||
private void checkValueForPut(long value) {
|
||||
assert (value & ~MASK) == 0L : "Value out of range, was " + value;
|
||||
assert positions.isClear(value) : "Shouldn't put existing value";
|
||||
}
|
||||
|
||||
private void checkValueForRemove(long value) {
|
||||
assert (value & ~MASK) == 0L : "Value out of range, was " + value;
|
||||
assert positions.isSet(value) : "Shouldn't remove absent value";
|
||||
}
|
||||
|
||||
private long pos(long key) {
|
||||
return indexToPos(key & capacityMask);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user