Commit 410b21ff authored by Sebastien Ponce's avatar Sebastien Ponce
Browse files

Implemented a fake librados so that synchronization can compile on SLC5

parent 97d739cd
......@@ -24,6 +24,7 @@
*****************************************************************************/
#include "castor/gc/CephGlobals.hpp"
#include <map>
/// global variables holding ioCtx and stripers for each ceph pool
std::map<std::string, libradosstriper::RadosStriper*> g_radosStripers;
......
/******************************************************************************
* This is a fake implementation of librados.hpp API allowing to
* compile CASTOR code without depending on CEPH
* This bad hack should be dropped. It only exists in order to support
* compilation on SLC5, while ceph is not compiling on SLC5.
* Obviously, even if the software will compile with this fake implementation
* the ceph functionnality won't be present when using this.
*****************************************************************************/
#ifndef __LIBRADOS_HPP
#define __LIBRADOS_HPP
#include <errno.h>
#include <string>
namespace ceph {
class bufferlist {
public:
void append(const char *data, unsigned len) {};
void copy(unsigned off, unsigned len, char *dest) const {};
};
};
namespace librados {
class ObjectIterator {
public:
ObjectIterator() {}
bool operator!=(const ObjectIterator& rhs) const {
return false;
}
const std::pair<std::string, std::string>* operator->() const {
return &m_null;
};
ObjectIterator operator++(int) {
return *this;
};
std::pair<std::string, std::string> m_null;
};
class IoCtx {
public:
IoCtx(){}
ObjectIterator objects_begin() {
return ObjectIterator();
}
ObjectIterator objects_end() {
return ObjectIterator();
}
};
class Rados {
public:
Rados(){};
int init(const char * const id) {
return -EINVAL;
}
int conf_read_file(const char * const path) {
return -EINVAL;
}
int conf_parse_env(const char *env) const {
return -EINVAL;
}
int connect() {
return -EINVAL;
}
void shutdown(){}
int ioctx_create(const char *name, IoCtx &pioctx) {
return -EINVAL;
}
};
};
#endif
......@@ -12,60 +12,7 @@
#include <errno.h>
#include <string>
namespace ceph {
class bufferlist {
public:
void append(const char *data, unsigned len) {};
void copy(unsigned off, unsigned len, char *dest) const {};
};
};
namespace librados {
class IoCtx {
public:
IoCtx(){}
};
class Rados {
public:
Rados(){};
int init(const char * const id) {
return -EINVAL;
}
int conf_read_file(const char * const path) {
return -EINVAL;
}
int conf_parse_env(const char *env) const {
return -EINVAL;
}
int connect() {
return -EINVAL;
}
void shutdown(){}
int ioctx_create(const char *name, IoCtx &pioctx) {
return -EINVAL;
}
};
};
#include <rados/librados.hpp>
namespace libradosstriper {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment