Package com.hazelcast.ringbuffer
Interface RingbufferStore<T>
- Type Parameters:
- T- ring buffer item type
public interface RingbufferStore<T>
Ringbuffer store makes a ring buffer backed by a central data store; such as database, disk, etc.
- 
Method SummaryModifier and TypeMethodDescriptionlongReturn the largest sequence seen by the data store.load(long sequence) Loads the value of a given sequence.voidStores one item with its corresponding sequence.voidStores multiple items.
- 
Method Details- 
storeStores one item with its corresponding sequence.Exceptions thrown by this method prevent Ringbufferfrom adding the item. It is the responsibility of the store to ensure that it keeps consistent with the Ringbuffer and in case of an exception is thrown, the data is not in the store.- Parameters:
- sequence- the sequence ID of the data
- data- the value of the data to store
- See Also:
 
- 
storeAllStores multiple items. Implementation of this method can optimize the store operation.Exceptions thrown by this method prevents Ringbufferfrom adding any of the items. It is the responsibility of the store to ensure that it keeps consistent with the Ringbuffer and in case of an exception is thrown the passed data is not in the store.- Parameters:
- firstItemSequence- the sequence of the first item
- items- the items that are being stored
- See Also:
 
- 
loadLoads the value of a given sequence. Null value means that the item was not found. This method is invoked by the ringbuffer if an item is requested with a sequence which is no longer in the Ringbuffer.- Parameters:
- sequence- the sequence of the requested item
- Returns:
- requested item, null if not found
- See Also:
 
- 
getLargestSequencelong getLargestSequence()Return the largest sequence seen by the data store. Can return -1 if the data store doesn't have or can't access any data. Used to initialize a Ringbuffer with the previously seen the largest sequence number.- Returns:
- the largest sequence of the data in the data store
 
 
-