--- /dev/null
+// -*- 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;
+}
--- /dev/null
+// -*- 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
osd/PGLog.cc \
osd/ReplicatedPG.cc \
osd/ReplicatedBackend.cc \
+ osd/ECBackend.cc \
osd/PGBackend.cc \
osd/Ager.cc \
osd/HitSet.cc \
osd/PGBackend.h \
osd/ReplicatedBackend.h \
osd/TierAgentState.h \
+ osd/ECBackend.h \
osd/Watch.h \
osd/osd_types.h
#include "PGBackend.h"
#include "ReplicatedBackend.h"
+#include "ECBackend.h"
class MOSDSubOpReply;
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)
--- /dev/null
+// -*- 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"