A BookmarkStoreImpl implementation that uses a memory mapped file for storage of the bookmarks.
More...
#include <MMapBookmarkStore.hpp>
A BookmarkStoreImpl implementation that uses a memory mapped file for storage of the bookmarks.
This implementation provides efficient bookmark tracking that persists across application restarts.
AMPS::MMapBookmarkStore::MMapBookmarkStore |
( |
const char * |
fileName_ | ) |
|
|
inline |
Create an MMapBookmarkStore that uses fileName_ as its file storage.
If the file already exists and has bookmarks stored, they will be recovered to determine the most recent bookmark and any messages since then that have been discarded.
- Parameters
-
fileName_ | The name of the file to use for storage. |
AMPS::MMapBookmarkStore::MMapBookmarkStore |
( |
const std::string & |
fileName_ | ) |
|
|
inline |
Create an MMapBookmarkStore that uses fileName_ as its file storage.
If the file already exists and has bookmarks stored, they will be recovered to determine the most recent bookmark and any messages since then that have been discarded.
- Parameters
-
fileName_ | The name of the file to use for storage. |
virtual void AMPS::MMapBookmarkStore::discard |
( |
const Message & |
message_ | ) |
|
|
inlinevirtual |
virtual void AMPS::MMapBookmarkStore::discard |
( |
const Message::Field & |
subId_, |
|
|
size_t |
bookmarkSeqNo_ |
|
) |
| |
|
inlinevirtual |
- Deprecated:
- Use the discard(const Message&) function instead.
Log a discard-bookmark entry to the persistent log based on a bookmark sequence number.
- Parameters
-
subId_ | The id of the subscription to which the bookmark applies. |
bookmarkSeqNo_ | The bookmark sequence number to discard. |
Reimplemented from AMPS::MemoryBookmarkStore.
Returns the most recent bookmark from the log that ought to be used for (re-)subscriptions.
- Parameters
-
subId_ | The id of the subscription to check. |
Reimplemented from AMPS::MemoryBookmarkStore.
virtual bool AMPS::MMapBookmarkStore::isDiscarded |
( |
Message & |
message_ | ) |
|
|
inlinevirtual |
Called for each arriving message to determine if the application has already seen this bookmark and should not be reprocessed.
Returns 'true' if the bookmark is in the log and should not be re-processed, false otherwise.
- Parameters
-
- Returns
- Whether or not the Message has been discarded from this store.
Reimplemented from AMPS::MemoryBookmarkStore.
virtual size_t AMPS::MMapBookmarkStore::log |
( |
Message & |
message_ | ) |
|
|
inlinevirtual |
Log a bookmark to the persistent log and return the corresponding sequence number for this bookmark.
- Parameters
-
Reimplemented from AMPS::MemoryBookmarkStore.
virtual void AMPS::MMapBookmarkStore::noPersistedAcks |
( |
const Message::Field & |
subId_ | ) |
|
|
inlinevirtual |
Flag the subscription as not requesting persisted acks No persisted acks will be sent for any bookmarks.
- Parameters
-
subId_ | The subscription id of the subscription without persisted acks. |
Reimplemented from AMPS::MemoryBookmarkStore.
virtual void AMPS::MMapBookmarkStore::purge |
( |
| ) |
|
|
inlinevirtual |
Called to purge the contents of this store.
Removes any tracking history associated with publishers and received messages, and may delete or truncate on-disk representations as well.
Reimplemented from AMPS::MemoryBookmarkStore.
virtual void AMPS::MMapBookmarkStore::purge |
( |
const Message::Field & |
subId_ | ) |
|
|
inlinevirtual |
Called to purge the contents of this store for particular subId.
Removes any tracking history associated with publishers and received messages, and will remove the subId from the file as well.
Reimplemented from AMPS::MemoryBookmarkStore.
void AMPS::MMapBookmarkStore::setServerVersion |
( |
const VersionInfo & |
version_ | ) |
|
|
inlinevirtual |
Internally used to set the server version so the store knows how to deal with persisted acks and calls to getMostRecent().
- Parameters
-
version_ | The version of the server being used. |
Reimplemented from AMPS::MemoryBookmarkStore.
void AMPS::MMapBookmarkStore::setServerVersion |
( |
size_t |
version_ | ) |
|
|
inlinevirtual |
Internally used to set the server version so the store knows how to deal with persisted acks and calls to getMostRecent().
- Parameters
-
version_ | The version of the server being used. |
Reimplemented from AMPS::MemoryBookmarkStore.
The documentation for this class was generated from the following file: