AMPS C# Client  5.3.3.4
AMPS C# Client for .NET
AMPS.Client.BookmarkRingBuffer Class Reference

Classes

class  Entry
 

Public Member Functions

 BookmarkRingBuffer ()
 
void reset ()
 
int capacity ()
 
Entry getByIndex (long index)
 
BookmarkField getLastDiscarded ()
 
bool isEmpty ()
 
long getStartIndex ()
 
long getEndIndex ()
 
long log (BookmarkField bookmark)
 
long relog (long oldIndex, BookmarkField bookmark)
 
bool discard (long index)
 
Entry find (BookmarkField field)
 
void checkResize ()
 
void setResizeHandler (BookmarkStoreResizeHandler handler, BookmarkStore store)
 
void setSubId (Field sub)
 
long setRecovery ()
 
IList< EntrygetRecoveryEntries ()
 
void getActiveEntries (IList< Entry > entryList_)
 

Static Public Attributes

const int UNSET_INDEX = -1
 

Constructor & Destructor Documentation

◆ BookmarkRingBuffer()

AMPS.Client.BookmarkRingBuffer.BookmarkRingBuffer ( )
inline

Initializes the underlying array, and sets the "last discarded" value to something reasonable.

Member Function Documentation

◆ capacity()

int AMPS.Client.BookmarkRingBuffer.capacity ( )
inline

Size of underlying array

Returns
current capacity of self.

◆ checkResize()

void AMPS.Client.BookmarkRingBuffer.checkResize ( )
inline

Called to see if resize can proceed.

◆ discard()

bool AMPS.Client.BookmarkRingBuffer.discard ( long  index)
inline

Discards an entry by index. If the discard is completed, lastDiscarded will change, otherwise the discard is cached in the entry, and the getLastDiscarded() value is unchanged.

Parameters
indexthe index of the entry.
Returns
true if this caused lastDiscarded to change.

◆ find()

Entry AMPS.Client.BookmarkRingBuffer.find ( BookmarkField  field)
inline

Searches valid Entrys for the given bookmark

Parameters
fieldthe bookmark to search for
Returns
the Entry containing the given bookmark, or null.

◆ getByIndex()

Entry AMPS.Client.BookmarkRingBuffer.getByIndex ( long  index)
inline

Retrieves an Entry given an index

Parameters
indexAn index returned by .getIndex(), getStartIndex(), getEndIndex(), log, etc.
Returns
The entry at that index, or null if not found.

◆ getEndIndex()

long AMPS.Client.BookmarkRingBuffer.getEndIndex ( )
inline

Returns the index value one greater than the last valid Entry in self.

Returns
index 1 greater than last valid entry.

◆ getLastDiscarded()

BookmarkField AMPS.Client.BookmarkRingBuffer.getLastDiscarded ( )
inline

Returns the "last discarded" bookmark. This may be a newer bookmark than the one you last passed to discard(), if you're discarding out of order.

Returns
the last bookmark to be discarded.

◆ getStartIndex()

long AMPS.Client.BookmarkRingBuffer.getStartIndex ( )
inline

Returns the index value associated with the first valid Entry in self.

Returns
index of first valid entry.

◆ isEmpty()

bool AMPS.Client.BookmarkRingBuffer.isEmpty ( )
inline

Returns if the buffer is currently empty.

Returns
true if self is empty and false otherwise.

◆ log()

long AMPS.Client.BookmarkRingBuffer.log ( BookmarkField  bookmark)
inline

Logs the bookmark by allocating an Entry, setting the Entry to active, copying the bookmark value to that entry, and returning the index of that entry.

Parameters
bookmarkthe bookmark to loc
Returns
the index of the new Entry.

◆ relog()

long AMPS.Client.BookmarkRingBuffer.relog ( long  oldIndex,
BookmarkField  bookmark 
)
inline

WARNING: Deprecated. Do Not Use. The notion of a separate "recovered bookmark" section within the ring buffer and the ability to re-log/re-order those entries into the main/active ring buffer section is an obsolete concept that hasn't been needed since the AMPS server stopped providing persisted acks for every message delivered on a replay (i.e. not needed since AMPS 4.0). The bookmark ring buffer has been simplified to remove this concept since a bug was discovered in it (AC-953).

Old Docs:

Re-logs the bookmark by copying an Entry to a new location and returning the index of that new location.

Parameters
bookmarkthe index to move
Returns
the index of the new Entry.

◆ reset()

void AMPS.Client.BookmarkRingBuffer.reset ( )
inline

Resets this bookmark ring buffer for reuse by clearing out its state.


The documentation for this class was generated from the following file: