1
0
Fork 0

Merge branch 'devel' of github.com:arangodb/arangodb into devel

This commit is contained in:
hkernbach 2015-11-17 13:10:53 +01:00
commit bb814f1c5d
6 changed files with 30 additions and 40 deletions

View File

@ -440,8 +440,6 @@ static bool Compactifier (TRI_df_marker_t const* marker,
if (marker->_type == TRI_DOC_MARKER_KEY_DOCUMENT || if (marker->_type == TRI_DOC_MARKER_KEY_DOCUMENT ||
marker->_type == TRI_DOC_MARKER_KEY_EDGE) { marker->_type == TRI_DOC_MARKER_KEY_EDGE) {
bool deleted;
TRI_doc_document_key_marker_t const* d = reinterpret_cast<TRI_doc_document_key_marker_t const*>(marker); TRI_doc_document_key_marker_t const* d = reinterpret_cast<TRI_doc_document_key_marker_t const*>(marker);
TRI_voc_key_t key = (char*) d + d->_offsetKey; TRI_voc_key_t key = (char*) d + d->_offsetKey;
@ -449,7 +447,7 @@ static bool Compactifier (TRI_df_marker_t const* marker,
auto primaryIndex = document->primaryIndex(); auto primaryIndex = document->primaryIndex();
auto found = static_cast<TRI_doc_mptr_t const*>(primaryIndex->lookupKey(key)); auto found = static_cast<TRI_doc_mptr_t const*>(primaryIndex->lookupKey(key));
deleted = (found == nullptr || found->_rid > d->_rid); bool deleted = (found == nullptr || found->_rid > d->_rid);
if (deleted) { if (deleted) {
LOG_TRACE("found a stale document: %s", key); LOG_TRACE("found a stale document: %s", key);

View File

@ -1157,13 +1157,14 @@ int TRI_replication_applier_t::start (TRI_voc_tick_t initialTick,
syncer.release(); syncer.release();
if (useTick) { if (useTick) {
LOG_INFO("started replication applier for database '%s' from tick %llu", LOG_INFO("started replication applier for database '%s', endpoint '%s' from tick %llu",
_databaseName.c_str(), _databaseName.c_str(),
_configuration._endpoint,
(unsigned long long) initialTick); (unsigned long long) initialTick);
} }
else { else {
LOG_INFO("re-started replication applier for database '%s'", LOG_INFO("re-started replication applier for database '%s', endpoint '%s'",
_databaseName.c_str()); _databaseName.c_str(), _configuration._endpoint);
} }
return TRI_ERROR_NO_ERROR; return TRI_ERROR_NO_ERROR;

View File

@ -1210,7 +1210,7 @@ int main (int argc, char* argv[]) {
} }
if (TickStart < TickEnd) { if (TickStart < TickEnd) {
cerr << "invalid values for --tick-start or --tick-end" << endl; cerr << "Error: invalid values for --tick-start or --tick-end" << endl;
TRI_EXIT_FUNCTION(EXIT_FAILURE, nullptr); TRI_EXIT_FUNCTION(EXIT_FAILURE, nullptr);
} }
@ -1242,12 +1242,12 @@ int main (int argc, char* argv[]) {
if (OutputDirectory.empty() || if (OutputDirectory.empty() ||
(TRI_ExistsFile(OutputDirectory.c_str()) && ! isDirectory)) { (TRI_ExistsFile(OutputDirectory.c_str()) && ! isDirectory)) {
cerr << "cannot write to output directory '" << OutputDirectory << "'" << endl; cerr << "Error: cannot write to output directory '" << OutputDirectory << "'" << endl;
TRI_EXIT_FUNCTION(EXIT_FAILURE, nullptr); TRI_EXIT_FUNCTION(EXIT_FAILURE, nullptr);
} }
if (isDirectory && ! isEmptyDirectory && ! Overwrite) { if (isDirectory && ! isEmptyDirectory && ! Overwrite) {
cerr << "output directory '" << OutputDirectory << "' already exists. use \"--overwrite true\" to overwrite data in it" << endl; cerr << "Error: output directory '" << OutputDirectory << "' already exists. use \"--overwrite true\" to overwrite data in it" << endl;
TRI_EXIT_FUNCTION(EXIT_FAILURE, nullptr); TRI_EXIT_FUNCTION(EXIT_FAILURE, nullptr);
} }
@ -1276,11 +1276,6 @@ int main (int argc, char* argv[]) {
Client = new SimpleHttpClient(Connection, BaseClient.requestTimeout(), false); Client = new SimpleHttpClient(Connection, BaseClient.requestTimeout(), false);
if (Client == nullptr) {
cerr << "out of memory" << endl;
TRI_EXIT_FUNCTION(EXIT_FAILURE, nullptr);
}
Client->setLocationRewriter(0, &rewriteLocation); Client->setLocationRewriter(0, &rewriteLocation);
Client->setUserNamePassword("/", BaseClient.username(), BaseClient.password()); Client->setUserNamePassword("/", BaseClient.username(), BaseClient.password());
@ -1301,7 +1296,7 @@ int main (int argc, char* argv[]) {
int minor = 0; int minor = 0;
if (sscanf(versionString.c_str(), "%d.%d", &major, &minor) != 2) { if (sscanf(versionString.c_str(), "%d.%d", &major, &minor) != 2) {
cerr << "invalid server version '" << versionString << "'" << endl; cerr << "Error: invalid server version '" << versionString << "'" << endl;
TRI_EXIT_FUNCTION(EXIT_FAILURE, nullptr); TRI_EXIT_FUNCTION(EXIT_FAILURE, nullptr);
} }
@ -1309,7 +1304,7 @@ int main (int argc, char* argv[]) {
major > 2 || major > 2 ||
(major == 1 && minor < 4)) { (major == 1 && minor < 4)) {
// we can connect to 1.4, 2.0 and higher only // we can connect to 1.4, 2.0 and higher only
cerr << "got incompatible server version '" << versionString << "'" << endl; cerr << "Error: got incompatible server version '" << versionString << "'" << endl;
if (! Force) { if (! Force) {
TRI_EXIT_FUNCTION(EXIT_FAILURE, nullptr); TRI_EXIT_FUNCTION(EXIT_FAILURE, nullptr);
} }
@ -1320,7 +1315,7 @@ int main (int argc, char* argv[]) {
clusterMode = GetArangoIsCluster(); clusterMode = GetArangoIsCluster();
if (clusterMode) { if (clusterMode) {
if (TickStart != 0 || TickEnd != 0) { if (TickStart != 0 || TickEnd != 0) {
cerr << "cannot use tick-start or tick-end on a cluster" << endl; cerr << "Error: cannot use tick-start or tick-end on a cluster" << endl;
TRI_EXIT_FUNCTION(EXIT_FAILURE, nullptr); TRI_EXIT_FUNCTION(EXIT_FAILURE, nullptr);
} }
} }
@ -1339,7 +1334,7 @@ int main (int argc, char* argv[]) {
int res = TRI_CreateDirectory(OutputDirectory.c_str(),systemError, errorMessage); int res = TRI_CreateDirectory(OutputDirectory.c_str(),systemError, errorMessage);
if (res != TRI_ERROR_NO_ERROR) { if (res != TRI_ERROR_NO_ERROR) {
cerr << "unable to create output directory '" << OutputDirectory << "': " << errorMessage << endl; cerr << "Error: unable to create output directory '" << OutputDirectory << "': " << errorMessage << endl;
TRI_EXIT_FUNCTION(EXIT_FAILURE, nullptr); TRI_EXIT_FUNCTION(EXIT_FAILURE, nullptr);
} }
} }
@ -1378,11 +1373,11 @@ int main (int argc, char* argv[]) {
} }
} }
catch (std::exception const& ex) { catch (std::exception const& ex) {
cerr << "caught exception " << ex.what() << endl; cerr << "Error: caught exception " << ex.what() << endl;
res = TRI_ERROR_INTERNAL; res = TRI_ERROR_INTERNAL;
} }
catch (...) { catch (...) {
cerr << "caught unknown exception" << endl; cerr << "Error: caught unknown exception" << endl;
res = TRI_ERROR_INTERNAL; res = TRI_ERROR_INTERNAL;
} }
@ -1398,7 +1393,9 @@ int main (int argc, char* argv[]) {
} }
if (res != TRI_ERROR_NO_ERROR) { if (res != TRI_ERROR_NO_ERROR) {
cerr << errorMsg << endl; if (! errorMsg.empty()) {
cerr << "Error: " << errorMsg << endl;
}
ret = EXIT_FAILURE; ret = EXIT_FAILURE;
} }

View File

@ -915,12 +915,12 @@ int main (int argc, char* argv[]) {
// ............................................................................. // .............................................................................
if (InputDirectory == "" || ! TRI_IsDirectory(InputDirectory.c_str())) { if (InputDirectory == "" || ! TRI_IsDirectory(InputDirectory.c_str())) {
cerr << "input directory '" << InputDirectory << "' does not exist" << endl; cerr << "Error: input directory '" << InputDirectory << "' does not exist" << endl;
TRI_EXIT_FUNCTION(EXIT_FAILURE, nullptr); TRI_EXIT_FUNCTION(EXIT_FAILURE, nullptr);
} }
if (! ImportStructure && ! ImportData) { if (! ImportStructure && ! ImportData) {
cerr << "must specify either --create-collection or --import-data" << endl; cerr << "Error: must specify either --create-collection or --import-data" << endl;
TRI_EXIT_FUNCTION(EXIT_FAILURE, nullptr); TRI_EXIT_FUNCTION(EXIT_FAILURE, nullptr);
} }
@ -931,7 +931,7 @@ int main (int argc, char* argv[]) {
BaseClient.createEndpoint(); BaseClient.createEndpoint();
if (BaseClient.endpointServer() == nullptr) { if (BaseClient.endpointServer() == nullptr) {
cerr << "invalid value for --server.endpoint ('" << BaseClient.endpointString() << "')" << endl; cerr << "Error: invalid value for --server.endpoint ('" << BaseClient.endpointString() << "')" << endl;
TRI_EXIT_FUNCTION(EXIT_FAILURE, nullptr); TRI_EXIT_FUNCTION(EXIT_FAILURE, nullptr);
} }
@ -941,18 +941,8 @@ int main (int argc, char* argv[]) {
ArangoClient::DEFAULT_RETRIES, ArangoClient::DEFAULT_RETRIES,
BaseClient.sslProtocol()); BaseClient.sslProtocol());
if (Connection == nullptr) {
cerr << "out of memory" << endl;
TRI_EXIT_FUNCTION(EXIT_FAILURE, nullptr);
}
Client = new SimpleHttpClient(Connection, BaseClient.requestTimeout(), false); Client = new SimpleHttpClient(Connection, BaseClient.requestTimeout(), false);
if (Client == nullptr) {
cerr << "out of memory" << endl;
TRI_EXIT_FUNCTION(EXIT_FAILURE, nullptr);
}
Client->setLocationRewriter(nullptr, &rewriteLocation); Client->setLocationRewriter(nullptr, &rewriteLocation);
Client->setUserNamePassword("/", BaseClient.username(), BaseClient.password()); Client->setUserNamePassword("/", BaseClient.username(), BaseClient.password());
@ -995,7 +985,7 @@ int main (int argc, char* argv[]) {
int minor = 0; int minor = 0;
if (sscanf(versionString.c_str(), "%d.%d", &major, &minor) != 2) { if (sscanf(versionString.c_str(), "%d.%d", &major, &minor) != 2) {
cerr << "invalid server version '" << versionString << "'" << endl; cerr << "Error: invalid server version '" << versionString << "'" << endl;
TRI_EXIT_FUNCTION(EXIT_FAILURE, nullptr); TRI_EXIT_FUNCTION(EXIT_FAILURE, nullptr);
} }
@ -1003,7 +993,7 @@ int main (int argc, char* argv[]) {
major > 2 || major > 2 ||
(major == 1 && minor < 4)) { (major == 1 && minor < 4)) {
// we can connect to 1.4, 2.0 and higher only // we can connect to 1.4, 2.0 and higher only
cerr << "got incompatible server version '" << versionString << "'" << endl; cerr << "Error: got incompatible server version '" << versionString << "'" << endl;
if (! Force) { if (! Force) {
TRI_EXIT_FUNCTION(EXIT_FAILURE, nullptr); TRI_EXIT_FUNCTION(EXIT_FAILURE, nullptr);
} }
@ -1027,11 +1017,11 @@ int main (int argc, char* argv[]) {
res = ProcessInputDirectory(errorMsg); res = ProcessInputDirectory(errorMsg);
} }
catch (std::exception const& ex) { catch (std::exception const& ex) {
cerr << "caught exception " << ex.what() << endl; cerr << "Error: caught exception " << ex.what() << endl;
res = TRI_ERROR_INTERNAL; res = TRI_ERROR_INTERNAL;
} }
catch (...) { catch (...) {
cerr << "caught unknown exception" << endl; cerr << "Error: caught unknown exception" << endl;
res = TRI_ERROR_INTERNAL; res = TRI_ERROR_INTERNAL;
} }
@ -1049,7 +1039,9 @@ int main (int argc, char* argv[]) {
if (res != TRI_ERROR_NO_ERROR) { if (res != TRI_ERROR_NO_ERROR) {
cerr << errorMsg << endl; if (! errorMsg.empty()) {
cerr << "Error: " << errorMsg << endl;
}
ret = EXIT_FAILURE; ret = EXIT_FAILURE;
} }

View File

@ -598,6 +598,7 @@ function processQuery (query, explain) {
if ([ "EnumerateCollectionNode", if ([ "EnumerateCollectionNode",
"EnumerateListNode", "EnumerateListNode",
"IndexRangeNode", "IndexRangeNode",
"IndexNode",
"SubqueryNode" ].indexOf(node.type) !== -1) { "SubqueryNode" ].indexOf(node.type) !== -1) {
level++; level++;
} }

View File

@ -597,6 +597,7 @@ function processQuery (query, explain) {
if ([ "EnumerateCollectionNode", if ([ "EnumerateCollectionNode",
"EnumerateListNode", "EnumerateListNode",
"IndexRangeNode", "IndexRangeNode",
"IndexNode",
"SubqueryNode" ].indexOf(node.type) !== -1) { "SubqueryNode" ].indexOf(node.type) !== -1) {
level++; level++;
} }