mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-12 16:09:37 -05:00
fixed up display of GroupStatisticsReq and moved priorities to RsTokReqOptions
This commit is contained in:
parent
7c77e82b1e
commit
ebee69df96
@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
bool operator<(const std::pair<uint32_t,GxsRequest*>& p1,const std::pair<uint32_t,GxsRequest*>& p2)
|
bool operator<(const std::pair<uint32_t,GxsRequest*>& p1,const std::pair<uint32_t,GxsRequest*>& p2)
|
||||||
{
|
{
|
||||||
return p1.second->priority <= p2.second->priority ; // <= so that new elements with same priority are inserted before
|
return p1.second->Options.mPriority <= p2.second->Options.mPriority ; // <= so that new elements with same priority are inserted before
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -47,9 +47,7 @@ RsGxsDataAccess::~RsGxsDataAccess()
|
|||||||
for(auto& it:mRequestQueue)
|
for(auto& it:mRequestQueue)
|
||||||
delete it.second;
|
delete it.second;
|
||||||
}
|
}
|
||||||
bool RsGxsDataAccess::requestGroupInfo(
|
bool RsGxsDataAccess::requestGroupInfo( uint32_t &token, uint32_t ansType, const RsTokReqOptions &opts, const std::list<RsGxsGroupId> &groupIds )
|
||||||
uint32_t &token, uint32_t ansType, const RsTokReqOptions &opts,
|
|
||||||
const std::list<RsGxsGroupId> &groupIds )
|
|
||||||
{
|
{
|
||||||
if(groupIds.empty())
|
if(groupIds.empty())
|
||||||
{
|
{
|
||||||
@ -145,8 +143,7 @@ void RsGxsDataAccess::generateToken(uint32_t &token)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool RsGxsDataAccess::requestMsgInfo(uint32_t &token, uint32_t ansType,
|
bool RsGxsDataAccess::requestMsgInfo(uint32_t &token, uint32_t ansType, const RsTokReqOptions &opts, const GxsMsgReq &msgIds)
|
||||||
const RsTokReqOptions &opts, const GxsMsgReq &msgIds)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
GxsRequest* req = NULL;
|
GxsRequest* req = NULL;
|
||||||
@ -207,8 +204,7 @@ bool RsGxsDataAccess::requestMsgInfo(uint32_t &token, uint32_t ansType,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RsGxsDataAccess::requestMsgInfo(uint32_t &token, uint32_t ansType,
|
bool RsGxsDataAccess::requestMsgInfo(uint32_t &token, uint32_t ansType, const RsTokReqOptions &opts, const std::list<RsGxsGroupId>& grpIds)
|
||||||
const RsTokReqOptions &opts, const std::list<RsGxsGroupId>& grpIds)
|
|
||||||
{
|
{
|
||||||
GxsRequest* req = NULL;
|
GxsRequest* req = NULL;
|
||||||
uint32_t reqType = opts.mReqType;
|
uint32_t reqType = opts.mReqType;
|
||||||
@ -262,33 +258,40 @@ bool RsGxsDataAccess::requestMsgInfo(uint32_t &token, uint32_t ansType,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void RsGxsDataAccess::requestServiceStatistic(uint32_t& token)
|
void RsGxsDataAccess::requestServiceStatistic(uint32_t& token,const RsTokReqOptions& opts)
|
||||||
{
|
{
|
||||||
ServiceStatisticRequest* req = new ServiceStatisticRequest();
|
ServiceStatisticRequest* req = new ServiceStatisticRequest();
|
||||||
|
|
||||||
generateToken(token);
|
generateToken(token);
|
||||||
|
|
||||||
RsTokReqOptions opts;
|
if(opts.mReqType != GXS_REQUEST_TYPE_SERVICE_STATS)
|
||||||
opts.mReqType = GXS_REQUEST_TYPE_SERVICE_STATS;
|
{
|
||||||
|
RsErr() << "Expected opts.mReqType to be GXS_REQUEST_TYPE_SERVICE_STATS requestServiceStatistic()" << std::endl;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
setReq(req, token, 0, opts);
|
setReq(req, token, 0, opts);
|
||||||
storeRequest(req);
|
storeRequest(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RsGxsDataAccess::requestGroupStatistic(uint32_t& token, const RsGxsGroupId& grpId)
|
void RsGxsDataAccess::requestGroupStatistic(uint32_t& token, const RsGxsGroupId& grpId,const RsTokReqOptions& opts)
|
||||||
{
|
{
|
||||||
GroupStatisticRequest* req = new GroupStatisticRequest();
|
GroupStatisticRequest* req = new GroupStatisticRequest();
|
||||||
req->mGrpId = grpId;
|
req->mGrpId = grpId;
|
||||||
|
|
||||||
|
if(opts.mReqType != GXS_REQUEST_TYPE_GROUP_STATS)
|
||||||
|
{
|
||||||
|
RsErr() << "Expected opts.mReqType to be GXS_REQUEST_TYPE_SERVICE_STATS requestServiceStatistic()" << std::endl;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
generateToken(token);
|
generateToken(token);
|
||||||
|
|
||||||
RsTokReqOptions opts;
|
setReq(req, token,0, opts);
|
||||||
opts.mReqType = GXS_REQUEST_TYPE_GROUP_STATS;
|
|
||||||
setReq(req, token, 0, opts);
|
|
||||||
storeRequest(req);
|
storeRequest(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RsGxsDataAccess::requestMsgRelatedInfo(uint32_t &token, uint32_t ansType, const RsTokReqOptions &opts,
|
bool RsGxsDataAccess::requestMsgRelatedInfo(uint32_t &token, uint32_t ansType, const RsTokReqOptions &opts, const std::vector<RsGxsGrpMsgIdPair> &msgIds)
|
||||||
const std::vector<RsGxsGrpMsgIdPair> &msgIds)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
MsgRelatedInfoReq* req = new MsgRelatedInfoReq();
|
MsgRelatedInfoReq* req = new MsgRelatedInfoReq();
|
||||||
@ -320,9 +323,9 @@ void RsGxsDataAccess::storeRequest(GxsRequest* req)
|
|||||||
mPublicToken[req->token] = PENDING;
|
mPublicToken[req->token] = PENDING;
|
||||||
|
|
||||||
#ifdef DATA_DEBUG
|
#ifdef DATA_DEBUG
|
||||||
std::cerr << "Stored request token=" << req->token << " priority = " << static_cast<int>(req->priority) << " Current request Queue is:" ;
|
std::cerr << "Stored request token=" << req->token << " priority = " << static_cast<int>(req->Options.mPriority) << " Current request Queue is:" ;
|
||||||
for(auto it(mRequestQueue.begin());it!=mRequestQueue.end();++it)
|
for(auto it(mRequestQueue.begin());it!=mRequestQueue.end();++it)
|
||||||
std::cerr << it->first << " (p=" << static_cast<int>(req->priority) << ") ";
|
std::cerr << it->first << " (p=" << static_cast<int>(req->Options.mPriority) << ") ";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
std::cerr << "Completed requests waiting for client: " << mCompletedRequests.size() << std::endl;
|
std::cerr << "Completed requests waiting for client: " << mCompletedRequests.size() << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
@ -59,7 +59,7 @@ public:
|
|||||||
* @param groupIds group id to request info for
|
* @param groupIds group id to request info for
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
bool requestGroupInfo(uint32_t &token, uint32_t ansType, const RsTokReqOptions &opts, const std::list<RsGxsGroupId> &groupIds);
|
bool requestGroupInfo(uint32_t &token, uint32_t ansType, const RsTokReqOptions &opts, const std::list<RsGxsGroupId> &groupIds) override;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Use this to request all group related info
|
* Use this to request all group related info
|
||||||
@ -68,7 +68,7 @@ public:
|
|||||||
* @param opts Additional option that affect outcome of request. Please see specific services, for valid values
|
* @param opts Additional option that affect outcome of request. Please see specific services, for valid values
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
bool requestGroupInfo(uint32_t &token, uint32_t ansType, const RsTokReqOptions &opts);
|
bool requestGroupInfo(uint32_t &token, uint32_t ansType, const RsTokReqOptions &opts) override;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Use this to get msg information (id, meta, or data), store token value to poll for request completion
|
* Use this to get msg information (id, meta, or data), store token value to poll for request completion
|
||||||
@ -78,7 +78,7 @@ public:
|
|||||||
* @param groupIds The ids of the groups to get, second entry of map empty to query for all msgs
|
* @param groupIds The ids of the groups to get, second entry of map empty to query for all msgs
|
||||||
* @return true if request successful false otherwise
|
* @return true if request successful false otherwise
|
||||||
*/
|
*/
|
||||||
bool requestMsgInfo(uint32_t &token, uint32_t ansType, const RsTokReqOptions &opts, const GxsMsgReq& msgIds);
|
bool requestMsgInfo(uint32_t &token, uint32_t ansType, const RsTokReqOptions &opts, const GxsMsgReq& msgIds) override;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Use this to get message information (id, meta, or data), store token value to poll for request completion
|
* Use this to get message information (id, meta, or data), store token value to poll for request completion
|
||||||
@ -89,7 +89,7 @@ public:
|
|||||||
* all messages for all groups are retrieved
|
* all messages for all groups are retrieved
|
||||||
* @return true if request successful false otherwise
|
* @return true if request successful false otherwise
|
||||||
*/
|
*/
|
||||||
bool requestMsgInfo(uint32_t &token, uint32_t ansType, const RsTokReqOptions &opts, const std::list<RsGxsGroupId>& grpIds);
|
bool requestMsgInfo(uint32_t &token, uint32_t ansType, const RsTokReqOptions &opts, const std::list<RsGxsGroupId>& grpIds) override;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* For requesting msgs related to a given msg id within a group
|
* For requesting msgs related to a given msg id within a group
|
||||||
@ -99,7 +99,7 @@ public:
|
|||||||
* @param groupIds The ids of the groups to get, second entry of map empty to query for all msgs
|
* @param groupIds The ids of the groups to get, second entry of map empty to query for all msgs
|
||||||
* @return true if request successful false otherwise
|
* @return true if request successful false otherwise
|
||||||
*/
|
*/
|
||||||
bool requestMsgRelatedInfo(uint32_t &token, uint32_t ansType, const RsTokReqOptions &opts, const std::vector<RsGxsGrpMsgIdPair> &msgIds);
|
bool requestMsgRelatedInfo(uint32_t &token, uint32_t ansType, const RsTokReqOptions &opts, const std::vector<RsGxsGrpMsgIdPair> &msgIds) override;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* This request statistics on amount of data held
|
* This request statistics on amount of data held
|
||||||
@ -110,16 +110,17 @@ public:
|
|||||||
* total size of messages
|
* total size of messages
|
||||||
* total size of groups
|
* total size of groups
|
||||||
* @param token
|
* @param token
|
||||||
|
* @param opts Additional option that affect outcome of request. Please see specific services, for valid values
|
||||||
*/
|
*/
|
||||||
void requestServiceStatistic(uint32_t& token);
|
void requestServiceStatistic(uint32_t& token, const RsTokReqOptions &opts) override;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* To request statistic on a group
|
* To request statistic on a group
|
||||||
* @param token set to value to be redeemed to get statistic
|
* @param token set to value to be redeemed to get statistic
|
||||||
* @param grpId the id of the group
|
* @param grpId the id of the group
|
||||||
|
* @param opts Additional option that affect outcome of request. Please see specific services, for valid values
|
||||||
*/
|
*/
|
||||||
void requestGroupStatistic(uint32_t& token, const RsGxsGroupId& grpId);
|
void requestGroupStatistic(uint32_t& token, const RsGxsGroupId& grpId, const RsTokReqOptions &opts) override;
|
||||||
|
|
||||||
|
|
||||||
/* Poll */
|
/* Poll */
|
||||||
GxsRequestStatus requestStatus(const uint32_t token);
|
GxsRequestStatus requestStatus(const uint32_t token);
|
||||||
|
@ -31,10 +31,15 @@ std::ostream& operator<<(std::ostream& o,const GxsRequest& g)
|
|||||||
|
|
||||||
std::ostream& GroupMetaReq::print(std::ostream& o) const
|
std::ostream& GroupMetaReq::print(std::ostream& o) const
|
||||||
{
|
{
|
||||||
o << "[Request type=GroupMeta groupIds (size=" << mGroupIds.size() << "): " << *mGroupIds.begin() ;
|
o << "[Request type=GroupMeta groupIds (size=" << mGroupIds.size() << "): " ;
|
||||||
|
|
||||||
if(mGroupIds.size() > 1)
|
if(!mGroupIds.empty())
|
||||||
o << " ..." ;
|
{
|
||||||
|
o << *mGroupIds.begin() ;
|
||||||
|
|
||||||
|
if(mGroupIds.size() > 1)
|
||||||
|
o << " ..." ;
|
||||||
|
}
|
||||||
|
|
||||||
o << "]" ;
|
o << "]" ;
|
||||||
|
|
||||||
@ -52,10 +57,15 @@ std::ostream& GroupSerializedDataReq::print(std::ostream& o) const
|
|||||||
|
|
||||||
std::ostream& GroupDataReq::print(std::ostream& o) const
|
std::ostream& GroupDataReq::print(std::ostream& o) const
|
||||||
{
|
{
|
||||||
o << "[Request type=GroupDataReq groupIds (size=" << mGroupIds.size() << "): " << *mGroupIds.begin() ;
|
o << "[Request type=GroupDataReq groupIds (size=" << mGroupIds.size() << "): " ;
|
||||||
|
|
||||||
if(mGroupIds.size() > 1)
|
if(!mGroupIds.empty())
|
||||||
o << " ..." ;
|
{
|
||||||
|
o << *mGroupIds.begin() ;
|
||||||
|
|
||||||
|
if(mGroupIds.size() > 1)
|
||||||
|
o << " ..." ;
|
||||||
|
}
|
||||||
|
|
||||||
o << "]" ;
|
o << "]" ;
|
||||||
|
|
||||||
@ -69,10 +79,15 @@ std::ostream& MsgIdReq::print(std::ostream& o) const
|
|||||||
|
|
||||||
std::ostream& MsgMetaReq::print(std::ostream& o) const
|
std::ostream& MsgMetaReq::print(std::ostream& o) const
|
||||||
{
|
{
|
||||||
o << "[Request type=MsgMetaReq groups (size=" << mMsgIds.size() << "): " << mMsgIds.begin()->first << " (" << mMsgIds.begin()->second.size() << " messages)";
|
o << "[Request type=MsgMetaReq groups (size=" << mMsgIds.size() << "): " ;
|
||||||
|
|
||||||
if(mMsgIds.size() > 1)
|
if(!mMsgIds.empty())
|
||||||
o << " ..." ;
|
{
|
||||||
|
o << mMsgIds.begin()->first << " (" << mMsgIds.begin()->second.size() << " messages)";
|
||||||
|
|
||||||
|
if(mMsgIds.size() > 1)
|
||||||
|
o << " ..." ;
|
||||||
|
}
|
||||||
|
|
||||||
o << "]" ;
|
o << "]" ;
|
||||||
|
|
||||||
@ -81,10 +96,15 @@ std::ostream& MsgMetaReq::print(std::ostream& o) const
|
|||||||
|
|
||||||
std::ostream& MsgDataReq::print(std::ostream& o) const
|
std::ostream& MsgDataReq::print(std::ostream& o) const
|
||||||
{
|
{
|
||||||
o << "[Request type=MsgDataReq groups (size=" << mMsgIds.size() << "): " << mMsgIds.begin()->first << " (" << mMsgIds.begin()->second.size() << " messages)";
|
o << "[Request type=MsgDataReq groups (size=" << mMsgIds.size() << "): " ;
|
||||||
|
|
||||||
if(mMsgIds.size() > 1)
|
if(!mMsgIds.empty())
|
||||||
o << " ..." ;
|
{
|
||||||
|
o << mMsgIds.begin()->first << " (" << mMsgIds.begin()->second.size() << " messages)";
|
||||||
|
|
||||||
|
if(mMsgIds.size() > 1)
|
||||||
|
o << " ..." ;
|
||||||
|
}
|
||||||
|
|
||||||
o << "]" ;
|
o << "]" ;
|
||||||
|
|
||||||
@ -93,10 +113,15 @@ std::ostream& MsgDataReq::print(std::ostream& o) const
|
|||||||
|
|
||||||
std::ostream& MsgRelatedInfoReq::print(std::ostream& o) const
|
std::ostream& MsgRelatedInfoReq::print(std::ostream& o) const
|
||||||
{
|
{
|
||||||
o << "[Request type=MsgRelatedInfo msgIds (size=" << mMsgIds.size() << "): " << mMsgIds.begin()->first ;
|
o << "[Request type=MsgRelatedInfo msgIds (size=" << mMsgIds.size() << "): " ;
|
||||||
|
|
||||||
if(mMsgIds.size() > 1)
|
if(!mMsgIds.empty())
|
||||||
o << " ..." ;
|
{
|
||||||
|
o << mMsgIds.begin()->first ;
|
||||||
|
|
||||||
|
if(mMsgIds.size() > 1)
|
||||||
|
o << " ..." ;
|
||||||
|
}
|
||||||
|
|
||||||
o << "]" ;
|
o << "]" ;
|
||||||
|
|
||||||
@ -105,7 +130,7 @@ std::ostream& MsgRelatedInfoReq::print(std::ostream& o) const
|
|||||||
|
|
||||||
std::ostream& GroupSetFlagReq::print(std::ostream& o) const
|
std::ostream& GroupSetFlagReq::print(std::ostream& o) const
|
||||||
{
|
{
|
||||||
return o << "[Request type=GroupFlagSet" << "]" ;
|
return o << "[Request type=GroupFlagSet grpId=" << grpId << "]" ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -117,7 +142,7 @@ std::ostream& ServiceStatisticRequest::print(std::ostream& o) const
|
|||||||
|
|
||||||
std::ostream& GroupStatisticRequest::print(std::ostream& o) const
|
std::ostream& GroupStatisticRequest::print(std::ostream& o) const
|
||||||
{
|
{
|
||||||
return o << "[Request type=GroupStatistics" << "]" ;
|
return o << "[Request type=GroupStatistics grpId=" << mGrpId << "]" ;
|
||||||
}
|
}
|
||||||
|
|
||||||
GroupMetaReq::~GroupMetaReq()
|
GroupMetaReq::~GroupMetaReq()
|
||||||
|
@ -26,18 +26,10 @@
|
|||||||
#include "gxs/rsgds.h"
|
#include "gxs/rsgds.h"
|
||||||
#include "util/rsdeprecate.h"
|
#include "util/rsdeprecate.h"
|
||||||
|
|
||||||
enum class GxsRequestPriority {
|
|
||||||
VERY_HIGH = 0x00,
|
|
||||||
HIGH = 0x01,
|
|
||||||
NORMAL = 0x02,
|
|
||||||
LOW = 0x03,
|
|
||||||
VERY_LOW = 0x04,
|
|
||||||
};
|
|
||||||
|
|
||||||
struct GxsRequest
|
struct GxsRequest
|
||||||
{
|
{
|
||||||
GxsRequest() :
|
GxsRequest() :
|
||||||
token(0), reqTime(0), ansType(0), reqType(0),priority(GxsRequestPriority::NORMAL),
|
token(0), reqTime(0), ansType(0), reqType(0),
|
||||||
status(RsTokenService::FAILED) {}
|
status(RsTokenService::FAILED) {}
|
||||||
virtual ~GxsRequest() {}
|
virtual ~GxsRequest() {}
|
||||||
|
|
||||||
@ -46,7 +38,6 @@ struct GxsRequest
|
|||||||
|
|
||||||
RS_DEPRECATED uint32_t ansType; /// G10h4ck: This is of no use. csoler: it's made available to the clients.
|
RS_DEPRECATED uint32_t ansType; /// G10h4ck: This is of no use. csoler: it's made available to the clients.
|
||||||
uint32_t reqType;
|
uint32_t reqType;
|
||||||
GxsRequestPriority priority;
|
|
||||||
RsTokReqOptions Options;
|
RsTokReqOptions Options;
|
||||||
|
|
||||||
RsTokenService::GxsRequestStatus status;
|
RsTokenService::GxsRequestStatus status;
|
||||||
|
@ -360,7 +360,10 @@ public:
|
|||||||
/// @see RsTokenService::requestServiceStatistic
|
/// @see RsTokenService::requestServiceStatistic
|
||||||
void requestServiceStatistic(uint32_t& token)
|
void requestServiceStatistic(uint32_t& token)
|
||||||
{
|
{
|
||||||
mTokenService.requestServiceStatistic(token);
|
RsTokReqOptions opts;
|
||||||
|
opts.mReqType = GXS_REQUEST_TYPE_SERVICE_STATS;
|
||||||
|
|
||||||
|
mTokenService.requestServiceStatistic(token,opts);
|
||||||
|
|
||||||
RS_STACK_MUTEX(mMtx);
|
RS_STACK_MUTEX(mMtx);
|
||||||
mActiveTokens[token]=TokenRequestType::SERVICE_STATISTICS;
|
mActiveTokens[token]=TokenRequestType::SERVICE_STATISTICS;
|
||||||
@ -371,7 +374,10 @@ public:
|
|||||||
/// @see RsTokenService::requestGroupStatistic
|
/// @see RsTokenService::requestGroupStatistic
|
||||||
bool requestGroupStatistic(uint32_t& token, const RsGxsGroupId& grpId)
|
bool requestGroupStatistic(uint32_t& token, const RsGxsGroupId& grpId)
|
||||||
{
|
{
|
||||||
mTokenService.requestGroupStatistic(token, grpId);
|
RsTokReqOptions opts;
|
||||||
|
opts.mReqType = GXS_REQUEST_TYPE_GROUP_STATS;
|
||||||
|
|
||||||
|
mTokenService.requestGroupStatistic(token, grpId,opts);
|
||||||
|
|
||||||
RS_STACK_MUTEX(mMtx);
|
RS_STACK_MUTEX(mMtx);
|
||||||
mActiveTokens[token]=TokenRequestType::GROUP_STATISTICS;
|
mActiveTokens[token]=TokenRequestType::GROUP_STATISTICS;
|
||||||
|
@ -45,6 +45,13 @@ struct RsMsgMetaData;
|
|||||||
|
|
||||||
typedef std::map<RsGxsGroupId, std::vector<RsMsgMetaData> > MsgMetaResult;
|
typedef std::map<RsGxsGroupId, std::vector<RsMsgMetaData> > MsgMetaResult;
|
||||||
|
|
||||||
|
enum class GxsRequestPriority {
|
||||||
|
VERY_HIGH = 0x00,
|
||||||
|
HIGH = 0x01,
|
||||||
|
NORMAL = 0x02,
|
||||||
|
LOW = 0x03,
|
||||||
|
VERY_LOW = 0x04,
|
||||||
|
};
|
||||||
|
|
||||||
class RsGxsGrpMetaData;
|
class RsGxsGrpMetaData;
|
||||||
class RsGxsMsgMetaData;
|
class RsGxsMsgMetaData;
|
||||||
|
@ -80,7 +80,7 @@ struct RsTokReqOptions
|
|||||||
{
|
{
|
||||||
RsTokReqOptions() : mOptions(0), mStatusFilter(0), mStatusMask(0),
|
RsTokReqOptions() : mOptions(0), mStatusFilter(0), mStatusMask(0),
|
||||||
mMsgFlagMask(0), mMsgFlagFilter(0), mReqType(0), mSubscribeFilter(0),
|
mMsgFlagMask(0), mMsgFlagFilter(0), mReqType(0), mSubscribeFilter(0),
|
||||||
mSubscribeMask(0), mBefore(0), mAfter(0) {}
|
mSubscribeMask(0), mBefore(0), mAfter(0),mPriority(GxsRequestPriority::NORMAL) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Can be one or multiple RS_TOKREQOPT_*
|
* Can be one or multiple RS_TOKREQOPT_*
|
||||||
@ -107,6 +107,8 @@ struct RsTokReqOptions
|
|||||||
// Time range... again applied after Options.
|
// Time range... again applied after Options.
|
||||||
rstime_t mBefore;
|
rstime_t mBefore;
|
||||||
rstime_t mAfter;
|
rstime_t mAfter;
|
||||||
|
|
||||||
|
GxsRequestPriority mPriority;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -181,6 +183,25 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual bool requestMsgRelatedInfo(uint32_t &token, uint32_t ansType, const RsTokReqOptions &opts, const std::vector<RsGxsGrpMsgIdPair>& msgIds) = 0;
|
virtual bool requestMsgRelatedInfo(uint32_t &token, uint32_t ansType, const RsTokReqOptions &opts, const std::vector<RsGxsGrpMsgIdPair>& msgIds) = 0;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* This request statistics on amount of data held
|
||||||
|
* number of groups
|
||||||
|
* number of groups subscribed
|
||||||
|
* number of messages
|
||||||
|
* size of db store
|
||||||
|
* total size of messages
|
||||||
|
* total size of groups
|
||||||
|
* @param token
|
||||||
|
*/
|
||||||
|
virtual void requestServiceStatistic(uint32_t& token, const RsTokReqOptions &opts) = 0;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* To request statistic on a group
|
||||||
|
* @param token set to value to be redeemed to get statistic
|
||||||
|
* @param grpId the id of the group
|
||||||
|
*/
|
||||||
|
virtual void requestGroupStatistic(uint32_t& token, const RsGxsGroupId& grpId, const RsTokReqOptions &opts) = 0;
|
||||||
|
|
||||||
|
|
||||||
/* Poll */
|
/* Poll */
|
||||||
|
|
||||||
@ -194,25 +215,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual GxsRequestStatus requestStatus(const uint32_t token) = 0;
|
virtual GxsRequestStatus requestStatus(const uint32_t token) = 0;
|
||||||
|
|
||||||
/*!
|
|
||||||
* This request statistics on amount of data held
|
|
||||||
* number of groups
|
|
||||||
* number of groups subscribed
|
|
||||||
* number of messages
|
|
||||||
* size of db store
|
|
||||||
* total size of messages
|
|
||||||
* total size of groups
|
|
||||||
* @param token
|
|
||||||
*/
|
|
||||||
virtual void requestServiceStatistic(uint32_t& token) = 0;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* To request statistic on a group
|
|
||||||
* @param token set to value to be redeemed to get statistic
|
|
||||||
* @param grpId the id of the group
|
|
||||||
*/
|
|
||||||
virtual void requestGroupStatistic(uint32_t& token, const RsGxsGroupId& grpId) = 0;
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Cancel Request
|
* @brief Cancel Request
|
||||||
* If this function returns false, it may be that the request has completed
|
* If this function returns false, it may be that the request has completed
|
||||||
|
@ -56,7 +56,10 @@ void GxsUserNotify::startUpdate()
|
|||||||
mNewChildMessageCount = 0;
|
mNewChildMessageCount = 0;
|
||||||
|
|
||||||
uint32_t token;
|
uint32_t token;
|
||||||
mTokenService->requestServiceStatistic(token);
|
RsTokReqOptions opts;
|
||||||
|
opts.mReqType = GXS_REQUEST_TYPE_SERVICE_STATS;
|
||||||
|
|
||||||
|
mTokenService->requestServiceStatistic(token,opts);
|
||||||
mTokenQueue->queueRequest(token, 0, RS_TOKREQ_ANSTYPE_ACK, TOKEN_TYPE_STATISTICS);
|
mTokenQueue->queueRequest(token, 0, RS_TOKREQ_ANSTYPE_ACK, TOKEN_TYPE_STATISTICS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -384,7 +384,10 @@ void GxsTransportStatistics::requestGroupMeta()
|
|||||||
void GxsTransportStatistics::requestGroupStat(const RsGxsGroupId &groupId)
|
void GxsTransportStatistics::requestGroupStat(const RsGxsGroupId &groupId)
|
||||||
{
|
{
|
||||||
uint32_t token;
|
uint32_t token;
|
||||||
rsGxsTrans->getTokenService()->requestGroupStatistic(token, groupId);
|
RsTokReqOptions opts;
|
||||||
|
opts.mReqType = GXS_REQUEST_TYPE_GROUP_STATS;
|
||||||
|
|
||||||
|
rsGxsTrans->getTokenService()->requestGroupStatistic(token, groupId,opts);
|
||||||
mTransQueue->queueRequest(token, 0, RS_TOKREQ_ANSTYPE_ACK, GXSTRANS_GROUP_STAT);
|
mTransQueue->queueRequest(token, 0, RS_TOKREQ_ANSTYPE_ACK, GXSTRANS_GROUP_STAT);
|
||||||
}
|
}
|
||||||
void GxsTransportStatistics::requestMsgMeta(const RsGxsGroupId& grpId)
|
void GxsTransportStatistics::requestMsgMeta(const RsGxsGroupId& grpId)
|
||||||
|
Loading…
Reference in New Issue
Block a user