From e8820ac42aef67db98fc3b1ec9fca1e32d98b80a Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Thu, 12 Dec 2013 11:17:04 -0800 Subject: [PATCH] src/osd/: add ECBackend stubs Signed-off-by: Samuel Just --- src/osd/ECBackend.cc | 100 ++++++++++++++++++++++++++++++++++ src/osd/ECBackend.h | 82 ++++++++++++++++++++++++++++ src/osd/Makefile.am | 2 + src/osd/ReplicatedPG.h | 1 + src/test/Makefile.am | 5 ++ src/test/osd/TestECBackend.cc | 20 +++++++ 6 files changed, 210 insertions(+) create mode 100644 src/osd/ECBackend.cc create mode 100644 src/osd/ECBackend.h create mode 100644 src/test/osd/TestECBackend.cc diff --git a/src/osd/ECBackend.cc b/src/osd/ECBackend.cc new file mode 100644 index 0000000000000..f25749d8729af --- /dev/null +++ b/src/osd/ECBackend.cc @@ -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 &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 > > &to_read, + Context *on_complete) +{ + return; +} diff --git a/src/osd/ECBackend.h b/src/osd/ECBackend.h new file mode 100644 index 0000000000000..76c3064b78a47 --- /dev/null +++ b/src/osd/ECBackend.h @@ -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 &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 > > &to_read, + Context *on_complete); +}; + + +#endif diff --git a/src/osd/Makefile.am b/src/osd/Makefile.am index 8b85ca681c6af..70bba301d259a 100644 --- a/src/osd/Makefile.am +++ b/src/osd/Makefile.am @@ -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 diff --git a/src/osd/ReplicatedPG.h b/src/osd/ReplicatedPG.h index 0a671e62641bf..b6a80e2594c86 100644 --- a/src/osd/ReplicatedPG.h +++ b/src/osd/ReplicatedPG.h @@ -38,6 +38,7 @@ #include "PGBackend.h" #include "ReplicatedBackend.h" +#include "ECBackend.h" class MOSDSubOpReply; diff --git a/src/test/Makefile.am b/src/test/Makefile.am index 32a36e3426e65..cd1e6c9a102a4 100644 --- a/src/test/Makefile.am +++ b/src/test/Makefile.am @@ -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 index 0000000000000..98530030aec30 --- /dev/null +++ b/src/test/osd/TestECBackend.cc @@ -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 +#include +#include +#include +#include "osd/ECBackend.h" +#include "gtest/gtest.h" -- 2.39.5