Sirikata
|
ManualReplicatedRequestManager tracks requests to adjust cuts and tries to make sure they get applied. More...
#include <ManualReplicatedRequestManager.hpp>
Classes | |
struct | expires_tag |
struct | objid_tag |
struct | query_tag |
struct | Request |
Public Types | |
typedef Prox::ManualQuery < ObjectProxSimulationTraits > | ProxQuery |
Public Member Functions | |
ManualReplicatedRequestManager (Context *ctx, Network::IOStrandPtr strand) | |
ManualReplicatedRequestManager (Context *ctx, Network::IOStrand *strand) | |
virtual | ~ManualReplicatedRequestManager () |
virtual void | start () |
virtual void | stop () |
void | addFailedRefine (ProxQuery *query, const ObjectReference &objid) |
void | lookupWaitingQueries (const ObjectReference &objid, std::vector< ProxQuery * > *queries_out) |
void | removeQuerier (ProxQuery *query) |
Private Types | |
typedef boost::multi_index_container < Request, boost::multi_index::indexed_by < boost::multi_index::hashed_non_unique < boost::multi_index::tag < query_tag > , BOOST_MULTI_INDEX_MEMBER(Request, ProxQuery *, query) > , boost::multi_index::hashed_non_unique < boost::multi_index::tag < objid_tag > , BOOST_MULTI_INDEX_MEMBER(Request, ObjectReference, objid), ObjectReference::Hasher > , boost::multi_index::ordered_non_unique < boost::multi_index::tag < expires_tag > , BOOST_MULTI_INDEX_MEMBER(Request, Time, expires) > > | RequestIndex ) |
typedef RequestIndex::index < query_tag >::type | RequestsByQuery |
typedef RequestIndex::index < objid_tag >::type | RequestsByObject |
typedef RequestIndex::index < expires_tag >::type | RequestsByExpiration |
Private Member Functions | |
void | processExpiredRequests () |
Private Attributes | |
Context * | mContext |
Network::IOStrandPtr | doNotUse___mStrand |
Network::IOStrand * | mStrand |
RequestIndex | mRequestIndex |
Network::IOTimerPtr | mExpiryTimer |
ManualReplicatedRequestManager tracks requests to adjust cuts and tries to make sure they get applied.
Essentially it masks failure to apply updates when an update fails not because something isn't along the cut and can be refined/coarsened, but rather because adjusting it requires grabbing additional data from another server and that data isn't available yet. You input the requests when they fail and events for when the children of a node becomes available. This class deals with generating notifications when a match between a request and available data is made, or expiring the request after a short period of time.
Of course, this really only makes sense for refinement since coarsening should *always* be successful. Additional commands might eventually need to be added.
typedef Prox::ManualQuery<ObjectProxSimulationTraits> Sirikata::ManualReplicatedRequestManager::ProxQuery |
typedef boost::multi_index_container< Request, boost::multi_index::indexed_by< boost::multi_index::hashed_non_unique< boost::multi_index::tag<query_tag>, BOOST_MULTI_INDEX_MEMBER(Request,ProxQuery*,query) >, boost::multi_index::hashed_non_unique< boost::multi_index::tag<objid_tag>, BOOST_MULTI_INDEX_MEMBER(Request,ObjectReference,objid), ObjectReference::Hasher >, boost::multi_index::ordered_non_unique< boost::multi_index::tag<expires_tag>, BOOST_MULTI_INDEX_MEMBER(Request,Time,expires) > > Sirikata::ManualReplicatedRequestManager::RequestIndex) [private] |
typedef RequestIndex::index<expires_tag>::type Sirikata::ManualReplicatedRequestManager::RequestsByExpiration [private] |
typedef RequestIndex::index<objid_tag>::type Sirikata::ManualReplicatedRequestManager::RequestsByObject [private] |
typedef RequestIndex::index<query_tag>::type Sirikata::ManualReplicatedRequestManager::RequestsByQuery [private] |
Sirikata::ManualReplicatedRequestManager::ManualReplicatedRequestManager | ( | Context * | ctx, |
Network::IOStrandPtr | strand | ||
) |
Sirikata::ManualReplicatedRequestManager::ManualReplicatedRequestManager | ( | Context * | ctx, |
Network::IOStrand * | strand | ||
) |
Sirikata::ManualReplicatedRequestManager::~ManualReplicatedRequestManager | ( | ) | [virtual] |
void Sirikata::ManualReplicatedRequestManager::addFailedRefine | ( | ProxQuery * | query, |
const ObjectReference & | objid | ||
) |
References mContext, mExpiryTimer, mRequestIndex, and Sirikata::Context::recentSimTime().
Referenced by Sirikata::LibproxManualProximity::handleObjectHostProxMessage().
void Sirikata::ManualReplicatedRequestManager::lookupWaitingQueries | ( | const ObjectReference & | objid, |
std::vector< ProxQuery * > * | queries_out | ||
) |
References mRequestIndex.
Referenced by Sirikata::LibproxManualProximity::handleUpdateServerQueryResultsToRetryRequests().
void Sirikata::ManualReplicatedRequestManager::processExpiredRequests | ( | ) | [private] |
References mContext, mExpiryTimer, mRequestIndex, and Sirikata::Context::recentSimTime().
void Sirikata::ManualReplicatedRequestManager::removeQuerier | ( | ProxQuery * | query | ) |
References mRequestIndex.
Referenced by Sirikata::LibproxManualProximity::unregisterOHQueryWithServerIndexHandler().
void Sirikata::ManualReplicatedRequestManager::start | ( | ) | [virtual] |
Implements Sirikata::Service.
void Sirikata::ManualReplicatedRequestManager::stop | ( | ) | [virtual] |
Implements Sirikata::Service.
References mExpiryTimer.
Referenced by addFailedRefine(), and processExpiredRequests().
Referenced by addFailedRefine(), processExpiredRequests(), and stop().
Referenced by addFailedRefine(), lookupWaitingQueries(), processExpiredRequests(), and removeQuerier().