]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Renamed filestore_backend test
authorJoe Buck <jbbuck@gmail.com>
Thu, 15 Aug 2013 05:29:46 +0000 (22:29 -0700)
committerSage Weil <sage@inktank.com>
Thu, 15 Aug 2013 16:48:22 +0000 (09:48 -0700)
Renamed filestore_backend to testfilestore_backend in
order to resolve compilation time issue.

Signed-off-by: Joe Buck <jbbuck@gmail.com>
src/Makefile.am
src/test/bench/filestore_backend.cc [deleted file]
src/test/bench/filestore_backend.h [deleted file]
src/test/bench/small_io_bench_fs.cc
src/test/bench/testfilestore_backend.cc [new file with mode: 0644]
src/test/bench/testfilestore_backend.h [new file with mode: 0644]

index f268cab5e2b2a0dbe9005f76880d9c33971591f7..353a1db639ac054e86a2ddcf8c0552b5e91abef9 100644 (file)
@@ -268,7 +268,7 @@ ceph_smalliobench_SOURCES = test/bench/small_io_bench.cc test/bench/rados_backen
 ceph_smalliobench_LDADD = librados.la -lboost_program_options $(LIBGLOBAL_LDA)
 bin_DEBUGPROGRAMS += ceph_smalliobench
 
-ceph_smalliobenchfs_SOURCES = test/bench/small_io_bench_fs.cc test/bench/filestore_backend.cc test/bench/detailed_stat_collector.cc test/bench/bencher.cc
+ceph_smalliobenchfs_SOURCES = test/bench/small_io_bench_fs.cc test/bench/testfilestore_backend.cc test/bench/detailed_stat_collector.cc test/bench/bencher.cc
 ceph_smalliobenchfs_LDADD = librados.la -lboost_program_options $(LIBOS_LDA) $(LIBGLOBAL_LDA)
 ceph_smalliobenchfs_CXXFLAGS = ${CRYPTO_CXXFLAGS} ${AM_CXXFLAGS}
 bin_DEBUGPROGRAMS += ceph_smalliobenchfs
@@ -2281,7 +2281,7 @@ noinst_HEADERS = \
         test/bench/dumb_backend.h \
         test/bench/stat_collector.h \
         test/bench/detailed_stat_collector.h \
-        test/bench/filestore_backend.h \
+        test/bench/testfilestore_backend.h \
         test/common/ObjectContents.h \
         test/encoding/types.h \
         test/filestore/DeterministicOpSequence.h \
diff --git a/src/test/bench/filestore_backend.cc b/src/test/bench/filestore_backend.cc
deleted file mode 100644 (file)
index 44abee9..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
-
-#include "filestore_backend.h"
-#include "global/global_init.h"
-#include "os/ObjectStore.h"
-
-struct C_DeleteTransWrapper : public Context {
-  Context *c;
-  ObjectStore::Transaction *t;
-  C_DeleteTransWrapper(
-    ObjectStore::Transaction *t,
-    Context *c) : c(c), t(t) {}
-  void finish(int r) {
-    c->complete(r);
-    delete t;
-  }
-};
-
-FileStoreBackend::FileStoreBackend(
-  ObjectStore *os, bool write_infos)
-  : os(os), finisher(g_ceph_context), write_infos(write_infos)
-{
-  finisher.start();
-}
-
-void FileStoreBackend::write(
-  const string &oid,
-  uint64_t offset,
-  const bufferlist &bl,
-  Context *on_applied,
-  Context *on_commit)
-{
-  ObjectStore::Transaction *t = new ObjectStore::Transaction;
-  size_t sep = oid.find("/");
-  assert(sep != string::npos);
-  assert(sep + 1 < oid.size());
-  string coll_str(oid.substr(0, sep));
-
-  if (!osrs.count(coll_str))
-    osrs.insert(make_pair(coll_str, ObjectStore::Sequencer(coll_str)));
-  ObjectStore::Sequencer *osr = &(osrs.find(coll_str)->second);
-
-
-  coll_t c(coll_str);
-  hobject_t h(sobject_t(oid.substr(sep+1), 0));
-  t->write(c, h, offset, bl.length(), bl);
-
-  if (write_infos) {
-    bufferlist bl2;
-    for (uint64_t j = 0; j < 128; ++j) bl2.append(0);
-    coll_t meta("meta");
-    hobject_t info(sobject_t(string("info_")+coll_str, 0));
-    t->write(meta, info, 0, bl2.length(), bl2);
-  }
-
-  os->queue_transaction(
-    osr,
-    t,
-    new C_DeleteTransWrapper(t, on_applied),
-    on_commit);
-}
-
-void FileStoreBackend::read(
-  const string &oid,
-  uint64_t offset,
-  uint64_t length,
-  bufferlist *bl,
-  Context *on_complete)
-{
-  size_t sep = oid.find("/");
-  assert(sep != string::npos);
-  assert(sep + 1 < oid.size());
-  coll_t c(oid.substr(0, sep));
-  hobject_t h(sobject_t(oid.substr(sep+1), 0));
-  os->read(c, h, offset, length, *bl);
-  finisher.queue(on_complete);
-}
diff --git a/src/test/bench/filestore_backend.h b/src/test/bench/filestore_backend.h
deleted file mode 100644 (file)
index 7142993..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
-
-#ifndef FILESTOREBACKENDH
-#define FILESTOREBACKENDH
-
-#include "common/Finisher.h"
-#include "backend.h"
-#include "include/Context.h"
-#include "os/ObjectStore.h"
-
-class FileStoreBackend : public Backend {
-  ObjectStore *os;
-  Finisher finisher;
-  map<string, ObjectStore::Sequencer> osrs;
-  const bool write_infos;
-
-public:
-  FileStoreBackend(ObjectStore *os, bool write_infos);
-  ~FileStoreBackend() {
-    finisher.stop();
-  }
-  void write(
-    const string &oid,
-    uint64_t offset,
-    const bufferlist &bl,
-    Context *on_applied,
-    Context *on_commit);
-
-  void read(
-    const string &oid,
-    uint64_t offset,
-    uint64_t length,
-    bufferlist *bl,
-    Context *on_complete);
-};
-
-#endif
index a37a7e71153a67ae80e87ff166fc45e1ed43ff18..6f4ac07d3620a8bef0830ee1b1e712c79c985436 100644 (file)
@@ -21,7 +21,7 @@
 #include "distribution.h"
 #include "global/global_init.h"
 #include "os/FileStore.h"
-#include "filestore_backend.h"
+#include "testfilestore_backend.h"
 #include "common/perf_counters.h"
 
 namespace po = boost::program_options;
@@ -217,7 +217,7 @@ int main(int argc, char **argv)
     Bencher *bencher = new Bencher(
       gen,
       col,
-      new FileStoreBackend(&fs, vm["write-infos"].as<bool>()),
+      new TestFileStoreBackend(&fs, vm["write-infos"].as<bool>()),
       vm["num-concurrent-ops"].as<unsigned>(),
       vm["duration"].as<unsigned>(),
       vm["max-ops"].as<unsigned>());
diff --git a/src/test/bench/testfilestore_backend.cc b/src/test/bench/testfilestore_backend.cc
new file mode 100644 (file)
index 0000000..4e2ca80
--- /dev/null
@@ -0,0 +1,77 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+
+#include "testfilestore_backend.h"
+#include "global/global_init.h"
+#include "os/ObjectStore.h"
+
+struct C_DeleteTransWrapper : public Context {
+  Context *c;
+  ObjectStore::Transaction *t;
+  C_DeleteTransWrapper(
+    ObjectStore::Transaction *t,
+    Context *c) : c(c), t(t) {}
+  void finish(int r) {
+    c->complete(r);
+    delete t;
+  }
+};
+
+TestFileStoreBackend::TestFileStoreBackend(
+  ObjectStore *os, bool write_infos)
+  : os(os), finisher(g_ceph_context), write_infos(write_infos)
+{
+  finisher.start();
+}
+
+void TestFileStoreBackend::write(
+  const string &oid,
+  uint64_t offset,
+  const bufferlist &bl,
+  Context *on_applied,
+  Context *on_commit)
+{
+  ObjectStore::Transaction *t = new ObjectStore::Transaction;
+  size_t sep = oid.find("/");
+  assert(sep != string::npos);
+  assert(sep + 1 < oid.size());
+  string coll_str(oid.substr(0, sep));
+
+  if (!osrs.count(coll_str))
+    osrs.insert(make_pair(coll_str, ObjectStore::Sequencer(coll_str)));
+  ObjectStore::Sequencer *osr = &(osrs.find(coll_str)->second);
+
+
+  coll_t c(coll_str);
+  hobject_t h(sobject_t(oid.substr(sep+1), 0));
+  t->write(c, h, offset, bl.length(), bl);
+
+  if (write_infos) {
+    bufferlist bl2;
+    for (uint64_t j = 0; j < 128; ++j) bl2.append(0);
+    coll_t meta("meta");
+    hobject_t info(sobject_t(string("info_")+coll_str, 0));
+    t->write(meta, info, 0, bl2.length(), bl2);
+  }
+
+  os->queue_transaction(
+    osr,
+    t,
+    new C_DeleteTransWrapper(t, on_applied),
+    on_commit);
+}
+
+void TestFileStoreBackend::read(
+  const string &oid,
+  uint64_t offset,
+  uint64_t length,
+  bufferlist *bl,
+  Context *on_complete)
+{
+  size_t sep = oid.find("/");
+  assert(sep != string::npos);
+  assert(sep + 1 < oid.size());
+  coll_t c(oid.substr(0, sep));
+  hobject_t h(sobject_t(oid.substr(sep+1), 0));
+  os->read(c, h, offset, length, *bl);
+  finisher.queue(on_complete);
+}
diff --git a/src/test/bench/testfilestore_backend.h b/src/test/bench/testfilestore_backend.h
new file mode 100644 (file)
index 0000000..2c3f8e6
--- /dev/null
@@ -0,0 +1,37 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+
+#ifndef TESTFILESTOREBACKENDH
+#define TESTFILESTOREBACKENDH
+
+#include "common/Finisher.h"
+#include "backend.h"
+#include "include/Context.h"
+#include "os/ObjectStore.h"
+
+class TestFileStoreBackend : public Backend {
+  ObjectStore *os;
+  Finisher finisher;
+  map<string, ObjectStore::Sequencer> osrs;
+  const bool write_infos;
+
+public:
+  TestFileStoreBackend(ObjectStore *os, bool write_infos);
+  ~TestFileStoreBackend() {
+    finisher.stop();
+  }
+  void write(
+    const string &oid,
+    uint64_t offset,
+    const bufferlist &bl,
+    Context *on_applied,
+    Context *on_commit);
+
+  void read(
+    const string &oid,
+    uint64_t offset,
+    uint64_t length,
+    bufferlist *bl,
+    Context *on_complete);
+};
+
+#endif