public final class RingbufferStoreWrapper extends Object implements RingbufferStore<Data>
Modifier and Type | Method and Description |
---|---|
static RingbufferStoreWrapper |
create(ObjectNamespace namespace,
RingbufferStoreConfig storeConfig,
InMemoryFormat inMemoryFormat,
SerializationService serializationService,
ClassLoader classLoader)
Factory method that creates a
RingbufferStoreWrapper . |
long |
getLargestSequence()
Return the largest sequence seen by the data store.
|
boolean |
isEnabled()
Is the ring buffer store enabled.
|
Data |
load(long sequence)
Loads the value of a given sequence.
|
void |
store(long sequence,
Data value)
Stores one item with it's corresponding sequence.
|
void |
storeAll(long firstItemSequence,
Data[] items)
Stores multiple items.
|
public static RingbufferStoreWrapper create(ObjectNamespace namespace, RingbufferStoreConfig storeConfig, InMemoryFormat inMemoryFormat, SerializationService serializationService, ClassLoader classLoader)
RingbufferStoreWrapper
. It attempts to create the ring buffer store from several
sources :
namespace
- ring buffer namespacestoreConfig
- store config of ring bufferinMemoryFormat
- the format of the stored items (BINARY, OBJECT or NATIVE). NATIVE format translates into
binary values on the store method calls.serializationService
- serialization service.RingbufferStoreWrapper
public boolean isEnabled()
public void store(long sequence, Data value)
RingbufferStore
Ringbuffer
from 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.store
in interface RingbufferStore<Data>
sequence
- the sequence ID of the datavalue
- the value of the data to storeRingbuffer.add(Object)
,
Ringbuffer.addAsync(Object, com.hazelcast.ringbuffer.OverflowPolicy)
public void storeAll(long firstItemSequence, Data[] items)
RingbufferStore
Ringbuffer
from 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.storeAll
in interface RingbufferStore<Data>
firstItemSequence
- the sequence of the first itemitems
- the items that are being storedRingbuffer.addAllAsync(java.util.Collection, com.hazelcast.ringbuffer.OverflowPolicy)
public Data load(long sequence)
RingbufferStore
load
in interface RingbufferStore<Data>
sequence
- the sequence of the requested itemRingbuffer.readOne(long)
,
Ringbuffer.readManyAsync(long, int, int, IFunction)
public long getLargestSequence()
RingbufferStore
getLargestSequence
in interface RingbufferStore<Data>
Copyright © 2018 Hazelcast, Inc.. All Rights Reserved.