Skip to content

Commit

Permalink
remove cmake option -DUSE_ROCKSDB
Browse files Browse the repository at this point in the history
  • Loading branch information
jsteemann committed Oct 18, 2016
1 parent 53a9b2b commit 7ee2940
Show file tree
Hide file tree
Showing 14 changed files with 4 additions and 85 deletions.
14 changes: 2 additions & 12 deletions CMakeLists.txt
Expand Up @@ -226,18 +226,8 @@ endif ()
## ROCKSDB
################################################################################

option(USE_ROCKSDB
"whether RocksDB is enabled"
ON
)

if (USE_ROCKSDB)
add_definitions("-DARANGODB_ENABLE_ROCKSDB=1")
add_definitions(-DARANGODB_ROCKSDB_VERSION=\"${ROCKSDB_VERSION}\")
include_directories(${ROCKSDB_INCLUDE_DIR})
else ()
set(ROCKSDB_LIBS "")
endif ()
add_definitions(-DARANGODB_ROCKSDB_VERSION=\"${ROCKSDB_VERSION}\")
include_directories(${ROCKSDB_INCLUDE_DIR})

################################################################################
## EXTERNAL PROGRAMS
Expand Down
4 changes: 0 additions & 4 deletions arangod/RestServer/DatabaseFeature.cpp
Expand Up @@ -54,9 +54,7 @@
#include "VocBase/vocbase.h"
#include "Wal/LogfileManager.h"

#ifdef ARANGODB_ENABLE_ROCKSDB
#include "Indexes/RocksDBIndex.h"
#endif

#include <velocypack/velocypack-aliases.h>

Expand Down Expand Up @@ -138,10 +136,8 @@ void DatabaseManagerThread::run() {
// regular database
// ---------------------------

#ifdef ARANGODB_ENABLE_ROCKSDB
// delete persistent indexes for this database
RocksDBFeature::dropDatabase(database->id());
#endif

LOG(TRACE) << "physically removing database directory '"
<< engine->databasePath(database) << "' of database '"
Expand Down
7 changes: 1 addition & 6 deletions arangod/RestServer/arangod.cpp
Expand Up @@ -79,9 +79,7 @@
#include "Wal/LogfileManager.h"
#include "Wal/RecoveryFeature.h"

#ifdef ARANGODB_ENABLE_ROCKSDB
#include "Indexes/RocksDBFeature.h"
#endif

#ifdef USE_ENTERPRISE
#include "Enterprise/Audit/AuditFeature.h"
Expand Down Expand Up @@ -146,6 +144,7 @@ static int runServer(int argc, char** argv) {
server.addFeature(new TraverserEngineRegistryFeature(&server));
server.addFeature(new RandomFeature(&server));
server.addFeature(new RecoveryFeature(&server));
server.addFeature(new RocksDBFeature(&server));
server.addFeature(new SchedulerFeature(&server));
server.addFeature(new ScriptFeature(&server, &ret));
server.addFeature(new ServerFeature(&server, &ret));
Expand All @@ -162,10 +161,6 @@ static int runServer(int argc, char** argv) {
server.addFeature(new VersionFeature(&server));
server.addFeature(new WorkMonitorFeature(&server));

#ifdef ARANGODB_ENABLE_ROCKSDB
server.addFeature(new RocksDBFeature(&server));
#endif

#ifdef ARANGODB_HAVE_FORK
server.addFeature(new DaemonFeature(&server));

Expand Down
6 changes: 0 additions & 6 deletions arangod/StorageEngine/MMFilesEngine.cpp
Expand Up @@ -42,10 +42,8 @@
#include "VocBase/vocbase.h"
#include "Wal/LogfileManager.h"

#ifdef ARANGODB_ENABLE_ROCKSDB
#include "Indexes/RocksDBFeature.h"
#include "Indexes/RocksDBIndex.h"
#endif

#include <velocypack/Collection.h>
#include <velocypack/Iterator.h>
Expand Down Expand Up @@ -327,12 +325,10 @@ void MMFilesEngine::getDatabases(arangodb::velocypack::Builder& result) {
LOG(DEBUG) << "found dropped database in directory '" << directory << "'";
LOG(DEBUG) << "removing superfluous database directory '" << directory << "'";

#ifdef ARANGODB_ENABLE_ROCKSDB
// delete persistent indexes for this database
TRI_voc_tick_t id = static_cast<TRI_voc_tick_t>(
basics::StringUtils::uint64(idSlice.copyString()));
RocksDBFeature::dropDatabase(id);
#endif

dropDatabaseDirectory(directory);
continue;
Expand Down Expand Up @@ -700,9 +696,7 @@ void MMFilesEngine::dropCollection(TRI_vocbase_t* vocbase, arangodb::LogicalColl
unregisterCollectionPath(vocbase->id(), collection->cid());

// delete persistent indexes
#ifdef ARANGODB_ENABLE_ROCKSDB
RocksDBFeature::dropCollection(vocbase->id(), collection->cid());
#endif

// rename collection directory
if (!collection->path().empty()) {
Expand Down
4 changes: 0 additions & 4 deletions arangod/Utils/Transaction.cpp
Expand Up @@ -53,12 +53,10 @@
#include "VocBase/ticks.h"
#include "Wal/LogfileManager.h"

#ifdef ARANGODB_ENABLE_ROCKSDB
#include "Indexes/RocksDBIndex.h"

#include <rocksdb/utilities/optimistic_transaction_db.h>
#include <rocksdb/utilities/transaction.h>
#endif

#include <velocypack/Builder.h>
#include <velocypack/Collection.h>
Expand Down Expand Up @@ -674,15 +672,13 @@ bool Transaction::hasDitch(TRI_voc_cid_t cid) const {
/// @brief get (or create) a rocksdb WriteTransaction
//////////////////////////////////////////////////////////////////////////////

#ifdef ARANGODB_ENABLE_ROCKSDB
rocksdb::Transaction* Transaction::rocksTransaction() {
if (_trx->_rocksTransaction == nullptr) {
_trx->_rocksTransaction = RocksDBFeature::instance()->db()->BeginTransaction(
rocksdb::WriteOptions(), rocksdb::OptimisticTransactionOptions());
}
return _trx->_rocksTransaction;
}
#endif

////////////////////////////////////////////////////////////////////////////////
/// @brief extract the _key attribute from a slice
Expand Down
4 changes: 0 additions & 4 deletions arangod/Utils/Transaction.h
Expand Up @@ -36,11 +36,9 @@

#include <velocypack/Slice.h>

#ifdef ARANGODB_ENABLE_ROCKSDB
namespace rocksdb {
class Transaction;
}
#endif

namespace arangodb {

Expand Down Expand Up @@ -189,9 +187,7 @@ class Transaction {
/// @brief get (or create) a rocksdb WriteTransaction
//////////////////////////////////////////////////////////////////////////////

#ifdef ARANGODB_ENABLE_ROCKSDB
rocksdb::Transaction* rocksTransaction();
#endif

//////////////////////////////////////////////////////////////////////////////
/// @brief add a transaction hint
Expand Down
2 changes: 0 additions & 2 deletions arangod/V8Server/v8-vocindex.cpp
Expand Up @@ -46,9 +46,7 @@
#include "VocBase/modes.h"
#include "VocBase/LogicalCollection.h"

#ifdef ARANGODB_ENABLE_ROCKSDB
#include "Indexes/RocksDBIndex.h"
#endif

#include <velocypack/Builder.h>
#include <velocypack/Iterator.h>
Expand Down
5 changes: 0 additions & 5 deletions arangod/VocBase/LogicalCollection.cpp
Expand Up @@ -270,13 +270,8 @@ static std::shared_ptr<Index> PrepareIndexFromSlice(VPackSlice info,
break;
}
case arangodb::Index::TRI_IDX_TYPE_ROCKSDB_INDEX: {
#ifdef ARANGODB_ENABLE_ROCKSDB
newIdx.reset(new arangodb::RocksDBIndex(iid, col, info));
break;
#else
THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_NOT_IMPLEMENTED,
"index type 'persistent' not supported in this build");
#endif
}
case arangodb::Index::TRI_IDX_TYPE_FULLTEXT_INDEX: {
newIdx.reset(new arangodb::FulltextIndex(iid, col, info));
Expand Down
15 changes: 1 addition & 14 deletions arangod/VocBase/transaction.cpp
Expand Up @@ -33,14 +33,12 @@
#include "VocBase/LogicalCollection.h"
#include "VocBase/modes.h"

#ifdef ARANGODB_ENABLE_ROCKSDB
#include "Indexes/RocksDBFeature.h"

#include <rocksdb/db.h>
#include <rocksdb/options.h>
#include <rocksdb/utilities/optimistic_transaction_db.h>
#include <rocksdb/utilities/transaction.h>
#endif

#ifdef ARANGODB_ENABLE_MAINTAINER_MODE

Expand Down Expand Up @@ -657,7 +655,6 @@ static int WriteCommitMarker(TRI_transaction_t* trx) {
TRI_IF_FAILURE("TransactionWriteCommitMarkerSegfault") {
TRI_SegfaultDebugging("crashing on commit");
}
#ifdef ARANGODB_ENABLE_ROCKSDB
TRI_IF_FAILURE("TransactionWriteCommitMarkerNoRocksSync") { return TRI_ERROR_NO_ERROR; }
Expand All @@ -673,7 +670,6 @@ static int WriteCommitMarker(TRI_transaction_t* trx) {
if (res != TRI_ERROR_NO_ERROR) {
THROW_ARANGO_EXCEPTION(res);
}
#endif
} catch (arangodb::basics::Exception const& ex) {
res = ex.code();
LOG(WARN) << "could not save transaction commit marker in log: " << ex.what();
Expand Down Expand Up @@ -1021,12 +1017,11 @@ int TRI_AddOperationTransaction(TRI_transaction_t* trx,
// some error occurred
return slotInfo.errorCode;
}
#ifdef ARANGODB_ENABLE_ROCKSDB
if (localWaitForSync) {
// also sync RocksDB WAL
RocksDBFeature::syncWal();
}
#endif
operation.tick = slotInfo.tick;
fid = slotInfo.logfileId;
position = slotInfo.mem;
Expand Down Expand Up @@ -1055,15 +1050,13 @@ int TRI_AddOperationTransaction(TRI_transaction_t* trx,
if (isSingleOperationTransaction) {
// operation is directly executed
#ifdef ARANGODB_ENABLE_ROCKSDB
if (trx->_rocksTransaction != nullptr) {
auto status = trx->_rocksTransaction->Commit();
if (!status.ok()) {
// TODO: what to do here?
}
}
#endif
operation.handle();
arangodb::aql::QueryCache::instance()->invalidate(
Expand Down Expand Up @@ -1202,7 +1195,6 @@ int TRI_CommitTransaction(TRI_transaction_t* trx, int nestingLevel) {
int res = TRI_ERROR_NO_ERROR;
if (nestingLevel == 0) {
#ifdef ARANGODB_ENABLE_ROCKSDB
if (trx->_rocksTransaction != nullptr) {
auto status = trx->_rocksTransaction->Commit();
Expand All @@ -1212,7 +1204,6 @@ int TRI_CommitTransaction(TRI_transaction_t* trx, int nestingLevel) {
return res;
}
}
#endif
res = WriteCommitMarker(trx);
Expand Down Expand Up @@ -1284,9 +1275,7 @@ TRI_transaction_t::TRI_transaction_t(TRI_vocbase_t* vocbase, double timeout, boo
_status(TRI_TRANSACTION_CREATED),
_arena(),
_collections{_arena}, // assign arena to vector
#ifdef ARANGODB_ENABLE_ROCKSDB
_rocksTransaction(nullptr),
#endif
_hints(0),
_nestingLevel(0),
_allowImplicit(true),
Expand All @@ -1311,9 +1300,7 @@ TRI_transaction_t::~TRI_transaction_t() {
TRI_AbortTransaction(this, 0);
}
#ifdef ARANGODB_ENABLE_ROCKSDB
delete _rocksTransaction;
#endif
ReleaseCollections(this, 0);
Expand Down
4 changes: 0 additions & 4 deletions arangod/VocBase/transaction.h
Expand Up @@ -28,11 +28,9 @@
#include "Basics/SmallVector.h"
#include "VocBase/voc-types.h"

#ifdef ARANGODB_ENABLE_ROCKSDB
namespace rocksdb {
class Transaction;
}
#endif

namespace arangodb {
class DocumentDitch;
Expand Down Expand Up @@ -122,9 +120,7 @@ struct TRI_transaction_t {
TRI_transaction_status_e _status; // current status
arangodb::SmallVector<TRI_transaction_collection_t*>::allocator_type::arena_type _arena; // memory for collections
arangodb::SmallVector<TRI_transaction_collection_t*> _collections; // list of participating collections
#ifdef ARANGODB_ENABLE_ROCKSDB
rocksdb::Transaction* _rocksTransaction;
#endif
TRI_transaction_hint_t _hints; // hints;
int _nestingLevel;
bool _allowImplicit;
Expand Down
4 changes: 0 additions & 4 deletions arangod/Wal/CollectorThread.cpp
Expand Up @@ -43,9 +43,7 @@
#include "Wal/Logfile.h"
#include "Wal/LogfileManager.h"

#ifdef ARANGODB_ENABLE_ROCKSDB
#include "Indexes/RocksDBIndex.h"
#endif

using namespace arangodb;
using namespace arangodb::wal;
Expand Down Expand Up @@ -388,9 +386,7 @@ int CollectorThread::collectLogfiles(bool& worked) {
_collectorResultCondition.broadcast();
}

#ifdef ARANGODB_ENABLE_ROCKSDB
RocksDBFeature::syncWal();
#endif

_logfileManager->setCollectionDone(logfile);
} else {
Expand Down
14 changes: 0 additions & 14 deletions arangod/Wal/RecoverState.cpp
Expand Up @@ -38,9 +38,7 @@
#include "Wal/LogfileManager.h"
#include "Wal/Slots.h"

#ifdef ARANGODB_ENABLE_ROCKSDB
#include "Indexes/RocksDBFeature.h"
#endif

#include <velocypack/Collection.h>
#include <velocypack/Parser.h>
Expand Down Expand Up @@ -685,9 +683,7 @@ bool RecoverState::ReplayMarker(TRI_df_marker_t const* marker, void* data,
return true;
}

#ifdef ARANGODB_ENABLE_ROCKSDB
RocksDBFeature::dropIndex(databaseId, collectionId, indexId);
#endif

std::string const indexName("index-" + std::to_string(indexId) + ".json");
std::string const filename(arangodb::basics::FileUtils::buildFilename(col->path(), indexName));
Expand Down Expand Up @@ -756,9 +752,7 @@ bool RecoverState::ReplayMarker(TRI_df_marker_t const* marker, void* data,
vocbase->dropCollection(collection, true, false);
}

#ifdef ARANGODB_ENABLE_ROCKSDB
RocksDBFeature::dropCollection(databaseId, collectionId);
#endif

// check if there is another collection with the same name as the one that
// we attempt to create
Expand Down Expand Up @@ -878,9 +872,7 @@ bool RecoverState::ReplayMarker(TRI_df_marker_t const* marker, void* data,
return state->canContinue();
}

#ifdef ARANGODB_ENABLE_ROCKSDB
RocksDBFeature::dropDatabase(databaseId);
#endif
break;
}

Expand Down Expand Up @@ -921,9 +913,7 @@ bool RecoverState::ReplayMarker(TRI_df_marker_t const* marker, void* data,
// ignore any potential error returned by this call
col->dropIndex(indexId, false);

#ifdef ARANGODB_ENABLE_ROCKSDB
RocksDBFeature::dropIndex(databaseId, collectionId, indexId);
#endif

// additionally remove the index file
std::string const indexName("index-" + std::to_string(indexId) + ".json");
Expand Down Expand Up @@ -959,9 +949,7 @@ bool RecoverState::ReplayMarker(TRI_df_marker_t const* marker, void* data,
if (collection != nullptr) {
vocbase->dropCollection(collection, true, false);
}
#ifdef ARANGODB_ENABLE_ROCKSDB
RocksDBFeature::dropCollection(databaseId, collectionId);
#endif
break;
}

Expand All @@ -980,9 +968,7 @@ bool RecoverState::ReplayMarker(TRI_df_marker_t const* marker, void* data,
state->databaseFeature->dropDatabase(databaseId, false, true, false);
}

#ifdef ARANGODB_ENABLE_ROCKSDB
RocksDBFeature::dropDatabase(databaseId);
#endif
break;
}

Expand Down
2 changes: 0 additions & 2 deletions arangod/Wal/RecoveryFeature.cpp
Expand Up @@ -42,9 +42,7 @@ RecoveryFeature::RecoveryFeature(ApplicationServer* server)
requiresElevatedPrivileges(false);
startsAfter("Database");
startsAfter("LogfileManager");
#ifdef ARANGODB_ENABLE_ROCKSDB
startsAfter("RocksDB");
#endif
}

/// @brief run the recovery procedure
Expand Down

0 comments on commit 7ee2940

Please sign in to comment.