]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
src/osd/: add ECBackend stubs
authorSamuel Just <sam.just@inktank.com>
Thu, 12 Dec 2013 19:17:04 +0000 (11:17 -0800)
committerSamuel Just <sam.just@inktank.com>
Tue, 18 Feb 2014 04:12:15 +0000 (20:12 -0800)
Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/ECBackend.cc [new file with mode: 0644]
src/osd/ECBackend.h [new file with mode: 0644]
src/osd/Makefile.am
src/osd/ReplicatedPG.h
src/test/Makefile.am
src/test/osd/TestECBackend.cc [new file with mode: 0644]

diff --git a/src/osd/ECBackend.cc b/src/osd/ECBackend.cc
new file mode 100644 (file)
index 0000000..f25749d
--- /dev/null
@@ -0,0 +1,100 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+/*
+ * Ceph - scalable distributed file system
+ *
+ * Copyright (C) 2013 Inktank Storage, Inc.
+ *
+ * This is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software
+ * Foundation.  See file COPYING.
+ *
+ */
+
+#include "ECBackend.h"
+
+PGBackend::RecoveryHandle *open_recovery_op()
+{
+  return 0;
+}
+
+void ECBackend::run_recovery_op(
+  RecoveryHandle *h,
+  int priority)
+{
+}
+
+void ECBackend::recover_object(
+  const hobject_t &hoid,
+  eversion_t v,
+  ObjectContextRef head,
+  ObjectContextRef obc,
+  RecoveryHandle *h)
+{
+}
+
+bool ECBackend::handle_message(
+  OpRequestRef op)
+{
+  return false;
+}
+
+void ECBackend::check_recovery_sources(const OSDMapRef osdmap)
+{
+}
+
+void ECBackend::_on_change(ObjectStore::Transaction *t)
+{
+}
+
+void ECBackend::clear_state()
+{
+}
+
+void ECBackend::on_flushed()
+{
+}
+
+
+void ECBackend::dump_recovery_info(Formatter *f) const
+{
+}
+
+PGBackend::PGTransaction *ECBackend::get_transaction()
+{
+  return new ECTransaction;
+}
+
+void ECBackend::submit_transaction(
+  const hobject_t &hoid,
+  const eversion_t &at_version,
+  PGTransaction *t,
+  const eversion_t &trim_to,
+  vector<pg_log_entry_t> &log_entries,
+  Context *on_local_applied_sync,
+  Context *on_all_applied,
+  Context *on_all_commit,
+  tid_t tid,
+  osd_reqid_t reqid,
+  OpRequestRef op)
+{
+}
+
+int ECBackend::objects_read_sync(
+  const hobject_t &hoid,
+  uint64_t off,
+  uint64_t len,
+  bufferlist *bl)
+{
+  return -EOPNOTSUPP;
+}
+
+void ECBackend::objects_read_async(
+  const hobject_t &hoid,
+  const list<pair<pair<uint64_t, uint64_t>,
+                 pair<bufferlist*, Context*> > > &to_read,
+  Context *on_complete)
+{
+  return;
+}
diff --git a/src/osd/ECBackend.h b/src/osd/ECBackend.h
new file mode 100644 (file)
index 0000000..76c3064
--- /dev/null
@@ -0,0 +1,82 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+/*
+ * Ceph - scalable distributed file system
+ *
+ * Copyright (C) 2013 Inktank Storage, Inc.
+ *
+ * This is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software
+ * Foundation.  See file COPYING.
+ *
+ */
+
+#ifndef ECBACKEND_H
+#define ECBACKEND_H
+
+#include "OSD.h"
+#include "PGBackend.h"
+#include "osd_types.h"
+
+class ECBackend : public PGBackend {
+public:
+  RecoveryHandle *open_recovery_op();
+
+  void run_recovery_op(
+    RecoveryHandle *h,
+    int priority
+    );
+
+  void recover_object(
+    const hobject_t &hoid,
+    eversion_t v,
+    ObjectContextRef head,
+    ObjectContextRef obc,
+    RecoveryHandle *h
+    );
+
+  bool handle_message(
+    OpRequestRef op
+    );
+
+  void check_recovery_sources(const OSDMapRef osdmap);
+
+  void _on_change(ObjectStore::Transaction *t);
+  void clear_state();
+
+  void on_flushed();
+
+  void dump_recovery_info(Formatter *f) const;
+
+  PGTransaction *get_transaction();
+
+  void submit_transaction(
+    const hobject_t &hoid,
+    const eversion_t &at_version,
+    PGTransaction *t,
+    const eversion_t &trim_to,
+    vector<pg_log_entry_t> &log_entries,
+    Context *on_local_applied_sync,
+    Context *on_all_applied,
+    Context *on_all_commit,
+    tid_t tid,
+    osd_reqid_t reqid,
+    OpRequestRef op
+    );
+
+  int objects_read_sync(
+    const hobject_t &hoid,
+    uint64_t off,
+    uint64_t len,
+    bufferlist *bl);
+
+  void objects_read_async(
+    const hobject_t &hoid,
+    const list<pair<pair<uint64_t, uint64_t>,
+                   pair<bufferlist*, Context*> > > &to_read,
+    Context *on_complete);
+};
+
+
+#endif
index 8b85ca681c6af88b0bf5e774d3e04e8fe2867f19..70bba301d259a82f3cb1cfc72db7fabe7e43d077 100644 (file)
@@ -3,6 +3,7 @@ libosd_la_SOURCES = \
        osd/PGLog.cc \
        osd/ReplicatedPG.cc \
        osd/ReplicatedBackend.cc \
+       osd/ECBackend.cc \
        osd/PGBackend.cc \
        osd/Ager.cc \
        osd/HitSet.cc \
@@ -34,6 +35,7 @@ noinst_HEADERS += \
        osd/PGBackend.h \
        osd/ReplicatedBackend.h \
        osd/TierAgentState.h \
+       osd/ECBackend.h \
        osd/Watch.h \
        osd/osd_types.h
 
index 0a671e62641bf663982f4b7579f46d2c62bc6aa2..b6a80e2594c8676bc0af6e25ef1114c2168a359a 100644 (file)
@@ -38,6 +38,7 @@
 
 #include "PGBackend.h"
 #include "ReplicatedBackend.h"
+#include "ECBackend.h"
 
 class MOSDSubOpReply;
 
index 32a36e3426e654774db3db576c1685cdcfa5be22..cd1e6c9a102a48b8b39c75743673e909bcf21f46 100644 (file)
@@ -371,6 +371,11 @@ unittest_pglog_CXXFLAGS = $(UNITTEST_CXXFLAGS)
 unittest_pglog_LDADD = $(LIBOSD) $(UNITTEST_LDADD) $(CEPH_GLOBAL)
 check_PROGRAMS += unittest_pglog
 
+unittest_ecbackend_SOURCES = test/osd/TestECBackend.cc
+unittest_ecbackend_CXXFLAGS = $(UNITTEST_CXXFLAGS)
+unittest_ecbackend_LDADD = $(LIBOSD) $(UNITTEST_LDADD) $(CEPH_GLOBAL)
+check_PROGRAMS += unittest_ecbackend
+
 unittest_hitset_SOURCES = test/osd/hitset.cc
 unittest_hitset_CXXFLAGS = $(UNITTEST_CXXFLAGS)
 unittest_hitset_LDADD = $(LIBOSD) $(UNITTEST_LDADD) $(CEPH_GLOBAL)
diff --git a/src/test/osd/TestECBackend.cc b/src/test/osd/TestECBackend.cc
new file mode 100644 (file)
index 0000000..9853003
--- /dev/null
@@ -0,0 +1,20 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+/*
+ * Ceph - scalable distributed file system
+ *
+ * Copyright (C) 2013 Inktank Storage, Inc.
+ *
+ * This is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software
+ * Foundation.  See file COPYING.
+ *
+ */
+
+#include <iostream>
+#include <sstream>
+#include <errno.h>
+#include <signal.h>
+#include "osd/ECBackend.h"
+#include "gtest/gtest.h"