当前位置: 首页>>代码示例>>C++>>正文


C++ bo::isEmpty方法代码示例

本文整理汇总了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;
    }
开发者ID:FrancescaK,项目名称:mongo,代码行数:20,代码来源:rs_config.cpp

示例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;
 }
开发者ID:dsavineau,项目名称:mongo,代码行数:21,代码来源:rs_config.cpp

示例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;
    }
开发者ID:ZhangHongJi,项目名称:mongo,代码行数:23,代码来源:rs_config.cpp


注:本文中的bo::isEmpty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。