]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/rocksdb/table/sst_file_writer.cc
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / rocksdb / table / sst_file_writer.cc
index b9a7273e07d08319671bc3591fd511976bd71e1c..a5d08ea77cd7fceaa6bcbdcaad11e78c7adc8c1f 100644 (file)
@@ -6,14 +6,16 @@
 #include "rocksdb/sst_file_writer.h"
 
 #include <vector>
+
 #include "db/dbformat.h"
+#include "env/composite_env_wrapper.h"
+#include "file/writable_file_writer.h"
 #include "rocksdb/table.h"
-#include "table/block_based_table_builder.h"
+#include "table/block_based/block_based_table_builder.h"
 #include "table/sst_file_writer_collectors.h"
-#include "util/file_reader_writer.h"
-#include "util/sync_point.h"
+#include "test_util/sync_point.h"
 
-namespace rocksdb {
+namespace ROCKSDB_NAMESPACE {
 
 const std::string ExternalSstFilePropertyNames::kVersion =
     "rocksdb.external_sst_file.version";
@@ -68,7 +70,8 @@ struct SstFileWriter::Rep {
       if (internal_comparator.user_comparator()->Compare(
               user_key, file_info.largest_key) <= 0) {
         // Make sure that keys are added in order
-        return Status::InvalidArgument("Keys must be added in order");
+        return Status::InvalidArgument(
+            "Keys must be added in strict ascending order.");
       }
     }
 
@@ -239,9 +242,10 @@ Status SstFileWriter::Open(const std::string& file_path) {
       &int_tbl_prop_collector_factories, compression_type,
       sample_for_compression, compression_opts, r->skip_filters,
       r->column_family_name, unknown_level);
-  r->file_writer.reset(new WritableFileWriter(
-      std::move(sst_file), file_path, r->env_options, r->ioptions.env,
-      nullptr /* stats */, r->ioptions.listeners));
+  r->file_writer.reset(
+      new WritableFileWriter(NewLegacyWritableFileWrapper(std::move(sst_file)),
+                             file_path, r->env_options, r->ioptions.env,
+                             nullptr /* stats */, r->ioptions.listeners));
 
   // TODO(tec) : If table_factory is using compressed block cache, we will
   // be adding the external sst file blocks into it, which is wasteful.
@@ -312,4 +316,4 @@ uint64_t SstFileWriter::FileSize() {
 }
 #endif  // !ROCKSDB_LITE
 
-}  // namespace rocksdb
+}  // namespace ROCKSDB_NAMESPACE