本文整理汇总了C++中bo::isEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ bo::isEmpty方法的具体用法?C++ bo::isEmpty怎么用?C++ bo::isEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bo
的用法示例。
在下文中一共展示了bo::isEmpty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: saveConfigLocally
/* comment MUST only be set when initiating the set by the initiator */
void ReplSetConfig::saveConfigLocally(bo comment) {
checkRsConfig();
log() << "replSet info saving a newer config version to local.system.replset" << rsLog;
{
writelock lk("");
Client::Context cx( rsConfigNs );
cx.db()->flushFiles(true);
//theReplSet->lastOpTimeWritten = ??;
//rather than above, do a logOp()? probably
BSONObj o = asBson();
Helpers::putSingletonGod(rsConfigNs.c_str(), o, false/*logOp=false; local db so would work regardless...*/);
if( !comment.isEmpty() && (!theReplSet || theReplSet->isPrimary()) )
logOpInitiate(comment);
cx.db()->flushFiles(true);
}
log() << "replSet saveConfigLocally done" << rsLog;
}
示例2: saveConfigLocally
/* comment MUST only be set when initiating the set by the initiator */
void ReplSetConfig::saveConfigLocally(bo comment, bool onInitiate) {
checkRsConfig();
log() << "replSet info saving a newer config version to local.system.replset" << rsLog;
{
// TODO: does this really need to be a global lock?
Lock::GlobalWrite lk;
Client::Context cx( rsConfigNs );
Client::Transaction transaction(DB_SERIALIZABLE);
if (onInitiate) {
cc().txn().txnIntiatingRs();
}
BSONObj o = asBson();
Helpers::putSingleton(rsConfigNs.c_str(), o);
if( !comment.isEmpty() && (!theReplSet || theReplSet->isPrimary()) ) {
OpLogHelpers::logComment(comment, &cc().txn());
}
transaction.commit(0);
}
log() << "replSet saveConfigLocally done" << rsLog;
}
示例3: saveConfigLocally
/* comment MUST only be set when initiating the set by the initiator */
void ReplSetConfig::saveConfigLocally(bo comment) {
checkRsConfig();
BSONObj newConfigBSON = asBson();
log() << "replSet info saving a newer config version to local.system.replset: "
<< newConfigBSON << rsLog;
{
OperationContextImpl txn;
Client::WriteContext cx(&txn, rsConfigNs);
//theReplSet->lastOpTimeWritten = ??;
//rather than above, do a logOp()? probably
Helpers::putSingletonGod(&txn,
rsConfigNs.c_str(),
newConfigBSON,
false/*logOp=false; local db so would work regardless...*/);
if( !comment.isEmpty() && (!theReplSet || theReplSet->isPrimary()) )
logOpInitiate(&txn, comment);
}
log() << "replSet saveConfigLocally done" << rsLog;
}