public class ByteBufferRedoLogFileStorage<T> extends Object implements IRedoLogFileStorage<T>, IStorageSegmentsMediator
| Modifier and Type | Class and Description |
|---|---|
class |
ByteBufferRedoLogFileStorage.ByteArrayResource
A resource for byte array, ensure capacity must be called each time this resource is taken
|
| Constructor and Description |
|---|
ByteBufferRedoLogFileStorage(IByteBufferStorageFactory byteBufferStorageProvider) |
ByteBufferRedoLogFileStorage(IByteBufferStorageFactory byteBufferStorageProvider,
ByteBufferRedoLogFileConfig<T> config) |
| Modifier and Type | Method and Description |
|---|---|
void |
allocatedNewResource(StorageSegment.SegmentCursor resource) |
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 |
deleteFirstBatch(long batchSize)
Delete a batch from the start of the list
|
long |
getExternalPacketsCount() |
long |
getMemoryPacketsCount() |
long |
getSpaceUsed() |
boolean |
isEmpty() |
StorageReadOnlyIterator<T> |
readOnlyIterator() |
StorageReadOnlyIterator<T> |
readOnlyIterator(long fromIndex) |
List<T> |
removeFirstBatch(int batchSize)
Removes a batch from the start of the list
|
long |
size()
This method should not assume a reader lock is obtained when accessing it
|
void |
validateIntegrity()
Peforms an integrity check that verifies the storage state and data is not compromised
|
public ByteBufferRedoLogFileStorage(IByteBufferStorageFactory byteBufferStorageProvider)
public ByteBufferRedoLogFileStorage(IByteBufferStorageFactory byteBufferStorageProvider, ByteBufferRedoLogFileConfig<T> config)
public void appendBatch(List<T> replicationPackets) throws StorageException, StorageFullException
IRedoLogFileStorageappendBatch in interface IRedoLogFileStorage<T>replicationPackets - packets to storeStorageExceptionStorageFullExceptionpublic void deleteFirstBatch(long batchSize)
throws StorageException
IRedoLogFileStoragedeleteFirstBatch in interface IRedoLogFileStorage<T>batchSize - batch size to deleteStorageExceptionpublic List<T> removeFirstBatch(int batchSize) throws StorageException
IRedoLogFileStorageremoveFirstBatch in interface IRedoLogFileStorage<T>batchSize - batch size to removeStorageExceptionpublic StorageReadOnlyIterator<T> readOnlyIterator() throws StorageException
readOnlyIterator in interface IRedoLogFileStorage<T>StorageExceptionpublic StorageReadOnlyIterator<T> readOnlyIterator(long fromIndex) throws StorageException
readOnlyIterator in interface IRedoLogFileStorage<T>fromIndex - index to start iterating fromStorageExceptionpublic long size()
throws StorageException
IRedoLogFileStoragesize in interface IRedoLogFileStorage<T>StorageExceptionpublic boolean isEmpty()
throws StorageException
isEmpty in interface IRedoLogFileStorage<T>StorageExceptionpublic long getSpaceUsed()
getSpaceUsed in interface IRedoLogFileStorageStatisticspublic long getExternalPacketsCount()
getExternalPacketsCount in interface IRedoLogFileStorageStatisticspublic long getMemoryPacketsCount()
getMemoryPacketsCount in interface IRedoLogFileStorageStatisticspublic void close()
IRedoLogFileStorageclose in interface IRedoLogFileStorage<T>public void allocatedNewResource(StorageSegment.SegmentCursor resource)
allocatedNewResource in interface IStorageSegmentsMediatorpublic void validateIntegrity()
throws ByteBufferStorageCompromisedException
validateIntegrity in interface IRedoLogFileStorage<T>ByteBufferStorageCompromisedExceptionCopyright © GigaSpaces.