public class FixedSizeSwapRedoLogFile<T> extends Object implements IRedoLogFile<T>
IRedoLogFile interface, A fixed number of packets can
be held in the memory and once this number is exeeded the other packets are stored in a provided
INonBatchRedoLogFileStorage| Constructor and Description |
|---|
FixedSizeSwapRedoLogFile(FixedSizeSwapRedoLogFileConfig config)
Constructs a fixed size swap redo log file
|
| 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.
|
long |
getExternalStoragePacketsCount() |
long |
getExternalStorageSpaceUsed() |
long |
getMemoryPacketCount() |
long |
getMemoryPacketsCount() |
T |
getOldest() |
long |
getStoragePacketCount() |
boolean |
isEmpty() |
Iterator<T> |
iterator() |
ReadOnlyIterator<T> |
readOnlyIterator() |
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
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic FixedSizeSwapRedoLogFile(FixedSizeSwapRedoLogFileConfig config)
public void add(T replicationPacket)
IRedoLogFileadd in interface IRedoLogFile<T>replicationPacket - packet to addpublic T getOldest()
getOldest in interface IRedoLogFile<T>public boolean isEmpty()
isEmpty in interface IRedoLogFile<T>public ReadOnlyIterator<T> readOnlyIterator(long fromIndex)
readOnlyIterator in interface IRedoLogFile<T>fromIndex - index to start frompublic T removeOldest()
IRedoLogFileremoveOldest in interface IRedoLogFile<T>public long size()
size in interface IRedoLogFileStatisticssize in interface IRedoLogFile<T>public long getApproximateSize()
IRedoLogFilegetApproximateSize in interface IRedoLogFile<T>public ReadOnlyIterator<T> readOnlyIterator()
readOnlyIterator in interface ReadOnlyIterable<T>public void deleteOldestBatch(long batchSize)
IRedoLogFiledeleteOldestBatch in interface IRedoLogFile<T>batchSize - number of oldest packets to deletepublic long getMemoryPacketCount()
public long getStoragePacketCount()
public long getExternalStorageSpaceUsed()
getExternalStorageSpaceUsed in interface IRedoLogFileStatisticspublic long getExternalStoragePacketsCount()
getExternalStoragePacketsCount in interface IRedoLogFileStatisticspublic long getMemoryPacketsCount()
getMemoryPacketsCount in interface IRedoLogFileStatisticspublic void validateIntegrity()
throws RedoLogFileCompromisedException
IRedoLogFilevalidateIntegrity in interface IRedoLogFile<T>RedoLogFileCompromisedExceptionpublic void close()
IRedoLogFileclose in interface IRedoLogFile<T>Copyright © GigaSpaces.