public class FixedSizeSwapRedoLogFile<T extends IReplicationOrderedPacket> extends Object implements IRedoLogFile<T>
IRedoLogFile interface, A fixed number of packets can
be held in the memory and once this number is exceeded the other packets are stored in a provided
INonBatchRedoLogFileStorage| Constructor and Description |
|---|
FixedSizeSwapRedoLogFile(FixedSizeSwapRedoLogFileConfig config,
String name,
AbstractSingleFileGroupBacklog groupBacklog)
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 |
deleteOldestPackets(long packetsCount)
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 |
getExternalStoragePacketsWeight() |
long |
getExternalStorageSpaceUsed() |
long |
getMemoryPacketCount() |
long |
getMemoryPacketsCount() |
long |
getMemoryPacketsWeight() |
MemoryRedoLogFile<T> |
getMemoryRedoLogFile() |
T |
getOldest() |
long |
getOldestKey() |
long |
getStoragePacketCount() |
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
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitflushToStoragepublic FixedSizeSwapRedoLogFile(FixedSizeSwapRedoLogFileConfig config, String name, AbstractSingleFileGroupBacklog groupBacklog)
public void add(T replicationPacket)
IRedoLogFileadd in interface IRedoLogFile<T extends IReplicationOrderedPacket>replicationPacket - packet to addpublic T getOldest()
getOldest in interface IRedoLogFile<T extends IReplicationOrderedPacket>public long getOldestKey()
getOldestKey in interface IRedoLogFile<T extends IReplicationOrderedPacket>public boolean isEmpty()
isEmpty in interface IRedoLogFile<T extends IReplicationOrderedPacket>public ReadOnlyIterator<T> readOnlyIterator(long fromKey)
readOnlyIterator in interface IRedoLogFile<T extends IReplicationOrderedPacket>fromKey - index to start frompublic T removeOldest()
IRedoLogFileremoveOldest in interface IRedoLogFile<T extends IReplicationOrderedPacket>public long size()
size in interface IRedoLogFileStatisticssize in interface IRedoLogFile<T extends IReplicationOrderedPacket>public long getApproximateSize()
IRedoLogFilegetApproximateSize in interface IRedoLogFile<T extends IReplicationOrderedPacket>public void deleteOldestPackets(long packetsCount)
IRedoLogFiledeleteOldestPackets in interface IRedoLogFile<T extends IReplicationOrderedPacket>packetsCount - 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 getMemoryPacketsWeight()
getMemoryPacketsWeight in interface IRedoLogFileStatisticspublic long getExternalStoragePacketsWeight()
getExternalStoragePacketsWeight in interface IRedoLogFileStatisticspublic long getMemoryPacketsCount()
getMemoryPacketsCount in interface IRedoLogFileStatisticspublic void validateIntegrity()
throws RedoLogFileCompromisedException
IRedoLogFilevalidateIntegrity in interface IRedoLogFile<T extends IReplicationOrderedPacket>RedoLogFileCompromisedExceptionpublic void close()
IRedoLogFileclose in interface IRedoLogFile<T extends IReplicationOrderedPacket>public long getWeight()
getWeight in interface IRedoLogFile<T extends IReplicationOrderedPacket>public CompactionResult performCompaction(long from, long to)
performCompaction in interface IRedoLogFile<T extends IReplicationOrderedPacket>from - key to start searching transient packet fromto - key to end searching transient packet frompublic MemoryRedoLogFile<T> getMemoryRedoLogFile()
Copyright © GigaSpaces.