public class CompiledReplicatedMapIterationContext<K,V,R> extends net.openhft.chronicle.hash.impl.stage.hash.ChainingInterface implements AutoCloseable, ChecksumEntry, HashEntry<K>, HashSegmentContext<K,MapEntry<K,V>>, ReplicatedHashSegmentContext<K,MapEntry<K,V>>, SegmentLock, net.openhft.chronicle.hash.impl.stage.entry.Alloc, net.openhft.chronicle.hash.impl.stage.entry.KeyHashCode, net.openhft.chronicle.hash.impl.stage.entry.LocksInterface, RemoteOperationContext<K>, ReplicableEntry, MapAbsentEntry<K,V>, MapContext<K,V,R>, MapEntry<K,V>, net.openhft.chronicle.map.impl.IterationContext<K,V,R>, net.openhft.chronicle.map.impl.ReplicatedChronicleMapHolder<K,V,R>, net.openhft.chronicle.map.impl.ReplicatedIterationContext<K,V,R>, MapReplicableEntry<K,V>, SetAbsentEntry<K>, SetContext<K,R>
Constructor and Description |
---|
CompiledReplicatedMapIterationContext(net.openhft.chronicle.hash.impl.stage.hash.ChainingInterface c,
net.openhft.chronicle.map.ReplicatedChronicleMap<K,V,R> m) |
CompiledReplicatedMapIterationContext(net.openhft.chronicle.map.ReplicatedChronicleMap<K,V,R> m) |
Modifier and Type | Method and Description |
---|---|
CompiledReplicatedMapIterationContext.ReplicatedMapAbsentDelegatingForIteration |
absentEntryDelegating() |
Data<K> |
absentKey()
Returns the key is going to be inserted into the
ChronicleHash . |
long |
alloc(int chunks,
long prevPos,
int prevChunks)
Allocates a block of specified number of chunks in a segment tier, optionally clears the
previous allocation.
|
int |
allocatedChunks() |
boolean |
allocatedChunksInit() |
long |
allocReturnCode(int chunks) |
long |
allocReturnCodeGuarded(int chunks) |
int |
changeAndGetLatestSameThreadSegmentModCount(int change) |
int |
changeAndGetTotalReadLockCount(int change) |
int |
changeAndGetTotalUpdateLockCount(int change) |
int |
changeAndGetTotalWriteLockCount(int change) |
boolean |
changed() |
void |
checkAccessingFromOwnerThread() |
void |
checkEntryNotRemovedOnThisIteration() |
void |
checkIterationContextNotLockedInThisThread() |
void |
checkNestedContextsQueryDifferentKeys(net.openhft.chronicle.hash.impl.stage.entry.LocksInterface innermostContextOnThisSegment) |
void |
checkOnEachPublicOperation() |
boolean |
checkSlotContainsExpectedKeyAndValue(long value) |
boolean |
checkSum()
Computes checksum from the entry bytes and checks whether it is equal to the stored checksum.
|
net.openhft.chronicle.hash.impl.stage.entry.ChecksumStrategy |
checksumStrategy() |
void |
close() |
void |
closeAllocatedChunks() |
void |
closeDelayedUpdateChecksum() |
void |
closeEntriesToTest() |
void |
closeEntryOffset() |
void |
closeEntryOffsetDependants() |
void |
closeEntryRemovedOnThisIteration() |
void |
closeEntrySizeInChunks() |
void |
closeHashLookupPos() |
void |
closeHashLookupPosDependants() |
void |
closeHashLookupSearchAddrDependants() |
void |
closeHashLookupSearchFoundDependants() |
void |
closeHashLookupSearchHlDependants() |
void |
closeHashLookupSearchNextPosDependants() |
void |
closeInputKey() |
void |
closeInputKeyDependants() |
void |
closeIterationCheckOnEachPublicOperationCheckOnEachPublicOperationDependants() |
void |
closeIterationKeyHashCodeKeyHashCodeDependants() |
void |
closeIterationSegmentStagesCheckNestedContextsQueryDifferentKeysDependants() |
void |
closeIterationSegmentStagesDeregisterIterationContextLockedInThisThreadDependants() |
void |
closeIterationSegmentStagesLowestPossiblyFreeChunkDependants() |
void |
closeIterationSegmentStagesRegisterIterationContextLockedInThisThreadDependants() |
void |
closeIterationSegmentStagesTierCountersAreaAddrDependants() |
void |
closeIterationSegmentStagesTierEntriesDependants() |
void |
closeKeyHash() |
void |
closeKeyHashDependants() |
void |
closeKeyOffset() |
void |
closeKeyOffsetDependants() |
void |
closeKeySearchKeyEqualsDependants() |
void |
closeKeySize() |
void |
closeKeySizeDependants() |
void |
closeLocksDependants() |
void |
closeOwnerThreadHolderCheckAccessingFromOwnerThreadDependants() |
void |
closePos() |
void |
closePosDependants() |
void |
closeReplicatedChronicleMapHolderImplContextAtIndexInChainDependants() |
void |
closeReplicatedChronicleMapHolderImplMDependants() |
void |
closeReplicatedMapEntryStagesCountValueSizeOffsetDependants() |
void |
closeReplicatedMapEntryStagesEntryEndDependants() |
void |
closeReplicatedMapEntryStagesEntrySizeDependants() |
void |
closeReplicatedMapEntryStagesKeyEndDependants() |
void |
closeReplicatedMapEntryStagesReadExistingEntryDependants() |
void |
closeReplicatedMapSegmentIterationCheckEntryNotRemovedOnThisIterationDependants() |
void |
closeReplicationState() |
void |
closeReplicationUpdate() |
void |
closeSearchKey() |
void |
closeSearchKeyDependants() |
void |
closeSegmentDependants() |
void |
closeSegmentHeader() |
void |
closeSegmentHeaderDependants() |
void |
closeSegmentIndex() |
void |
closeSegmentIndexDependants() |
void |
closeSegmentTier() |
void |
closeSegmentTierDependants() |
void |
closeValueSize() |
void |
closeValueSizeDependants() |
void |
closeValueSizeOffset() |
void |
closeValueSizeOffsetDependants() |
CompiledReplicatedMapIterationContext<K,V,R> |
context()
Returns the context, in which the entry is accessed.
|
<T> T |
contextAtIndexInChain(int index) |
List<net.openhft.chronicle.hash.impl.stage.hash.ChainingInterface> |
contextChain() |
void |
copyExistingEntry(long newPos,
long bytesToCopy,
long oldKeyAddr,
long oldKeySizeAddr) |
String |
debugContextsAndLocks() |
String |
debugContextsAndLocksGuarded() |
String |
debugLocksState() |
int |
decrementRead() |
int |
decrementUpdate() |
int |
decrementUpdateGuarded() |
int |
decrementWrite() |
int |
decrementWriteGuarded() |
Data<V> |
defaultValue()
Returns the default (or nil) value, that should be inserted into the map in
this context.
|
Data<V> |
defaultValue(MapAbsentEntry<K,V> absentEntry)
Returns the "nil" value, which should be inserted into the map, in the given
absentEntry context. |
void |
doInsert()
Inserts
the new key into the set. |
void |
doInsert(Data<V> value)
Inserts the new entry into the map, of the key and the given
value . |
void |
doRemove()
Removes the entry from the
ChronicleHash . |
void |
doRemoveCompletely()
Completely remove the entry from the Chronicle hash, not just mark is as deleted, what
MapEntry.doRemove() does for Replicated Chronicle hash. |
void |
doReplaceValue(Data<V> newValue)
Replaces the entry's value with the given
newValue . |
void |
dropChange() |
void |
dropChanged()
Suppress the entry, if it was scheduled to be replicated over to remote Chronicle nodes.
|
CompiledReplicatedMapIterationContext.DummyValueZeroData |
dummyValue() |
net.openhft.chronicle.map.impl.CompiledReplicatedMapIterationContext.EntriesToTest |
entriesToTest() |
boolean |
entriesToTestInit() |
CompiledReplicatedMapIterationContext.ReplicatedMapEntryDelegating |
entryDelegating() |
boolean |
entryDeleted() |
protected long |
entryEnd() |
Object |
entryForIteration() |
CompiledReplicatedMapIterationContext.EntryKeyBytesData |
entryKey() |
boolean |
entryOffsetInit() |
long |
entrySize(long keySize,
long valueSize) |
int |
entrySizeInChunks() |
boolean |
entrySizeInChunksInit() |
long |
entrySpaceOffset() |
CompiledReplicatedMapIterationContext.EntryValueBytesData |
entryValue() |
void |
forEachSegmentEntry(Consumer<? super MapEntry<K,V>> action)
Performs the given action for each present entry in this segment until all entries
have been processed or the action throws an
Exception . |
boolean |
forEachSegmentEntryWhile(Predicate<? super MapEntry<K,V>> predicate)
Checks the given predicate on each present entry in this segment until all entries
have been processed or the predicate returns
false for some entry, or throws
an Exception . |
void |
forEachSegmentReplicableEntry(Consumer<? super ReplicableEntry> action) |
boolean |
forEachSegmentReplicableEntryWhile(Predicate<? super ReplicableEntry> predicate) |
void |
found() |
void |
free(long fromPos,
int chunks) |
void |
freeExtra(long pos,
int oldChunks,
int newChunks) |
void |
freeExtraAllocatedChunks() |
void |
freeExtraGuarded(long pos,
int oldChunks,
int newChunks) |
void |
freeGuarded(long fromPos,
int chunks) |
ReusableBitSet |
freeList() |
<T extends net.openhft.chronicle.hash.impl.stage.hash.ChainingInterface> |
getContext(Class<? extends T> contextClass,
Function<net.openhft.chronicle.hash.impl.stage.hash.ChainingInterface,T> createChaining) |
List<net.openhft.chronicle.hash.impl.stage.hash.ChainingInterface> |
getContextChain() |
void |
goToFirstTier() |
void |
goToLastTier() |
ChronicleHash<K,?,?,?> |
hash()
Returns the accessed
ChronicleHash . |
CompiledReplicatedMapIterationContext.HashEntryChecksumStrategy |
hashEntryChecksumStrategy() |
long |
hashLookupEntry() |
boolean |
hashLookupEntryInit() |
long |
hashLookupPos() |
boolean |
hashLookupPosInit() |
boolean |
hasNextTier() |
net.openhft.chronicle.hash.impl.CompactOffHeapLinearHashTable |
hl() |
void |
incrementModCount() |
void |
incrementModCountGuarded() |
void |
incrementRead() |
void |
incrementReadGuarded() |
void |
incrementUpdate() |
void |
incrementUpdateGuarded() |
void |
incrementWrite() |
void |
incrementWriteGuarded() |
int |
indexInContextChain() |
void |
initAllocatedChunks(int allocatedChunks) |
void |
initDelayedUpdateChecksum(boolean delayedUpdateChecksum) |
boolean |
initEntryAndKeyCopying(long entrySize,
long bytesToCopy,
long prevPos,
int prevChunks) |
void |
initEntryOffset() |
protected void |
initEntryRemovedOnThisIteration(boolean entryRemovedOnThisIteration) |
void |
initEntrySizeInChunks(int actuallyUsedChunks) |
void |
initHashLookupEntry(long entry) |
void |
initHashLookupPos() |
void |
initHashLookupPos(long hashLookupPos) |
void |
initInputKey(Data<K> inputKey) |
void |
initKeyOffset(long keyOffset) |
void |
initKeySearch() |
void |
initKeySize(long keySize) |
void |
initPos(long pos) |
void |
initReplicationUpdate(long timestamp,
byte identifier) |
void |
initSearchKey(long searchKey) |
void |
initSegmentIndex(int segmentIndex) |
void |
initSegmentTier_WithBaseAddr(int tier,
long tierBaseAddr,
long tierIndex) |
void |
initSegmentTier() |
void |
initSegmentTier(int tier,
long tierIndex,
long tierBaseAddr) |
void |
initUsed(boolean used) |
void |
initValue_WithoutSize(Data<?> value,
long oldValueSizeOffset,
long oldValueSize,
long oldValueOffset) |
void |
initValue(Data<?> value) |
void |
innerDefaultReplaceValue(Data<V> newValue) |
long |
innerEntrySize(long sizeOfEverythingBeforeValue,
long valueSize) |
<T> boolean |
innerForEachSegmentEntryWhile(Predicate<? super T> predicate) |
CompiledReplicatedMapIterationContext.ReadLock |
innerReadLock() |
byte |
innerRemoteIdentifier() |
long |
innerRemoteTimestamp() |
void |
innerRemoveEntryExceptHashLookupUpdate() |
CompiledReplicatedMapIterationContext.UpdateLock |
innerUpdateLock() |
CompiledReplicatedMapIterationContext.WriteLock |
innerWriteLock() |
Data<K> |
inputKey() |
R |
insert(MapAbsentEntry<K,V> absentEntry,
Data<V> value)
Inserts the new entry into the map, of
the key from
the given insertion context (absentEntry ) and the given value . |
boolean |
isChanged()
Check is the entry is scheduled to be replicated to the remote Chronicle nodes, to which
the connection is currently established.
|
void |
iterationRemove() |
Data<K> |
key()
Returns the entry key.
|
long |
keyEnd() |
long |
keyHash() |
long |
keyHashCode() |
boolean |
keyHashInit() |
long |
keyOffset() |
boolean |
keyOffsetInit() |
SizedReader<K> |
keyReader() |
long |
keySize() |
boolean |
keySizeInit() |
long |
keySizeOffset() |
int |
latestSameThreadSegmentModCount() |
net.openhft.chronicle.hash.impl.LocalLockState |
localLockState() |
boolean |
locksInit() |
org.slf4j.Logger |
LOG() |
void |
lowestPossiblyFreeChunk(long lowestPossiblyFreeChunk) |
net.openhft.chronicle.map.ReplicatedChronicleMap<K,V,R> |
m() |
ChronicleMap<K,V> |
map()
Returns the accessed
ChronicleMap . |
void |
moveChange(long oldTierIndex,
long oldPos,
long newPos) |
boolean |
nestedContextsLockedOnSameSegment() |
long |
newEntrySize(Data<V> newValue,
long entryStartOffset,
long newValueOffset) |
long |
newSizeOfEverythingBeforeValue(Data<V> newValue) |
net.openhft.chronicle.hash.impl.stage.entry.LocksInterface |
nextNode() |
long |
nextPos() |
void |
nextTier() |
long |
nextTierIndex() |
void |
nextTierIndex(long nextTierIndex) |
byte |
originIdentifier()
The identifier, associated with this entry.
|
long |
originTimestamp()
The timestamp, associated with this entry.
|
Thread |
owner() |
long |
pos() |
boolean |
posInit() |
void |
prevTier() |
long |
prevTierIndex() |
void |
prevTierIndex(long prevTierIndex) |
void |
putNewVolatile(long value) |
void |
putValueDeletedEntry(Data<V> newValue) |
void |
putValueVolatile(long newValue) |
void |
raiseChange() |
void |
raiseChanged()
Propagate the entry, schedule it to be replicated over to remote Chronicle nodes.
|
void |
readExistingEntry(long pos) |
InterProcessLock |
readLock()
Returns the read-level lock.
|
void |
readUnlockAndDecrementCount() |
void |
readUnlockAndDecrementCountGuarded() |
boolean |
readZero() |
boolean |
readZeroGuarded() |
boolean |
realloc(long fromPos,
int oldChunks,
int newChunks) |
boolean |
reallocGuarded(long fromPos,
int oldChunks,
int newChunks) |
protected void |
relocation(Data<V> newValue,
long newSizeOfEverythingBeforeValue) |
byte |
remoteIdentifier() |
long |
remoteTimestamp() |
void |
remove() |
R |
remove(MapEntry<K,V> entry)
Removes the given entry from the map.
|
R |
replaceValue(MapEntry<K,V> entry,
Data<V> newValue)
Replaces the given entry's value with the new one.
|
long |
replicationBytesOffset() |
boolean |
replicationStateInit() |
boolean |
replicationUpdateInit() |
net.openhft.chronicle.hash.impl.stage.hash.ChainingInterface |
rootContextInThisThread() |
net.openhft.chronicle.hash.impl.stage.entry.LocksInterface |
rootContextLockedOnThisSegment() |
long |
searchKey() |
boolean |
searchKeyInit() |
long |
searchStartPos() |
CompiledReplicatedMapIterationContext.SearchState |
searchState() |
boolean |
searchStateAbsent() |
boolean |
searchStateDeleted() |
boolean |
searchStatePresent() |
PointerBytesStore |
segmentBS() |
Bytes |
segmentBytes() |
Bytes |
segmentBytesForRead() |
Bytes |
segmentBytesForReadGuarded() |
Bytes |
segmentBytesForWrite() |
Bytes |
segmentBytesForWriteGuarded() |
net.openhft.chronicle.hash.impl.SegmentHeader |
segmentHeader() |
long |
segmentHeaderAddress() |
boolean |
segmentHeaderInit() |
int |
segmentIndex()
Returns the index of the accessed segment.
|
boolean |
segmentIndexInit() |
boolean |
segmentTierInit() |
ChronicleSet<K> |
set()
Returns the accessed
ChronicleSet . |
void |
setHashLookupPos(long hashLookupPos) |
void |
setHashLookupPosGuarded(long hashLookupPos) |
void |
setLocalLockState(net.openhft.chronicle.hash.impl.LocalLockState newState) |
void |
setLocalLockStateGuarded(net.openhft.chronicle.hash.impl.LocalLockState newState) |
void |
setNestedContextsLockedOnSameSegment(boolean nestedContextsLockedOnSameSegment) |
void |
setNextNode(net.openhft.chronicle.hash.impl.stage.entry.LocksInterface nextNode) |
void |
setSearchState(CompiledReplicatedMapIterationContext.SearchState newSearchState) |
boolean |
shouldTestEntry() |
long |
size()
Returns the number of present entries in this segment.
|
int |
tier() |
long |
tierBaseAddr() |
long |
tierCountersAreaAddr() |
long |
tierDeleted() |
void |
tierDeleted(long tierDeleted) |
long |
tierEntries() |
void |
tierEntries(long tierEntries) |
long |
tierEntriesForIteration() |
long |
tierIndex() |
long |
timestamp() |
int |
totalReadLockCount() |
int |
totalUpdateLockCount() |
int |
totalWriteLockCount() |
void |
updateChange() |
void |
updateChecksum()
Re-computes and stores checksum for the entry.
|
void |
updatedReplicationStateOnAbsentEntry() |
void |
updatedReplicationStateOnPresentEntry() |
InterProcessLock |
updateLock()
Returns the update-level lock.
|
void |
updateOrigin(byte newIdentifier,
long newTimestamp)
Overwrite the entry's associated identifier and timestamp.
|
boolean |
updateZero() |
boolean |
updateZeroGuarded() |
boolean |
usedInit() |
Data<V> |
value()
Returns the entry value.
|
long |
valueOffset() |
SizedReader<V> |
valueReader() |
long |
valueSize() |
boolean |
valueSizeInit() |
long |
valueSizeOffset() |
boolean |
valueSizeOffsetInit() |
void |
verifyTierCountersAreaData() |
CompiledReplicatedMapIterationContext.WrappedValueInstanceDataHolder |
wrappedValueInstanceValueHolder() |
Data<V> |
wrapValueAsData(V value)
Wraps the given value as a
Data . |
void |
writeEntryDeleted() |
void |
writeEntryPresent() |
InterProcessLock |
writeLock()
Returns the write-level lock.
|
void |
writeNewEntry(long pos,
Data<?> key) |
void |
writeValue(Data<?> value) |
void |
writeValueAndPutPos(Data<V> value) |
boolean |
writeZero() |
boolean |
writeZeroGuarded() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
closeQuietly, notifyClosing
insert, remove
public final int indexInContextChain
public final CompiledReplicatedMapIterationContext.ReadLock innerReadLock
public static final org.slf4j.Logger LOG
public final CompiledReplicatedMapIterationContext.WriteLock innerWriteLock
public final SizedReader<K> keyReader
public final CompiledReplicatedMapIterationContext.UpdateLock innerUpdateLock
public final SizedReader<V> valueReader
public final net.openhft.chronicle.hash.impl.stage.hash.ChainingInterface rootContextInThisThread
public final List<net.openhft.chronicle.hash.impl.stage.hash.ChainingInterface> contextChain
public final CompiledReplicatedMapIterationContext.EntryValueBytesData entryValue
public final PointerBytesStore segmentBS
public final net.openhft.chronicle.hash.impl.stage.entry.ChecksumStrategy checksumStrategy
public final Bytes segmentBytes
public long searchStartPos
public long keySize
public long hashLookupEntry
public int segmentIndex
public int tier
public long tierIndex
public long tierBaseAddr
public boolean entryRemovedOnThisIteration
public int latestSameThreadSegmentModCount
public int contextModCount
public boolean nestedContextsLockedOnSameSegment
public net.openhft.chronicle.hash.impl.stage.entry.LocksInterface rootContextLockedOnThisSegment
public long hashLookupPos
public long pos
public long keySizeOffset
public long keyOffset
public long valueSizeOffset
public long valueSize
public long valueOffset
public int entrySizeInChunks
protected CompiledReplicatedMapIterationContext.SearchState searchState
public boolean delayedUpdateChecksum
public int allocatedChunks
public long innerRemoteTimestamp
public byte innerRemoteIdentifier
public CompiledReplicatedMapIterationContext(net.openhft.chronicle.hash.impl.stage.hash.ChainingInterface c, net.openhft.chronicle.map.ReplicatedChronicleMap<K,V,R> m)
public boolean readZeroGuarded()
public boolean reallocGuarded(long fromPos, int oldChunks, int newChunks)
public boolean updateZeroGuarded()
public boolean writeZeroGuarded()
public int decrementUpdateGuarded()
public int decrementWriteGuarded()
public String debugContextsAndLocksGuarded()
public long allocReturnCodeGuarded(int chunks)
public Bytes segmentBytesForReadGuarded()
public Bytes segmentBytesForWriteGuarded()
public void close()
close
in interface Closeable
close
in interface AutoCloseable
public void freeExtraGuarded(long pos, int oldChunks, int newChunks)
public void freeGuarded(long fromPos, int chunks)
public void incrementModCountGuarded()
public void incrementReadGuarded()
public void incrementUpdateGuarded()
public void incrementWriteGuarded()
public void readUnlockAndDecrementCountGuarded()
public void setHashLookupPosGuarded(long hashLookupPos)
public void setLocalLockStateGuarded(net.openhft.chronicle.hash.impl.LocalLockState newState)
public int changeAndGetLatestSameThreadSegmentModCount(int change)
changeAndGetLatestSameThreadSegmentModCount
in interface net.openhft.chronicle.hash.impl.stage.entry.LocksInterface
public int changeAndGetTotalReadLockCount(int change)
changeAndGetTotalReadLockCount
in interface net.openhft.chronicle.hash.impl.stage.entry.LocksInterface
public int changeAndGetTotalUpdateLockCount(int change)
changeAndGetTotalUpdateLockCount
in interface net.openhft.chronicle.hash.impl.stage.entry.LocksInterface
public int changeAndGetTotalWriteLockCount(int change)
changeAndGetTotalWriteLockCount
in interface net.openhft.chronicle.hash.impl.stage.entry.LocksInterface
public int decrementRead()
public int decrementUpdate()
public int decrementWrite()
public long allocReturnCode(int chunks)
public void free(long fromPos, int chunks)
public void freeExtra(long pos, int oldChunks, int newChunks)
public void incrementModCount()
public void incrementRead()
public void incrementUpdate()
public void incrementWrite()
public void readUnlockAndDecrementCount()
public void setHashLookupPos(long hashLookupPos)
public void setLocalLockState(net.openhft.chronicle.hash.impl.LocalLockState newState)
public void setNestedContextsLockedOnSameSegment(boolean nestedContextsLockedOnSameSegment)
setNestedContextsLockedOnSameSegment
in interface net.openhft.chronicle.hash.impl.stage.entry.LocksInterface
public void setNextNode(net.openhft.chronicle.hash.impl.stage.entry.LocksInterface nextNode)
setNextNode
in interface net.openhft.chronicle.hash.impl.stage.entry.LocksInterface
public void setSearchState(CompiledReplicatedMapIterationContext.SearchState newSearchState)
public Thread owner()
public Bytes segmentBytesForRead()
public Bytes segmentBytesForWrite()
public String debugContextsAndLocks()
public boolean readZero()
public boolean realloc(long fromPos, int oldChunks, int newChunks)
public boolean updateZero()
public boolean writeZero()
public int indexInContextChain()
public CompiledReplicatedMapIterationContext.ReadLock innerReadLock()
public CompiledReplicatedMapIterationContext.WriteLock innerWriteLock()
public org.slf4j.Logger LOG()
public SizedReader<V> valueReader()
public CompiledReplicatedMapIterationContext.UpdateLock innerUpdateLock()
public SizedReader<K> keyReader()
public CompiledReplicatedMapIterationContext.EntryKeyBytesData entryKey()
public net.openhft.chronicle.hash.impl.stage.hash.ChainingInterface rootContextInThisThread()
public CompiledReplicatedMapIterationContext.DummyValueZeroData dummyValue()
public CompiledReplicatedMapIterationContext.WrappedValueInstanceDataHolder wrappedValueInstanceValueHolder()
public CompiledReplicatedMapIterationContext.HashEntryChecksumStrategy hashEntryChecksumStrategy()
public List<net.openhft.chronicle.hash.impl.stage.hash.ChainingInterface> contextChain()
public CompiledReplicatedMapIterationContext.EntryValueBytesData entryValue()
public CompiledReplicatedMapIterationContext.ReplicatedMapEntryDelegating entryDelegating()
public ReusableBitSet freeList()
public CompiledReplicatedMapIterationContext.ReplicatedMapAbsentDelegatingForIteration absentEntryDelegating()
public net.openhft.chronicle.hash.impl.stage.entry.ChecksumStrategy checksumStrategy()
public Bytes segmentBytes()
public void closeIterationSegmentStagesDeregisterIterationContextLockedInThisThreadDependants()
public List<net.openhft.chronicle.hash.impl.stage.hash.ChainingInterface> getContextChain()
getContextChain
in class net.openhft.chronicle.hash.impl.stage.hash.ChainingInterface
public <T> T contextAtIndexInChain(int index)
public void closeReplicatedChronicleMapHolderImplContextAtIndexInChainDependants()
public <T extends net.openhft.chronicle.hash.impl.stage.hash.ChainingInterface> T getContext(Class<? extends T> contextClass, Function<net.openhft.chronicle.hash.impl.stage.hash.ChainingInterface,T> createChaining)
getContext
in class net.openhft.chronicle.hash.impl.stage.hash.ChainingInterface
@NotNull public CompiledReplicatedMapIterationContext<K,V,R> context()
HashEntry
public void checkAccessingFromOwnerThread()
public void closeOwnerThreadHolderCheckAccessingFromOwnerThreadDependants()
public void checkIterationContextNotLockedInThisThread()
public void checkEntryNotRemovedOnThisIteration()
public void closeReplicatedMapSegmentIterationCheckEntryNotRemovedOnThisIterationDependants()
public void checkOnEachPublicOperation()
public void closeIterationCheckOnEachPublicOperationCheckOnEachPublicOperationDependants()
public boolean checkSum()
ChecksumEntry
checkSum
in interface ChecksumEntry
true
if stored checksum equals to checksum computed from the entry bytespublic Data<V> wrapValueAsData(V value)
MapContext
Data
. Useful when you need to pass a value
to some method accepting Data
, for example, MapEntryOperations.replaceValue(
MapEntry, Data)
, without allocating new objects (i. e. garbage) and ThreadLocals
.
The returned Data
object shouldn't outlive this MapContext
.
wrapValueAsData
in interface MapContext<K,V,R>
value
- the value object to wrapData
@NotNull public Data<V> value()
MapEntry
@NotNull public Data<K> key()
HashEntry
public void updateChecksum()
ChecksumEntry
MapAbsentEntry.doInsert(Data)
, MapEntry.doReplaceValue(Data)
: it is performed automatically underneath. Call this method,
only when value bytes was updated directly, for example though flyweight implementation of
a value
interface.updateChecksum
in interface ChecksumEntry
@NotNull public InterProcessLock writeLock()
InterProcessReadWriteUpdateLock
lock()
or other
locking methods (tryLock()
, etc.) on this lock acquires the read and update locks,
as well.
Any attempt to acquire this lock (including tryLock()
, if the read lock is already
held by the current thread, but the update and write locks are not yet, is prevented by
throwing IllegalInterProcessLockStateException
.
writeLock
in interface ReadWriteLock
writeLock
in interface InterProcessReadWriteUpdateLock
@NotNull public InterProcessLock readLock()
InterProcessReadWriteUpdateLock
unlock()
on this
lock also releases the update and write locks, if held, as well.readLock
in interface ReadWriteLock
readLock
in interface InterProcessReadWriteUpdateLock
@NotNull public Data<V> defaultValue()
MapAbsentEntry
ChronicleMap.acquireUsing(K, V)
operation
implementation, i. e. MapMethods.acquireUsing(net.openhft.chronicle.map.MapQueryContext<K, V, R>, net.openhft.chronicle.map.ReturnValue<V>)
.
This method if the default implementation for DefaultValueProvider.defaultValue(MapAbsentEntry)
,
which might be customized over the default.
defaultValue
in interface MapAbsentEntry<K,V>
DefaultValueProvider.defaultValue(MapAbsentEntry)
@NotNull public InterProcessLock updateLock()
InterProcessReadWriteUpdateLock
lock()
or other
locking methods (tryLock()
, etc.) on this lock acquires the read lock, as well.
Calling unlock()
on this lock also releases the write lock.
Any attempt to acquire this lock (including tryLock()
, if the read lock is already
held by the current thread, but the update lock is not yet, is prevented by throwing IllegalInterProcessLockStateException
.
updateLock
in interface InterProcessReadWriteUpdateLock
public void closeReplicatedChronicleMapHolderImplMDependants()
public long innerEntrySize(long sizeOfEverythingBeforeValue, long valueSize)
public Data<V> defaultValue(@NotNull MapAbsentEntry<K,V> absentEntry)
DefaultValueProvider
absentEntry
context. This is primarily used in ChronicleMap.acquireUsing(K, V)
operation implementation, i. e. MapMethods.acquireUsing(net.openhft.chronicle.map.MapQueryContext<K, V, R>, net.openhft.chronicle.map.ReturnValue<V>)
.
The default implementation simply delegates to MapAbsentEntry.defaultValue()
.defaultValue
in interface DefaultValueProvider<K,V>
public R replaceValue(@NotNull MapEntry<K,V> entry, Data<V> newValue)
MapEntryOperations
replaceValue
in interface MapEntryOperations<K,V,R>
entry
- the entry to replace the value inpublic final long entrySize(long keySize, long valueSize)
public R remove(@NotNull MapEntry<K,V> entry)
MapEntryOperations
remove
in interface MapEntryOperations<K,V,R>
entry
- the entry to removepublic ChronicleMap<K,V> map()
MapContext
ChronicleMap
. Synonym to MapContext.hash()
.public R insert(@NotNull MapAbsentEntry<K,V> absentEntry, Data<V> value)
MapEntryOperations
the key
from
the given insertion context (absentEntry
) and the given value
.insert
in interface MapEntryOperations<K,V,R>
public ChronicleSet<K> set()
SetContext
ChronicleSet
. Synonym to SetContext.hash()
.public ChronicleHash<K,?,?,?> hash()
HashContext
ChronicleHash
.hash
in interface HashContext<K>
hash
in interface MapContext<K,V,R>
hash
in interface SetContext<K,R>
public void closeIterationSegmentStagesRegisterIterationContextLockedInThisThreadDependants()
public net.openhft.chronicle.hash.impl.CompactOffHeapLinearHashTable hl()
public void closeHashLookupSearchHlDependants()
public boolean searchKeyInit()
public void initSearchKey(long searchKey)
public long searchKey()
public long searchStartPos()
public void closeSearchKey()
public void closeSearchKeyDependants()
public boolean keySizeInit()
public void initKeySize(long keySize)
public long keySize()
public void closeKeySize()
public void closeKeySizeDependants()
public boolean hashLookupEntryInit()
public void initHashLookupEntry(long entry)
public long hashLookupEntry()
public boolean segmentIndexInit()
public void initSegmentIndex(int segmentIndex)
public int segmentIndex()
SegmentLock
segmentIndex
in interface SegmentLock
public void closeSegmentIndex()
public void closeSegmentIndexDependants()
public boolean segmentHeaderInit()
segmentHeaderInit
in interface net.openhft.chronicle.hash.impl.stage.entry.LocksInterface
public long segmentHeaderAddress()
segmentHeaderAddress
in interface net.openhft.chronicle.hash.impl.stage.entry.LocksInterface
public net.openhft.chronicle.hash.impl.SegmentHeader segmentHeader()
public void closeSegmentHeader()
public void closeSegmentHeaderDependants()
public boolean segmentTierInit()
public void initSegmentTier()
public void initSegmentTier(int tier, long tierIndex, long tierBaseAddr)
public void initSegmentTier_WithBaseAddr(int tier, long tierBaseAddr, long tierIndex)
public int tier()
public long tierBaseAddr()
public long tierIndex()
public void closeSegmentTier()
public void closeSegmentTierDependants()
public long tierCountersAreaAddr()
public void closeIterationSegmentStagesTierCountersAreaAddrDependants()
public long prevTierIndex()
public void prevTier()
public void prevTierIndex(long prevTierIndex)
public long nextTierIndex()
public boolean hasNextTier()
public void nextTierIndex(long nextTierIndex)
public void goToFirstTier()
public long tierEntries()
public void tierEntries(long tierEntries)
public void closeIterationSegmentStagesTierEntriesDependants()
public long tierDeleted()
public void tierDeleted(long tierDeleted)
public void closeHashLookupSearchAddrDependants()
public void closeIterationSegmentStagesLowestPossiblyFreeChunkDependants()
public void lowestPossiblyFreeChunk(long lowestPossiblyFreeChunk)
public long entrySpaceOffset()
public PointerBytesStore segmentBS()
public void closeSegmentDependants()
public void nextTier()
public void goToLastTier()
public long size()
HashSegmentContext
public long alloc(int chunks, long prevPos, int prevChunks)
net.openhft.chronicle.hash.impl.stage.entry.Alloc
alloc
in interface net.openhft.chronicle.hash.impl.stage.entry.Alloc
chunks
- chunks to allocateprevPos
- the previous position to clear, -1 if not neededprevChunks
- the size of the previous allocation to clear, 0 if not neededpublic void verifyTierCountersAreaData()
public boolean usedInit()
usedInit
in class net.openhft.chronicle.hash.impl.stage.hash.ChainingInterface
public void initUsed(boolean used)
initUsed
in class net.openhft.chronicle.hash.impl.stage.hash.ChainingInterface
public boolean entriesToTestInit()
public net.openhft.chronicle.map.impl.CompiledReplicatedMapIterationContext.EntriesToTest entriesToTest()
public void closeEntriesToTest()
public long tierEntriesForIteration()
protected void initEntryRemovedOnThisIteration(boolean entryRemovedOnThisIteration)
public void closeEntryRemovedOnThisIteration()
public void closeInputKey()
public void closeInputKeyDependants()
public void checkNestedContextsQueryDifferentKeys(net.openhft.chronicle.hash.impl.stage.entry.LocksInterface innermostContextOnThisSegment)
public void closeIterationSegmentStagesCheckNestedContextsQueryDifferentKeysDependants()
public boolean locksInit()
locksInit
in interface net.openhft.chronicle.hash.impl.stage.entry.LocksInterface
public boolean nestedContextsLockedOnSameSegment()
public int latestSameThreadSegmentModCount()
latestSameThreadSegmentModCount
in interface net.openhft.chronicle.hash.impl.stage.entry.LocksInterface
public int totalReadLockCount()
totalReadLockCount
in interface net.openhft.chronicle.hash.impl.stage.entry.LocksInterface
public int totalUpdateLockCount()
totalUpdateLockCount
in interface net.openhft.chronicle.hash.impl.stage.entry.LocksInterface
public int totalWriteLockCount()
totalWriteLockCount
in interface net.openhft.chronicle.hash.impl.stage.entry.LocksInterface
public net.openhft.chronicle.hash.impl.LocalLockState localLockState()
public net.openhft.chronicle.hash.impl.stage.entry.LocksInterface nextNode()
nextNode
in interface net.openhft.chronicle.hash.impl.stage.entry.LocksInterface
public net.openhft.chronicle.hash.impl.stage.entry.LocksInterface rootContextLockedOnThisSegment()
rootContextLockedOnThisSegment
in interface net.openhft.chronicle.hash.impl.stage.entry.LocksInterface
public void closeLocksDependants()
public boolean hashLookupPosInit()
public void initHashLookupPos()
public void initHashLookupPos(long hashLookupPos)
public long hashLookupPos()
public void closeHashLookupPos()
public void closeHashLookupPosDependants()
public long nextPos()
public void closeHashLookupSearchNextPosDependants()
public void putValueVolatile(long newValue)
public void found()
public void closeHashLookupSearchFoundDependants()
public boolean checkSlotContainsExpectedKeyAndValue(long value)
public void remove()
public String debugLocksState()
debugLocksState
in interface net.openhft.chronicle.hash.impl.stage.entry.LocksInterface
@NotNull public Data<K> absentKey()
HashAbsentEntry
ChronicleHash
.absentKey
in interface HashAbsentEntry<K>
public boolean posInit()
public void initPos(long pos)
public long pos()
public void closePos()
public void closePosDependants()
public void dropChange()
public void dropChanged()
ReplicableEntry
dropChanged
in interface ReplicableEntry
public boolean changed()
public boolean isChanged()
ReplicableEntry
isChanged
in interface ReplicableEntry
true
is the entry is "dirty" locally, i. e. should be replicated to remote
Chronicle nodes, false
otherwisepublic boolean entryOffsetInit()
public void initEntryOffset()
public long keySizeOffset()
public void closeEntryOffset()
public void closeEntryOffsetDependants()
public void readExistingEntry(long pos)
public void closeReplicatedMapEntryStagesReadExistingEntryDependants()
public void copyExistingEntry(long newPos, long bytesToCopy, long oldKeyAddr, long oldKeySizeAddr)
public boolean keyOffsetInit()
public void initKeyOffset(long keyOffset)
public long keyOffset()
public void closeKeyOffset()
public void closeKeyOffsetDependants()
public long keyEnd()
public void closeReplicatedMapEntryStagesKeyEndDependants()
public void closeReplicatedMapEntryStagesCountValueSizeOffsetDependants()
public boolean valueSizeOffsetInit()
public long valueSizeOffset()
public void closeValueSizeOffset()
public void closeValueSizeOffsetDependants()
public boolean valueSizeInit()
public long valueOffset()
public long valueSize()
public void closeValueSize()
public void closeValueSizeDependants()
public void writeValue(Data<?> value)
public void initValue_WithoutSize(Data<?> value, long oldValueSizeOffset, long oldValueSize, long oldValueOffset)
public void initValue(Data<?> value)
public boolean replicationStateInit()
public long replicationBytesOffset()
public void closeReplicationState()
public void updatedReplicationStateOnAbsentEntry()
public void updateOrigin(byte newIdentifier, long newTimestamp)
ReplicableEntry
ReplicableEntry.originIdentifier()
returns the given newIdentifier
and ReplicableEntry.originTimestamp()
returns the given newTimestamp
respectively.updateOrigin
in interface ReplicableEntry
newIdentifier
- the new identifier for the entrynewTimestamp
- the new timestamp for the entrypublic void writeEntryDeleted()
public void writeEntryPresent()
public boolean entryDeleted()
public Object entryForIteration()
public boolean shouldTestEntry()
public <T> boolean innerForEachSegmentEntryWhile(Predicate<? super T> predicate)
public boolean forEachSegmentEntryWhile(Predicate<? super MapEntry<K,V>> predicate)
HashSegmentContext
false
for some entry, or throws
an Exception
. Exceptions thrown by the predicate are relayed to the caller.
If this segment is empty (i. e. HashSegmentContext.size()
call returns 0), this method returns
true
immediately.
forEachSegmentEntryWhile
in interface HashSegmentContext<K,MapEntry<K,V>>
predicate
- the predicate to be checked for each entry in this segmenttrue
if the predicate returned true
for all checked entries,
false
if it returned false
for some entrypublic void forEachSegmentEntry(Consumer<? super MapEntry<K,V>> action)
HashSegmentContext
Exception
. Exceptions thrown by the
action are relayed to the caller.forEachSegmentEntry
in interface HashSegmentContext<K,MapEntry<K,V>>
action
- the action to be performed for each entry in this segmentpublic boolean forEachSegmentReplicableEntryWhile(Predicate<? super ReplicableEntry> predicate)
forEachSegmentReplicableEntryWhile
in interface ReplicatedHashSegmentContext<K,MapEntry<K,V>>
public void forEachSegmentReplicableEntry(Consumer<? super ReplicableEntry> action)
forEachSegmentReplicableEntry
in interface ReplicatedHashSegmentContext<K,MapEntry<K,V>>
public void doRemoveCompletely()
ReplicableEntry
MapEntry.doRemove()
does for Replicated Chronicle hash. After calling this method
the entry won't be replicated over to remote Chronicle nodes, as if ReplicableEntry.dropChanged()
was called, and incoming entry replication event with the key if this entry will be
processed, as the entry have never been present in the Chronicle hash. After calling this
method any subsequent call of any method of ReplicableEntry
class throws IllegalStateException
.doRemoveCompletely
in interface ReplicableEntry
ChronicleHashBuilder.cleanupRemovedEntries(boolean)
,
ChronicleHashBuilder.removedEntryCleanupTimeout(long, TimeUnit)
public long timestamp()
public void raiseChange()
public void updateChange()
public void raiseChanged()
ReplicableEntry
raiseChanged
in interface ReplicableEntry
public long originTimestamp()
ReplicableEntry
When the entry is replicated, this timestamp comes to remote nodes as RemoteOperationContext.remoteTimestamp()
.
On ChronicleHash
local operations with entries, like Map.put(
Object, Object)
, this timestamp is overwritten using the configured time provider. On remote
operations, proxied through MapRemoteOperations
or SetRemoteOperations
,
you are free to overwrite this timestamp by any value, using ReplicableEntry.updateOrigin(byte, long)
method.
originTimestamp
in interface ReplicableEntry
TimeProvider
public void moveChange(long oldTierIndex, long oldPos, long newPos)
public void updatedReplicationStateOnPresentEntry()
public byte originIdentifier()
ReplicableEntry
ChronicleHash
node on which this entry was updated last.
When the entry is replicated, this identifier comes to remote nodes as RemoteOperationContext.remoteIdentifier()
.
On ChronicleHash
local operations with entries, like Map.put(
Object, Object)
, this identifier is overwritten to the own ChronicleHash
Replica.identifier()
. On remote operations, proxied through MapRemoteOperations
or
SetRemoteOperations
, you are free to overwrite this identifier to any value, using
ReplicableEntry.updateOrigin(byte, long)
method.
originIdentifier
in interface ReplicableEntry
protected long entryEnd()
public void closeReplicatedMapEntryStagesEntryEndDependants()
public void closeReplicatedMapEntryStagesEntrySizeDependants()
public boolean entrySizeInChunksInit()
public void initEntrySizeInChunks(int actuallyUsedChunks)
public int entrySizeInChunks()
public void closeEntrySizeInChunks()
public void innerRemoveEntryExceptHashLookupUpdate()
public void iterationRemove()
public void writeNewEntry(long pos, Data<?> key)
public void closeKeySearchKeyEqualsDependants()
public void initKeySearch()
public CompiledReplicatedMapIterationContext.SearchState searchState()
public boolean searchStateDeleted()
public boolean searchStatePresent()
public boolean searchStateAbsent()
public void putNewVolatile(long value)
public boolean keyHashInit()
public long keyHash()
public void closeKeyHash()
public void closeKeyHashDependants()
public long keyHashCode()
keyHashCode
in interface net.openhft.chronicle.hash.impl.stage.entry.KeyHashCode
public void closeIterationKeyHashCodeKeyHashCodeDependants()
public void initDelayedUpdateChecksum(boolean delayedUpdateChecksum)
public void closeDelayedUpdateChecksum()
public boolean allocatedChunksInit()
public void initAllocatedChunks(int allocatedChunks)
public int allocatedChunks()
public void closeAllocatedChunks()
public final void freeExtraAllocatedChunks()
public boolean initEntryAndKeyCopying(long entrySize, long bytesToCopy, long prevPos, int prevChunks)
public void doInsert(Data<V> value)
MapAbsentEntry
value
.
This method is the default implementation for MapEntryOperations.insert(
MapAbsentEntry, Data)
, which might be customized over the default.
doInsert
in interface MapAbsentEntry<K,V>
value
- the value to insert into the map along with the key
MapEntryOperations.insert(MapAbsentEntry, Data)
public void doInsert()
SetAbsentEntry
the new key
into the set.
This method is the default implementation for SetEntryOperations.insert(
SetAbsentEntry)
, which might be customized over the default.
doInsert
in interface SetAbsentEntry<K>
SetEntryOperations.insert(SetAbsentEntry)
public void doReplaceValue(Data<V> newValue)
MapEntry
newValue
.
This method is the default implementation for MapEntryOperations.replaceValue(
MapEntry, Data)
, which might be customized over the default.
doReplaceValue
in interface MapEntry<K,V>
newValue
- the value to be put into the map instead of the current
valuepublic void doRemove()
HashEntry
ChronicleHash
.public boolean replicationUpdateInit()
public void initReplicationUpdate(long timestamp, byte identifier)
public byte innerRemoteIdentifier()
public long innerRemoteTimestamp()
public void closeReplicationUpdate()
public long remoteTimestamp()
remoteTimestamp
in interface RemoteOperationContext<K>
public byte remoteIdentifier()
remoteIdentifier
in interface RemoteOperationContext<K>
Copyright © 2015. All rights reserved.