Store.StoreReplayer
Modifier and Type | Field and Description |
---|---|
protected int |
_cap |
protected PublishStore |
_fileStore |
protected int |
_lowWatermark |
protected MemoryPublishStore |
_memoryStore |
protected java.lang.String |
_path |
SOWDeleteByBookmark, SOWDeleteByBookmarkCancel, SOWDeleteByData, SOWDeleteByFilter, SOWDeleteByKeys
Constructor and Description |
---|
HybridPublishStore(java.lang.String path,
int cap) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
discardUpTo(long index)
Discards from both the disk store and memory store.
|
void |
flush()
Wait for the store to discard everything that has been stored
up to the point in time when flush is called, then
return.
|
void |
flush(long timeout)
Wait for the store to discard everything that has been stored
up to the point in time when flush is called, then
return.
|
long |
getLastPersisted()
Return the last persisted index in the store.
|
long |
getLowestUnpersisted()
Returns the lowest sequence number currently in the store.
|
void |
replay(Store.StoreReplayer replayer)
Replay all operations in the store using the provided StoreReplayer.
|
boolean |
replaySingle(Store.StoreReplayer replayer,
long index)
Replay the operation at the specified index.
|
void |
setLowWatermark(int lowWatermark_)
Sets the low watermark; once we start swapping out to disk, we
keep going until the number of entries in memory is lower than this.
|
void |
setMessage(Message m)
Provide the Store with a preallocated Message for use in replay.
|
void |
setResizeHandler(PublishStoreResizeHandler handler)
Set the resize handler for the publish store.
|
void |
store(Message message)
Store the provided message.
|
long |
unpersistedCount()
Return the number of operations in the store.
|
protected PublishStore _fileStore
protected MemoryPublishStore _memoryStore
protected int _cap
protected java.lang.String _path
protected int _lowWatermark
public HybridPublishStore(java.lang.String path, int cap) throws StoreException
StoreException
public void setLowWatermark(int lowWatermark_)
lowWatermark_
- The number of entries to serve as a low watermark.public long getLowestUnpersisted()
getLowestUnpersisted
in interface Store
public void discardUpTo(long index) throws StoreException
discardUpTo
in interface Store
index
- the index number to keep -- all previous index numbers will be discardedStoreException
- Thrown if the Store is unable to discard the messages.Store.discardUpTo(long)
public void replay(Store.StoreReplayer replayer) throws StoreException, DisconnectedException
Store
replay
in interface Store
replayer
- the StoreReplayer to use to replay the operationsStoreException
- Thrown if the Store is unable to replay the operations.DisconnectedException
- Thrown if the Store receives a DisconnectedException while replaying.Store.replay(com.crankuptheamps.client.Store.StoreReplayer)
public boolean replaySingle(Store.StoreReplayer replayer, long index) throws StoreException, DisconnectedException
Store
replaySingle
in interface Store
replayer
- the StoreReplayer to use to replay the operationsindex
- The index of the message to replay within the storeStoreException
- Thrown if the Store is unable to replay the operations.DisconnectedException
- Thrown if the Store receives a DisconnectedException while replaying.Store.replaySingle(com.crankuptheamps.client.Store.StoreReplayer, long)
public long unpersistedCount()
Store
unpersistedCount
in interface Store
Store.unpersistedCount()
public void store(Message message) throws StoreException
Store
store
in interface Store
message
- the message to storeStoreException
- Thrown if the Store is unable to store the message.public void setMessage(Message m)
Store
setMessage
in interface Store
m
- The message object for the Store to use during replay.public long getLastPersisted() throws StoreException
Store
getLastPersisted
in interface Store
StoreException
- Thrown if the store is unable to produce the last persisted index.public void flush() throws TimedOutException
Store
flush
in interface Store
TimedOutException
- Not thrown from this overload.public void flush(long timeout) throws TimedOutException
Store
flush
in interface Store
timeout
- the number of milliseconds to wait for the flushTimedOutException
- Thrown if the timeout period passes without the messages being discarded.public void setResizeHandler(PublishStoreResizeHandler handler)
Store
setResizeHandler
in interface Store
handler
- The handler to install.public void close() throws java.lang.Exception
close
in interface java.lang.AutoCloseable
java.lang.Exception