CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
30 class ColumnFamilyHandle;
37 namespace catapult {
namespace cache {
73 rocksdb::PinnableSlice&
storage()
const;
96 const std::string& databaseDirectory,
97 const std::vector<std::string>& columnFamilyNames,
139 void put(
size_t columnId,
const rocksdb::Slice& key,
const std::string& value);
142 void del(
size_t columnId,
const rocksdb::Slice& key);
145 size_t prune(
size_t columnId, uint64_t boundary);
void setFound(bool found)
Sets flag to found indicating that iterator contains data.
Definition: RocksDatabase.cpp:68
constexpr RawString ExtractDirectoryName(const char *fullPath)
Definition: PathUtils.h:77
static RdbDataIterator End()
Iterator representing no match.
Definition: RocksDatabase.cpp:52
RocksDb settings.
Definition: RocksDatabase.h:88
constexpr uint64_t bytes() const
Returns the number of bytes.
Definition: FileSize.h:67
bool operator==(const RdbDataIterator &rhs) const
Returns true if this iterator and rhs are equal.
Definition: RocksDatabase.cpp:56
bool m_isFound
Definition: RocksDatabase.h:84
const std::vector< std::string > & columnFamilyNames() const
Gets the database column family names.
Definition: RocksDatabase.cpp:136
rocksdb::PinnableSlice & storage() const
Returns storage associated with iterator.
Definition: RocksDatabase.cpp:64
#define CATAPULT_THROW_RUNTIME_ERROR_2(MESSAGE, PARAM1, PARAM2)
Macro used to throw a catapult runtime error with two parameters.
Definition: exceptions.h:175
RawBuffer buffer() const
Returns storage as raw buffer.
Definition: RocksDatabase.cpp:72
constexpr void HexFormat(const ByteArray< N, TTag > &)
void saveIfBatchFull()
Definition: RocksDatabase.cpp:218
std::unique_ptr< rocksdb::WriteBatch > m_pWriteBatch
Definition: RocksDatabase.h:156
~RocksDatabase()
Destroys database.
Definition: RocksDatabase.cpp:131
size_t numRemoved() const
Returns number of pruned entries since last prune.
Definition: RocksPruningFilter.cpp:87
rocksdb::PinnableSlice Result
Definition: RocksDatabase.cpp:35
rocksdb::CompactionFilter * compactionFilter()
Returns underlying compaction filter.
Definition: RocksPruningFilter.cpp:79
const utils::FileSize MaxDatabaseWriteBatchSize
Maximum size of database write batch.
Definition: RocksDatabase.h:109
Rocks pruning filter.
Definition: RocksPruningFilter.h:38
const AsyncTcpServerSettings m_settings
Definition: AsyncTcpServer.cpp:203
FilterPruningMode
Possible modes of rocks pruning filter.
Definition: RocksPruningFilter.h:29
std::vector< rocksdb::ColumnFamilyHandle * > m_handles
Definition: RocksDatabase.h:159
#define CATAPULT_THROW_DB_KEY_ERROR(message)
Definition: RocksDatabase.cpp:151
RdbDataIterator()
Creates an iterator.
Definition: RocksDatabase.cpp:43
RocksPruningFilter m_pruningFilter
Definition: RocksDatabase.h:155
Enabled, allocate underlying filter implementation.
const RocksDatabaseSettings m_settings
Definition: RocksDatabase.h:154
Iterator adapter, allowing existence check on keys and data retrieval.
Definition: RocksDatabase.h:40
#define CATAPULT_THROW_RUNTIME_ERROR_1(MESSAGE, PARAM1)
Macro used to throw a catapult runtime error with a single parameter.
Definition: exceptions.h:171
RocksDatabaseSettings()
Creates default database settings.
Definition: RocksDatabase.cpp:80
const std::vector< std::string > ColumnFamilyNames
Names of database columns.
Definition: RocksDatabase.h:106
size_t prune(size_t columnId, uint64_t boundary)
Prunes elements from columnId below boundary. Returns number of pruned elements.
Definition: RocksDatabase.cpp:193
Simple RAII class that logs slow operation messages.
Definition: StackLogger.h:51
RocksDatabase()
Creates an empty database.
bool canPrune() const
Returns true if pruning is enabled.
Definition: RocksDatabase.cpp:140
Represents a file size.
Definition: FileSize.h:29
RocksDb-backed database.
Definition: RocksDatabase.h:116
~RdbDataIterator()
Destroys an iterator.
StorageStrategy
Definition: RocksDatabase.h:42
const std::string DatabaseDirectory
Database directory.
Definition: RocksDatabase.h:103
static constexpr FileSize FromKilobytes(uint64_t kilobytes)
Creates a file size from the given number of kilobytes.
Definition: FileSize.h:46
void del(size_t columnId, const rocksdb::Slice &key)
Deletes key from columnId.
Definition: RocksDatabase.cpp:180
Patricia tree storage should be disabled.
const FilterPruningMode PruningMode
Database pruning mode.
Definition: RocksDatabase.h:112
#define CATAPULT_THROW_INVALID_ARGUMENT(MESSAGE)
Macro used to throw a catapult invalid argument.
Definition: exceptions.h:179
void flush()
Finalize batched operations.
Definition: RocksDatabase.cpp:202
std::shared_ptr< Impl > m_pImpl
Definition: RocksDatabase.h:82
bool operator!=(const RdbDataIterator &rhs) const
Returns true if this iterator and rhs are not equal.
Definition: RocksDatabase.cpp:60
Definition: AddressExtractionExtension.cpp:28
RdbDataIterator & operator=(RdbDataIterator &&)
Move assignment operator.
void put(size_t columnId, const rocksdb::Slice &key, const std::string &value)
Puts value with key in columnId.
Definition: RocksDatabase.cpp:169
std::unique_ptr< rocksdb::DB > m_pDb
Definition: RocksDatabase.h:158
Definition: RocksDatabase.h:29
Level for logging warning events.
void setPruningBoundary(uint64_t pruningBoundary)
Sets pruning boundary.
Definition: RocksPruningFilter.cpp:91
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
Definition: RocksDatabase.cpp:34