1
0
Fork 0

Merge branch 'devel' of github.com:triAGENS/ArangoDB into devel

This commit is contained in:
Michael Hackstein 2013-11-20 09:35:38 +01:00
commit 38ec615b7f
36 changed files with 283 additions and 319 deletions

View File

@ -1,6 +1,35 @@
v1.5.x (XXXX-XX-XX)
-------------------
* simplified ArangoDB startup options
Some startup options are now superfluous or their usage is simplified. The
following options have been changed:
* `--javascript.modules-path`: this option has been removed. The modules paths
are determined by arangod and arangosh automatically based on the value of
`--javascript.startup-directory`.
If the option is set on startup, it is ignored so startup will not abort with
an error `unrecognized option`.
* `--javascript.action-directory`: this option has been removed. The actions
directory is determined by arangod automatically based on the value of
`--javascript.startup-directory`.
If the option is set on startup, it is ignored so startup will not abort with
an error `unrecognized option`.
* `--javascript.package-path`: this option is still available but it is not
required anymore to set the standard package paths (e.g. `js/npm`). arangod
will automatically use this standard package path regardless of whether it
was specified via the options.
It is possible to use this option to add additional package paths to the
standard value.
Configuration files included with arangod are adjusted accordingly.
* layout of the graphs tab adapted to better fit with the other tabs
* database selection is moved to the bottom right corner of the web interface

View File

@ -29,6 +29,7 @@ set(BIN_ARANGOIMP arangoimp)
set(BIN_ARANGOIRB arangoirb)
set(BIN_ARANGORESTORE arangorestore)
set(BIN_ARANGOSH arangosh)
set(BIN_CHECK_SERVER check-server)
set(SCRIPT_ARANGO_DFDB arango-dfdb)
set(SCRIPT_FOXX_MANAGER foxx-manager)

View File

@ -155,7 +155,7 @@ The configuration file will be installed in
The database will be installed in
/var/lib/arangodb
/usr/local/var/lib/arangodb
The ArangoShell will be installed in

View File

@ -225,8 +225,6 @@ you can skip this section.
* `server.endpoint`: what IP address and port to bind to,
* `log` parameters: if and where to log
* `database.directory`: path the database files are stored in
* `javascript.action-directory` and `javascript.modules-path`: where to
look for Javascript files
If the configuration reveals something is not configured right, the config
file should be adjusted and the server be restarted.
@ -570,8 +568,6 @@ Use `--help` to get a list of command-line options:
--javascript.check <string> syntax check code Javascript code from file
--javascript.execute <string> execute Javascript code from file
--javascript.execute-string <string> execute Javascript code from string
--javascript.modules-path <string> one or more directories separated by semi-colons
--javascript.package-path <string> one or more directories separated by semi-colons
--javascript.startup-directory <string> startup paths containing the JavaScript files
--javascript.unit-tests <string> do not start as shell, run unit tests instead
--jslint <string> do not start as shell, run jslint instead

View File

@ -224,7 +224,8 @@ bin_SCRIPTS =
### @brief uninstalled programs
################################################################################
noinst_PROGRAMS =
noinst_PROGRAMS = \
bin/check-server
################################################################################
### @brief ruby additions

View File

@ -108,11 +108,9 @@ SERVER_OPT := \
--configuration none \
--database.maximal-journal-size 1048576 \
--database.force-sync-properties false \
--javascript.action-directory @top_srcdir@/js/actions \
--javascript.app-path @top_srcdir@/js/apps \
--javascript.gc-interval 1 \
--javascript.modules-path @top_srcdir@/js/server/modules\;@top_srcdir@/js/common/modules\;@top_srcdir@/js/node \
--javascript.package-path @top_srcdir@/js/npm\;@top_srcdir@/js/common/test-data/modules \
--javascript.package-path @top_srcdir@/js/common/test-data/modules \
--javascript.startup-directory @top_srcdir@/js \
--log.file "" \
--ruby.action-directory @top_srcdir@/mr/actions \
@ -123,7 +121,6 @@ SERVER_OPT := \
CLIENT_OPT := \
--configuration none \
--javascript.startup-directory @top_srcdir@/js \
--javascript.modules-path @top_srcdir@/js/client/modules\;@top_srcdir@/js/common/modules\;@top_srcdir@/js/node \
--javascript.package-path @top_srcdir@/js/common/test-data/modules \
--no-colors \
--quiet

View File

@ -8,10 +8,7 @@ threads = 4
# maximal-journal-size 1048576
[javascript]
action-directory = .\js\actions
modules-path = .\js\server\modules;.\js\common\modules;.\js\node
app-path = .\js\apps
package-path = .\js\npm
startup-directory = .\js
[scheduler]

View File

@ -6,5 +6,3 @@ disable-authentication = true
[javascript]
startup-directory = .\js
modules-path = .\js\client\modules;.\js\common\modules;.\js\node
package-path = .\js\npm

View File

@ -75,8 +75,6 @@ add_executable(
HashIndex/hash-index.c
IndexIterators/index-iterator.c
IndexOperators/index-operator.c
PriorityQueue/pqueueindex.c
PriorityQueue/priorityqueue.c
Replication/replication-static.cpp
Replication/ContinuousSyncer.cpp
Replication/InitialSyncer.cpp
@ -121,7 +119,6 @@ add_executable(
VocBase/replication-logger.c
VocBase/replication-master.c
VocBase/server.c
VocBase/shape-collection.c
VocBase/synchroniser.c
VocBase/transaction.c
VocBase/update-policy.c

View File

@ -45,6 +45,26 @@ using namespace triagens::rest;
using namespace triagens::arango;
using namespace triagens::httpclient;
// -----------------------------------------------------------------------------
// --SECTION-- private defines
// -----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
/// @brief write-lock the status
////////////////////////////////////////////////////////////////////////////////
#define WRITE_LOCK_STATUS(applier) \
while (! TRI_TryWriteLockReadWriteLock(&(applier->_statusLock))) { \
usleep(1000); \
}
////////////////////////////////////////////////////////////////////////////////
/// @brief write-unlock the status
////////////////////////////////////////////////////////////////////////////////
#define WRITE_UNLOCK_STATUS(applier) \
TRI_WriteUnlockReadWriteLock(&(applier->_statusLock))
// -----------------------------------------------------------------------------
// --SECTION-- constructors and destructors
// -----------------------------------------------------------------------------
@ -118,9 +138,9 @@ int ContinuousSyncer::run () {
uint64_t connectRetries = 0;
// reset failed connects
TRI_WriteLockReadWriteLock(&_applier->_statusLock);
WRITE_LOCK_STATUS(_applier);
_applier->_state._failedConnects = 0;
TRI_WriteUnlockReadWriteLock(&_applier->_statusLock);
WRITE_UNLOCK_STATUS(_applier);
while (_vocbase->_state < 2) {
setProgress("fetching master state information");
@ -131,11 +151,11 @@ int ContinuousSyncer::run () {
// master error. try again after a sleep period
connectRetries++;
TRI_WriteLockReadWriteLock(&_applier->_statusLock);
WRITE_LOCK_STATUS(_applier);
_applier->_state._failedConnects = connectRetries;
_applier->_state._totalRequests++;
_applier->_state._totalFailedConnects++;
TRI_WriteUnlockReadWriteLock(&_applier->_statusLock);
WRITE_UNLOCK_STATUS(_applier);
if (connectRetries <= _configuration._maxConnectRetries) {
// check if we are aborted externally
@ -153,12 +173,12 @@ int ContinuousSyncer::run () {
}
if (res == TRI_ERROR_NO_ERROR) {
TRI_WriteLockReadWriteLock(&_applier->_statusLock);
WRITE_LOCK_STATUS(_applier);
res = getLocalState(errorMsg);
_applier->_state._failedConnects = 0;
_applier->_state._totalRequests++;
TRI_WriteUnlockReadWriteLock(&_applier->_statusLock);
WRITE_UNLOCK_STATUS(_applier);
}
if (res != TRI_ERROR_NO_ERROR) {
@ -664,7 +684,7 @@ int ContinuousSyncer::applyLogMarker (TRI_json_t const* json,
if (! tick.empty()) {
TRI_voc_tick_t newTick = (TRI_voc_tick_t) StringUtils::uint64(tick.c_str(), tick.size());
TRI_WriteLockReadWriteLock(&_applier->_statusLock);
WRITE_LOCK_STATUS(_applier);
if (newTick > _applier->_state._lastProcessedContinuousTick) {
_applier->_state._lastProcessedContinuousTick = newTick;
}
@ -673,7 +693,7 @@ int ContinuousSyncer::applyLogMarker (TRI_json_t const* json,
(unsigned long long) newTick,
(unsigned long long) _applier->_state._lastProcessedContinuousTick);
}
TRI_WriteUnlockReadWriteLock(&_applier->_statusLock);
WRITE_UNLOCK_STATUS(_applier);
}
// handle marker type
@ -812,11 +832,11 @@ int ContinuousSyncer::applyLog (SimpleHttpResult* response,
if (updateTick) {
// update tick value
TRI_WriteLockReadWriteLock(&_applier->_statusLock);
WRITE_LOCK_STATUS(_applier);
if (_applier->_state._lastProcessedContinuousTick > _applier->_state._lastAppliedContinuousTick) {
_applier->_state._lastAppliedContinuousTick = _applier->_state._lastProcessedContinuousTick;
}
TRI_WriteUnlockReadWriteLock(&_applier->_statusLock);
WRITE_UNLOCK_STATUS(_applier);
}
}
}
@ -834,7 +854,7 @@ int ContinuousSyncer::runContinuousSync (string& errorMsg) {
// ---------------------------------------
TRI_voc_tick_t fromTick = 0;
TRI_WriteLockReadWriteLock(&_applier->_statusLock);
WRITE_LOCK_STATUS(_applier);
if (_useTick) {
// use user-defined tick
@ -850,7 +870,7 @@ int ContinuousSyncer::runContinuousSync (string& errorMsg) {
}
}
TRI_WriteUnlockReadWriteLock(&_applier->_statusLock);
WRITE_UNLOCK_STATUS(_applier);
if (fromTick == 0) {
return TRI_ERROR_REPLICATION_NO_START_TICK;
@ -873,11 +893,11 @@ int ContinuousSyncer::runContinuousSync (string& errorMsg) {
sleepTime = 30 * 1000 * 1000;
connectRetries++;
TRI_WriteLockReadWriteLock(&_applier->_statusLock);
WRITE_LOCK_STATUS(_applier);
_applier->_state._failedConnects = connectRetries;
_applier->_state._totalRequests++;
_applier->_state._totalFailedConnects++;
TRI_WriteUnlockReadWriteLock(&_applier->_statusLock);
WRITE_UNLOCK_STATUS(_applier);
if (connectRetries > _configuration._maxConnectRetries) {
// halt
@ -887,10 +907,10 @@ int ContinuousSyncer::runContinuousSync (string& errorMsg) {
else {
connectRetries = 0;
TRI_WriteLockReadWriteLock(&_applier->_statusLock);
WRITE_LOCK_STATUS(_applier);
_applier->_state._failedConnects = connectRetries;
_applier->_state._totalRequests++;
TRI_WriteUnlockReadWriteLock(&_applier->_statusLock);
WRITE_UNLOCK_STATUS(_applier);
if (res != TRI_ERROR_NO_ERROR) {
// some other error we will not ignore
@ -1031,9 +1051,9 @@ int ContinuousSyncer::followMasterLog (string& errorMsg,
if (found) {
tick = StringUtils::uint64(header);
TRI_WriteLockReadWriteLock(&_applier->_statusLock);
WRITE_LOCK_STATUS(_applier);
_applier->_state._lastAvailableContinuousTick = tick;
TRI_WriteUnlockReadWriteLock(&_applier->_statusLock);
WRITE_UNLOCK_STATUS(_applier);
}
}
}
@ -1046,9 +1066,9 @@ int ContinuousSyncer::followMasterLog (string& errorMsg,
if (res == TRI_ERROR_NO_ERROR) {
TRI_ReadLockReadWriteLock(&_applier->_statusLock);
WRITE_LOCK_STATUS(_applier);
TRI_voc_tick_t lastAppliedTick = _applier->_state._lastAppliedContinuousTick;
TRI_ReadUnlockReadWriteLock(&_applier->_statusLock);
WRITE_UNLOCK_STATUS(_applier);
uint64_t processedMarkers = 0;
res = applyLog(response, errorMsg, processedMarkers, ignoreCount);
@ -1056,13 +1076,13 @@ int ContinuousSyncer::followMasterLog (string& errorMsg,
if (processedMarkers > 0) {
worked = true;
TRI_WriteLockReadWriteLock(&_applier->_statusLock);
WRITE_LOCK_STATUS(_applier);
_applier->_state._totalEvents += processedMarkers;
if (_applier->_state._lastAppliedContinuousTick != lastAppliedTick) {
saveApplierState();
}
TRI_WriteUnlockReadWriteLock(&_applier->_statusLock);
WRITE_UNLOCK_STATUS(_applier);
}
}

View File

@ -51,6 +51,12 @@ using namespace triagens::basics;
using namespace triagens::arango;
using namespace std;
////////////////////////////////////////////////////////////////////////////////
/// @brief we'll store deprecated config option values in here
////////////////////////////////////////////////////////////////////////////////
static std::string DeprecatedPath;
// -----------------------------------------------------------------------------
// --SECTION-- class V8GcThread
// -----------------------------------------------------------------------------
@ -553,13 +559,14 @@ void ApplicationV8::setupOptions (map<string, basics::ProgramOptionsDescription>
options["JAVASCRIPT Options:help-admin"]
("javascript.gc-interval", &_gcInterval, "JavaScript request-based garbage collection interval (each x requests)")
("javascript.gc-frequency", &_gcFrequency, "JavaScript time-based garbage collection frequency (each x seconds)")
("javascript.action-directory", &_actionPath, "path to the JavaScript action directory")
("javascript.app-path", &_appPath, "directory for Foxx applications (normal mode)")
("javascript.dev-app-path", &_devAppPath, "directory for Foxx applications (development mode)")
("javascript.modules-path", &_modulesPath, "one or more directories separated by semi-colons")
("javascript.package-path", &_packagePath, "one or more directories separated by semi-colons")
("javascript.startup-directory", &_startupPath, "path to the directory containing JavaScript startup scripts")
("javascript.v8-options", &_v8Options, "options to pass to v8")
// deprecated options
("javascript.action-directory", &DeprecatedPath, "path to the JavaScript action directory (deprecated)")
("javascript.modules-path", &DeprecatedPath, "one or more directories separated by semi-colons (deprecated)")
;
}
@ -568,20 +575,20 @@ void ApplicationV8::setupOptions (map<string, basics::ProgramOptionsDescription>
////////////////////////////////////////////////////////////////////////////////
bool ApplicationV8::prepare () {
// check the startup modules
if (_modulesPath.empty()) {
LOG_FATAL_AND_EXIT("no 'javascript.modules-path' has been supplied, giving up");
}
// set up the startup loader
// check the startup path
if (_startupPath.empty()) {
LOG_FATAL_AND_EXIT("no 'javascript.startup-directory' has been supplied, giving up");
}
// set the actions path
if (_useActions && _actionPath.empty()) {
LOG_FATAL_AND_EXIT("no 'javascript.action-directory' has been supplied, giving up");
}
// remove trailing / from path
_startupPath = StringUtils::trim(_startupPath, TRI_DIR_SEPARATOR_STR);
// derive all other options from --javascript.startup-directory
_actionPath = _startupPath + TRI_DIR_SEPARATOR_STR + "actions";
_modulesPath = _startupPath + TRI_DIR_SEPARATOR_STR + "server" + TRI_DIR_SEPARATOR_STR + "modules;" +
_startupPath + TRI_DIR_SEPARATOR_STR + "common" + TRI_DIR_SEPARATOR_STR + "modules;" +
_startupPath + TRI_DIR_SEPARATOR_STR + "node";
// dump paths
{
@ -589,10 +596,7 @@ bool ApplicationV8::prepare () {
paths.push_back(string("startup '" + _startupPath + "'"));
paths.push_back(string("modules '" + _modulesPath + "'"));
if (! _packagePath.empty()) {
paths.push_back(string("packages '" + _packagePath + "'"));
}
paths.push_back(string("packages '" + _packagePath + "'"));
if (_useActions) {
paths.push_back(string("actions '" + _actionPath + "'"));
@ -614,12 +618,6 @@ bool ApplicationV8::prepare () {
LOG_FATAL_AND_EXIT("no value has been specified for --javascript.app-path.");
}
if (_packagePath.empty()) {
LOG_ERROR("--javascript.package-path option was not specified. this may cause follow-up errors.");
// TODO: decide if we want to abort server start here
}
_startupLoader.setDirectory(_startupPath);
@ -760,7 +758,7 @@ bool ApplicationV8::prepareV8Instance (const size_t i) {
TRI_InitV8Buffer(context->_context);
TRI_InitV8Conversions(context->_context);
TRI_InitV8Utils(context->_context, _modulesPath, _packagePath, _startupPath);
TRI_InitV8Utils(context->_context, _startupPath, _modulesPath, _packagePath);
TRI_InitV8Shell(context->_context);
{

View File

@ -371,12 +371,12 @@ namespace triagens {
struct TRI_server_s* _server;
////////////////////////////////////////////////////////////////////////////////
/// @brief path to the directory containing alternate startup scripts
/// @brief path to the directory containing the startup scripts
///
/// @CMDOPT{\--javascript.directory @CA{directory}}
/// @CMDOPT{\--javascript.startup-directory @CA{directory}}
///
/// Specifies the @CA{directory} path to the JavaScript files used for
/// bootstraping. Multiple paths can be specified separated with commas.
/// bootstraping.
////////////////////////////////////////////////////////////////////////////////
string _startupPath;
@ -384,16 +384,14 @@ namespace triagens {
////////////////////////////////////////////////////////////////////////////////
/// @brief semicolon separated list of module directories
///
/// @CMDOPT{\--javascript.modules-path @CA{directory}}
///
/// Specifies the @CA{directory} paths where the JavaScript modules are located.
/// Multiple paths can be specified separated with commas.
/// This variable is automatically set based on the value of
/// `--javascript.startup-directory`.
////////////////////////////////////////////////////////////////////////////////
string _modulesPath;
////////////////////////////////////////////////////////////////////////////////
/// @brief semicolon separated list of module directories
/// @brief semicolon separated list of package directories
///
/// @CMDOPT{\--javascript.package-path @CA{directory}}
///
@ -406,10 +404,8 @@ namespace triagens {
////////////////////////////////////////////////////////////////////////////////
/// @brief path to the system action directory
///
/// @CMDOPT{\--javascript.action-directory @CA{directory}}
///
/// Specifies the @CA{directory} containg the JavaScript files describing the
/// system actions. Multiple paths can be specified separated with commas.
/// This variable is automatically set based on the value of
/// `--javascript.startup-directory`.
////////////////////////////////////////////////////////////////////////////////
string _actionPath;

View File

@ -1181,7 +1181,10 @@ static bool TryLockCompaction (TRI_vocbase_t* vocbase) {
////////////////////////////////////////////////////////////////////////////////
static void LockCompaction (TRI_vocbase_t* vocbase) {
TRI_WriteLockReadWriteLock(&vocbase->_compactionBlockers._lock);
while (! TryLockCompaction(vocbase)) {
// cycle until we have acquired the write-lock
usleep(1000);
}
}
////////////////////////////////////////////////////////////////////////////////

View File

@ -1211,6 +1211,7 @@ int TRI_WriteElementDatafile (TRI_datafile_t* datafile,
type != TRI_DF_MARKER_FOOTER &&
type != TRI_COL_MARKER_HEADER) {
#ifdef TRI_ENABLE_MAINTAINER_MODE
// check _tick value of marker and set min/max tick values for datafile
if (tick <= datafile->_tickMin || tick <= (TRI_voc_tick_t) datafile->_fid) {
LOG_WARNING("logic error. invalid tick value %llu encountered when writing marker of type %d into datafile '%s'. "
@ -1229,6 +1230,7 @@ int TRI_WriteElementDatafile (TRI_datafile_t* datafile,
datafile->getName(datafile),
(unsigned long long) datafile->_tickMax);
}
#endif
// set data tick values (for documents and edge markers)
if (type == TRI_DOC_MARKER_KEY_DOCUMENT ||

View File

@ -763,6 +763,13 @@ static int DumpCollection (TRI_replication_dump_t* dump,
}
ptr += TRI_DF_ALIGN_BLOCK(marker->_size);
if (marker->_type == TRI_DF_MARKER_ATTRIBUTE ||
marker->_type == TRI_DF_MARKER_SHAPE) {
// fully ignore these marker types. they don't need to be replicated,
// but we also cannot stop iteration if we find one of these
continue;
}
// get the marker's tick and check whether we should include it
foundTick = marker->_tick;
@ -777,7 +784,7 @@ static int DumpCollection (TRI_replication_dump_t* dump,
hasMore = false;
goto NEXT_DF;
}
if (marker->_type != TRI_DOC_MARKER_KEY_DOCUMENT &&
marker->_type != TRI_DOC_MARKER_KEY_EDGE &&
marker->_type != TRI_DOC_MARKER_KEY_DELETION) {

View File

@ -62,6 +62,36 @@
#define DATABASE_MANAGER_INTERVAL (500 * 1000)
////////////////////////////////////////////////////////////////////////////////
/// @brief eventually acquire a write-lock on the databases
////////////////////////////////////////////////////////////////////////////////
#define WRITE_LOCK_DATABASES(server) \
while (! TRI_TryWriteLockReadWriteLock(&server->_databasesLock)) { \
usleep(1000); \
}
////////////////////////////////////////////////////////////////////////////////
/// @brief write-unlock the databases
////////////////////////////////////////////////////////////////////////////////
#define WRITE_UNLOCK_DATABASES(server) \
TRI_WriteUnlockReadWriteLock(&server->_databasesLock)
////////////////////////////////////////////////////////////////////////////////
/// @brief read-lock the databases
////////////////////////////////////////////////////////////////////////////////
#define READ_LOCK_DATABASES(server) \
TRI_ReadLockReadWriteLock(&server->_databasesLock)
////////////////////////////////////////////////////////////////////////////////
/// @brief read-unlock the databases
////////////////////////////////////////////////////////////////////////////////
#define READ_UNLOCK_DATABASES(server) \
TRI_ReadUnlockReadWriteLock(&server->_databasesLock)
// -----------------------------------------------------------------------------
// --SECTION-- private variables
// -----------------------------------------------------------------------------
@ -823,7 +853,8 @@ static int OpenDatabases (TRI_server_t* server,
static int CloseDatabases (TRI_server_t* server) {
size_t i, n;
TRI_WriteLockReadWriteLock(&server->_databasesLock);
WRITE_LOCK_DATABASES(server);
n = server->_databases._nrAlloc;
for (i = 0; i < n; ++i) {
@ -838,7 +869,7 @@ static int CloseDatabases (TRI_server_t* server) {
}
}
TRI_WriteUnlockReadWriteLock(&server->_databasesLock);
WRITE_UNLOCK_DATABASES(server);
return TRI_ERROR_NO_ERROR;
}
@ -1405,7 +1436,7 @@ static void DatabaseManager (void* data) {
// check if we have to drop some database
database = NULL;
TRI_ReadLockReadWriteLock(&server->_databasesLock);
READ_LOCK_DATABASES(server);
n = server->_droppedDatabases._length;
@ -1420,8 +1451,8 @@ static void DatabaseManager (void* data) {
database = (TRI_vocbase_t*) TRI_RemoveVectorPointer(&server->_droppedDatabases, i);
break;
}
TRI_ReadUnlockReadWriteLock(&server->_databasesLock);
READ_UNLOCK_DATABASES(server);
if (database != NULL) {
// remember the database path
@ -1978,7 +2009,7 @@ int TRI_CreateDatabaseServer (TRI_server_t* server,
TRI_LockMutex(&server->_createLock);
TRI_ReadLockReadWriteLock(&server->_databasesLock);
READ_LOCK_DATABASES(server);
n = server->_databases._nrAlloc;
for (i = 0; i < n; ++i) {
@ -1987,7 +2018,7 @@ int TRI_CreateDatabaseServer (TRI_server_t* server,
if (vocbase != NULL) {
if (TRI_EqualString(name, vocbase->_name)) {
// name already in use
TRI_ReadUnlockReadWriteLock(&server->_databasesLock);
READ_UNLOCK_DATABASES(server);
TRI_UnlockMutex(&server->_createLock);
return TRI_ERROR_ARANGO_DUPLICATE_NAME;
@ -1996,7 +2027,7 @@ int TRI_CreateDatabaseServer (TRI_server_t* server,
}
// name not yet in use, release the read lock
TRI_ReadUnlockReadWriteLock(&server->_databasesLock);
READ_UNLOCK_DATABASES(server);
// create the database directory
tick = TRI_NewTickServer();
@ -2045,10 +2076,10 @@ int TRI_CreateDatabaseServer (TRI_server_t* server,
// increase reference counter
TRI_UseVocBase(vocbase);
TRI_WriteLockReadWriteLock(&server->_databasesLock);
WRITE_LOCK_DATABASES(server);
TRI_InsertKeyAssociativePointer(&server->_databases, vocbase->_name, vocbase, false);
TRI_WriteUnlockReadWriteLock(&server->_databasesLock);
WRITE_UNLOCK_DATABASES(server);
TRI_UnlockMutex(&server->_createLock);
@ -2071,11 +2102,11 @@ int TRI_DropDatabaseServer (TRI_server_t* server,
return TRI_ERROR_FORBIDDEN;
}
TRI_WriteLockReadWriteLock(&server->_databasesLock);
WRITE_LOCK_DATABASES(server);
if (TRI_ReserveVectorPointer(&server->_droppedDatabases, 1) != TRI_ERROR_NO_ERROR) {
// we need space for one more element
TRI_WriteUnlockReadWriteLock(&server->_databasesLock);
WRITE_UNLOCK_DATABASES(server);
return TRI_ERROR_OUT_OF_MEMORY;
}
@ -2108,7 +2139,7 @@ int TRI_DropDatabaseServer (TRI_server_t* server,
}
}
TRI_WriteUnlockReadWriteLock(&server->_databasesLock);
WRITE_UNLOCK_DATABASES(server);
return res;
}
@ -2122,7 +2153,7 @@ TRI_vocbase_t* TRI_UseDatabaseServer (TRI_server_t* server,
char const* name) {
TRI_vocbase_t* vocbase;
TRI_ReadLockReadWriteLock(&server->_databasesLock);
READ_LOCK_DATABASES(server);
vocbase = TRI_LookupByKeyAssociativePointer(&server->_databases, name);
@ -2132,8 +2163,8 @@ TRI_vocbase_t* TRI_UseDatabaseServer (TRI_server_t* server,
// if we got here, no one else can have deleted the database
assert(result == true);
}
TRI_ReadUnlockReadWriteLock(&server->_databasesLock);
READ_UNLOCK_DATABASES(server);
return vocbase;
}
@ -2163,7 +2194,7 @@ int TRI_GetUserDatabasesServer (TRI_server_t* server,
res = TRI_ERROR_NO_ERROR;
TRI_ReadLockReadWriteLock(&server->_databasesLock);
READ_LOCK_DATABASES(server);
n = server->_databases._nrAlloc;
for (i = 0; i < n; ++i) {
@ -2194,7 +2225,8 @@ int TRI_GetUserDatabasesServer (TRI_server_t* server,
}
}
}
TRI_ReadUnlockReadWriteLock(&server->_databasesLock);
READ_UNLOCK_DATABASES(server);
SortDatabaseNames(names);
@ -2213,7 +2245,7 @@ int TRI_GetDatabaseNamesServer (TRI_server_t* server,
res = TRI_ERROR_NO_ERROR;
TRI_ReadLockReadWriteLock(&server->_databasesLock);
READ_LOCK_DATABASES(server);
n = server->_databases._nrAlloc;
for (i = 0; i < n; ++i) {
@ -2239,7 +2271,8 @@ int TRI_GetDatabaseNamesServer (TRI_server_t* server,
}
}
}
TRI_ReadUnlockReadWriteLock(&server->_databasesLock);
READ_UNLOCK_DATABASES(server);
SortDatabaseNames(names);

View File

@ -64,7 +64,7 @@ static int const SYNCHRONISER_INTERVAL = (100 * 1000);
/// @brief checks if a file needs to be synced
////////////////////////////////////////////////////////////////////////////////
static bool CheckSyncDocumentCollection (TRI_document_collection_t* doc) {
static bool CheckSyncDocumentCollection (TRI_document_collection_t* document) {
TRI_collection_t* base;
TRI_datafile_t* journal;
bool ok;
@ -75,7 +75,7 @@ static bool CheckSyncDocumentCollection (TRI_document_collection_t* doc) {
size_t n;
worked = false;
base = &doc->base.base;
base = &document->base.base;
// .............................................................................
// the only thread MODIFYING the _journals variable is this thread,
@ -93,18 +93,16 @@ static bool CheckSyncDocumentCollection (TRI_document_collection_t* doc) {
continue;
}
TRI_LOCK_JOURNAL_ENTRIES_DOC_COLLECTION(doc);
synced = journal->_synced;
TRI_LOCK_JOURNAL_ENTRIES_DOC_COLLECTION(document);
synced = journal->_synced;
written = journal->_written;
TRI_UNLOCK_JOURNAL_ENTRIES_DOC_COLLECTION(doc);
TRI_UNLOCK_JOURNAL_ENTRIES_DOC_COLLECTION(document);
if (synced < written) {
worked = true;
ok = journal->sync(journal, synced, written);
TRI_LOCK_JOURNAL_ENTRIES_DOC_COLLECTION(doc);
TRI_LOCK_JOURNAL_ENTRIES_DOC_COLLECTION(document);
if (ok) {
journal->_synced = written;
@ -113,11 +111,11 @@ static bool CheckSyncDocumentCollection (TRI_document_collection_t* doc) {
journal->_state = TRI_DF_STATE_WRITE_ERROR;
}
TRI_BROADCAST_JOURNAL_ENTRIES_DOC_COLLECTION(doc);
TRI_UNLOCK_JOURNAL_ENTRIES_DOC_COLLECTION(doc);
TRI_BROADCAST_JOURNAL_ENTRIES_DOC_COLLECTION(document);
TRI_UNLOCK_JOURNAL_ENTRIES_DOC_COLLECTION(document);
if (ok) {
LOG_TRACE("msync succeeded %p, size %lu", synced, (unsigned long)(written - synced));
LOG_TRACE("msync succeeded %p, size %lu", synced, (unsigned long) (written - synced));
}
else {
LOG_ERROR("msync failed with: %s", TRI_last_error());
@ -152,7 +150,6 @@ static bool CheckJournalDocumentCollection (TRI_document_collection_t* document)
// .............................................................................
TRI_LOCK_JOURNAL_ENTRIES_DOC_COLLECTION(document);
n = base->_journals._length;
for (i = 0; i < n;) {

View File

@ -212,6 +212,9 @@ static bool UnregisterCollection (TRI_vocbase_t* vocbase,
assert(collection->_name != NULL);
TRI_WRITE_LOCK_COLLECTIONS_VOCBASE(vocbase);
// pre-condition
TRI_ASSERT_MAINTAINER(vocbase->_collectionsByName._nrUsed == vocbase->_collectionsById._nrUsed);
// only if we find the collection by its id, we can delete it by name
if (TRI_RemoveKeyAssociativePointer(&vocbase->_collectionsById, &collection->_cid) != NULL) {
@ -220,6 +223,7 @@ static bool UnregisterCollection (TRI_vocbase_t* vocbase,
TRI_RemoveKeyAssociativePointer(&vocbase->_collectionsByName, collection->_name);
}
// post-condition
TRI_ASSERT_MAINTAINER(vocbase->_collectionsByName._nrUsed == vocbase->_collectionsById._nrUsed);
TRI_WRITE_UNLOCK_COLLECTIONS_VOCBASE(vocbase);
@ -577,7 +581,7 @@ static TRI_vocbase_col_t* AddCollection (TRI_vocbase_t* vocbase,
}
if (res != TRI_ERROR_NO_ERROR) {
// OOM. this might have happend AFTER insertion
// OOM. this might have happened AFTER insertion
TRI_RemoveKeyAssociativePointer(&vocbase->_collectionsByName, name);
TRI_Free(TRI_UNKNOWN_MEM_ZONE, collection);
TRI_set_errno(res);
@ -822,6 +826,8 @@ static int RenameCollection (TRI_vocbase_t* vocbase,
// this shouldn't fail, as we removed an element above so adding one should be ok
found = TRI_InsertKeyAssociativePointer(&vocbase->_collectionsByName, newName, CONST_CAST(collection), false);
assert(found == NULL);
TRI_ASSERT_MAINTAINER(vocbase->_collectionsByName._nrUsed == vocbase->_collectionsById._nrUsed);
TRI_WRITE_UNLOCK_COLLECTIONS_VOCBASE(vocbase);
@ -1547,11 +1553,11 @@ void TRI_DestroyVocBase (TRI_vocbase_t* vocbase) {
// stop replication
TRI_StopReplicationApplier(vocbase->_replicationApplier, false);
TRI_StopReplicationLogger(vocbase->_replicationLogger);
TRI_InitVectorPointer(&collections, TRI_UNKNOWN_MEM_ZONE);
TRI_WRITE_LOCK_COLLECTIONS_VOCBASE(vocbase);
// cannot use this vocbase from now on
TRI_CopyDataVectorPointer(&collections, &vocbase->_collections);
TRI_WRITE_UNLOCK_COLLECTIONS_VOCBASE(vocbase);
@ -1754,7 +1760,10 @@ TRI_json_t* TRI_InventoryCollectionsVocBase (TRI_vocbase_t* vocbase,
TRI_InitVectorPointer(&collections, TRI_CORE_MEM_ZONE);
TRI_WriteLockReadWriteLock(&vocbase->_inventoryLock);
while (! TRI_TryWriteLockReadWriteLock(&vocbase->_inventoryLock)) {
// cycle on write-lock
usleep(1000);
}
// copy collection pointers into vector so we can work with the copy without
// the global lock

View File

@ -246,6 +246,27 @@ install(
REGEX "^.*/common/tests$" EXCLUDE
REGEX "^.*/client/tests$" EXCLUDE)
################################################################################
### @brief check-server
################################################################################
add_executable(
${BIN_CHECK_SERVER}
V8Client/V8ClientConnection.cpp
V8Client/check-server.cpp
)
target_link_libraries(
${BIN_CHECK_SERVER}
${LIB_ARANGO_V8}
${LIB_ARANGO_CLIENT}
${LIB_ARANGO}
${V8_LIBS}
${ICU_LIBS}
${ZLIB_LIBS}
${OPENSSL_LIBS}
)
## -----------------------------------------------------------------------------
## --SECTION-- END-OF-FILE
## -----------------------------------------------------------------------------

View File

@ -1,8 +1,8 @@
# -*- mode: Makefile; -*-
################################################################################
## -----------------------------------------------------------------------------
## --SECTION-- PROGRAM
################################################################################
## -----------------------------------------------------------------------------
################################################################################
### @brief program "arangob"
@ -104,9 +104,28 @@ bin_arangosh_SOURCES = \
arangosh/V8Client/arangosh.cpp
################################################################################
## --SECTION-- END-OF-FILE
### @brief program "check-server"
################################################################################
bin_check_server_CPPFLAGS = \
-I@top_srcdir@/arangosh \
$(AM_CPPFLAGS)
bin_check_server_LDADD = \
lib/libarango_v8.a \
lib/libarango_client.a \
lib/libarango.a \
$(LIBS) \
@V8_LIBS@
bin_check_server_SOURCES = \
arangosh/V8Client/V8ClientConnection.cpp \
arangosh/V8Client/check-server.cpp
## -----------------------------------------------------------------------------
## --SECTION-- END-OF-FILE
## -----------------------------------------------------------------------------
## Local Variables:
## mode: outline-minor
## outline-regexp: "^\\(### @brief\\|## --SECTION--\\|# -\\*- \\)"

View File

@ -51,11 +51,6 @@ using namespace std;
// --SECTION-- constructors and destructors
// -----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
/// @addtogroup V8ClientConnection
/// @{
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/// @brief constructor
////////////////////////////////////////////////////////////////////////////////
@ -157,24 +152,15 @@ V8ClientConnection::~V8ClientConnection () {
}
}
////////////////////////////////////////////////////////////////////////////////
/// @}
////////////////////////////////////////////////////////////////////////////////
// -----------------------------------------------------------------------------
// --SECTION-- public functions
// -----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
/// @addtogroup V8ClientConnection
/// @{
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/// @brief request location rewriter (injects database name)
////////////////////////////////////////////////////////////////////////////////
string V8ClientConnection::rewriteLocation (void* data,
string V8ClientConnection::rewriteLocation (void* data,
const string& location) {
V8ClientConnection* c = static_cast<V8ClientConnection*>(data);
@ -374,19 +360,10 @@ v8::Handle<v8::Value> V8ClientConnection::patchData (std::string const& location
}
}
////////////////////////////////////////////////////////////////////////////////
/// @}
////////////////////////////////////////////////////////////////////////////////
// -----------------------------------------------------------------------------
// --SECTION-- private functions
// -----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
/// @addtogroup V8ClientConnection
/// @{
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/// @brief executes a request
////////////////////////////////////////////////////////////////////////////////
@ -396,7 +373,7 @@ v8::Handle<v8::Value> V8ClientConnection::requestData (HttpRequest::HttpRequestT
const char* body,
const size_t bodySize,
map<string, string> const& headerFields) {
_lastErrorMessage = "";
_lastHttpReturnCode = 0;
@ -634,9 +611,9 @@ v8::Handle<v8::Value> V8ClientConnection::requestDataRaw (HttpRequest::HttpReque
}
}
////////////////////////////////////////////////////////////////////////////////
/// @}
////////////////////////////////////////////////////////////////////////////////
// -----------------------------------------------------------------------------
// --SECTION-- END-OF-FILE
// -----------------------------------------------------------------------------
// Local Variables:
// mode: outline-minor

View File

@ -54,11 +54,6 @@ namespace triagens {
// --SECTION-- class V8ClientConnection
// -----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
/// @addtogroup ArangoDB
/// @{
////////////////////////////////////////////////////////////////////////////////
namespace triagens {
namespace v8client {
@ -71,19 +66,10 @@ namespace triagens {
V8ClientConnection (V8ClientConnection const&);
V8ClientConnection& operator= (V8ClientConnection const&);
////////////////////////////////////////////////////////////////////////////////
/// @}
////////////////////////////////////////////////////////////////////////////////
// -----------------------------------------------------------------------------
// --SECTION-- constructors and destructors
// -----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
/// @addtogroup ArangoDB
/// @{
////////////////////////////////////////////////////////////////////////////////
public:
////////////////////////////////////////////////////////////////////////////////
@ -105,19 +91,10 @@ namespace triagens {
~V8ClientConnection ();
////////////////////////////////////////////////////////////////////////////////
/// @}
////////////////////////////////////////////////////////////////////////////////
// -----------------------------------------------------------------------------
// --SECTION-- public methods
// -----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
/// @addtogroup ArangoDB
/// @{
////////////////////////////////////////////////////////////////////////////////
public:
////////////////////////////////////////////////////////////////////////////////
@ -293,19 +270,10 @@ namespace triagens {
map<string, string> const& headerFields,
bool raw);
////////////////////////////////////////////////////////////////////////////////
/// @}
////////////////////////////////////////////////////////////////////////////////
// -----------------------------------------------------------------------------
// --SECTION-- private functions
// -----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
/// @addtogroup V8ClientConnection
/// @{
////////////////////////////////////////////////////////////////////////////////
private:
////////////////////////////////////////////////////////////////////////////////
@ -330,7 +298,7 @@ namespace triagens {
////////////////////////////////////////////////////////////////////////////////
/// @brief handles a result
////////////////////////////////////////////////////////////////////////////////
v8::Handle<v8::Value> handleResult ();
////////////////////////////////////////////////////////////////////////////////
@ -342,19 +310,10 @@ namespace triagens {
std::string const& body,
map<string, string> const& headerFields);
////////////////////////////////////////////////////////////////////////////////
/// @}
////////////////////////////////////////////////////////////////////////////////
// -----------------------------------------------------------------------------
// --SECTION-- private variables
// -----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
/// @addtogroup V8ClientConnection
/// @{
////////////////////////////////////////////////////////////////////////////////
private:
////////////////////////////////////////////////////////////////////////////////
@ -402,10 +361,6 @@ namespace triagens {
}
}
////////////////////////////////////////////////////////////////////////////////
/// @}
////////////////////////////////////////////////////////////////////////////////
#endif
// -----------------------------------------------------------------------------

View File

@ -72,6 +72,12 @@ using namespace triagens::arango;
// --SECTION-- private variables
// -----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
/// @brief we'll store deprecated config option values in here
////////////////////////////////////////////////////////////////////////////////
static std::string DeprecatedPath;
////////////////////////////////////////////////////////////////////////////////
/// @brief base class for clients
////////////////////////////////////////////////////////////////////////////////
@ -117,7 +123,7 @@ static JSLoader StartupLoader;
static string StartupModules = "";
////////////////////////////////////////////////////////////////////////////////
/// @brief path for Node modules files
/// @brief path for JavaScript packages
////////////////////////////////////////////////////////////////////////////////
static string StartupPackages = "";
@ -434,11 +440,12 @@ static vector<string> ParseProgramOptions (int argc, char* argv[]) {
("javascript.execute-string", &ExecuteString, "execute Javascript code from string")
("javascript.check", &CheckScripts, "syntax check code Javascript code from file")
("javascript.gc-interval", &GcInterval, "JavaScript request-based garbage collection interval (each x commands)")
("javascript.modules-path", &StartupModules, "one or more directories separated by semi-colons")
("javascript.package-path", &StartupPackages, "one or more directories separated by semi-colons")
("javascript.startup-directory", &StartupPath, "startup paths containing the JavaScript files")
("javascript.unit-tests", &UnitTests, "do not start as shell, run unit tests instead")
("jslint", &JsLint, "do not start as shell, run jslint instead")
// deprecated options
("javascript.modules-path", &DeprecatedPath, "one or more directories separated by semi-colons (deprecated)")
;
#ifdef _WIN32
@ -479,10 +486,10 @@ static vector<string> ParseProgramOptions (int argc, char* argv[]) {
// set V8 options
v8::V8::SetFlagsFromCommandLine(&argc, argv, true);
// check module path
if (StartupModules.empty()) {
LOG_FATAL_AND_EXIT("module path not known, please use '--javascript.modules-path'");
}
// derive other paths from `--javascript.directory`
StartupModules = StartupPath + TRI_DIR_SEPARATOR_STR + "client" + TRI_DIR_SEPARATOR_STR + "modules;" +
StartupPath + TRI_DIR_SEPARATOR_STR + "common" + TRI_DIR_SEPARATOR_STR + "modules;" +
StartupPath + TRI_DIR_SEPARATOR_STR + "node";
// turn on paging automatically if "pager" option is set
if (options.has("pager") && ! options.has("use-pager")) {
@ -1814,7 +1821,7 @@ int main (int argc, char* argv[]) {
TRI_InitV8Buffer(context);
TRI_InitV8Utils(context, StartupModules, StartupPackages, StartupPath);
TRI_InitV8Utils(context, StartupPath, StartupModules, StartupPackages);
TRI_InitV8Shell(context);
// reset the prompt error flag (will determine prompt colors)

View File

@ -37,9 +37,6 @@ threads = 3
[javascript]
startup-directory = @PKGDATADIR@/js
action-directory = @PKGDATADIR@/js/actions
modules-path = @PKGDATADIR@/js/server/modules;@PKGDATADIR@/js/common/modules;@PKGDATADIR@/js/node
package-path = @PKGDATADIR@/js/npm
app-path = @PKGDATADIR@/js/apps
[ruby]

View File

@ -6,5 +6,3 @@ disable-authentication = true
[javascript]
startup-directory = @PKGDATADIR@/js
modules-path = @PKGDATADIR@/js/client/modules;@PKGDATADIR@/js/common/modules;@PKGDATADIR@/js/node
package-path = @PKGDATADIR@/js/npm

View File

@ -13,9 +13,6 @@ threads = 3
[javascript]
startup-directory = ./js
action-directory = ./js/actions
modules-path = ./js/server/modules;./js/common/modules;./js/node
package-path = ./js/npm
app-path = ./js/apps
[ruby]

View File

@ -5,5 +5,3 @@ disable-authentication = true
[javascript]
startup-directory = ./js
modules-path = ./js/client/modules;./js/common/modules;./js/node
package-path = ./js/npm

View File

@ -74,8 +74,6 @@ jslint:
--log.level error \
--server.password "" \
--javascript.startup-directory @srcdir@/js \
--javascript.modules-path "@srcdir@/js/client/modules;@srcdir@/js/common/modules;@srcdir@/js/node" \
--javascript.package-path "@srcdir@/js/npm;@srcdir@/js/common/test-data/modules" \
--jslint $$file; \
done

View File

@ -2,7 +2,7 @@
/*global exports, appCollection*/
////////////////////////////////////////////////////////////////////////////////
/// @brief A TODO-List Foxx-Application written for ArangoDB
/// @brief functionality to expose API documentation for Foxx apps
///
/// @file
///

View File

@ -37,11 +37,6 @@
// --SECTION-- constructors and destructors
// -----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
/// @addtogroup Threading
/// @{
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/// @brief initialises a new mutex
////////////////////////////////////////////////////////////////////////////////
@ -70,19 +65,10 @@ int TRI_DestroyMutex (TRI_mutex_t* mutex) {
return TRI_ERROR_NO_ERROR;
}
////////////////////////////////////////////////////////////////////////////////
/// @}
////////////////////////////////////////////////////////////////////////////////
// -----------------------------------------------------------------------------
// --SECTION-- public functions
// -----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
/// @addtogroup Threading
/// @{
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/// @brief locks mutex
////////////////////////////////////////////////////////////////////////////////
@ -124,10 +110,6 @@ void TRI_UnlockMutex (TRI_mutex_t* mutex) {
}
}
////////////////////////////////////////////////////////////////////////////////
/// @}
////////////////////////////////////////////////////////////////////////////////
// -----------------------------------------------------------------------------
// --SECTION-- SPIN
// -----------------------------------------------------------------------------
@ -136,11 +118,6 @@ void TRI_UnlockMutex (TRI_mutex_t* mutex) {
// --SECTION-- constructors and destructors
// -----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
/// @addtogroup Threading
/// @{
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/// @brief initialises a new spin
////////////////////////////////////////////////////////////////////////////////
@ -157,19 +134,10 @@ void TRI_DestroySpin (TRI_spin_t* spin) {
DeleteCriticalSection(spin);
}
////////////////////////////////////////////////////////////////////////////////
/// @}
////////////////////////////////////////////////////////////////////////////////
// -----------------------------------------------------------------------------
// --SECTION-- public functions
// -----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
/// @addtogroup Threading
/// @{
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/// @brief locks spin
////////////////////////////////////////////////////////////////////////////////
@ -186,10 +154,6 @@ void TRI_UnlockSpin (TRI_spin_t* spin) {
LeaveCriticalSection(spin);
}
////////////////////////////////////////////////////////////////////////////////
/// @}
////////////////////////////////////////////////////////////////////////////////
// -----------------------------------------------------------------------------
// --SECTION-- READ-WRITE LOCK
// -----------------------------------------------------------------------------
@ -198,11 +162,6 @@ void TRI_UnlockSpin (TRI_spin_t* spin) {
// --SECTION-- constructors and destructors
// -----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
/// @addtogroup Threading
/// @{
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/// @brief initialises a new read-write lock
////////////////////////////////////////////////////////////////////////////////
@ -218,28 +177,10 @@ void TRI_InitReadWriteLock (TRI_read_write_lock_t* lock) {
void TRI_DestroyReadWriteLock (TRI_read_write_lock_t* lock) {
}
////////////////////////////////////////////////////////////////////////////////
/// @}
////////////////////////////////////////////////////////////////////////////////
// -----------------------------------------------------------------------------
// --SECTION-- private functions
// -----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
/// @addtogroup Threading
/// @{
////////////////////////////////////////////////////////////////////////////////
// -----------------------------------------------------------------------------
// --SECTION-- public functions
// -----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
/// @addtogroup Threading
/// @{
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/// @brief tries to read lock a read-write lock
////////////////////////////////////////////////////////////////////////////////
@ -288,10 +229,6 @@ void TRI_WriteUnlockReadWriteLock (TRI_read_write_lock_t* lock) {
ReleaseSRWLockExclusive(&lock->_lock);
}
////////////////////////////////////////////////////////////////////////////////
/// @}
////////////////////////////////////////////////////////////////////////////////
// -----------------------------------------------------------------------------
// --SECTION-- CONDITION VARIABLE
// -----------------------------------------------------------------------------
@ -300,11 +237,6 @@ void TRI_WriteUnlockReadWriteLock (TRI_read_write_lock_t* lock) {
// --SECTION-- constructors and destructors
// -----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
/// @addtogroup Threading
/// @{
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/// @brief initialises a new condition variable
////////////////////////////////////////////////////////////////////////////////
@ -322,19 +254,10 @@ void TRI_DestroyCondition (TRI_condition_t* cond) {
DeleteCriticalSection(&cond->_lockWaiters);
}
////////////////////////////////////////////////////////////////////////////////
/// @}
////////////////////////////////////////////////////////////////////////////////
// -----------------------------------------------------------------------------
// --SECTION-- public functions
// -----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
/// @addtogroup Threading
/// @{
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/// @brief signals a condition variable
///
@ -476,10 +399,6 @@ bool TRI_ComparePointer(void* volatile* theValue, void* oldValue) {
#endif
////////////////////////////////////////////////////////////////////////////////
/// @}
////////////////////////////////////////////////////////////////////////////////
// Local Variables:
// mode: outline-minor
// outline-regexp: "/// @brief\\|/// {@inheritDoc}\\|/// @addtogroup\\|/// @page\\|// --SECTION--\\|/// @\\}"

View File

@ -40,11 +40,6 @@ extern "C" {
// --SECTION-- public types
// -----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
/// @addtogroup Threading
/// @{
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/// @brief mutex type
////////////////////////////////////////////////////////////////////////////////
@ -79,10 +74,6 @@ typedef struct TRI_condition_s {
}
TRI_condition_t;
////////////////////////////////////////////////////////////////////////////////
/// @}
////////////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
}
#endif

View File

@ -38,22 +38,22 @@ extern "C" {
// -----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
/// @addtogroup messages
/// @{
/// @brief bye bye message
////////////////////////////////////////////////////////////////////////////////
#define TRI_BYE_MESSAGE "Auf Wiedersehen! Bye Bye! Arrivederci! Na shledanou! Au revoir! ¡Hasta luego! Εις το επανιδείν! Adjö! До свидания! さようなら"
////////////////////////////////////////////////////////////////////////////////
/// @}
////////////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
}
#endif
#endif
// -----------------------------------------------------------------------------
// --SECTION-- END-OF-FILE
// -----------------------------------------------------------------------------
// Local Variables:
// mode: outline-minor
// outline-regexp: "/// @brief\\|/// {@inheritDoc}\\|/// @addtogroup\\|/// @page\\|// --SECTION--\\|/// @\\}"

View File

@ -81,11 +81,6 @@ add_library(
BasicsC/voc-mimetypes.c
BasicsC/tri-zip.c
JsonParser/json-parser.c
Logger/Logger.cpp
Logger/LoggerData.cpp
Logger/LoggerInfo.cpp
Logger/LoggerStream.cpp
Logger/LoggerTiming.cpp
ProgramOptions/program-options.c
Rest/AnyServer.cpp
Rest/EndpointList.cpp

View File

@ -2724,10 +2724,25 @@ v8::Handle<v8::Array> TRI_V8PathList (string const& modules) {
////////////////////////////////////////////////////////////////////////////////
void TRI_InitV8Utils (v8::Handle<v8::Context> context,
string const& startupPath,
string const& modules,
string const& packages,
string const& startupPath) {
string packages) {
v8::HandleScope scope;
// merge package-paths
// built-in package-path is first
string realPackages = startupPath + TRI_DIR_SEPARATOR_STR + "npm";
if (! packages.empty()) {
if (packages.substr(0, realPackages.size()) == realPackages) {
packages = packages.substr(realPackages.size());
}
packages = StringUtils::lTrim(packages, ";:");
if (! packages.empty()) {
realPackages += ";" + packages;
}
}
// check the isolate
v8::Isolate* isolate = v8::Isolate::GetCurrent();
@ -2817,7 +2832,7 @@ void TRI_InitV8Utils (v8::Handle<v8::Context> context,
TRI_AddGlobalVariableVocbase(context, "HOME", v8::String::New(FileUtils::homeDirectory().c_str()));
TRI_AddGlobalVariableVocbase(context, "MODULES_PATH", TRI_V8PathList(modules));
TRI_AddGlobalVariableVocbase(context, "PACKAGE_PATH", TRI_V8PathList(packages));
TRI_AddGlobalVariableVocbase(context, "PACKAGE_PATH", TRI_V8PathList(realPackages));
TRI_AddGlobalVariableVocbase(context, "STARTUP_PATH", v8::String::New(startupPath.c_str()));
TRI_AddGlobalVariableVocbase(context, "PATH_SEPARATOR", v8::String::New(TRI_DIR_SEPARATOR_STR));
TRI_AddGlobalVariableVocbase(context, "VALGRIND", RUNNING_ON_VALGRIND > 0 ? v8::True() : v8::False());

View File

@ -198,7 +198,7 @@ v8::Handle<v8::Array> TRI_V8PathList (std::string const&);
void TRI_InitV8Utils (v8::Handle<v8::Context>,
std::string const&,
std::string const&,
std::string const&);
std::string);
#endif

View File

@ -4,8 +4,6 @@
ARANGOD="${ARANGODB_ROOT}@SBINDIR@/arangod"
DATABASE="${ARANGODB_ROOT}@DATABASEDIR@"
MODULESPATH="${ARANGODB_ROOT}@PKGDATADIR@/js/server/modules;${ARANGODB_ROOT}@PKGDATADIR@/js/common/modules;${ARANGODB_ROOT}@PKGDATADIR@/js/node"
PACKAGEPATH="${ARANGODB_ROOT}@PKGDATADIR@/js/npm"
APPPATH="${ARANGODB_ROOT}@PKGDATADIR@/js/apps"
STARTUPPATH="${ARANGODB_ROOT}@PKGDATADIR@/js"
SCRIPT="${ARANGODB_ROOT}@PKGDATADIR@/js/server/arango-dfdb.js"
@ -41,7 +39,5 @@ $ARANGOD \
--no-upgrade \
--database.directory "$DATABASE" \
--javascript.startup-directory "$STARTUPPATH" \
--javascript.modules-path "$MODULESPATH" \
--javascript.package-path "$PACKAGEPATH" \
--javascript.app-path "$APPPATH" \
--javascript.script "$SCRIPT"