summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/collection_to_capped.cpp
diff options
context:
space:
mode:
authormatt dannenberg <matt.dannenberg@10gen.com>2015-02-23 13:39:17 -0500
committermatt dannenberg <matt.dannenberg@10gen.com>2015-03-11 08:08:34 -0400
commitddc1a7f9c3303f8ef685792ec9e5d144fb1983eb (patch)
tree920234058804b1097efc6dd064ad37e4e0f4d9d2 /src/mongo/db/commands/collection_to_capped.cpp
parent8ca1f787738bdfe67a6662835f514b555b65af24 (diff)
downloadmongo-ddc1a7f9c3303f8ef685792ec9e5d144fb1983eb.tar.gz
SERVER-13896 Replace logOp() with a more operation-aware observer interface
Diffstat (limited to 'src/mongo/db/commands/collection_to_capped.cpp')
-rw-r--r--src/mongo/db/commands/collection_to_capped.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/mongo/db/commands/collection_to_capped.cpp b/src/mongo/db/commands/collection_to_capped.cpp
index 14e817840fa..9d15d3df794 100644
--- a/src/mongo/db/commands/collection_to_capped.cpp
+++ b/src/mongo/db/commands/collection_to_capped.cpp
@@ -35,10 +35,11 @@
#include "mongo/db/background.h"
#include "mongo/db/client.h"
#include "mongo/db/commands.h"
+#include "mongo/db/global_environment_experiment.h"
#include "mongo/db/index_builder.h"
+#include "mongo/db/op_observer.h"
#include "mongo/db/query/internal_plans.h"
#include "mongo/db/query/find.h"
-#include "mongo/db/repl/oplog.h"
#include "mongo/db/repl/replication_coordinator_global.h"
#include "mongo/db/operation_context_impl.h"
@@ -123,8 +124,9 @@ namespace {
WriteUnitOfWork wunit(txn);
toCollection->insertDocument( txn, obj, true );
- if ( logForReplication )
- repl::logOp(txn, "i", toNs.c_str(), obj);
+ if ( logForReplication ) {
+ getGlobalEnvironment()->getOpObserver()->onInsert(txn, toNs, obj);
+ }
wunit.commit();
}
}
@@ -296,8 +298,12 @@ namespace {
if ( !status.isOK() )
return appendCommandStatus( result, status );
- if (!fromRepl)
- repl::logOp(txn, "c",(dbname + ".$cmd").c_str(), jsobj);
+ if (!fromRepl) {
+ getGlobalEnvironment()->getOpObserver()->onConvertToCapped(
+ txn,
+ NamespaceString(longSource),
+ size);
+ }
wunit.commit();
return true;