|
| PublishStore (string path, bool errorOnPublishGap=false) |
| Create a PublishStore using a file at path More...
|
|
| PublishStore (string path, int blocksPerRealloc, bool errorOnPublishGap=false) |
| Create a PublishStore using a file at path with an initial size and resize value of blocksPerRealloc. More...
|
|
void | setCrc (Utilities.CRC32 crc_) |
| Set an implementation of CRC32 to be used by the Store to prevent message corruption Default implementation is AMPS.Client.Utilities.DefaultCRC32 Passing in null will mean no crc calculation and no checking for file corruption. More...
|
|
void | open () |
| Opens the memory-mapped file buffer. More...
|
|
void | truncateOnClose (bool truncate) |
| Sets whether to truncate the file on close. More...
|
|
override void | Dispose () |
| Disposes of the current instance, closing the memory-mapped file and performing any necessary cleanup. More...
|
|
void | close () |
| Closes the memory-mapped file and performs any necessary cleanup. More...
|
|
void | sync () |
| Flushes any buffered data to the memory-mapped file and underlying file stream, ensuring that all changes are persisted. More...
|
|
void | store (Message m) |
| Stores a message in the BlockPublishStore. More...
|
|
void | store (Message m, Boolean assignSequence) |
| Internal utility method for storing messages in the BlockPublishStore. More...
|
|
virtual void | discardUpTo (ulong sequence) |
| Discard messages in the store, up to and including the message specified by the passed in sequnence number. This is called by the client when it's notified a message is persisted on the server. The space used by discarded messages is made available for reuse by later messages. More...
|
|
ulong | getLastPersisted () |
| Gets the last persisted sequence number More...
|
|
ulong | getLowestUnpersisted () |
| Gets the lowest unpersisted sequence number. More...
|
|
ulong | getHighestUnpersisted () |
| Gets the highest unpersisted sequence number. More...
|
|
void | setMessage (Message message) |
| Used internally by the Client to give the store a Message implementing the correct protocol for the connection. This Message instance is also used for replay operations. More...
|
|
virtual void | replay (StoreReplayer replayer) |
| Implemented to replay unpersisted messages from the stored blocks onto the provided StoreReplayer. More...
|
|
bool | replaySingle (StoreReplayer replayer, ulong sequence) |
| Implemented to find the unpersisted message with the specified sequence among the stored blocks, and replay it onto the provided StoreReplayer. Checks if the specified sequence is less than or equal to the stored metadata block's sequence number. More...
|
|
long | unpersistedCount () |
| Returns the count of unpersisted messages in the store. This count represents the number of messages that have been received but not yet persisted. More...
|
|
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. More...
|
|
void | flush (int timeout) |
| Wait for the store to discard everything that has been stored up to the point in time when flush is called, then return. Throw an exception if this is not completed in the number of milliseconds specified by the timeout. More...
|
|
void | setResizeHandler (PublishStoreResizeHandler handler) |
| Set the resize handler for the publish store. An implementation can call the resize handler in the event that it needs to grow the size of the publish store. More...
|
|
void | setErrorOnPublishGap (bool errorOnPublishGap_) |
| Set if a PublishStoreGapException should be thrown by the Store if there is an attempt to call discardUpTo with a sequence number lower than the last persisted sequence number. This could occur during logon after a failover event if the new server was not current on messages due to being an async replication destination. More...
|
|
virtual bool | getErrorOnPublishGap () |
| Get if a PublishStoreGapException can be thrown by the Store if there is an attempt to call discardUpTo with a sequence number lower than the last persisted sequence number. This could occur during logon after a failover event if the new server was not current on messages due to being an async replication destination. More...
|
|
PublishStore is a memory-mapped file-backed store for storing outgoing messages. As messages are stored, space is allocated from a pre-created flat buffer on disk. As messages are discarded, space in that buffer is marked "free" for future store operations. If messages are stored faster than they are published, the buffer is re-sized to create more capacity. PublishStore helps in keeping track of unacknowledged messages. If messages are published at a rate exceeding the storage capacity, the buffer is resized to accommodate more messages.
The PublishStore class provides a robust foundation for implementing features such as tracking unacknowledged messages and ensuring message persistence.