public class DBSwapRedoLogFile<T extends IReplicationOrderedPacket> extends Object implements IRedoLogFile<T>
Constructor and Description |
---|
DBSwapRedoLogFile(DBSwapRedoLogFileConfig<T> config,
AbstractSingleFileGroupBacklog<?,?> groupBacklog) |
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
|
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.
|
long |
getExternalStoragePacketsCount() |
long |
getExternalStoragePacketsWeight() |
long |
getExternalStorageSpaceUsed() |
long |
getMemoryPacketsCount() |
long |
getMemoryPacketsWeight() |
T |
getOldest() |
long |
getOldestKey() |
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
|
public DBSwapRedoLogFile(DBSwapRedoLogFileConfig<T> config, AbstractSingleFileGroupBacklog<?,?> groupBacklog)
public RedoLogSwapStorageType getSwapStorageType()
getSwapStorageType
in interface IRedoLogFile<T extends IReplicationOrderedPacket>
public long getExternalStorageSpaceUsed()
getExternalStorageSpaceUsed
in interface IRedoLogFileStatistics
public long getMemoryPacketsCount()
getMemoryPacketsCount
in interface IRedoLogFileStatistics
public long getExternalStoragePacketsCount()
getExternalStoragePacketsCount
in interface IRedoLogFileStatistics
public long getMemoryPacketsWeight()
getMemoryPacketsWeight
in interface IRedoLogFileStatistics
public long getExternalStoragePacketsWeight()
getExternalStoragePacketsWeight
in interface IRedoLogFileStatistics
public void add(T replicationPacket)
IRedoLogFile
add
in interface IRedoLogFile<T extends IReplicationOrderedPacket>
replicationPacket
- packet to addpublic T removeOldest()
IRedoLogFile
removeOldest
in interface IRedoLogFile<T extends IReplicationOrderedPacket>
public T getOldest()
getOldest
in interface IRedoLogFile<T extends IReplicationOrderedPacket>
public long getOldestKey()
getOldestKey
in interface IRedoLogFile<T extends IReplicationOrderedPacket>
public long size()
size
in interface IRedoLogFileStatistics
size
in interface IRedoLogFile<T extends IReplicationOrderedPacket>
public long getApproximateSize()
IRedoLogFile
getApproximateSize
in interface IRedoLogFile<T extends IReplicationOrderedPacket>
public boolean isEmpty()
isEmpty
in interface IRedoLogFile<T extends IReplicationOrderedPacket>
public void deleteOldestPackets(long packetsCount)
IRedoLogFile
deleteOldestPackets
in interface IRedoLogFile<T extends IReplicationOrderedPacket>
packetsCount
- number of oldest packets to deletepublic void validateIntegrity() throws RedoLogFileCompromisedException
IRedoLogFile
validateIntegrity
in interface IRedoLogFile<T extends IReplicationOrderedPacket>
RedoLogFileCompromisedException
public void close()
IRedoLogFile
close
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 ReadOnlyIterator<T> readOnlyIterator(long fromKey)
readOnlyIterator
in interface IRedoLogFile<T extends IReplicationOrderedPacket>
fromKey
- index to start frompublic int flushToStorage()
IRedoLogFile
flushToStorage
in interface IRedoLogFile<T extends IReplicationOrderedPacket>
Copyright © GigaSpaces.