public class SqliteRedoLogFileStorage<T extends IReplicationOrderedPacket> extends SqliteStorageLayer<T> implements IRedoLogFileStorage<T>
SqliteStorageLayer.RDBMSRedoLogIteratorCOLUMN_NAMES, connection, OPERATION_TYPE_COLUMN_INDEX, PACKET_COLUMN_INDEX, PACKET_COUNT_COLUMN_INDEX, PACKET_WEIGHT_COLUMN_INDEX, REDO_KEY_COLUMN_INDEX, TABLE_NAME, TYPE_NAME_COLUMN_INDEX, UID_COLUMN_INDEX| Constructor and Description |
|---|
SqliteRedoLogFileStorage(DBSwapRedoLogFileConfig<T> config) |
| Modifier and Type | Method and Description |
|---|---|
void |
appendBatch(List<T> replicationPackets)
Adds a batch of packets that will be stored at the end of the list
|
void |
close()
Close the storage and clears its resources, the storage can no longer be used.
|
void |
deleteOldestPackets(long packetsCount)
Delete a batch from the start of the list
|
long |
getCacheWeight() |
long |
getDiscardedPacketsCount() |
long |
getExternalPacketsCount() |
long |
getExternalStoragePacketsWeight() |
long |
getMemoryPacketsCount() |
long |
getMemoryPacketsWeight() |
T |
getOldest() |
long |
getSpaceUsed() |
long |
getWeight() |
boolean |
isEmpty() |
CompactionResult |
performCompaction(long from,
long to) |
StorageReadOnlyIterator<T> |
readOnlyIterator(long fromIndex) |
WeightedBatch<T> |
removeFirstBatch(int batchCapacity,
long lastCompactionRangeEndKey)
Removes a batch from the start of the list
|
T |
removeOldest() |
long |
size()
This method should not assume a reader lock is obtained when accessing it
|
void |
validateIntegrity()
Validates the integrity of the storage
|
deleteDataFile, deserializePacket, dropTable, executeCreateTable, executeDelete, executeInsert, executeQuery, getPacketCount, getPacketOperationTypeName, getPacketTypeName, getPacketUID, getPacketWeight, serializePacketpublic SqliteRedoLogFileStorage(DBSwapRedoLogFileConfig<T> config)
public void appendBatch(List<T> replicationPackets) throws StorageException
IRedoLogFileStorageappendBatch in interface IRedoLogFileStorage<T extends IReplicationOrderedPacket>replicationPackets - packets to storeStorageExceptionpublic long size()
throws StorageException
IRedoLogFileStoragesize in interface IRedoLogFileStorage<T extends IReplicationOrderedPacket>StorageExceptionpublic WeightedBatch<T> removeFirstBatch(int batchCapacity, long lastCompactionRangeEndKey) throws StorageException
IRedoLogFileStorageremoveFirstBatch in interface IRedoLogFileStorage<T extends IReplicationOrderedPacket>batchCapacity - WeightToRemove to removelastCompactionRangeEndKey - packets with keys larger than this cannot be discardedStorageExceptionpublic void deleteOldestPackets(long packetsCount)
throws StorageException
IRedoLogFileStoragedeleteOldestPackets in interface IRedoLogFileStorage<T extends IReplicationOrderedPacket>packetsCount - number of packets to deleteStorageExceptionpublic StorageReadOnlyIterator<T> readOnlyIterator(long fromIndex) throws StorageException
readOnlyIterator in interface IRedoLogFileStorage<T extends IReplicationOrderedPacket>fromIndex - index to start iterating fromStorageExceptionpublic boolean isEmpty()
throws StorageException
isEmpty in interface IRedoLogFileStorage<T extends IReplicationOrderedPacket>StorageExceptionpublic void validateIntegrity()
throws RedoLogFileCompromisedException
IRedoLogFileStoragevalidateIntegrity in interface IRedoLogFileStorage<T extends IReplicationOrderedPacket>RedoLogFileCompromisedExceptionpublic T getOldest() throws StorageException
getOldest in interface IRedoLogFileStorage<T extends IReplicationOrderedPacket>StorageExceptionpublic T removeOldest() throws StorageException
removeOldest in interface IRedoLogFileStorage<T extends IReplicationOrderedPacket>StorageExceptionpublic void close()
IRedoLogFileStorageclose in interface IRedoLogFileStorage<T extends IReplicationOrderedPacket>public long getWeight()
getWeight in interface IRedoLogFileStorage<T extends IReplicationOrderedPacket>public long getDiscardedPacketsCount()
getDiscardedPacketsCount in interface IRedoLogFileStorage<T extends IReplicationOrderedPacket>public CompactionResult performCompaction(long from, long to)
performCompaction in interface IRedoLogFileStorage<T extends IReplicationOrderedPacket>public long getCacheWeight()
getCacheWeight in interface IRedoLogFileStorage<T extends IReplicationOrderedPacket>public long getSpaceUsed()
getSpaceUsed in interface IRedoLogFileStorageStatisticspublic long getExternalPacketsCount()
getExternalPacketsCount in interface IRedoLogFileStorageStatisticspublic long getMemoryPacketsCount()
getMemoryPacketsCount in interface IRedoLogFileStorageStatisticspublic long getMemoryPacketsWeight()
getMemoryPacketsWeight in interface IRedoLogFileStorageStatisticspublic long getExternalStoragePacketsWeight()
getExternalStoragePacketsWeight in interface IRedoLogFileStorageStatisticsCopyright © GigaSpaces.