mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
updated the bom to the latest map
This commit is contained in:
@@ -707,7 +707,7 @@ public abstract class VanillaChronicleHash<K,
|
||||
}
|
||||
|
||||
public long bsAddress() {
|
||||
return bs.address(0);
|
||||
return bs.addressForRead(0);
|
||||
}
|
||||
|
||||
public final long segmentBaseAddr(int segmentIndex) {
|
||||
@@ -819,7 +819,7 @@ public abstract class VanillaChronicleHash<K,
|
||||
globalMutableState.setExtraTiersInUse(tiersInUse + 1);
|
||||
BytesStore allocatedTierBytes = tierBytesStore(firstFreeTierIndex);
|
||||
long allocatedTierOffset = tierBytesOffset(firstFreeTierIndex);
|
||||
long tierBaseAddr = allocatedTierBytes.address(0) + allocatedTierOffset;
|
||||
long tierBaseAddr = allocatedTierBytes.addressForRead(0) + allocatedTierOffset;
|
||||
long tierCountersAreaAddr = tierBaseAddr + tierHashLookupOuterSize;
|
||||
long nextFreeTierIndex = TierCountersArea.nextTierIndex(tierCountersAreaAddr);
|
||||
globalMutableState.setFirstFreeTierIndex(nextFreeTierIndex);
|
||||
@@ -847,8 +847,8 @@ public abstract class VanillaChronicleHash<K,
|
||||
|
||||
// see HCOLL-397
|
||||
if (persisted()) {
|
||||
long address = tierBytesStore.address(firstTierOffset - tierBulkInnerOffsetToTiers);
|
||||
long endAddress = tierBytesStore.address(tierBytesOffset(lastTierIndex)) + tierSize;
|
||||
long address = tierBytesStore.addressForRead(firstTierOffset - tierBulkInnerOffsetToTiers);
|
||||
long endAddress = tierBytesStore.addressForRead(tierBytesOffset(lastTierIndex)) + tierSize;
|
||||
long length = endAddress - address;
|
||||
msync(address, length);
|
||||
}
|
||||
@@ -886,7 +886,7 @@ public abstract class VanillaChronicleHash<K,
|
||||
zeroOutNewlyMappedTier(tierBytesStore, tierOffset);
|
||||
if (tierIndex < lastTierIndex) {
|
||||
long tierCountersAreaOffset = tierOffset + tierHashLookupOuterSize;
|
||||
TierCountersArea.nextTierIndex(tierBytesStore.address(0) + tierCountersAreaOffset,
|
||||
TierCountersArea.nextTierIndex(tierBytesStore.addressForRead(0) + tierCountersAreaOffset,
|
||||
tierIndex + 1);
|
||||
}
|
||||
}
|
||||
@@ -943,7 +943,7 @@ public abstract class VanillaChronicleHash<K,
|
||||
}
|
||||
|
||||
protected long tierAddr(TierBulkData tierBulkData, long tierIndexOffsetWithinBulk) {
|
||||
return tierBulkData.bytesStore.address(0) + tierBulkData.offset +
|
||||
return tierBulkData.bytesStore.addressForRead(0) + tierBulkData.offset +
|
||||
tierBulkInnerOffsetToTiers + tierIndexOffsetWithinBulk * tierSize;
|
||||
}
|
||||
|
||||
|
||||
@@ -195,8 +195,8 @@ public class TierRecovery {
|
||||
try (ExternalMapQueryContext<?, ?, ?> c = m.queryContext(key)) {
|
||||
MapEntry<?, ?> entry2 = c.entry();
|
||||
Data<?> key2 = ((MapEntry) c).key();
|
||||
long keyAddress = key.bytes().address(key.offset());
|
||||
long key2Address = key2.bytes().address(key2.offset());
|
||||
long keyAddress = key.bytes().addressForRead(key.offset());
|
||||
long key2Address = key2.bytes().addressForRead(key2.offset());
|
||||
if (key2Address != keyAddress) {
|
||||
report(corruptionListener, corruption, s.segmentIndex, () ->
|
||||
format("entries with duplicate key {} in segment {}: " +
|
||||
|
||||
@@ -695,7 +695,7 @@ public class ReplicatedChronicleMap<K, V, R> extends VanillaChronicleMap<K, V, R
|
||||
}
|
||||
|
||||
private long bitSetsAddr(TierBulkData tierBulkData) {
|
||||
return tierBulkData.bytesStore.address(tierBulkData.offset) +
|
||||
return tierBulkData.bytesStore.addressForRead(tierBulkData.offset) +
|
||||
offsetToBitSetsWithinATierBulk;
|
||||
}
|
||||
|
||||
|
||||
@@ -300,7 +300,7 @@ public class VanillaChronicleMap<K, V, R>
|
||||
}
|
||||
|
||||
public void alignReadPosition(Bytes entry) {
|
||||
long positionAddr = entry.address(entry.readPosition());
|
||||
long positionAddr = entry.addressForRead(entry.readPosition());
|
||||
long skip = alignAddr(positionAddr, alignment) - positionAddr;
|
||||
if (skip > 0)
|
||||
entry.readSkip(skip);
|
||||
|
||||
@@ -29,6 +29,11 @@ import java.nio.ByteBuffer;
|
||||
public enum ZeroBytesStore implements BytesStore<ZeroBytesStore, Void> {
|
||||
INSTANCE;
|
||||
|
||||
@Override
|
||||
public long addressForWrite(long offset) throws UnsupportedOperationException, BufferOverflowException {
|
||||
throw new UnsupportedOperationException("todo");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int peekUnsignedByte(long offset) {
|
||||
return 0;
|
||||
@@ -123,10 +128,11 @@ public enum ZeroBytesStore implements BytesStore<ZeroBytesStore, Void> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public long address(long offset) throws UnsupportedOperationException {
|
||||
public long addressForRead(long offset) throws UnsupportedOperationException {
|
||||
return offset;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean compareAndSwapInt(long offset, int expected, int value)
|
||||
throws BufferOverflowException, IllegalArgumentException {
|
||||
|
||||
@@ -18,8 +18,6 @@
|
||||
package net.openhft.chronicle.map.impl.stage.entry;
|
||||
|
||||
import net.openhft.chronicle.bytes.Bytes;
|
||||
import net.openhft.chronicle.bytes.NativeBytesStore;
|
||||
import net.openhft.chronicle.bytes.RandomDataInput;
|
||||
import net.openhft.chronicle.hash.Data;
|
||||
import net.openhft.chronicle.hash.impl.CompactOffHeapLinearHashTable;
|
||||
import net.openhft.chronicle.hash.impl.stage.entry.AllocatedChunks;
|
||||
@@ -64,7 +62,7 @@ public abstract class MapEntryStages<K, V> extends HashEntryStages<K>
|
||||
segmentBytes.writePosition(valueSizeOffset);
|
||||
mh.m().valueSizeMarshaller.writeSize(segmentBytes, valueSize);
|
||||
long currentPosition = segmentBytes.writePosition();
|
||||
long currentAddr = segmentBytes.address(currentPosition);
|
||||
long currentAddr = segmentBytes.addressForRead(currentPosition);
|
||||
long skip = alignAddr(currentAddr, mh.m().alignment) - currentAddr;
|
||||
if (skip > 0)
|
||||
segmentBytes.writeSkip(skip);
|
||||
|
||||
Reference in New Issue
Block a user