Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make RadosDictionary interface independent from librados #265

Open
jrse opened this issue Sep 17, 2019 · 0 comments
Open

Make RadosDictionary interface independent from librados #265

jrse opened this issue Sep 17, 2019 · 0 comments
Labels

Comments

@jrse
Copy link
Contributor

jrse commented Sep 17, 2019

// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
/*
 * Copyright (c) 2017-2018 Tallence AG and the authors
 *
 * 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 SRC_LIBRMB_INTERFACES_RADOS_DICTIONARY_INTERFACE_H_
#define SRC_LIBRMB_INTERFACES_RADOS_DICTIONARY_INTERFACE_H_

#include <string>

#include <rados/librados.hpp>

namespace librmb {

/**
 * Rados Dictionary
 *
 * Dictionary module (omap values).
 */
class RadosDictionary {
 public:
  virtual ~RadosDictionary() {}

  virtual const std::string get_full_oid(const std::string& key) = 0;
  virtual const std::string get_shared_oid() = 0;
  virtual const std::string get_private_oid() = 0;

  virtual const std::string& get_oid() = 0;
  virtual const std::string& get_username() = 0;
  virtual const std::string& get_poolname() = 0;

  virtual librados::IoCtx& get_io_ctx(const std::string& key) = 0;
  virtual librados::IoCtx& get_shared_io_ctx() = 0;
  virtual librados::IoCtx& get_private_io_ctx() = 0;

  virtual void remove_completion(librados::AioCompletion* c) = 0;
  virtual void push_back_completion(librados::AioCompletion* c) = 0;
  virtual void wait_for_completions() = 0;

  virtual int get(const std::string& key, std::string* value_r) = 0;
};
}  // namespace librmb

#endif  // SRC_LIBRMB_INTERFACES_RADOS_DICTIONARY_INTERFACE_H_

@jrse jrse added the cleanup label Sep 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant