diff options
-rw-r--r-- | src/mongo/db/catalog/collection.cpp | 17 | ||||
-rw-r--r-- | src/mongo/db/commands/compact.cpp | 28 | ||||
-rw-r--r-- | src/mongo/db/storage/record_store.h | 7 |
3 files changed, 2 insertions, 50 deletions
diff --git a/src/mongo/db/catalog/collection.cpp b/src/mongo/db/catalog/collection.cpp index c9458035631..b816d075493 100644 --- a/src/mongo/db/catalog/collection.cpp +++ b/src/mongo/db/catalog/collection.cpp @@ -39,22 +39,7 @@ namespace mongo { std::string CompactOptions::toString() const { - std::stringstream ss; - ss << "paddingMode: "; - switch (paddingMode) { - case NONE: - ss << "NONE"; - break; - case PRESERVE: - ss << "PRESERVE"; - break; - case MANUAL: - ss << "MANUAL (" << paddingBytes << " + ( doc * " << paddingFactor << ") )"; - } - - ss << " validateDocuments: " << validateDocuments; - - return ss.str(); + return str::stream() << " validateDocuments: " << validateDocuments; } // diff --git a/src/mongo/db/commands/compact.cpp b/src/mongo/db/commands/compact.cpp index 3c0400a77ea..d24f1d44c71 100644 --- a/src/mongo/db/commands/compact.cpp +++ b/src/mongo/db/commands/compact.cpp @@ -81,8 +81,7 @@ public: return "compact collection\n" "warning: this operation locks the database and is slow. you can cancel with " "killOp()\n" - "{ compact : <collection_name>, [force:<bool>], [validate:<bool>],\n" - " [paddingFactor:<num>], [paddingBytes:<num>] }\n" + "{ compact : <collection_name>, [force:<bool>], [validate:<bool>] }\n" " force - allows to run on a replica set primary\n" " validate - check records are noncorrupt before adding to newly compacting " "extents. slower but safer (defaults to true in this version)\n"; @@ -117,31 +116,6 @@ public: CompactOptions compactOptions; - if (cmdObj["preservePadding"].trueValue()) { - compactOptions.paddingMode = CompactOptions::PRESERVE; - if (cmdObj.hasElement("paddingFactor") || cmdObj.hasElement("paddingBytes")) { - errmsg = "cannot mix preservePadding and paddingFactor|paddingBytes"; - return false; - } - } else if (cmdObj.hasElement("paddingFactor") || cmdObj.hasElement("paddingBytes")) { - compactOptions.paddingMode = CompactOptions::MANUAL; - if (cmdObj.hasElement("paddingFactor")) { - compactOptions.paddingFactor = cmdObj["paddingFactor"].Number(); - if (compactOptions.paddingFactor < 1 || compactOptions.paddingFactor > 4) { - errmsg = "invalid padding factor"; - return false; - } - } - if (cmdObj.hasElement("paddingBytes")) { - compactOptions.paddingBytes = cmdObj["paddingBytes"].numberInt(); - if (compactOptions.paddingBytes < 0 || - compactOptions.paddingBytes > (1024 * 1024)) { - errmsg = "invalid padding bytes"; - return false; - } - } - } - if (cmdObj.hasElement("validate")) compactOptions.validateDocuments = cmdObj["validate"].trueValue(); diff --git a/src/mongo/db/storage/record_store.h b/src/mongo/db/storage/record_store.h index e2d659e840a..8dba667ad22 100644 --- a/src/mongo/db/storage/record_store.h +++ b/src/mongo/db/storage/record_store.h @@ -54,13 +54,6 @@ struct ValidateResults; class ValidateAdaptor; struct CompactOptions { - // padding - enum PaddingMode { PRESERVE, NONE, MANUAL } paddingMode = NONE; - - // only used if _paddingMode == MANUAL - double paddingFactor = 1; // what to multiple document size by - int paddingBytes = 0; // what to add to ducment size after multiplication - // other bool validateDocuments = true; |