CCF
|
#include <historical_queries_interface.h>
Inherits ccf::AbstractNodeSubSystem.
Inherited by ccf::historical::StateCache.
Static Public Member Functions | |
static char const * | get_subsystem_name () |
Stores the progress of historical query requests.
A request will generally need to be made multiple times (with the same handle and range) before the response is available, as the historical state is asynchronously retrieved from the ledger and then validated. If the same handle is used for a new range, the state for the old range will be discarded. State is also discarded after the handle's expiry duration, or when drop_cached_states is called for a given handle. The management of requests (how many unique handles are concurrently active, how they are correlated across HTTP requests, how the active quota is divided between callers) is left to the calling system.
|
virtualdefault |
|
pure virtual |
Drop state for the given handle.
May be used to free up space once a historical query has been resolved, more aggressively than waiting for the states to expire.
Implemented in ccf::historical::StateCache.
|
pure virtual |
Same as get_state_at
but uses default expiry value.
Implemented in ccf::historical::StateCache.
|
pure virtual |
Retrieve a full state at a given seqno, including the Store, the TxID assigned by consensus, and an offline-verifiable receipt for the Tx.
Implemented in ccf::historical::StateCache.
|
pure virtual |
Same as get_state_range
but uses default expiry value.
Implemented in ccf::historical::StateCache.
|
pure virtual |
Retrieve a range of states at the given indices, including the Store, the TxID assigned by consensus, and an offline-verifiable receipt for the Tx.
Implemented in ccf::historical::StateCache.
|
pure virtual |
Implemented in ccf::historical::StateCache.
|
pure virtual |
Retrieve states for a set of given indices.
Implemented in ccf::historical::StateCache.
|
pure virtual |
Same as get_store_at
but uses default expiry value.
Implemented in ccf::historical::StateCache.
|
pure virtual |
Retrieve a Store containing the state written at the given seqno.
See get_store_range
for a description of the caching behaviour. This is equivalent to get_store_at(handle, seqno, seqno), but returns nullptr if the state is currently unavailable.
Implemented in ccf::historical::StateCache.
|
pure virtual |
Same as get_store_range
but uses default expiry value.
Implemented in ccf::historical::StateCache.
|
pure virtual |
Retrieve a range of Stores containing the state written at the given indices.
If this is not currently available, this function returns an empty vector and begins fetching the ledger entry asynchronously. This will generally be true for the first call for a given seqno, and it may take some time to completely fetch and validate. The call should be repeated later with the same arguments to retrieve the requested entries. This state is kept until it is deleted for one of the following reasons:
drop_cached_states
seconds_until_expiry
seconds elapse without calling this functionThe range is inclusive of both start_seqno and end_seqno. If a non-empty vector is returned, it will always contain the full requested range; the vector will be of length (end_seqno - start_seqno + 1) and will contain no nullptrs.
Implemented in ccf::historical::StateCache.
|
pure virtual |
Implemented in ccf::historical::StateCache.
|
pure virtual |
Retrieve stores for a set of given indices.
Implemented in ccf::historical::StateCache.
|
inlinestatic |
|
pure virtual |
Set the default time after which a request's state will be deleted, and will not be accessible without retrieving it again from the ledger. Any call to get_store_XXX which doesn't pass an explicit seconds_until_expiry will reset the timer to this default duration.
Implemented in ccf::historical::StateCache.
|
pure virtual |
Set the cache limit (in bytes) to evict least recently used requests from the cache after its size grows beyond this limit. The limit is not strict. It is estimated based on serialized states' sizes approximation and is checked once per tick, and so it can overflow for a short time.
Implemented in ccf::historical::StateCache.
|
pure virtual |
EXPERIMENTAL: Set the tracking of deletes on missing keys for historical queries.
This is experimental but setting this to true ensures that the tx_diff
available in index handlers can observe deleted values.
Implemented in ccf::historical::StateCache.