1
0
Fork 0

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

This commit is contained in:
hkernbach 2016-02-08 18:20:54 +01:00
commit ae68725a5f
8 changed files with 78 additions and 60 deletions

View File

@ -27,11 +27,11 @@ They use the ful spectrum of ArangoDBs graph features. You may access them via s
- [AQL Graph traversals](../Aql/GraphTraversals.md) on both named and anonymous graphs
- [AQL operations on named Graphs](../Aql/GraphOperations.md)
- [AQL operations on raw vertex & edge collections](../Aql/GraphFunctions.md)
- [the RESTful General Graph interface](../HttpGharial/README.md)
- [The javascript General Graph implementation, as you may use it in FOXX Services](../GeneralGraphs/README.md)
* [Graph Management](../GeneralGraphs/Management.md)
* [Graph Functions](../GeneralGraphs/Functions.md)
* [Fluent Query Interface](../GeneralGraphs/FluentAQLInterface.md)
* [Graph Management](../GeneralGraphs/Management.md); creating & manipualating graph definitions; inserting, updating and deleting vertices and edges into graphs
* [Graph Functions](../GeneralGraphs/Functions.md) for working with edges and vertices, to analyze them and their relations
* [Fluent Query Interface](../GeneralGraphs/FluentAQLInterface.md); if you like to work with graphs via a [fluent interface](https://en.wikipedia.org/wiki/Fluent_interface)
- [the RESTful General Graph interface](../HttpGharial/README.md) used to implement graph management in client drivers
!SUBSUBSECTION Manipulating collections of named graphs with regular document functions

View File

@ -67,12 +67,14 @@ static std::string StateNames[] = {
"instantiating plan", // PLAN_INSTANTIATION
"optimizing plan", // PLAN_OPTIMIZATION
"executing", // EXECUTION
"finalizing" // FINALIZATION
"finalizing", // FINALIZATION
"invalid" // INVALID
};
// make sure the state strings and the actual states match
static_assert(sizeof(StateNames) / sizeof(std::string) ==
static_cast<size_t>(ExecutionState::INVALID_STATE),
static_cast<size_t>(ExecutionState::INVALID_STATE) + 1,
"invalid number of ExecutionState values");
////////////////////////////////////////////////////////////////////////////////

View File

@ -110,6 +110,10 @@ struct Profile {
////////////////////////////////////////////////////////////////////////////////
class Query {
private:
Query(Query const&) = delete;
Query& operator=(Query const&) = delete;
public:
Query(arangodb::ApplicationV8*, bool, TRI_vocbase_t*, char const*, size_t,
struct TRI_json_t*, struct TRI_json_t*, QueryPart);

View File

@ -201,7 +201,6 @@ void RestCursorHandler::processQuery(VPackSlice const& slice) {
}
arangodb::JsonCursor* cursor = cursors->createFromVelocyPack(
builder, batchSize, extra, ttl, count, queryResult.cached);
queryResult.json = nullptr;
try {
_response->body().appendChar('{');

View File

@ -1469,7 +1469,7 @@ void TRI_replication_applier_t::toVelocyPack(VPackBuilder& builder) const {
// add server info
builder.add("server", VPackValue(VPackValueType::Object));
builder.add("version", VPackValue(TRI_VERSION));
builder.add("serverId", VPackValue(TRI_StringUInt64(TRI_GetIdServer())));
builder.add("serverId", VPackValue(std::to_string(TRI_GetIdServer())));
builder.close(); // server
if (config._endpoint != nullptr) {

View File

@ -329,6 +329,10 @@ function readImportantLogLines(logPath) {
/// # and know the PID plus the process name for later use.
/// kernel.core_uses_pid = 1
/// kernel.core_pattern = /var/tmp/core-%e-%p-%t
///
/// If you set coreDirectory to empty, this behavior is changed: The core file
/// expected to be named simply "core" and should exist in the current
/// directory.
////////////////////////////////////////////////////////////////////////////////
function analyzeCoreDump(instanceInfo, options, storeArangodPath, pid) {
@ -340,7 +344,12 @@ function analyzeCoreDump(instanceInfo, options, storeArangodPath, pid) {
command += "echo quit;";
command += "sleep 2";
command += ") | gdb " + storeArangodPath + " ";
command += options.coreDirectory + "/*core*" + pid + '*';
if (options.coreDirectory === "") {
command += "core";
} else {
command += options.coreDirectory + "/*core*" + pid + '*';
}
const args = ['-c', command];
print(JSON.stringify(args));
@ -408,9 +417,12 @@ function checkInstanceAliveSingleServer(instanceInfo, options) {
print("Core dump written; copying arangod to " +
instanceInfo.tmpDataDir + " for later analysis.");
let corePath = (options.coreDirectory === "") ?
"core" :
options.coreDirectory + "/core*" + instanceInfo.pid.pid + "*'";
res.gdbHint = "Run debugger with 'gdb " +
storeArangodPath + " " + options.coreDirectory +
"/core*" + instanceInfo.pid.pid + "*'";
storeArangodPath + " " + corePath;
if (require("internal").platform.substr(0, 3) === 'win') {
// Windows: wait for procdump to do its job...

View File

@ -46,17 +46,36 @@ Exception::Exception(int code, char const* file, int line)
_file(file),
_line(line),
_code(code) {
#ifdef TRI_ENABLE_MAINTAINER_MODE
#if HAVE_BACKTRACE
if (WithBackTrace) {
_errorMessage += std::string("\n\n");
TRI_GetBacktrace(_errorMessage);
_errorMessage += std::string("\n\n");
}
#endif
#endif
appendLocation();
}
////////////////////////////////////////////////////////////////////////////////
/// @brief constructor, for creating an exception with an already created
/// error message (normally based on error templates containing %s, %d etc.)
////////////////////////////////////////////////////////////////////////////////
Exception::Exception(int code, std::string const& errorMessage,
char const* file, int line)
: _errorMessage(errorMessage), _file(file), _line(line), _code(code) {
appendLocation();
}
////////////////////////////////////////////////////////////////////////////////
/// @brief constructor, for creating an exception with an already created
/// error message (normally based on error templates containing %s, %d etc.)
////////////////////////////////////////////////////////////////////////////////
Exception::Exception(int code, char const* errorMessage, char const* file,
int line)
: _errorMessage(errorMessage), _file(file), _line(line), _code(code) {
appendLocation();
}
Exception::~Exception() throw() {}
////////////////////////////////////////////////////////////////////////////////
/// @brief returns the error message
////////////////////////////////////////////////////////////////////////////////
@ -75,52 +94,32 @@ int Exception::code() const throw() { return _code; }
void Exception::addToMessage(std::string const& more) { _errorMessage += more; }
////////////////////////////////////////////////////////////////////////////////
/// @brief constructor, for creating an exception with an already created
/// error message (normally based on error templates containing %s, %d etc.)
////////////////////////////////////////////////////////////////////////////////
Exception::Exception(int code, std::string const& errorMessage,
char const* file, int line)
: _errorMessage(errorMessage), _file(file), _line(line), _code(code) {
#ifdef TRI_ENABLE_MAINTAINER_MODE
#if HAVE_BACKTRACE
if (WithBackTrace) {
_errorMessage += std::string("\n\n");
TRI_GetBacktrace(_errorMessage);
_errorMessage += std::string("\n\n");
}
#endif
#endif
}
////////////////////////////////////////////////////////////////////////////////
/// @brief constructor, for creating an exception with an already created
/// error message (normally based on error templates containing %s, %d etc.)
////////////////////////////////////////////////////////////////////////////////
Exception::Exception(int code, char const* errorMessage, char const* file,
int line)
: _errorMessage(errorMessage), _file(file), _line(line), _code(code) {
#ifdef TRI_ENABLE_MAINTAINER_MODE
#if HAVE_BACKTRACE
if (WithBackTrace) {
_errorMessage += std::string("\n\n");
TRI_GetBacktrace(_errorMessage);
_errorMessage += std::string("\n\n");
}
#endif
#endif
}
Exception::~Exception() throw() {}
////////////////////////////////////////////////////////////////////////////////
/// @brief return exception message
////////////////////////////////////////////////////////////////////////////////
char const* Exception::what() const throw() { return _errorMessage.c_str(); }
////////////////////////////////////////////////////////////////////////////////
/// @brief append original error location to message
////////////////////////////////////////////////////////////////////////////////
void Exception::appendLocation () {
if (_code == TRI_ERROR_INTERNAL) {
_errorMessage += std::string(" (location: ") + _file + ":" + std::to_string(_line) + "). Please report this error to arangodb.com";
}
#ifdef TRI_ENABLE_MAINTAINER_MODE
#if HAVE_BACKTRACE
if (WithBackTrace) {
_errorMessage += std::string("\n\n");
TRI_GetBacktrace(_errorMessage);
_errorMessage += std::string("\n\n");
}
#endif
#endif
}
////////////////////////////////////////////////////////////////////////////////
/// @brief construct an error message from a template string
////////////////////////////////////////////////////////////////////////////////

View File

@ -100,6 +100,8 @@ class Exception : public virtual std::exception {
std::string message() const throw();
int code() const throw();
void addToMessage(std::string const&);
private:
void appendLocation ();
protected:
std::string _errorMessage;