CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
28 class RdbDataIterator;
33 namespace catapult {
namespace cache {
50 template<
typename TValue>
51 bool prop(
const std::string& propertyName, TValue& value)
const {
53 load(propertyName, [&result, &value](
const char* buffer) {
58 value = reinterpret_cast<const TValue&>(*buffer);
65 template<
typename TValue>
66 void setProp(
const std::string& propertyName,
const TValue& value) {
67 std::string strValue(
sizeof(TValue), 0);
68 reinterpret_cast<TValue&>(strValue[0]) = value;
69 save(propertyName, strValue);
88 size_t prune(uint64_t pruningBoundary);
93 void save(
const std::string& propertyName,
const std::string& strValue);
static RdbDataIterator End()
Iterator representing no match.
Definition: RocksDatabase.cpp:52
void setSize(size_t newSize)
Sets size of the column to newSize.
Definition: RdbColumnContainer.cpp:68
bool prop(const std::string &propertyName, TValue &value) const
Definition: RdbColumnContainer.h:51
rocksdb::PinnableSlice & storage() const
Returns storage associated with iterator.
Definition: RocksDatabase.cpp:64
size_t prune(uint64_t pruningBoundary)
Prunes elements below pruningBoundary. Returns number of pruned elements.
Definition: RdbColumnContainer.cpp:85
size_t m_columnId
Definition: RdbColumnContainer.h:97
RdbColumnContainer(RocksDatabase &database, size_t columnId)
Creates an adapter around database and columnId.
Definition: RdbColumnContainer.cpp:38
void setProp(const std::string &propertyName, const TValue &value)
Sets property value of a column (propertyName) to value.
Definition: RdbColumnContainer.h:66
MongoDatabase m_database
Definition: MongoBlockStorage.cpp:242
constexpr size_t Special_Key_Max_Length
Definition: RocksInclude.h:30
RocksDatabase & database()
Returns underlying database.
Definition: RdbColumnContainer.h:73
size_t m_size
Definition: RdbColumnContainer.h:98
Iterator adapter, allowing existence check on keys and data retrieval.
Definition: RocksDatabase.h:40
size_t prune(size_t columnId, uint64_t boundary)
Prunes elements from columnId below boundary. Returns number of pruned elements.
Definition: RocksDatabase.cpp:193
void remove(const RawBuffer &key)
Removes element with key.
Definition: RdbColumnContainer.cpp:81
RocksDb-backed database.
Definition: RocksDatabase.h:116
RocksDatabase & m_database
Definition: RdbColumnContainer.h:96
#define CATAPULT_THROW_INVALID_ARGUMENT_1(MESSAGE, PARAM1)
Macro used to throw a catapult invalid argument with a single parameter.
Definition: exceptions.h:183
size_t size() const
Returns size of the column.
Definition: RdbColumnContainer.cpp:64
void save(const std::string &propertyName, const std::string &strValue)
Definition: RdbColumnContainer.cpp:52
void del(size_t columnId, const rocksdb::Slice &key)
Deletes key from columnId.
Definition: RocksDatabase.cpp:180
RocksDb-backed container adapter.
Definition: RdbColumnContainer.h:36
void load(const std::string &propertyName, const consumer< const char * > &sink) const
Definition: RdbColumnContainer.cpp:57
Definition: AddressExtractionExtension.cpp:28
void find(const RawBuffer &key, RdbDataIterator &iterator) const
Finds element with key, storing result in iterator.
Definition: RdbColumnContainer.cpp:73
void put(size_t columnId, const rocksdb::Slice &key, const std::string &value)
Puts value with key in columnId.
Definition: RocksDatabase.cpp:169
void insert(const RawBuffer &key, const std::string &value)
Inserts element with key and value.
Definition: RdbColumnContainer.cpp:77
std::function< void(TArgs...)> consumer
A consumer function.
Definition: functions.h:35
BasicRawBuffer< const uint8_t > RawBuffer
A const binary buffer.
Definition: RawBuffer.h:62
void get(size_t columnId, const rocksdb::Slice &key, RdbDataIterator &result)
Gets key from columnId returning data in result.
Definition: RocksDatabase.cpp:154