1
0
Fork 0

some cleanup (#3583)

This commit is contained in:
Jan 2017-11-07 10:27:21 +01:00 committed by Frank Celler
parent 3022ad4658
commit f6a90c4879
11 changed files with 12 additions and 50 deletions

View File

@ -586,8 +586,8 @@ void HeartbeatThread::runSingleServer() {
auto prv = ServerState::setServerMode(ServerState::Mode::REDIRECT);
if (prv == ServerState::Mode::DEFAULT) {
// we were leader previously, now we need to ensure no ongoing operations
// on this server may prevent us from beeing a proper follower. We wait for
// all ongoing ops to stop, and make sure nothing is committet:
// on this server may prevent us from being a proper follower. We wait for
// all ongoing ops to stop, and make sure nothing is committed:
// setting server mode to REDIRECT stops DDL ops and write transactions
LOG_TOPIC(INFO, Logger::HEARTBEAT) << "Detected leader to secondary change"
<< " this might take a few seconds";

View File

@ -127,7 +127,7 @@ inline std::unique_ptr<basics::StringBuffer> createChunkForNetworkDetail(
chunk <<= 1;
chunk |= isFirstChunk ? 0x1 : 0x0;
// get the lenght of VPack data
// get the length of VPack data
uint32_t dataLength = static_cast<uint32_t>(end - begin);
// calculate length of current chunk

View File

@ -73,24 +73,6 @@ Index::Index(TRI_idx_iid_t iid, arangodb::LogicalCollection* collection,
Index::allowExpansion(Index::type(slice.get("type").copyString())));
}
/// TODO: can we remove this?
/// @brief create an index stub with a hard-coded selectivity estimate
/// this is used in the cluster coordinator case
Index::Index(VPackSlice const& slice)
: _iid(arangodb::basics::StringUtils::uint64(
arangodb::basics::VelocyPackHelper::checkAndGetStringValue(slice,
"id"))),
_collection(nullptr),
_fields(),
_unique(arangodb::basics::VelocyPackHelper::getBooleanValue(
slice, "unique", false)),
_sparse(arangodb::basics::VelocyPackHelper::getBooleanValue(
slice, "sparse", false)) {
VPackSlice const fields = slice.get("fields");
setFields(fields,
Index::allowExpansion(Index::type(slice.get("type").copyString())));
}
Index::~Index() {}
size_t Index::sortWeight(arangodb::aql::AstNode const* node) {

View File

@ -71,9 +71,6 @@ class Index {
Index(TRI_idx_iid_t, LogicalCollection*, arangodb::velocypack::Slice const&);
/// TODO: can we remove this?
explicit Index(arangodb::velocypack::Slice const&);
virtual ~Index();
public:

View File

@ -172,9 +172,6 @@ static void JS_DatafileScanVocbaseCol(
v8::Handle<v8::Object> result;
{
// TODO Check with JAN Okay to just remove the lock?
// READ_LOCKER(readLocker, collection->_lock);
TRI_vocbase_col_status_e status = collection->getStatusLocked();
if (status != TRI_VOC_COL_STATUS_UNLOADED &&
status != TRI_VOC_COL_STATUS_CORRUPTED) {

View File

@ -1190,10 +1190,6 @@ bool MMFilesWalRecoverState::ReplayMarker(MMFilesMarker const* marker,
MMFilesPersistentIndexFeature::dropDatabase(databaseId);
vocbase = nullptr;
/* TODO: check what TRI_ERROR_ARANGO_DATABASE_NOT_FOUND means here
WaitForDeletion(state->server, databaseId,
TRI_ERROR_ARANGO_DATABASE_NOT_FOUND);
*/
int res = state->databaseFeature->createDatabase(databaseId, nameString,
vocbase);

View File

@ -385,7 +385,7 @@ static int DumpCollection(MMFilesReplicationDumpContext* dump,
THROW_ARANGO_EXCEPTION(res);
}
// TODO if vstcase find out slice lenght of _slices.back()
// TODO if vstcase find out slice length of _slices.back()
if (static_cast<uint64_t>(TRI_LengthStringBuffer(dump->_buffer)) >
dump->_chunkSize) {
// abort the iteration

View File

@ -59,7 +59,7 @@ Result syncChunkRocksDB(DatabaseInitialSyncer& syncer,
options.isSynchronousReplicationFrom = syncer._leaderId;
}
LOG_TOPIC(TRACE, Logger::REPLICATION) << "synching chunk. low: '" << lowString
LOG_TOPIC(TRACE, Logger::REPLICATION) << "syncing chunk. low: '" << lowString
<< "', high: '" << highString << "'";
// no match

View File

@ -182,10 +182,9 @@ void ExportFeature::prepare() {
std::vector<std::string> files(
TRI_FullTreeDirectory(_outputDirectory.c_str()));
// we don't care if the target directory is empty
isEmptyDirectory = (files.size() <= 1); // TODO: TRI_FullTreeDirectory
// always returns at least one
// element (""), even if
// directory is empty?
// note: TRI_FullTreeDirectory always returns at least one
// element (""), even if directory is empty.
isEmptyDirectory = (files.size() <= 1);
}
}

View File

@ -462,16 +462,9 @@ int RestoreFeature::processInputDirectory(std::string& errorMsg) {
}
if (overwriteName) {
// TODO MAX
// Situation:
// Ich habe ein Json-Object von Datei (teile des Inhalts im Zweifel
// unbekannt)
// Es gibt ein Sub-Json-Object "parameters" mit einem Attribute "name"
// der gesetzt ist.
// Ich muss nur diesen namen überschreiben, der Rest soll identisch
// bleiben.
// TODO: we have a JSON object with sub-object "parameters" with
// attribute "name". we only want to replace this. how?
} else {
//std::shared_ptr<VPackBuffer<uint8_t>> buff = fileContentBuilder.steal();
collections.emplace_back(std::move(fileContentBuilder));
}
}

View File

@ -716,8 +716,7 @@ void ApplicationServer::raisePrivilegesTemporarily() {
}
LOG_TOPIC(TRACE, Logger::STARTUP) << "raising privileges";
// TODO
// TODO: raising privileges not implemented
}
// temporarily drop privileges
@ -729,8 +728,7 @@ void ApplicationServer::dropPrivilegesTemporarily() {
}
LOG_TOPIC(TRACE, Logger::STARTUP) << "dropping privileges";
// TODO
// TODO: dropping privileges not implemented
}
// permanently dropped privileges