public class MemoryPublishStore extends BlockPublishStore
Publish stores hold messages until the AMPS server has acknowledged that they are persisted. When the client detects disconnection and reconnects, the client can republish any messages which have not been acknowledged by AMPS.
Use this PublishStore when you are only concerned about server failover: MemoryPublishStore does not protect you in case of subscriber failure, because it has no persisted backing store.
BlockPublishStore.Buffer, BlockPublishStore.ByteSequence
Store.StoreReplayer
Modifier and Type | Field and Description |
---|---|
static int |
BLOCK_SIZE
The size of each block the store allocates.
|
_buffer, _errorOnPublishGap, _resizeHandler, AMPS_MIN_PUB_STORE_DISCARDED_VERSION, METADATA_LAST_DISCARDED_LOCATION, METADATA_VERSION_LOCATION
SOWDeleteByBookmark, SOWDeleteByBookmarkCancel, SOWDeleteByData, SOWDeleteByFilter, SOWDeleteByKeys
Constructor and Description |
---|
MemoryPublishStore(int initialCapacity)
Construct an in-memory public store with the specified number of
blocks as the initial capacity.
|
Modifier and Type | Method and Description |
---|---|
void |
discardUpTo(long index)
This method is responsible for managing the discarding of blocks in a store
based on the specified index.
|
boolean |
getErrorOnPublishGap()
Get whether the Store will throw a PublishGapException from discardUpTo if the
sequence number being discarded is less then the current last persisted.
|
close, flush, flush, getHighestUnpersisted, getLastPersisted, getLowestUnpersisted, growFreeListIfEmpty, recover, replay, replaySingle, setErrorOnPublishGap, setMessage, setResizeHandler, store, store, unpersistedCount
public static final int BLOCK_SIZE
public MemoryPublishStore(int initialCapacity) throws StoreException
initialCapacity
- The number of blocks to allocate on constructionStoreException
- Thrown when an operation fails with details of the
failure.public void discardUpTo(long index) throws StoreException
BlockPublishStore
discardUpTo
in interface Store
discardUpTo
in class BlockPublishStore
index
- the index number to keep -- all previous index numbers will be discardedStoreException
- Thrown if the Store is unable to discard the messages.public boolean getErrorOnPublishGap()
BlockPublishStore
getErrorOnPublishGap
in interface Store
getErrorOnPublishGap
in class BlockPublishStore