ddc
Public Member Functions | Public Attributes | List of all members
CFirstHitsQueryResult Struct Reference

parsed get_first_hits response More...

#include <BranchServer.h>

Public Member Functions

 ~CFirstHitsQueryResult ()
 
void Clear ()
 
bool HasErrors () const
 
void CloseSockets ()
 
void CollectCounts ()
 
void PruneHits (size_t PruneLimit)
 
size_t HostHitsLimit (const vector< size_t > &HostHitIds)
 
size_t PhysicalOffset (size_t LogicalHitNo) const
 
size_t LogicalOffset (size_t PhysicalHitNo) const
 
size_t LogicalMax (size_t LogicalHitNo) const
 
size_t PhysicalMax (size_t LogicalHitNo) const
 
size_t LogicalSize (size_t StartHitNo, size_t ResultLimit) const
 

Public Attributes

size_t m_AllHitsCount
 
size_t m_AllRelevantDocsCount
 
string m_HitsDistributionStr
 
string m_RelevantDocsDistributionStr
 
int m_InternalError
 
HitSortOrderEnum m_SortOrder
 
NetworkErrorsEnum m_NetworkError
 
string m_ErrorStr
 
vector< CHitToSortm_Hits
 
vector< size_t > m_DtrEnds
 
vector< int > m_Sockets
 
size_t m_Offset
 

Detailed Description

parsed get_first_hits response

Constructor & Destructor Documentation

◆ ~CFirstHitsQueryResult()

CFirstHitsQueryResult::~CFirstHitsQueryResult ( )
inline

destructor implicitly calls CloseSockets()

Member Function Documentation

◆ Clear()

void CFirstHitsQueryResult::Clear ( )

clear the object

References ClearVector(), errNone, hsoNone, m_AllHitsCount, m_AllRelevantDocsCount, m_DtrEnds, m_Hits, m_HitsDistributionStr, m_InternalError, m_NetworkError, m_Offset, m_RelevantDocsDistributionStr, m_Sockets, m_SortOrder, and neSuccess.

Referenced by CDDCBranchServer::RunGetFirstHits().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HasErrors()

bool CFirstHitsQueryResult::HasErrors ( ) const
inline

check whether this result raised any errors

References errNone, and neSuccess.

Referenced by CDDCBranchServer::GetHitContexts(), and CDDCBranchServer::RunGetFirstHits().

Here is the caller graph for this function:

◆ CloseSockets()

void CFirstHitsQueryResult::CloseSockets ( )

close any previously opened sockets

References CloseSocket(), m_Sockets, and SendString().

Referenced by CDDCBranchServer::GetHitContexts(), CDDCBranchServer::GetHitCounts(), and CDDCBranchServer::RunGetFirstHits().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CollectCounts()

void CFirstHitsQueryResult::CollectCounts ( )

collect counts by sort-key, only makes sense if m_SortOrder==hsoCounts ; also modifies m_AllHitsCount

References hsoAscendingCountKeys, hsoAscendingCountValues, hsoDescendingCountKeys, hsoDescendingCountValues, IsCountSort(), m_AllHitsCount, CHitToSort::m_HitNo, m_Hits, CHitToSort::m_SortKeyStr, m_SortOrder, and CHitToSort::steal().

Referenced by CDDCBranchServer::RunGetFirstHits().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PruneHits()

void CFirstHitsQueryResult::PruneHits ( size_t  PruneLimit)

prune hits by sort-key, only makes sense for #prune[]-sorts; also modifies m_AllHitsCount

References m_AllHitsCount, m_Hits, CHitToSort::m_SortKeyStr, and CHitToSort::steal().

Referenced by CDDCBranchServer::RunGetFirstHits().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HostHitsLimit()

size_t CFirstHitsQueryResult::HostHitsLimit ( const vector< size_t > &  HostHitIds)

compute the number of hits we need to request to cover all physical hit-offsets (for a single host) in HostHits

  • for prune-queries
  • HostHitIds[] is a list of physical indices into m_Hits[]
  • all hits in m_Hits[HostHitIds[]] should share the same m_HostNo
  • hits m_Hits[HistHitIds[]] should be sorted by m_HitNo , but may contain gaps

References m_Hits.

◆ PhysicalOffset()

size_t CFirstHitsQueryResult::PhysicalOffset ( size_t  LogicalHitNo) const
inline

convert a logical branch-level hit offset to a physical index in m_Hits[] (no boundary-checking, underflow possible)

Referenced by CDDCBranchServer::GetHitContexts(), CDDCBranchServer::GetHitCounts(), CDDCBranchServer::handle__get_first_hits(), and CDDCBranchServer::RunGetFirstHits().

Here is the caller graph for this function:

◆ LogicalOffset()

size_t CFirstHitsQueryResult::LogicalOffset ( size_t  PhysicalHitNo) const
inline

convert a physical offset in m_Hits[] to a logical branch-level hit offset (no boundary-checking, no underflow)

Referenced by CDDCBranchServer::GetHitContexts(), CDDCBranchServer::handle__get_first_hits(), and CDDCBranchServer::RunGetFirstHits().

Here is the caller graph for this function:

◆ LogicalMax()

size_t CFirstHitsQueryResult::LogicalMax ( size_t  LogicalHitNo) const
inline

returns the logical upper bound hit offset for LogicalHitNo, with boundary-checking

Referenced by CDDCBranchServer::handle__get_hit_strings(), CDDCBranchServer::RunDistributed(), and CDDCBranchServer::RunGetFirstHits().

Here is the caller graph for this function:

◆ PhysicalMax()

size_t CFirstHitsQueryResult::PhysicalMax ( size_t  LogicalHitNo) const
inline

returns the physical upper bound hit offset LogicalHitNo, with boundary-checking

Referenced by CDDCBranchServer::GetHitContexts(), CDDCBranchServer::GetHitCounts(), CDDCBranchServer::handle__get_first_hits(), and CDDCBranchServer::RunGetFirstHits().

Here is the caller graph for this function:

◆ LogicalSize()

size_t CFirstHitsQueryResult::LogicalSize ( size_t  StartHitNo,
size_t  ResultLimit 
) const
inline

returns the number of items in m_Hits[] logical range [StartHitNo,StartHitNo+ResultLimit), with boundary-checking

Referenced by CDDCBranchServer::handle__get_hit_strings().

Here is the caller graph for this function:

Member Data Documentation

◆ m_AllHitsCount

size_t CFirstHitsQueryResult::m_AllHitsCount

◆ m_AllRelevantDocsCount

size_t CFirstHitsQueryResult::m_AllRelevantDocsCount

◆ m_HitsDistributionStr

string CFirstHitsQueryResult::m_HitsDistributionStr

◆ m_RelevantDocsDistributionStr

string CFirstHitsQueryResult::m_RelevantDocsDistributionStr

◆ m_InternalError

int CFirstHitsQueryResult::m_InternalError

◆ m_SortOrder

HitSortOrderEnum CFirstHitsQueryResult::m_SortOrder

◆ m_NetworkError

NetworkErrorsEnum CFirstHitsQueryResult::m_NetworkError

◆ m_ErrorStr

string CFirstHitsQueryResult::m_ErrorStr

◆ m_Hits

vector<CHitToSort> CFirstHitsQueryResult::m_Hits

◆ m_DtrEnds

vector<size_t> CFirstHitsQueryResult::m_DtrEnds

◆ m_Sockets

vector< int > CFirstHitsQueryResult::m_Sockets

◆ m_Offset

size_t CFirstHitsQueryResult::m_Offset

The documentation for this struct was generated from the following files: