public interface IRedoLogFile<T extends IReplicationOrderedPacket> extends IRedoLogFileStatistics
MemoryRedoLogFile
Implementor should support concurrent
readers or a single writer, in other words, the implementor can assume access to this structure
are guarded with a reader writer lock according to the operation type
An exception is getApproximateSize()
method which should not assume a reader lock is
held.Modifier and Type | Method and Description |
---|---|
void |
add(T replicationPacket)
Add a replication packet to the file as the latest packet
|
void |
close()
Closes the redo log file
|
void |
deleteOldestPackets(long packetsCount)
Deletes the oldest packets, starting from the oldest up until the specified batch size
|
default int |
flushToStorage()
Flush redo-log packets from memory to underlying storage.
|
long |
getApproximateSize()
Gets an approximation of the number of replication packets held in the file, implementation
of this method should not assume a reader lock is held and hence can return a result which is
not accurate if it cannot do so without a lock.
|
T |
getOldest() |
long |
getOldestKey() |
default RedoLogSwapStorageType |
getSwapStorageType() |
long |
getWeight() |
boolean |
isEmpty() |
CompactionResult |
performCompaction(long from,
long to) |
ReadOnlyIterator<T> |
readOnlyIterator(long fromKey) |
T |
removeOldest()
Remove and returns the oldest replication packet in the file
|
long |
size() |
void |
validateIntegrity()
Validates the integrity of the redo log file
|
getExternalStoragePacketsCount, getExternalStoragePacketsWeight, getExternalStorageSpaceUsed, getMemoryPacketsCount, getMemoryPacketsWeight
T removeOldest()
T getOldest()
long getOldestKey()
void add(T replicationPacket)
replicationPacket
- packet to addlong size()
size
in interface IRedoLogFileStatistics
long getApproximateSize()
boolean isEmpty()
ReadOnlyIterator<T> readOnlyIterator(long fromKey)
fromKey
- index to start fromvoid deleteOldestPackets(long packetsCount)
packetsCount
- number of oldest packets to deletevoid validateIntegrity() throws RedoLogFileCompromisedException
RedoLogFileCompromisedException
void close()
long getWeight()
CompactionResult performCompaction(long from, long to)
from
- key to start searching transient packet fromto
- key to end searching transient packet fromdefault int flushToStorage()
default RedoLogSwapStorageType getSwapStorageType()
Copyright © GigaSpaces.