本文整理汇总了C++中Strategy::getMore方法的典型用法代码示例。如果您正苦于以下问题:C++ Strategy::getMore方法的具体用法?C++ Strategy::getMore怎么用?C++ Strategy::getMore使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Strategy
的用法示例。
在下文中一共展示了Strategy::getMore方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: process
void Request::process( int attempt ) {
init();
int op = _m.operation();
verify( op > dbMsg );
int msgId = (int)(_m.header()->id);
Timer t;
LOG(3) << "Request::process begin ns: " << getns()
<< " msg id: " << msgId
<< " op: " << op
<< " attempt: " << attempt
<< endl;
Strategy * s = SHARDED;
_d.markSet();
bool iscmd = false;
if ( op == dbKillCursors ) {
cursorCache.gotKillCursors( _m );
}
else if ( op == dbQuery ) {
NamespaceString nss(getns());
iscmd = nss.isCommand() || nss.isSpecialCommand();
if (iscmd) {
int n = _d.getQueryNToReturn();
uassert( 16978, str::stream() << "bad numberToReturn (" << n
<< ") for $cmd type ns - can only be 1 or -1",
n == 1 || n == -1 );
SINGLE->queryOp(*this);
}
else {
s->queryOp( *this );
}
}
else if ( op == dbGetMore ) {
s->getMore( *this );
}
else {
s->writeOp( op, *this );
}
LOG(3) << "Request::process end ns: " << getns()
<< " msg id: " << msgId
<< " op: " << op
<< " attempt: " << attempt
<< " " << t.millis() << "ms"
<< endl;
globalOpCounters.gotOp( op , iscmd );
}
示例2: process
void Request::process( int attempt ) {
init();
int op = _m.operation();
verify( op > dbMsg );
if ( op == dbKillCursors ) {
cursorCache.gotKillCursors( _m );
return;
}
int msgId = (int)(_m.header()->id);
Timer t;
LOG(3) << "Request::process begin ns: " << getns()
<< " msg id: " << msgId
<< " op: " << op
<< " attempt: " << attempt
<< endl;
Strategy * s = SHARDED;
_counter = &opsNonSharded;
_d.markSet();
bool iscmd = false;
if ( op == dbQuery ) {
iscmd = isCommand();
if (iscmd) {
SINGLE->queryOp(*this);
}
else {
s->queryOp( *this );
}
}
else if ( op == dbGetMore ) {
s->getMore( *this );
}
else {
s->writeOp( op, *this );
}
LOG(3) << "Request::process end ns: " << getns()
<< " msg id: " << msgId
<< " op: " << op
<< " attempt: " << attempt
<< " " << t.millis() << "ms"
<< endl;
globalOpCounters.gotOp( op , iscmd );
_counter->gotOp( op , iscmd );
}
示例3: process
void Request::process( int attempt ) {
init();
int op = _m.operation();
assert( op > dbMsg );
if ( op == dbKillCursors ) {
cursorCache.gotKillCursors( _m );
return;
}
MONGO_LOG(3) << "Request::process ns: " << getns() << " msg id:" << (int)(_m.header()->id) << " attempt: " << attempt << endl;
Strategy * s = SHARDED;
_counter = &opsNonSharded;
_d.markSet();
bool iscmd = false;
if ( op == dbQuery ) {
try {
iscmd = isCommand();
s->queryOp( *this );
}
catch ( RecvStaleConfigException& stale ) {
_d.markReset();
log( attempt == 0 ) << "got RecvStaleConfigException at top level: " << stale.toString() << " attempt: " << attempt << endl;
massert( 16062 , "too many attemps to handle RecvStaleConfigException at top level" , attempt <= 5 );
process( attempt + 1 );
return;
}
}
else if ( op == dbGetMore ) {
checkAuth( Auth::READ ); // this is important so someone can't steal a cursor
s->getMore( *this );
}
else {
checkAuth( Auth::WRITE );
s->writeOp( op, *this );
}
globalOpCounters.gotOp( op , iscmd );
_counter->gotOp( op , iscmd );
}