mirror of https://gitee.com/bigwinds/arangodb
remove functions that are not called anymore
This commit is contained in:
parent
53978b6b93
commit
44eae59dc0
|
@ -1158,27 +1158,6 @@ static void JS_JavaScriptPathServerState(
|
|||
TRI_V8_TRY_CATCH_END
|
||||
}
|
||||
|
||||
#ifdef DEBUG_SYNC_REPLICATION
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief set arangoserver state to initialized
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static void JS_EnableSyncReplicationDebug(
|
||||
v8::FunctionCallbackInfo<v8::Value> const& args) {
|
||||
TRI_V8_TRY_CATCH_BEGIN(isolate);
|
||||
v8::HandleScope scope(isolate);
|
||||
|
||||
if (args.Length() != 0) {
|
||||
TRI_V8_THROW_EXCEPTION_USAGE("enableSyncReplicationDebug()");
|
||||
}
|
||||
|
||||
ServerState::instance()->setInitialized();
|
||||
ServerState::instance()->setId("repltest");
|
||||
AgencyComm::syncReplDebug = true;
|
||||
TRI_V8_TRY_CATCH_END
|
||||
}
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief return whether the cluster is initialized
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -2089,10 +2068,6 @@ void TRI_InitV8Cluster(v8::Isolate* isolate, v8::Handle<v8::Context> context) {
|
|||
JS_IdOfPrimaryServerState);
|
||||
TRI_AddMethodVocbase(isolate, rt, TRI_V8_ASCII_STRING(isolate, "javaScriptPath"),
|
||||
JS_JavaScriptPathServerState);
|
||||
#ifdef DEBUG_SYNC_REPLICATION
|
||||
TRI_AddMethodVocbase(isolate, rt, TRI_V8_ASCII_STRING(isolate, "enableSyncReplicationDebug"),
|
||||
JS_EnableSyncReplicationDebug);
|
||||
#endif
|
||||
TRI_AddMethodVocbase(isolate, rt, TRI_V8_ASCII_STRING(isolate, "initialized"),
|
||||
JS_InitializedServerState);
|
||||
TRI_AddMethodVocbase(isolate, rt, TRI_V8_ASCII_STRING(isolate, "isCoordinator"),
|
||||
|
|
|
@ -1101,53 +1101,6 @@ static void JS_GetLeader(v8::FunctionCallbackInfo<v8::Value> const& args) {
|
|||
TRI_V8_TRY_CATCH_END
|
||||
}
|
||||
|
||||
#ifdef DEBUG_SYNC_REPLICATION
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief was docuBlock getFollowers
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static void JS_AddFollower(v8::FunctionCallbackInfo<v8::Value> const& args) {
|
||||
TRI_V8_TRY_CATCH_BEGIN(isolate);
|
||||
v8::HandleScope scope(isolate);
|
||||
|
||||
auto& vocbase = GetContextVocBase(isolate);
|
||||
|
||||
if (vocbase.isDropped()) {
|
||||
TRI_V8_THROW_EXCEPTION(TRI_ERROR_ARANGO_DATABASE_NOT_FOUND);
|
||||
}
|
||||
|
||||
if (args.Length() < 1) {
|
||||
TRI_V8_THROW_EXCEPTION_USAGE("addFollower(<name>)");
|
||||
}
|
||||
|
||||
ServerID const serverId = TRI_ObjectToString(args[0]);
|
||||
|
||||
if (ServerState::instance()->isDBServer()) {
|
||||
arangodb::LogicalCollection const* v8Collection =
|
||||
TRI_UnwrapClass<arangodb::LogicalCollection>(args.Holder(),
|
||||
WRP_VOCBASE_COL_TYPE);
|
||||
|
||||
if (v8Collection == nullptr) {
|
||||
TRI_V8_THROW_EXCEPTION_INTERNAL("cannot extract collection");
|
||||
}
|
||||
|
||||
std::string collectionName = v8Collection->name();
|
||||
auto collection = v8Collection->vocbase().lookupCollection(collectionName);
|
||||
|
||||
if (collection == nullptr) {
|
||||
TRI_V8_THROW_EXCEPTION(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
|
||||
}
|
||||
|
||||
collection->followers()->add(serverId);
|
||||
}
|
||||
|
||||
TRI_V8_RETURN_TRUE();
|
||||
TRI_V8_TRY_CATCH_END
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief was docuBlock removeFollower
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -2856,10 +2809,6 @@ void TRI_InitV8Collections(v8::Handle<v8::Context> context,
|
|||
JS_SetTheLeader, true);
|
||||
TRI_AddMethodVocbase(isolate, rt, TRI_V8_ASCII_STRING(isolate, "getLeader"),
|
||||
JS_GetLeader, true);
|
||||
#ifdef DEBUG_SYNC_REPLICATION
|
||||
TRI_AddMethodVocbase(isolate, rt, TRI_V8_ASCII_STRING(isolate, "addFollower"),
|
||||
JS_AddFollower, true);
|
||||
#endif
|
||||
TRI_AddMethodVocbase(isolate, rt, TRI_V8_ASCII_STRING(isolate, "removeFollower"),
|
||||
JS_RemoveFollower, true);
|
||||
TRI_AddMethodVocbase(isolate, rt, TRI_V8_ASCII_STRING(isolate, "getFollowers"),
|
||||
|
|
|
@ -1,43 +0,0 @@
|
|||
/* jshint strict: false */
|
||||
/* global ArangoServerState */
|
||||
|
||||
// //////////////////////////////////////////////////////////////////////////////
|
||||
// / DISCLAIMER
|
||||
// /
|
||||
// / Copyright 2017 ArangoDB GmbH, Cologne, Germany
|
||||
// /
|
||||
// / Licensed under the Apache License, Version 2.0 (the "License")
|
||||
// / you may not use this file except in compliance with the License.
|
||||
// / You may obtain a copy of the License at
|
||||
// /
|
||||
// / http://www.apache.org/licenses/LICENSE-2.0
|
||||
// /
|
||||
// / Unless required by applicable law or agreed to in writing, software
|
||||
// / distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// / WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// / See the License for the specific language governing permissions and
|
||||
// / limitations under the License.
|
||||
// /
|
||||
// / Copyright holder is triAGENS GmbH, Cologne, Germany
|
||||
// /
|
||||
// / @author Andreas Streichardt
|
||||
// //////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
exports.setup = function() {
|
||||
global.ArangoServerState.enableSyncReplicationDebug();
|
||||
ArangoServerState.setRole('PRIMARY');
|
||||
global.ArangoAgency.set = function() { return true; };
|
||||
global.ArangoAgency.write = function() { return true; };
|
||||
global.ArangoAgency.increaseVersion = function() { return true; };
|
||||
global.ArangoAgency.get = function(path) {
|
||||
let value = {};
|
||||
let pathSegments = path.split('/');
|
||||
let keyValue = 1;
|
||||
value.arango = pathSegments.reverse().reduce((v, key) => {
|
||||
let kv = {};
|
||||
kv[key] = v;
|
||||
return kv;
|
||||
}, keyValue);
|
||||
return value;
|
||||
};
|
||||
};
|
Loading…
Reference in New Issue