AMPS C# Client
5.3.5.0
AMPS C# Client for .NET
|
A Store implementation that uses memory to hold the newest messages and rolls older messages over to a file. More...
Public Member Functions | |
HybridPublishStore (String path, int cap, bool errorOnPublishGap=false) | |
Create a new HybridPublishStore using a <file named path, a max capacity of cap for its < MemoryPublishStore>. More... | |
void | Dispose () |
Performs application-defined tasks associated with freeing, releasing, or resetting resources. This method has no effect for the BlockPublishStore class. 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... | |
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... | |
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. More... | |
ulong | getLowestUnpersisted () |
Gets the lowest unpersisted sequence number More... | |
void | discardUpTo (ulong index) |
This method is repsonsible for managing the discarding of blocks in a store based on the specified index. It handles locking, updating metadata, and organizng the blocks for efficient reuse. More... | |
virtual void | replay (StoreReplayer replayer) |
Replays the stored blocks onto the provided StoreReplayer. More... | |
bool | replaySingle (StoreReplayer replayer, ulong index) |
Replays a single stored block with the specified index onto the provided StoreReplayer. Checks if the specified index 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 | store (Message message) |
Stores a message in the BlockPublishStore. More... | |
void | setMessage (Message m) |
Used internally by the Client to give the store a Message implementing the correct protocol for the connection. More... | |
ulong | getLastPersisted () |
Gets the last persisted sequence number 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 | close () |
Close the file access, making this store unusable. More... | |
Protected Attributes | |
PublishStore | _fileStore |
MemoryPublishStore | _memoryStore |
int | _cap |
string | _path |
int | _lowWatermark = 0 |
A Store implementation that uses memory to hold the newest messages and rolls older messages over to a file.
|
inline |
Create a new HybridPublishStore using a <file named path, a max capacity of cap for its < MemoryPublishStore>.
path | The file location for the file-based portion of the store. |
cap | The capacity on in-memory messages before offloading to file. |
errorOnPublishGap_ | Indicates if an excpetion should be thrown if discardUpTo is called with an idex below the last persisted. |
|
inline |
Close the file access, making this store unusable.
|
inline |
This method is repsonsible for managing the discarding of blocks in a store based on the specified index. It handles locking, updating metadata, and organizng the blocks for efficient reuse.
index |
StoreException |
Implements AMPS.Client.Store.
|
inline |
Performs application-defined tasks associated with freeing, releasing, or resetting resources. This method has no effect for the BlockPublishStore class.
|
inline |
Wait for the store to discard everything that has been stored up to the point in time when flush is called, then return.
Implements AMPS.Client.Store.
|
inline |
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.
timeout | The number of milliseconds to wait for the flush. |
TimedOutException |
Implements AMPS.Client.Store.
|
inline |
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.
Implements AMPS.Client.Store.
|
inline |
Gets the last persisted sequence number
Implements AMPS.Client.Store.
|
inline |
Gets the lowest unpersisted sequence number
|
inlinevirtual |
Replays the stored blocks onto the provided StoreReplayer.
replayer | The StoreReplayer onto which the blocks will be replayed. |
Implements AMPS.Client.Store.
|
inline |
Replays a single stored block with the specified index onto the provided StoreReplayer. Checks if the specified index is less than or equal to the stored metadata block's sequence number.
replayer | The StoreReplayer onto which the block will be replayed. |
index | The sequence number of the block to be replayed. |
Implements AMPS.Client.Store.
|
inline |
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.
errorOnPublishGap_ | Indicates if the exception should be thrown |
Implements AMPS.Client.Store.
|
inline |
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.
lowWatermark_ | The number of entries to serve as a low watermark. |
|
inline |
Used internally by the Client to give the store a Message implementing the correct protocol for the connection.
m | A Message of the correct protocol type. |
Implements AMPS.Client.Store.
|
inline |
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.
handler | The resize handler to set |
Implements AMPS.Client.Store.
|
inline |
Stores a message in the BlockPublishStore.
m | The message to be stored. |
StoreException | If an error occurs during message storage. |
Implements AMPS.Client.Store.
|
inline |
Returns the count of unpersisted messages in the store. This count represents the number of messages that have been received but not yet persisted.
Implements AMPS.Client.Store.