diff options
Diffstat (limited to 'src/mongo/db/sorter')
| -rw-r--r-- | src/mongo/db/sorter/SConscript | 2 | ||||
| -rw-r--r-- | src/mongo/db/sorter/sorter.cpp | 33 |
2 files changed, 18 insertions, 17 deletions
diff --git a/src/mongo/db/sorter/SConscript b/src/mongo/db/sorter/SConscript index 959f6cdb919..1ceb05088af 100644 --- a/src/mongo/db/sorter/SConscript +++ b/src/mongo/db/sorter/SConscript @@ -5,6 +5,6 @@ sorterEnv.InjectThirdPartyIncludePaths(libraries=['snappy']) sorterEnv.CppUnitTest('sorter_test', 'sorter_test.cpp', LIBDEPS=['$BUILD_DIR/mongo/db/service_context', - '$BUILD_DIR/mongo/db/storage/wiredtiger/storage_wiredtiger_customization_hooks', + '$BUILD_DIR/mongo/db/storage/encryption_hooks', '$BUILD_DIR/mongo/db/storage/storage_options', '$BUILD_DIR/third_party/shim_snappy']) diff --git a/src/mongo/db/sorter/sorter.cpp b/src/mongo/db/sorter/sorter.cpp index 7f6e8866562..0165e0adccc 100644 --- a/src/mongo/db/sorter/sorter.cpp +++ b/src/mongo/db/sorter/sorter.cpp @@ -55,8 +55,8 @@ #include "mongo/config.h" #include "mongo/db/jsobj.h" #include "mongo/db/service_context.h" +#include "mongo/db/storage/encryption_hooks.h" #include "mongo/db/storage/storage_options.h" -#include "mongo/db/storage/wiredtiger/wiredtiger_customization_hooks.h" #include "mongo/platform/atomic_word.h" #include "mongo/s/mongos_options.h" #include "mongo/util/assert_util.h" @@ -226,15 +226,16 @@ private: read(_buffer.get(), blockSize); massert(16816, "file too short?", !_done); - auto hooks = WiredTigerCustomizationHooks::get(getGlobalServiceContext()); - if (hooks->enabled()) { + auto encryptionHooks = EncryptionHooks::get(getGlobalServiceContext()); + if (encryptionHooks->enabled()) { std::unique_ptr<char[]> out(new char[blockSize]); size_t outLen; - Status status = hooks->unprotectTmpData(reinterpret_cast<uint8_t*>(_buffer.get()), - blockSize, - reinterpret_cast<uint8_t*>(out.get()), - blockSize, - &outLen); + Status status = + encryptionHooks->unprotectTmpData(reinterpret_cast<uint8_t*>(_buffer.get()), + blockSize, + reinterpret_cast<uint8_t*>(out.get()), + blockSize, + &outLen); massert(28841, str::stream() << "Failed to unprotect data: " << status.toString(), status.isOK()); @@ -884,16 +885,16 @@ void SortedFileWriter<Key, Value>::spill() { } std::unique_ptr<char[]> out; - auto hooks = WiredTigerCustomizationHooks::get(getGlobalServiceContext()); - if (hooks->enabled()) { - size_t protectedSizeMax = size + hooks->additionalBytesForProtectedBuffer(); + auto encryptionHooks = EncryptionHooks::get(getGlobalServiceContext()); + if (encryptionHooks->enabled()) { + size_t protectedSizeMax = size + encryptionHooks->additionalBytesForProtectedBuffer(); out.reset(new char[protectedSizeMax]); size_t resultLen; - Status status = hooks->protectTmpData(reinterpret_cast<const uint8_t*>(outBuffer), - size, - reinterpret_cast<uint8_t*>(out.get()), - protectedSizeMax, - &resultLen); + Status status = encryptionHooks->protectTmpData(reinterpret_cast<const uint8_t*>(outBuffer), + size, + reinterpret_cast<uint8_t*>(out.get()), + protectedSizeMax, + &resultLen); massert(28842, str::stream() << "Failed to compress data: " << status.toString(), status.isOK()); |
