public interface IRedoLogFile<T> extends Iterable<T>, ReadOnlyIterable<T>, IRedoLogFileStatistics
MemoryRedoLog
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 |
deleteOldestBatch(long batchSize)
Deletes the oldest packets, starting from the oldest up until the specified batch size
|
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() |
boolean |
isEmpty() |
ReadOnlyIterator<T> |
readOnlyIterator(long fromIndex) |
T |
removeOldest()
Remove and returns the oldest replication packet in the file
|
long |
size() |
void |
validateIntegrity()
Validates the integrity of the redo log file
|
forEach, iterator, spliterator
readOnlyIterator
getExternalStoragePacketsCount, getExternalStorageSpaceUsed, getMemoryPacketsCount
T removeOldest()
T getOldest()
void add(T replicationPacket)
replicationPacket
- packet to addlong size()
size
in interface IRedoLogFileStatistics
long getApproximateSize()
boolean isEmpty()
ReadOnlyIterator<T> readOnlyIterator(long fromIndex)
fromIndex
- index to start fromvoid deleteOldestBatch(long batchSize)
batchSize
- number of oldest packets to deletevoid validateIntegrity() throws RedoLogFileCompromisedException
RedoLogFileCompromisedException
void close()
Copyright © GigaSpaces.