public class SqliteRedoLogFileStorage<T extends IReplicationOrderedPacket> extends SqliteStorageLayer<T> implements IRedoLogFileStorage<T>
SqliteStorageLayer.RDBMSRedoLogIterator
COLUMN_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 |
getOldestKey() |
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, getStorageRedoLogSize, serializePacket
public SqliteRedoLogFileStorage(DBSwapRedoLogFileConfig<T> config)
public void appendBatch(List<T> replicationPackets) throws StorageException
IRedoLogFileStorage
appendBatch
in interface IRedoLogFileStorage<T extends IReplicationOrderedPacket>
replicationPackets
- packets to storeStorageException
public long size() throws StorageException
IRedoLogFileStorage
size
in interface IRedoLogFileStorage<T extends IReplicationOrderedPacket>
StorageException
public WeightedBatch<T> removeFirstBatch(int batchCapacity, long lastCompactionRangeEndKey) throws StorageException
IRedoLogFileStorage
removeFirstBatch
in interface IRedoLogFileStorage<T extends IReplicationOrderedPacket>
batchCapacity
- WeightToRemove to removelastCompactionRangeEndKey
- packets with keys larger than this cannot be discardedStorageException
public void deleteOldestPackets(long packetsCount) throws StorageException
IRedoLogFileStorage
deleteOldestPackets
in interface IRedoLogFileStorage<T extends IReplicationOrderedPacket>
packetsCount
- number of packets to deleteStorageException
public StorageReadOnlyIterator<T> readOnlyIterator(long fromIndex) throws StorageException
readOnlyIterator
in interface IRedoLogFileStorage<T extends IReplicationOrderedPacket>
fromIndex
- index to start iterating fromStorageException
public boolean isEmpty() throws StorageException
isEmpty
in interface IRedoLogFileStorage<T extends IReplicationOrderedPacket>
StorageException
public void validateIntegrity() throws RedoLogFileCompromisedException
IRedoLogFileStorage
validateIntegrity
in interface IRedoLogFileStorage<T extends IReplicationOrderedPacket>
RedoLogFileCompromisedException
public T getOldest() throws StorageException
getOldest
in interface IRedoLogFileStorage<T extends IReplicationOrderedPacket>
StorageException
public T removeOldest() throws StorageException
removeOldest
in interface IRedoLogFileStorage<T extends IReplicationOrderedPacket>
StorageException
public long getOldestKey()
getOldestKey
in interface IRedoLogFileStorage<T extends IReplicationOrderedPacket>
public void close()
IRedoLogFileStorage
close
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 IRedoLogFileStorageStatistics
public long getExternalPacketsCount()
getExternalPacketsCount
in interface IRedoLogFileStorageStatistics
public long getMemoryPacketsCount()
getMemoryPacketsCount
in interface IRedoLogFileStorageStatistics
public long getMemoryPacketsWeight()
getMemoryPacketsWeight
in interface IRedoLogFileStorageStatistics
public long getExternalStoragePacketsWeight()
getExternalStoragePacketsWeight
in interface IRedoLogFileStorageStatistics
Copyright © GigaSpaces.