10000 Remove unused bindings (#7143) · temon/arangodb@c8961b2 · GitHub
[go: up one dir, main page]

Skip to content

Commit c8961b2

Browse files
graetzerjsteemann
authored andcommitted
Remove unused bindings (arangodb#7143)
1 parent 95ce366 commit c8961b2

File tree

2 files changed

+0
-214
lines changed

2 files changed

+0
-214
lines changed

arangod/V8Server/v8-collection.cpp

Lines changed: 0 additions & 179 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,177 +1009,6 @@ static void JS_FiguresVocbaseCol(
10091009
TRI_V8_TRY_CATCH_END
10101010
}
10111011

1012-
////////////////////////////////////////////////////////////////////////////////
1013-
/// @brief was docuBlock assumeLeadership
1014-
////////////////////////////////////////////////////////////////////////////////
1015-
1016-
static void JS_SetTheLeader(v8::FunctionCallbackInfo<v8::Value> const& args) {
1017-
TRI_V8_TRY_CATCH_BEGIN(isolate);
1018-
v8::HandleScope scope(isolate);
1019-
auto& vocbase = GetContextVocBase(isolate);
1020-
1021-
if (vocbase.isDropped()) {
1022-
TRI_V8_THROW_EXCEPTION(TRI_ERROR_ARANGO_DATABASE_NOT_FOUND);
1023-
}
1024-
1025-
if (ServerState::instance()->isDBServer()) {
1026-
auto* v8Collection = UnwrapCollection(args.Holder());
1027-
1028-
if (!v8Collection) {
1029-
TRI_V8_THROW_EXCEPTION_INTERNAL("cannot extract collection");
1030-
}
1031-
1032-
auto& collectionName = v8Collection->name();
1033-
auto collection = v8Collection->vocbase().lookupCollection(collectionName);
1034-
1035-
if (collection == nullptr) {
1036-
TRI_V8_THROW_EXCEPTION(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
1037-
}
1038-
1039-
std::string theLeader;
1040-
1041-
if (args.Length() >= 1 && args[0]->IsString()) {
1042-
TRI_Utf8ValueNFC l(args[0]);
1043-
theLeader = std::string(*l, l.length());
1044-
}
1045-
1046-
collection->followers()->setTheLeader(theLeader);
1047-
1048-
if (theLeader.empty()) {
1049-
collection->followers()->clear();
1050-
}
1051-
// do not reset followers when we resign at this time...we are
1052-
// still the only source of truth to trust, in particular, in the
1053-
// planned leader resignation, we will shortly after the call to
1054-
// this function here report the controlled resignation to the
1055-
// agency. This report must still contain the correct follower list
1056-
// or else the supervision is super angry with us.
1057-
}
1058-
1059-
TRI_V8_RETURN_UNDEFINED();
1060-
TRI_V8_TRY_CATCH_END
1061-
}
1062-
1063-
////////////////////////////////////////////////////////////////////////////////
1064-
/// @brief was docuBlock getLeader
1065-
////////////////////////////////////////////////////////////////////////////////
1066-
1067-
static void JS_GetLeader(v8::FunctionCallbackInfo<v8::Value> const& args) {
1068-
TRI_V8_TRY_CATCH_BEGIN(isolate);
1069-
v8::HandleScope scope(isolate);
1070-
auto& vocbase = GetContextVocBase(isolate);
1071-
1072-
if (vocbase.isDropped()) {
1073-
TRI_V8_THROW_EXCEPTION(TRI_ERROR_ARANGO_DATABASE_NOT_FOUND);
1074-
}
1075-
1076-
std::string theLeader;
1077-
if (ServerState::instance()->isDBServer()) {
1078-
auto* collection = UnwrapCollection(args.Holder());
1079-
1080-
if (!collection) {
1081-
TRI_V8_THROW_EXCEPTION_INTERNAL("cannot extract collection");
1082-
}
1083-
1084-
auto& collectionName = collection->name();
1085-
auto realCollection =
1086-
collection->vocbase().lookupCollection(collectionName);
1087-
1088-
if (realCollection == nullptr) {
1089-
TRI_V8_THROW_EXCEPTION(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
1090-
}
1091-
1092-
theLeader = realCollection->followers()->getLeader();
1093-
}
1094-
1095-
v8::Handle<v8::String> res = TRI_V8_STD_STRING(isolate, theLeader);
1096-
TRI_V8_RETURN(res);
1097-
TRI_V8_TRY_CATCH_END
1098-
}
1099-
1100-
////////////////////////////////////////////////////////////////////////////////
1101-
/// @brief was docuBlock removeFollower
1102-
////////////////////////////////////////////////////////////////////////////////
1103-
1104-
static void JS_RemoveFollower(v8::FunctionCallbackInfo<v8::Value> const& args) {
1105-
TRI_V8_TRY_CATCH_BEGIN(isolate);
1106-
v8::HandleScope scope(isolate);
1107-
auto& vocbase = GetContextVocBase(isolate);
1108-
1109-
if (vocbase.isDropped()) {
1110-
TRI_V8_THROW_EXCEPTION(TRI_ERROR_ARANGO_DATABASE_NOT_FOUND);
1111-
}
1112-
1113-
if (args.Length() < 1) {
1114-
TRI_V8_THROW_EXCEPTION_USAGE("removeFollower(<name>)");
1115-
}
1116-
1117-
ServerID const serverId = TRI_ObjectToString(args[0]);
1118-
1119-
if (ServerState::instance()->isDBServer()) {
1120-
auto* v8Collection = UnwrapCollection(args.Holder());
1121-
1122-
if (!v8Collection) {
1123-
TRI_V8_THROW_EXCEPTION_INTERNAL("cannot extract collection");
1124-
}
1125-
1126-
auto& collectionName = v8Collection->name();
1127-
auto collection = v8Collection->vocbase().lookupCollection(collectionName);
1128-
1129-
if (collection == nullptr) {
1130-
TRI_V8_THROW_EXCEPTION(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
1131-
}
1132-
1133-
collection->followers()->remove(serverId);
1134-
}
1135-
1136-
TRI_V8_RETURN_TRUE();
1137-
TRI_V8_TRY_CATCH_END
1138-
}
1139-
1140-
////////////////////////////////////////////////////////////////////////////////
1141-
F438 /// @brief was docuBlock getFollowers
1142-
////////////////////////////////////////////////////////////////////////////////
1143-
1144-
static void JS_GetFollowers(v8::FunctionCallbackInfo<v8::Value> const& args) {
1145-
TRI_V8_TRY_CATCH_BEGIN(isolate);
1146-
v8::HandleScope scope(isolate);
1147-
1148-
auto& vocbase = GetContextVocBase(isolate);
1149-
1150-
if (vocbase.isDropped()) {
1151-
TRI_V8_THROW_EXCEPTION(TRI_ERROR_ARANGO_DATABASE_NOT_FOUND);
1152-
}
1153-
1154-
v8::Handle<v8::Array> list = v8::Array::New(isolate);
1155-
1156-
if (ServerState::instance()->isDBServer()) {
1157-
auto* v8Collection = UnwrapCollection(args.Holder());
1158-
1159-
if (!v8Collection) {
1160-
TRI_V8_THROW_EXCEPTION_INTERNAL("cannot extract collection");
1161-
}
1162-
1163-
auto& collectionName = v8Collection->name();
1164-
auto collection = v8Collection->vocbase().lookupCollection(collectionName);
1165-
1166-
if (collection == nullptr) {
1167-
TRI_V8_THROW_EXCEPTION(TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND);
1168-
}
1169-
1170-
std::unique_ptr<arangodb::FollowerInfo> const& followerInfo = collection->followers();
1171-
std::shared_ptr<std::vector<ServerID> const> followers = followerInfo->get();
1172-
uint32_t i = 0;
1173-
1174-
for (auto const& n : *followers) {
1175-
list->Set(i++, TRI_V8_STD_STRING(isolate, n));
1176-
}
1177-
}
1178-
1179-
TRI_V8_RETURN(list);
1180-
TRI_V8_TRY_CATCH_END
1181-
}
1182-
11831012
////////////////////////////////////////////////////////////////////////////////
11841013
/// @brief was docuBlock collectionLoad
11851014
////////////////////////////////////////////////////////////////////////////////
@@ -2732,14 +2561,6 @@ void TRI_InitV8Collections(v8::Handle<v8::Context> context,
27322561
JS_InsertVocbaseCol);
27332562
TRI_AddMethodVocbase(isolate, rt, TRI_V8_ASCII_STRING(isolate, "_binaryInsert"),
27342563
JS_BinaryInsertVocbaseCol);
2735-
TRI_AddMethodVocbase(isolate, rt, TRI_V8_ASCII_STRING(isolate, "setTheLeader"),
2736-
JS_SetTheLeader, true);
2737-
TRI_AddMethodVocbase(isolate, rt, TRI_V8_ASCII_STRING(isolate, "getLeader"),
2738-
JS_GetLeader, true);
2739-
TRI_AddMethodVocbase(isolate, rt, TRI_V8_ASCII_STRING(isolate, "removeFollower"),
2740-
JS_RemoveFollower, true);
2741-
TRI_AddMethodVocbase(isolate, rt, TRI_V8_ASCII_STRING(isolate, "getFollowers"),
2742-
JS_GetFollowers, true);
27432564
TRI_AddMethodVocbase(isolate, rt, TRI_V8_ASCII_STRING(isolate, "globallyUniqueId"),
27442565
JS_GloballyUniqueIdVocbaseCol);
27452566
TRI_AddMethodVocbase(isolate, rt, TRI_V8_ASCII_STRING(isolate, "load"),

js/server/modules/@arangodb/cluster.js

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -496,40 +496,6 @@ function queryAgencyJob(id) {
496496
return {error: true, errorMsg: "Did not find job.", id, job: null};
497497
}
498498

499-
function getLocalInfo () {
500-
var ret = {};
501-
var db = require('internal').db;
502-
var database = '_system';
503-
ret.result = {};
504-
db._collections().forEach(
505-
function(col) {
506-
507-
var name = col.name();
508-
if (name.charAt(0)!=='_') {
509-
var data = {
510-
id: col._id, name, type: col.type(), status: col.status(),
511-
planId: col.planId(), theLeader: col.getLeader()
512-
};
513-
514-
// merge properties
515-
var properties = col.properties(), p;
516-
for (p in properties) {
517-
if (properties.hasOwnProperty(p)) {
518-
data[p] = properties[p];
519-
}
520-
}
521-
522-
data.indexes = [];
523-
524-
col.getIndexes().forEach( function(index) {
525-
data.indexes.push(index);
526-
});
527-
ret.result[name] = data;
528-
}
529-
});
530-
return ret;
531-
}
532-
533499
exports.coordinatorId = coordinatorId;
534500
exports.isCluster = isCluster;
535501
exports.isCoordinator = isCoordinator;
@@ -546,4 +512,3 @@ exports.supervisionState = supervisionState;
546512
exports.waitForSyncRepl = waitForSyncRepl;
547513
exports.endpoints = endpoints;
548514
exports.queryAgencyJob = queryAgencyJob;
549-
exports.getLocalInfo = getLocalInfo;

0 commit comments

Comments
 (0)
0