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.ByteSequenceStore.StoreReplayer_blockSize, _buffer, _errorOnPublishGap, _resizeHandler, AMPS_MIN_BLOCK_SIZE_CONFIGURABLE_VERSION, AMPS_MIN_PUB_STORE_DISCARDED_VERSION, MAX_BLOCK_SIZE, METADATA_BLOCK_SIZE_LOCATION, METADATA_LAST_DISCARDED_LOCATION, METADATA_VERSION_LOCATION, MIN_BLOCK_SIZESOWDeleteByBookmark, 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.
|
MemoryPublishStore(int initialCapacity,
int blockSize)
Construct an in-memory public store with the specified number of
blocks of size blockSize 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, unpersistedCountpublic 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 MemoryPublishStore(int initialCapacity,
int blockSize)
throws StoreException
initialCapacity - The number of blocks to allocate on constructionblockSize - The size in bytes for each block.StoreException - Thrown when an operation fails with details of the
failure.public void discardUpTo(long index)
throws StoreException
BlockPublishStorediscardUpTo in interface StorediscardUpTo in class BlockPublishStoreindex - 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()
BlockPublishStoregetErrorOnPublishGap in interface StoregetErrorOnPublishGap in class BlockPublishStore