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 Rados-Cluster Interface independet from librados #266

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

Make Rados-Cluster Interface independet from librados #266

jrse opened this issue Sep 17, 2019 · 0 comments
Assignees
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_CLUSTER_INTERFACE_H_
#define SRC_LIBRMB_INTERFACES_RADOS_CLUSTER_INTERFACE_H_

#include <string>

#include <rados/librados.hpp>

namespace librmb {
/** class RadosDictionary
 *  brief an abstract Rados Cluster
 *  details This abstract class provides the api
 *         to create a rados cluster connection:
 */
class RadosDictionary;

class RadosCluster {
 public:
  virtual ~RadosCluster() {}
  /*!
   * initialize the cluster with default user and clustername
   * @return linux error code or 0 if successful
   *
   */
  virtual int init() = 0;
  /*!
   * initialize the cluster with custom user and clustername
   * @return linux error code or 0 if successful
   */
  virtual int init(const std::string &clustername, const std::string &rados_username) = 0;
  /*! tear down cluster
   * @return linux error code or 0 if successful
   * */
  virtual void deinit() = 0;
  /*! create a storae pool
   * @param[in] pool poolname to create if not existend.
   * @return linux errror code or 0 if successful
   * */
  virtual int pool_create(const std::string &pool) = 0;
  /*! create io context
   * @param[in] pool poolname
   * @praam[in] valid io_ctx.
   * @return linux errror code or 0 if successful
   * */
  virtual int io_ctx_create(const std::string &pool, librados::IoCtx *io_ctx) = 0;
  /*!
   * read ceph configuration
   * @param[in] option option name as described in the ceph documentation
   * @param[out] value valid ptr to a string buffer.
   * @return linux error code or 0 if successful
   *
   */
  virtual int get_config_option(const char *option, std::string *value) = 0;

  /*!
     * set ceph configuration
     * @param[in] option option name as described in the ceph documentation
     * @param[out] value valid ptr to a string buffer.
     * @return linux error code or 0 if successful
     *
     */
  virtual void set_config_option(const char *option, const char *value) = 0;

  /*!
   * Check if cluster connection does exist and is working-
   * @return true if connected
   */
  virtual bool is_connected() = 0;
};

}  // namespace librmb

#endif  // SRC_LIBRMB_INTERFACES_RADOS_CLUSTER_INTERFACE_H_

@jrse jrse added the cleanup label Sep 17, 2019
@jrse jrse self-assigned this Jun 1, 2023
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