public class CompiledReplicatedMapQueryContext<K,V,R> extends net.openhft.chronicle.hash.impl.stage.hash.ChainingInterface implements AutoCloseable, ChecksumEntry, HashEntry<K>, 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, ExternalMapQueryContext<K,V,R>, MapAbsentEntry<K,V>, MapContext<K,V,R>, MapEntry<K,V>, net.openhft.chronicle.map.impl.QueryContextInterface<K,V,R>, net.openhft.chronicle.map.impl.ReplicatedChronicleMapHolder<K,V,R>, net.openhft.chronicle.map.impl.stage.query.Absent<K,V>, net.openhft.chronicle.map.impl.stage.query.MapAndSetContext<K,V,R>, MapRemoteQueryContext<K,V,R>, MapReplicableEntry<K,V>, ExternalSetQueryContext<K,R>, SetContext<K,R>, SetEntry<K>, SetRemoteQueryContext<K,R>, SetReplicableEntry<K>
Constructor and Description |
---|
CompiledReplicatedMapQueryContext(net.openhft.chronicle.hash.impl.stage.hash.ChainingInterface c,
net.openhft.chronicle.map.ReplicatedChronicleMap<K,V,R> m) |
CompiledReplicatedMapQueryContext(net.openhft.chronicle.map.ReplicatedChronicleMap<K,V,R> m) |
public final int indexInContextChain
public final CompiledReplicatedMapQueryContext.ReadLock innerReadLock
public static final org.slf4j.Logger LOG
public final CompiledReplicatedMapQueryContext.WriteLock innerWriteLock
public final SizedReader<K> keyReader
public final CompiledReplicatedMapQueryContext.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 CompiledReplicatedMapQueryContext.AcquireHandle acquireHandle
public final CompiledReplicatedMapQueryContext.UsingReturnValue usingReturnValue
public final CompiledReplicatedMapQueryContext.DefaultReturnValue defaultReturnValue
public final CompiledReplicatedMapQueryContext.EntryValueBytesData entryValue
public final PointerBytesStore segmentBS
public final net.openhft.chronicle.hash.impl.stage.entry.ChecksumStrategy checksumStrategy
public final Bytes segmentBytes
public long bootstrapTimestamp
public long riKeySize
public long riValueSize
public long riKeyOffset
public long riValueOffset
public long riTimestamp
public byte riId
public boolean isDeleted
public long keySize
public Bytes replicatedInputBytes
public long keyHash
public int segmentIndex
public int latestSameThreadSegmentModCount
public int contextModCount
public boolean nestedContextsLockedOnSameSegment
public net.openhft.chronicle.hash.impl.stage.entry.LocksInterface rootContextLockedOnThisSegment
public int tier
public long tierIndex
public long tierBaseAddr
public long searchStartPos
public long hashLookupPos
public long pos
public long keySizeOffset
public long keyOffset
public long valueSizeOffset
public long valueSize
public long valueOffset
public int entrySizeInChunks
public boolean delayedUpdateChecksum
protected CompiledReplicatedMapQueryContext.SearchState searchState
public int allocatedChunks
public long innerRemoteTimestamp
public byte innerRemoteIdentifier
public CompiledReplicatedMapQueryContext(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()
ExternalHashQueryContext
try (ExternalHashQueryContext<K> q = hash.queryContext(key))
q.writeLock().lock();
// ...make a query under exclusive lock
// NOT NEEDED - q.readLock().unlock();
}
close
in interface AutoCloseable
close
in interface ExternalHashQueryContext<K>
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 void setSearchStateGuarded(CompiledReplicatedMapQueryContext.SearchState newSearchState)
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(CompiledReplicatedMapQueryContext.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 net.openhft.chronicle.map.impl.CompiledReplicatedMapQueryContext.CleanupAction cleanupAction()
public DataAccess<K> innerInputKeyDataAccess()
public DataAccess<V> innerInputValueDataAccess()
public CompiledReplicatedMapQueryContext.ReadLock innerReadLock()
public CompiledReplicatedMapQueryContext.WriteLock innerWriteLock()
public org.slf4j.Logger LOG()
public SizedReader<V> valueReader()
public CompiledReplicatedMapQueryContext.UpdateLock innerUpdateLock()
public SizedReader<K> keyReader()
public CompiledReplicatedMapQueryContext.EntryKeyBytesData entryKey()
public net.openhft.chronicle.hash.impl.stage.hash.ChainingInterface rootContextInThisThread()
public CompiledReplicatedMapQueryContext.DummyValueZeroData dummyValue()
public CompiledReplicatedMapQueryContext.WrappedValueInstanceDataHolder wrappedValueInstanceValueHolder()
public CompiledReplicatedMapQueryContext.HashEntryChecksumStrategy hashEntryChecksumStrategy()
public CompiledReplicatedMapQueryContext.UsingReturnValue usingReturnValue()
public CompiledReplicatedMapQueryContext.AcquireHandle acquireHandle()
public List<net.openhft.chronicle.hash.impl.stage.hash.ChainingInterface> contextChain()
public CompiledReplicatedMapQueryContext.DefaultReturnValue defaultReturnValue()
public CompiledReplicatedMapQueryContext.EntryValueBytesData entryValue()
public CompiledReplicatedMapQueryContext.ReplicatedInputKeyBytesData replicatedInputKeyBytesValue()
public CompiledReplicatedMapQueryContext.ReplicatedInputValueBytesData replicatedInputValueBytesValue()
public CompiledReplicatedMapQueryContext.ReplicatedMapAbsentDelegating absentDelegating()
public ReusableBitSet freeList()
public net.openhft.chronicle.hash.impl.stage.entry.ChecksumStrategy checksumStrategy()
public Bytes segmentBytes()
public <T> T contextAtIndexInChain(int index)
public void closeReplicatedChronicleMapHolderImplContextAtIndexInChainDependants()
public void checkAccessingFromOwnerThread()
public void closeOwnerThreadHolderCheckAccessingFromOwnerThreadDependants()
public void closeReplicatedChronicleMapHolderImplMDependants()
public long innerEntrySize(long sizeOfEverythingBeforeValue, long valueSize)
public final long entrySize(long keySize, long valueSize)
public ChronicleMap<K,V> map()
MapContext
ChronicleMap
. Synonym to MapContext.hash()
.public boolean replicationInputInit()
public void initReplicationInput(Bytes replicatedInputBytes)
public boolean isDeleted()
public byte riId()
public long bootstrapTimestamp()
public long riKeyOffset()
public long riKeySize()
public long riValueOffset()
public long riValueSize()
public void closeReplicationInput()
public void closeReplicationInputDependants()
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 <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
public DataAccess<K> inputKeyDataAccess()
public void checkIterationContextNotLockedInThisThread()
public DataAccess<V> inputValueDataAccess()
public void closeQuerySegmentStagesRegisterIterationContextLockedInThisThreadDependants()
public net.openhft.chronicle.hash.impl.CompactOffHeapLinearHashTable hl()
public void closeQueryHashLookupSearchHlDependants()
public Data<V> dummyZeroValue()
MapRemoteQueryContext
The returned value doesn't have object form (i. e. it's Data.get()
and Data.getUsing(Object)
methods throw UnsupportedOperationException
), it has only
bytes form, of all zero bytes.
dummyZeroValue
in interface MapRemoteQueryContext<K,V,R>
public List<net.openhft.chronicle.hash.impl.stage.hash.ChainingInterface> getContextChain()
getContextChain
in class net.openhft.chronicle.hash.impl.stage.hash.ChainingInterface
public void closeQuerySegmentStagesDeregisterIterationContextLockedInThisThreadDependants()
public boolean inputKeyDataAccessInit()
public boolean keySizeInit()
public void initKeySize(long keySize)
public long keySize()
public void closeKeySize()
public void closeKeySizeDependants()
public boolean inputValueDataAccessInit()
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 replicatedInputBytesInit()
public void initReplicatedInputBytes(Bytes replicatedInputBytes)
public Bytes replicatedInputBytes()
public void closeReplicatedInputBytes()
public void closeReplicatedInputBytesDependants()
public void closeInputKey()
public void closeInputKeyDependants()
public void checkNestedContextsQueryDifferentKeys(net.openhft.chronicle.hash.impl.stage.entry.LocksInterface innermostContextOnThisSegment)
public void closeQuerySegmentStagesCheckNestedContextsQueryDifferentKeysDependants()
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 closeInputKeyHashCodeKeyHashCodeDependants()
public boolean segmentIndexInit()
public void initSegmentIndex(int segmentIndex)
public int segmentIndex()
SegmentLock
segmentIndex
in interface HashQueryContext<K>
segmentIndex
in interface SegmentLock
public void closeSegmentIndex()
public void closeSegmentIndexDependants()
public boolean forcedOldDeletedEntriesCleanup(long prevPos)
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 locksInit()
locksInit
in interface net.openhft.chronicle.hash.impl.stage.entry.LocksInterface
public boolean nestedContextsLockedOnSameSegment()
public int contextModCount()
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 String debugLocksState()
debugLocksState
in interface net.openhft.chronicle.hash.impl.stage.entry.LocksInterface
public void processReplicatedEvent()
public boolean segmentTierInit()
public void initSegmentTier()
public void initSegmentTier(int tier, long tierIndex, long tierBaseAddr)
public int tier()
public long tierBaseAddr()
public long tierIndex()
public void closeSegmentTier()
public void closeSegmentTierDependants()
public void closeQueryHashLookupSearchAddrDependants()
public long tierCountersAreaAddr()
public void closeQuerySegmentStagesTierCountersAreaAddrDependants()
public void prevTierIndex(long prevTierIndex)
public void closeQuerySegmentStagesPrevTierIndexDependants()
public long prevTierIndex()
public void prevTier()
public void tierDeleted(long tierDeleted)
public long tierDeleted()
public void nextTierIndex(long nextTierIndex)
public void closeQuerySegmentStagesNextTierIndexDependants()
public long nextTierIndex()
public boolean hasNextTier()
public void closeQuerySegmentStagesHasNextTierDependants()
public void nextTier()
public void closeQuerySegmentStagesNextTierDependants()
public void goToLastTier()
public void lowestPossiblyFreeChunk(long lowestPossiblyFreeChunk)
public void closeQuerySegmentStagesLowestPossiblyFreeChunkDependants()
public void tierEntries(long tierEntries)
public void closeQuerySegmentStagesTierEntriesDependants()
public long tierEntries()
public long entrySpaceOffset()
public PointerBytesStore segmentBS()
public void closeSegmentDependants()
public void goToFirstTier()
public long size()
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 searchKeyInit()
public void initSearchKey(long searchKey)
public long searchKey()
public long searchStartPos()
public void closeSearchKey()
public void closeSearchKeyDependants()
public boolean hashLookupPosInit()
public void initHashLookupPos()
public void initHashLookupPos(long hashLookupPos)
public long hashLookupPos()
public void closeHashLookupPos()
public void closeHashLookupPosDependants()
public void found()
public void closeQueryHashLookupSearchFoundDependants()
public long nextPos()
public void closeQueryHashLookupSearchNextPosDependants()
public boolean checkSlotContainsExpectedKeyAndValue(long value)
public void closeQueryHashLookupSearchCheckSlotContainsExpectedKeyAndValueDependants()
public void putValueVolatile(long newValue)
public void remove()
public boolean posInit()
public void initPos(long pos)
public long pos()
public void closePos()
public void closePosDependants()
public void dropChange()
public boolean changed()
public 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 writeEntryDeleted()
public void writeEntryPresent()
public boolean entryDeleted()
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 moveChange(long oldTierIndex, long oldPos, long newPos)
public void updatedReplicationStateOnPresentEntry()
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 initDelayedUpdateChecksum(boolean delayedUpdateChecksum)
public void closeDelayedUpdateChecksum()
public void writeNewEntry(long pos, Data<?> key)
public void closeKeySearchKeyEqualsDependants()
public void initKeySearch()
public CompiledReplicatedMapQueryContext.SearchState searchState()
public void closeKeySearchDependants()
public void dropSearchIfNestedContextsAndPresentHashLookupSlotCheckFailed()
public void closeReplicatedMapQueryDropSearchIfNestedContextsAndPresentHashLookupSlotCheckFailedDependants()
public void checkOnEachPublicOperation()
public void closeQueryCheckOnEachPublicOperationCheckOnEachPublicOperationDependants()
public void dropChanged()
ReplicableEntry
dropChanged
in interface ReplicableEntry
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 in@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 boolean checkSum()
ChecksumEntry
checkSum
in interface ChecksumEntry
true
if stored checksum equals to checksum computed from the entry bytes@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
public Data<K> queriedKey()
HashQueryContext
Data
.queriedKey
in interface HashQueryContext<K>
public 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
public void raiseChanged()
ReplicableEntry
raiseChanged
in interface ReplicableEntry
@NotNull public Data<K> key()
HashEntry
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
otherwise@NotNull public CompiledReplicatedMapQueryContext<K,V,R> context()
HashEntry
context
in interface HashAbsentEntry<K>
context
in interface HashEntry<K>
context
in interface net.openhft.chronicle.map.impl.stage.query.Absent<K,V>
context
in interface MapAbsentEntry<K,V>
context
in interface MapEntry<K,V>
context
in interface SetAbsentEntry<K>
context
in interface SetEntry<K>
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
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 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 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
public R remove(@NotNull MapEntry<K,V> entry)
MapEntryOperations
remove
in interface MapEntryOperations<K,V,R>
entry
- the entry to remove@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 Data<K> absentKey()
HashAbsentEntry
ChronicleHash
.absentKey
in interface HashAbsentEntry<K>
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 entry@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)
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 boolean searchStateDeleted()
public boolean searchStatePresent()
public void closeKeySearchSearchStatePresentDependants()
public void closeReplicatedMapQueryTieredEntryPresentDependants()
public boolean searchStateAbsent()
protected void putPrefix()
public void putNewVolatile(long value)
public boolean presenceOfEntryInit()
public void initPresenceOfEntry(CompiledReplicatedMapQueryContext.EntryPresence entryPresence)
public CompiledReplicatedMapQueryContext.EntryPresence entryPresence()
public void closePresenceOfEntry()
public boolean entryPresent()
@Nullable public net.openhft.chronicle.map.impl.stage.query.Absent<K,V> absentEntry()
HashQueryContext
null
, if the entry is present.absentEntry
in interface HashQueryContext<K>
absentEntry
in interface MapQueryContext<K,V,R>
absentEntry
in interface SetQueryContext<K,R>
public CompiledReplicatedMapQueryContext<K,V,R> entry()
HashQueryContext
ChronicleHash
, returns null
is the entry is absent.entry
in interface HashQueryContext<K>
entry
in interface MapQueryContext<K,V,R>
entry
in interface MapRemoteQueryContext<K,V,R>
entry
in interface SetRemoteQueryContext<K,R>
entry
in interface SetQueryContext<K,R>
public boolean allocatedChunksInit()
public void initAllocatedChunks(int allocatedChunks)
public int allocatedChunks()
public void closeAllocatedChunks()
public boolean initEntryAndKeyCopying(long entrySize, long bytesToCopy, long prevPos, int prevChunks)
public final void freeExtraAllocatedChunks()
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 initEntryAndKey(long entrySize)
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 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.