1
0
Fork 0

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

This commit is contained in:
Andreas Streichardt 2016-04-22 11:22:20 +02:00
commit 3f1b75c99f
77 changed files with 531 additions and 2019 deletions

View File

@ -220,7 +220,7 @@ if (MSVC)
set(MSVC_LIBS crypt32.lib;WINMM.LIB;Ws2_32.lib;getopt;regex)
set(CMAKE_EXE_LINKER_FLAGS
"${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:CONSOLE /SAFESEH:NO /MACHINE:x64 /ignore:4099 ${BASE_LD_FLAGS}"
"${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:CONSOLE /SAFESEH:NO /MACHINE:x64 /ignore:4099 /ignore:1021 ${BASE_LD_FLAGS}"
)
else ()
set(CMAKE_EXE_LINKER_FLAGS

View File

@ -1,341 +0,0 @@
!CHAPTER Module "planner"
!SUBSECTION Cluster Module
This module contains functions to plan, launch and shutdown clusters
of ArangoDB instances. We distinguish between the planning phase of
a cluster and the startup phase. The planning involves determining
how many processes in which role to run on which server, what ports and
endpoints to use, as well as the sequence of events to startup the whole
machinery. The result of such a planning phase is a "cluster plan". This
in turn can be given to a "Kickstarter", which uses the plan to actually
fire up the necessary processes. This is done via "dispatchers". A
dispatcher is nothing but a regular ArangoDB instance, compiled with the
cluster extensions, but not running in cluster mode. It exposes a REST
API to help in the planning and running of a cluster, mainly by
starting up further processes on the local machine. The planner needs
a complete description of all dispatchers in the system, which basically
describes the set of machines used for the cluster. These dispatchers
are also used during the planning to find free network ports.
Here are the details of the functionality:
!SUBSECTION Require
<!-- js/server/modules/@arangodb/cluster/planner.js -->
*new require("@arangodb/cluster").Planner(userConfig)*
This constructor builds a cluster planner object. The one and only
argument is an object that can have the properties described below.
The planner can plan clusters on a single machine (basically for
testing purposes) and on multiple machines. The resulting "cluster plans"
can be used by the kickstarter to start up the processes comprising
the cluster, including the agency. To this end, there has to be one
dispatcher on every machine participating in the cluster. A dispatcher
is a simple instance of ArangoDB, compiled with the cluster extensions,
but not running in cluster mode. This is why the configuration option
*dispatchers* below is of central importance.
- *dispatchers*: an object with a property for each dispatcher,
the property name is the ID of the dispatcher and the value
should be an object with at least the property *endpoint*
containing the endpoint of the corresponding dispatcher.
Further optional properties are:
- *avoidPorts* which is an object
in which all port numbers that should not be used are bound to
*true*, default is empty, that is, all ports can be used
- *arangodExtraArgs*, which is a list of additional
command line arguments that will be given to DBservers and
coordinators started by this dispatcher, the default is
an empty list. These arguments will be appended to those
produced automatically, such that one can overwrite
things with this.
- *allowCoordinators*, which is a boolean value indicating
whether or not coordinators should be started on this
dispatcher, the default is *true*
- *allowDBservers*, which is a boolean value indicating
whether or not DBservers should be started on this dispatcher,
the default is *true*
- *allowAgents*, which is a boolean value indicating whether or
not agents should be started on this dispatcher, the default is
*true*
- *username*, which is a string that contains the user name
for authentication with this dispatcher
- *passwd*, which is a string that contains the password
for authentication with this dispatcher, if not both
*username* and *passwd* are set, then no authentication
is used between dispatchers. Note that this will not work
if the dispatchers are configured with authentication.
If *.dispatchers* is empty (no property), then an entry for the
local arangod itself is automatically added. Note that if the
only configured dispatcher has endpoint *tcp://localhost:*,
all processes are started in a special "local" mode and are
configured to bind their endpoints only to the localhost device.
In all other cases both agents and *arangod* instances bind
their endpoints to all available network devices.
- *numberOfAgents*: the number of agents in the agency,
usually there is no reason to deviate from the default of 3. The
planner distributes them amongst the dispatchers, if possible.
- *agencyPrefix*: a string that is used as prefix for all keys of
configuration data stored in the agency.
- *numberOfDBservers*: the number of DBservers in the
cluster. The planner distributes them evenly amongst the dispatchers.
- *startSecondaries*: a boolean flag indicating whether or not
secondary servers are started. In this version, this flag is
silently ignored, since we do not yet have secondary servers.
- *numberOfCoordinators*: the number of coordinators in the cluster,
the planner distributes them evenly amongst the dispatchers.
- *DBserverIDs*: a list of DBserver IDs (strings). If the planner
runs out of IDs it creates its own ones using *DBserver*
concatenated with a unique number.
- *coordinatorIDs*: a list of coordinator IDs (strings). If the planner
runs out of IDs it creates its own ones using *Coordinator*
concatenated with a unique number.
- *dataPath*: this is a string and describes the path under which
the agents, the DBservers and the coordinators store their
data directories. This can either be an absolute path (in which
case all machines in the clusters must use the same path), or
it can be a relative path. In the latter case it is relative
to the directory that is configured in the dispatcher with the
*cluster.data-path* option (command line or configuration file).
The directories created will be called *data-PREFIX-ID* where
*PREFIX* is replaced with the agency prefix (see above) and *ID*
is the ID of the DBserver or coordinator.
- *logPath*: this is a string and describes the path under which
the DBservers and the coordinators store their log file. This can
either be an absolute path (in which case all machines in the cluster
must use the same path), or it can be a relative path. In the
latter case it is relative to the directory that is configured
in the dispatcher with the *cluster.log-path* option.
- *arangodPath*: this is a string and describes the path to the
actual executable *arangod* that will be started for the
DBservers and coordinators. If this is an absolute path, it
obviously has to be the same on all machines in the cluster
as described for *dataPath*. If it is an empty string, the
dispatcher uses the executable that is configured with the
*cluster.arangod-path* option, which is by default the same
executable as the dispatcher uses.
- *agentPath*: this is a string and describes the path to the
actual executable that will be started for the agents in the
agency. If this is an absolute path, it obviously has to be
the same on all machines in the cluster, as described for
*arangodPath*. If it is an empty string, the dispatcher
uses its *cluster.agent-path* option.
- *agentExtPorts*: a list of port numbers to use for the external
ports of the agents. When running out of numbers in this list,
the planner increments the last one used by one for every port
needed. Note that the planner checks availability of the ports
during the planning phase by contacting the dispatchers on the
different machines, and uses only ports that are free during
the planning phase. Obviously, if those ports are connected
before the actual startup, things can go wrong.
- *agentIntPorts*: a list of port numbers to use for the internal
ports of the agents. The same comments as for *agentExtPorts*
apply.
- *DBserverPorts*: a list of port numbers to use for the
DBservers. The same comments as for *agentExtPorts* apply.
- *coordinatorPorts*: a list of port numbers to use for the
coordinators. The same comments as for *agentExtPorts* apply.
- *useSSLonDBservers*: a boolean flag indicating whether or not
we use SSL on all DBservers in the cluster
- *useSSLonCoordinators*: a boolean flag indicating whether or not
we use SSL on all coordinators in the cluster
- *valgrind*: a string to contain the path of the valgrind binary
if we should run the cluster components in it
- *valgrindopts*: commandline options to the valgrind process
- *valgrindXmlFileBase*: pattern for logfiles
- *valgrindTestname*: name of test to add to the logfiles
- *valgrindHosts*: which host classes should run in valgrind?
Coordinator / DBServer
- *extremeVerbosity* : if set to true, then there will be more test
run output, especially for cluster tests.
All these values have default values. Here is the current set of
default values:
```js
{
"agencyPrefix" : "arango",
"numberOfAgents" : 1,
"numberOfDBservers" : 2,
"startSecondaries" : false,
"numberOfCoordinators" : 1,
"DBserverIDs" : ["Pavel", "Perry", "Pancho", "Paul", "Pierre",
"Pit", "Pia", "Pablo" ],
"coordinatorIDs" : ["Claus", "Chantalle", "Claire", "Claudia",
"Claas", "Clemens", "Chris" ],
"dataPath" : "", // means configured in dispatcher
"logPath" : "", // means configured in dispatcher
"arangodPath" : "", // means configured as dispatcher
"agentPath" : "", // means configured in dispatcher
"agentExtPorts" : [4001],
"agentIntPorts" : [7001],
"DBserverPorts" : [8629],
"coordinatorPorts" : [8530],
"dispatchers" : {"me": {"endpoint": "tcp://localhost:"}},
// this means only we as a local instance
"useSSLonDBservers" : false,
"useSSLonCoordinators" : false
};
```
!SUBSECTION Get Plan
<!-- js/server/modules/@arangodb/cluster/planner.js -->
`Planner.getPlan()`
returns the cluster plan as a JavaScript object. The result of this
method can be given to the constructor of a Kickstarter.
!SUBSECTION Require
<!-- js/server/modules/@arangodb/cluster/kickstarter.js -->
`new require("@arangodb/cluster").Kickstarter(plan)`
This constructor constructs a kickstarter object. Its first
argument is a cluster plan as for example provided by the planner
(see Cluster Planner Constructor and the general
explanations before this reference). The second argument is
optional and is taken to be "me" if omitted, it is the ID of the
dispatcher this object should consider itself to be. If the plan
contains startup commands for the dispatcher with this ID, these
commands are executed immediately. Otherwise they are handed over
to another responsible dispatcher via a REST call.
The resulting object of this constructors allows to launch,
shutdown, relaunch the cluster described in the plan.
!SUBSECTION Launch
<!-- js/server/modules/@arangodb/cluster/kickstarter.js -->
`Kickstarter.launch()`
This starts up a cluster as described in the plan which was given to
the constructor. To this end, other dispatchers are contacted as
necessary. All startup commands for the local dispatcher are
executed immediately.
The result is an object that contains information about the started
processes, this object is also stored in the Kickstarter object
itself. We do not go into details here about the data structure,
but the most important information are the process IDs of the
started processes. The corresponding
[see shutdown method](../ModulePlanner/README.md#shutdown) needs this
information to shut down all processes.
Note that all data in the DBservers and all log files and all agency
information in the cluster is deleted by this call. This is because
it is intended to set up a cluster for the first time. See
the [relaunch method](../ModulePlanner/README.md#relaunch)
for restarting a cluster without data loss.
!SUBSECTION Check Cluster Health
`Kickstarter.isHealthy()`
This checks that all processes belonging to a running cluster are
healthy. To this end, other dispatchers are contacted as necessary.
At this stage it is only checked that the processes are still up and
running.
!SUBSECTION Shutdown
<!-- js/server/modules/@arangodb/cluster/kickstarter.js -->
`Kickstarter.shutdown()`
This shuts down a cluster as described in the plan which was given to
the constructor. To this end, other dispatchers are contacted as
necessary. All processes in the cluster are gracefully shut down
in the right order.
!SUBSECTION Relaunch
<!-- js/server/modules/@arangodb/cluster/kickstarter.js -->
`Kickstarter.relaunch()`
This starts up a cluster as described in the plan which was given to
the constructor. To this end, other dispatchers are contacted as
necessary. All startup commands for the local dispatcher are
executed immediately.
The result is an object that contains information about the started
processes, this object is also stored in the Kickstarter object
itself. We do not go into details here about the data structure,
but the most important information are the process IDs of the
started processes. The corresponding
[shutdown method ](../ModulePlanner/README.md#shutdown) needs this information to
shut down all processes.
Note that this methods needs that all data in the DBservers and the
agency information in the cluster are already set up properly. See
the [launch method](../ModulePlanner/README.md#launch) for
starting a cluster for the first time.
!SUBSECTION Upgrade
<!-- js/server/modules/@arangodb/cluster/kickstarter.js -->
`Kickstarter.upgrade(username, passwd)`
This performs an upgrade procedure on a cluster as described in
the plan which was given to the constructor. To this end, other
dispatchers are contacted as necessary. All commands for the local
dispatcher are executed immediately. The basic approach for the
upgrade is as follows: The agency is started first (exactly as
in relaunch), no configuration is sent there (exactly as in the
relaunch action), all servers are first started with the option
"--upgrade" and then normally. In the end, the upgrade-database.js
script is run on one of the coordinators, as in the launch action.
The result is an object that contains information about the started
processes, this object is also stored in the Kickstarter object
itself. We do not go into details here about the data structure,
but the most important information are the process IDs of the
started processes. The corresponding
[shutdown method](../ModulePlanner/README.md#shutdown) needs
this information to shut down all processes.
Note that this methods needs that all data in the DBservers and the
agency information in the cluster are already set up properly. See
the [launch method](../ModulePlanner/README.md#launch) for
starting a cluster for the first time.
!SUBSECTION Cleanup
<!-- js/server/modules/@arangodb/cluster/kickstarter.js -->
`Kickstarter.cleanup()`
This cleans up all the data and logs of a previously shut down cluster.
To this end, other dispatchers are contacted as necessary.
[Use shutdown](../ModulePlanner/README.md#shutdown) first and
use with caution, since potentially a lot of data is being erased with
this call!

View File

@ -255,7 +255,6 @@
* ["request"](ModuleRequest/README.md)
* ["actions"](ModuleActions/README.md)
* ["queries"](ModuleQueries/README.md)
* ["planner"](ModulePlanner/README.md)
* [Write-ahead log](ModuleWal/README.md)
* [Task Management](ModuleTasks/README.md)
* [Using jsUnity](UsingJsUnity/README.md)

View File

@ -30,7 +30,7 @@
#include "Basics/StringBuffer.h"
#include "Basics/files.h"
#include "Basics/json.h"
#include "Basics/RandomGenerator.h"
#include "Random/RandomGenerator.h"
using namespace arangodb::basics;

View File

@ -35,7 +35,8 @@ using namespace arangodb::options;
ActionFeature* ActionFeature::ACTION = nullptr;
ActionFeature::ActionFeature(application_features::ApplicationServer* server)
: ApplicationFeature(server, "Action") {
: ApplicationFeature(server, "Action"),
_allowUseDatabase(false) {
setOptional(true);
requiresElevatedPrivileges(false);
startsAfter("Logger");

View File

@ -23,37 +23,30 @@
#include "Constituent.h"
#include <velocypack/Iterator.h>
#include <velocypack/velocypack-aliases.h>
#include <chrono>
#include <chrono>
#include <iomanip>
#include <iomanip>
#include <thread>
#include <thread>
#include <velocypack/Iterator.h>
#include <velocypack/velocypack-aliases.h>
#include "Agency/Agent.h"
#include "Aql/Query.h"
#include "Aql/QueryRegistry.h"
#include "Basics/ConditionLocker.h"
#include "Basics/RandomGenerator.h"
#include "Cluster/ClusterComm.h"
#include "Logger/Logger.h"
#include "Random/RandomGenerator.h"
#include "Utils/OperationOptions.h"
#include "Utils/OperationResult.h"
#include "Utils/SingleCollectionTransaction.h"
#include "Utils/StandaloneTransactionContext.h"
#include "VocBase/collection.h"
#include "VocBase/vocbase.h"
#include "Constituent.h"
#include "Agent.h"
#include "NotifierThread.h"
#include <velocypack/Iterator.h>
#include <velocypack/velocypack-aliases.h>
#include <chrono>
#include <iomanip>
#include <thread>
#include "Agency/NotifierThread.h"
using namespace arangodb::consensus;
using namespace arangodb::rest;

View File

@ -23,22 +23,22 @@
#include "AgencyCallbackRegistry.h"
#include "Basics/ReadLocker.h"
#include "Basics/WriteLocker.h"
#include "Basics/Exceptions.h"
#include "Basics/RandomGenerator.h"
#include "Cluster/ServerState.h"
#include "Endpoint/Endpoint.h"
#include <ctime>
//XXX #warning MOP why? use ConditionVariable
#warning MOP why? use ConditionVariable
#include <condition_variable>
//XXX #warning MOP why? use Mutex
#include <mutex>
//XXX #warning MOP why?
#include <thread>
#include <velocypack/Slice.h>
#include <velocypack/velocypack-aliases.h>
#include "Basics/Exceptions.h"
#include "Basics/ReadLocker.h"
#include "Basics/WriteLocker.h"
#include "Cluster/ServerState.h"
#include "Endpoint/Endpoint.h"
#include "Random/RandomGenerator.h"
using namespace arangodb;
AgencyCallbackRegistry::AgencyCallbackRegistry(std::string const& callbackBasePath)

View File

@ -34,11 +34,11 @@
#include "Basics/VelocyPackHelper.h"
#include "Basics/WriteLocker.h"
#include "Basics/json.h"
#include "Logger/Logger.h"
#include "Basics/RandomGenerator.h"
#include "Cluster/ServerState.h"
#include "Endpoint/Endpoint.h"
#include "Logger/Logger.h"
#include "Logger/Logger.h"
#include "Random/RandomGenerator.h"
#include "Rest/HttpRequest.h"
#include "Rest/HttpResponse.h"
#include "SimpleHttpClient/GeneralClientConnection.h"

View File

@ -26,8 +26,9 @@
#include <velocypack/Builder.h>
#include <velocypack/velocypack-aliases.h>
#include "Logger/Logger.h"
#include "Basics/StringUtils.h"
#include "Logger/LogBuffer.h"
#include "Logger/Logger.h"
#include "Rest/HttpRequest.h"
using namespace arangodb;
@ -44,13 +45,6 @@ bool RestAdminLogHandler::isDirect() const { return true; }
////////////////////////////////////////////////////////////////////////////////
HttpHandler::status_t RestAdminLogHandler::execute() {
// "/log" can only be called for the _system database
if (_request->databaseName() != "_system") {
generateError(GeneralResponse::ResponseCode::FORBIDDEN,
TRI_ERROR_ARANGO_USE_SYSTEM_DATABASE);
return status_t(HANDLER_DONE);
}
// check the maximal log level to report
bool found1;
std::string const& upto =
@ -137,9 +131,7 @@ HttpHandler::status_t RestAdminLogHandler::execute() {
StringUtils::tolower(_request->value("search", search));
// generate result
#warning TODO
#if 0
std::vector<LogBuffer> entries = Logger::bufferedEntries(ul, start, useUpto);
std::vector<LogBuffer> entries = LogBuffer::entries(ul, start, useUpto);
std::vector<LogBuffer> clean;
if (search) {
@ -254,6 +246,5 @@ HttpHandler::status_t RestAdminLogHandler::execute() {
// So ignore again
}
#endif
return status_t(HANDLER_DONE);
}

File diff suppressed because it is too large Load Diff

View File

@ -22,7 +22,7 @@
#include "CheckVersionFeature.h"
#include "ApplicationFeatures/LoggerFeature.h"
#include "Logger/LoggerFeature.h"
#include "ProgramOptions/ProgramOptions.h"
#include "ProgramOptions/Section.h"
#include "RestServer/DatabaseFeature.h"

View File

@ -74,6 +74,7 @@ DatabaseFeature::DatabaseFeature(ApplicationServer* server)
startsAfter("Random");
startsAfter("Temp");
startsAfter("WorkMonitor");
startsAfter("Statistics");
}
void DatabaseFeature::collectOptions(std::shared_ptr<ProgramOptions> options) {

View File

@ -128,9 +128,10 @@ void RestServerFeature::collectOptions(
"keep-alive timeout in seconds",
new DoubleParameter(&_keepAliveTimeout));
options->addOption("--http.hide-product-header",
"do not expose \"Server: ArangoDB\" header in HTTP responses",
new BooleanParameter(&HttpResponse::HIDE_PRODUCT_HEADER));
options->addOption(
"--http.hide-product-header",
"do not expose \"Server: ArangoDB\" header in HTTP responses",
new BooleanParameter(&HttpResponse::HIDE_PRODUCT_HEADER));
}
void RestServerFeature::validateOptions(std::shared_ptr<ProgramOptions>) {
@ -217,6 +218,19 @@ void RestServerFeature::start() {
// disabled maintenance mode
HttpHandlerFactory::setMaintenance(false);
LOG(INFO) << "Authentication is turned " << (_authentication ? "on" : "off");
if (_authentication) {
if (_authenticationSystemOnly) {
LOG(INFO) << "Authentication system only";
}
#ifdef ARANGODB_HAVE_DOMAIN_SOCKETS
LOG(INFO) << "Authentication for unix sockets is turned "
<< (_authenticationUnixSockets ? "on" : "off");
#endif
}
}
void RestServerFeature::stop() {
@ -248,7 +262,7 @@ void RestServerFeature::buildServers() {
SchedulerFeature::SCHEDULER, DispatcherFeature::DISPATCHER,
_handlerFactory.get(), _jobManager.get(), _keepAliveTimeout);
//YYY #warning FRANK filter list
// YYY #warning FRANK filter list
auto const& endpointList = endpoint->endpointList();
httpServer->setEndpointList(&endpointList);
_servers.push_back(httpServer);
@ -282,7 +296,7 @@ void RestServerFeature::defineHandlers() {
AgencyFeature* agency = dynamic_cast<AgencyFeature*>(
application_features::ApplicationServer::lookupFeature("Agency"));
TRI_ASSERT(agency != nullptr);
ClusterFeature* cluster = dynamic_cast<ClusterFeature*>(
application_features::ApplicationServer::lookupFeature("Cluster"));
TRI_ASSERT(cluster != nullptr);
@ -335,7 +349,7 @@ void RestServerFeature::defineHandlers() {
RestHandlerCreator<RestSimpleQueryHandler>::createData<
aql::QueryRegistry*>,
queryRegistry);
_handlerFactory->addPrefixHandler(
RestVocbaseBaseHandler::SIMPLE_QUERY_ALL_KEYS_PATH,
RestHandlerCreator<RestSimpleQueryHandler>::createData<
@ -379,15 +393,17 @@ void RestServerFeature::defineHandlers() {
_handlerFactory->addPrefixHandler(
RestVocbaseBaseHandler::AGENCY_PRIV_PATH,
RestHandlerCreator<RestAgencyPrivHandler>::createData<consensus::Agent*>,
RestHandlerCreator<RestAgencyPrivHandler>::createData<
consensus::Agent*>,
agency->agent());
}
if (cluster->isEnabled()) {
if (cluster->isEnabled()) {
// add "/agency-callbacks" handler
_handlerFactory->addPrefixHandler(
cluster->agencyCallbacksPath(),
RestHandlerCreator<RestAgencyCallbacksHandler>::createData<AgencyCallbackRegistry*>,
RestHandlerCreator<RestAgencyCallbacksHandler>::createData<
AgencyCallbackRegistry*>,
cluster->agencyCallbackRegistry());
}

View File

@ -51,7 +51,6 @@ ServerFeature::ServerFeature(application_features::ApplicationServer* server,
: ApplicationFeature(server, "Server"),
_console(false),
_restServer(true),
_authentication(false),
_result(res),
_operationMode(OperationMode::MODE_SERVER) {
setOptional(true);
@ -149,7 +148,6 @@ void ServerFeature::validateOptions(std::shared_ptr<ProgramOptions>) {
if (_operationMode == OperationMode::MODE_SCRIPT ||
_operationMode == OperationMode::MODE_UNITTESTS) {
_authentication = false;
v8dealer->setMinimumContexts(2);
} else {
v8dealer->setMinimumContexts(1);
@ -180,10 +178,6 @@ void ServerFeature::start() {
waitForHeartbeat();
if (!_authentication) {
LOG(INFO) << "Authentication is turned off";
}
LOG(INFO) << "ArangoDB (version " << ARANGODB_VERSION_FULL
<< ") is ready for business. Have fun!";

View File

@ -50,7 +50,6 @@ class ServerFeature final : public application_features::ApplicationFeature {
private:
bool _console;
bool _restServer;
bool _authentication;
std::vector<std::string> _unitTests;
std::vector<std::string> _scripts;
std::vector<std::string> _scriptParameters;

View File

@ -28,9 +28,7 @@
#include "ApplicationFeatures/ConfigFeature.h"
#include "ApplicationFeatures/DaemonFeature.h"
#include "ApplicationFeatures/LanguageFeature.h"
#include "ApplicationFeatures/LoggerFeature.h"
#include "ApplicationFeatures/NonceFeature.h"
#include "ApplicationFeatures/RandomFeature.h"
#include "ApplicationFeatures/ShutdownFeature.h"
#include "ApplicationFeatures/SslFeature.h"
#include "ApplicationFeatures/SupervisorFeature.h"
@ -40,7 +38,10 @@
#include "Basics/ArangoGlobalContext.h"
#include "Cluster/ClusterFeature.h"
#include "Dispatcher/DispatcherFeature.h"
#include "Logger/LoggerBufferFeature.h"
#include "Logger/LoggerFeature.h"
#include "ProgramOptions/ProgramOptions.h"
#include "Random/RandomFeature.h"
#include "RestServer/AffinityFeature.h"
#include "RestServer/CheckVersionFeature.h"
#include "RestServer/ConsoleFeature.h"
@ -91,8 +92,7 @@ int main(int argc, char* argv[]) {
std::vector<std::string> nonServerFeatures = {
"Action", "Agency", "Cluster", "Daemon", "Dispatcher", "Endpoint",
"Server", "Scheduler", "Ssl", "Supervisor"};
#warning FRANK: does it make sense to list Agency here?
"LoggerBufferFeature", "Server", "Scheduler", "Ssl", "Supervisor"};
int ret = EXIT_FAILURE;
@ -109,6 +109,7 @@ int main(int argc, char* argv[]) {
server.addFeature(new FileDescriptorsFeature(&server));
server.addFeature(new FrontendFeature(&server));
server.addFeature(new LanguageFeature(&server));
server.addFeature(new LoggerBufferFeature(&server));
server.addFeature(new LoggerFeature(&server, true));
server.addFeature(new NonceFeature(&server));
server.addFeature(new RandomFeature(&server));

View File

@ -26,7 +26,6 @@
#include "ApplicationFeatures/V8PlatformFeature.h"
#include "Basics/ConditionLocker.h"
#include "Basics/RandomGenerator.h"
#include "Basics/StringUtils.h"
#include "Basics/WorkMonitor.h"
#include "Cluster/ServerState.h"
@ -34,6 +33,7 @@
#include "Dispatcher/DispatcherThread.h"
#include "ProgramOptions/ProgramOptions.h"
#include "ProgramOptions/Section.h"
#include "Random/RandomGenerator.h"
#include "RestServer/DatabaseFeature.h"
#include "Utils/V8TransactionContext.h"
#include "V8/v8-buffer.h"
@ -225,6 +225,8 @@ void V8DealerFeature::start() {
ApplicationServer::lookupFeature("Database"));
loadJavascript(database->vocbase(), "server/initialize.js");
startGarbageCollection();
}
void V8DealerFeature::stop() {
@ -233,9 +235,7 @@ void V8DealerFeature::stop() {
shutdownContexts();
// delete GC thread after all action threads have been stopped
if (_gcThread != nullptr) {
delete _gcThread;
}
delete _gcThread;
DEALER = nullptr;
}
@ -489,18 +489,19 @@ V8Context* V8DealerFeature::enterContext(TRI_vocbase_t* vocbase,
V8Context* context = _dirtyContexts.back();
_freeContexts.push_back(context);
_dirtyContexts.pop_back();
} else {
auto currentThread = arangodb::rest::DispatcherThread::current();
break;
}
auto currentThread = arangodb::rest::DispatcherThread::current();
if (currentThread != nullptr) {
currentThread->block();
}
if (currentThread != nullptr) {
currentThread->block();
}
guard.wait();
guard.wait();
if (currentThread != nullptr) {
currentThread->unblock();
}
if (currentThread != nullptr) {
currentThread->unblock();
}
}
@ -670,6 +671,8 @@ void V8DealerFeature::exitContext(V8Context* context) {
_busyContexts.erase(context);
_freeContexts.emplace_back(context);
guard.broadcast();
}
}

View File

@ -83,7 +83,11 @@ bool V8TimerTask::handleTimeout() {
new V8Job(_vocbase, "(function (params) { " + _command + " } )(params);",
_parameters, _allowUseDatabase));
DispatcherFeature::DISPATCHER->addJob(job);
int res = DispatcherFeature::DISPATCHER->addJob(job);
if (res != TRI_ERROR_NO_ERROR) {
LOG(WARN) << "could not add task " << _command << " to queue";
}
// note: this will destroy the task (i.e. ourselves!!)
SchedulerFeature::SCHEDULER->destroyTask(this);

View File

@ -82,29 +82,25 @@ struct BasicExpander {
std::vector<EdgeCollectionInfo*> const _colls;
arangodb::Transaction* _trx;
TRI_edge_direction_e _dir;
std::shared_ptr<OperationResult> _opRes;
std::vector<TRI_doc_mptr_t*> _cursor;
public:
BasicExpander(std::vector<EdgeCollectionInfo*> const& colls,
arangodb::Transaction* trx, TRI_edge_direction_e dir)
: _colls(colls),
_trx(trx),
_dir(dir),
_opRes(std::make_shared<OperationResult>(TRI_ERROR_NO_ERROR)){};
_dir(dir) {}
void operator()(std::string const& v, std::vector<std::string>& res_edges,
std::vector<std::string>& neighbors) {
for (auto const& edgeCollection : _colls) {
_cursor.clear();
TRI_ASSERT(edgeCollection != nullptr);
std::shared_ptr<OperationCursor> edgeCursor = edgeCollection->getEdges(_dir, v);
while (edgeCursor->hasMore()) {
edgeCursor->getMore(_opRes, UINT64_MAX, false);
if (_opRes->failed()) {
THROW_ARANGO_EXCEPTION(_opRes->code);
}
VPackSlice edges = _opRes->slice();
for (auto const& edge : VPackArrayIterator(edges)) {
edgeCursor->getMoreMptr(_cursor, UINT64_MAX);
for (auto const& mptr : _cursor) {
VPackSlice edge(mptr->vpack());
std::string edgeId = _trx->extractIdString(edge);
std::string from = edge.get(TRI_VOC_ATTRIBUTE_FROM).copyString();
if (from == v) {
@ -210,6 +206,7 @@ class MultiCollectionEdgeExpander {
void operator()(std::string const& source,
std::vector<ArangoDBPathFinder::Step*>& result) {
std::vector<TRI_doc_mptr_t*> cursor;
for (auto const& edgeCollection : _edgeCollections) {
TRI_ASSERT(edgeCollection != nullptr);
@ -235,16 +232,12 @@ class MultiCollectionEdgeExpander {
}
}
};
auto opRes = std::make_shared<OperationResult>(TRI_ERROR_NO_ERROR);
cursor.clear();
while (edgeCursor->hasMore()) {
edgeCursor->getMore(opRes, UINT64_MAX, false);
if (opRes->failed()) {
THROW_ARANGO_EXCEPTION(opRes->code);
}
VPackSlice edges = opRes->slice();
for (auto const& edge : VPackArrayIterator(edges)) {
edgeCursor->getMoreMptr(cursor, UINT64_MAX);
for (auto const& mptr : cursor) {
VPackSlice edge(mptr->vpack());
if (!_isAllowed(edge)) {
continue;
}

View File

@ -3605,7 +3605,7 @@ void TRI_InitV8VocBridge(v8::Isolate* isolate, v8::Handle<v8::Context> context,
// whether or not statistics are enabled
context->Global()->ForceSet(
TRI_V8_ASCII_STRING("ENABLE_STATISTICS"),
v8::Boolean::New(isolate, StatisticsFeature::enabled()), v8::ReadOnly);
v8::Boolean::New(isolate, StatisticsFeature::enabled())); //, v8::ReadOnly);
// a thread-global variable that will is supposed to contain the AQL module
// do not remove this, otherwise AQL queries will break

View File

@ -26,14 +26,14 @@
#include "Basics/FileUtils.h"
#include "Basics/JsonHelper.h"
#include "Basics/ReadLocker.h"
#include "Basics/WriteLocker.h"
#include "Logger/Logger.h"
#include "Basics/StringUtils.h"
#include "Basics/VelocyPackHelper.h"
#include "Basics/WriteLocker.h"
#include "Basics/files.h"
#include "Basics/memory-map.h"
#include "Basics/RandomGenerator.h"
#include "Basics/tri-strings.h"
#include "Logger/Logger.h"
#include "Random/RandomGenerator.h"
#include "VocBase/DatafileHelper.h"
#include "VocBase/document-collection.h"
#include "VocBase/server.h"

View File

@ -33,22 +33,22 @@
#include "Basics/FileUtils.h"
#include "Basics/MutexLocker.h"
#include "Basics/StringUtils.h"
#include "Basics/VelocyPackHelper.h"
#include "Basics/conversions.h"
#include "Basics/files.h"
#include "Basics/hashes.h"
#include "Basics/memory-map.h"
#include "Basics/RandomGenerator.h"
#include "Basics/tri-strings.h"
#include "Basics/VelocyPackHelper.h"
#include "Cluster/ServerState.h"
#include "Logger/Logger.h"
#include "Random/RandomGenerator.h"
#include "Utils/CursorRepository.h"
#include "V8Server/V8DealerFeature.h"
#include "VocBase/auth.h"
#include "VocBase/replication-applier.h"
#include "VocBase/vocbase.h"
#include "Wal/LogfileManager.h"
#include "Wal/Marker.h"
#include "V8Server/V8DealerFeature.h"
using namespace arangodb;
using namespace arangodb::application_features;

View File

@ -25,13 +25,13 @@
#include "ApplicationFeatures/ClientFeature.h"
#include "ApplicationFeatures/ConfigFeature.h"
#include "ApplicationFeatures/LoggerFeature.h"
#include "ApplicationFeatures/RandomFeature.h"
#include "ApplicationFeatures/ShutdownFeature.h"
#include "ApplicationFeatures/TempFeature.h"
#include "Basics/ArangoGlobalContext.h"
#include "Benchmark/BenchFeature.h"
#include "Logger/LoggerFeature.h"
#include "ProgramOptions/ProgramOptions.h"
#include "Random/RandomFeature.h"
using namespace arangodb;
using namespace arangodb::application_features;

View File

@ -23,7 +23,7 @@
#include "Basics/Common.h"
#include "Basics/RandomGenerator.h"
#include "Random/RandomGenerator.h"
static bool DeleteCollection(SimpleHttpClient*, std::string const&);

View File

@ -25,12 +25,12 @@
#include "ApplicationFeatures/ClientFeature.h"
#include "ApplicationFeatures/ConfigFeature.h"
#include "ApplicationFeatures/LoggerFeature.h"
#include "ApplicationFeatures/RandomFeature.h"
#include "ApplicationFeatures/ShutdownFeature.h"
#include "Basics/ArangoGlobalContext.h"
#include "Dump/DumpFeature.h"
#include "Logger/LoggerFeature.h"
#include "ProgramOptions/ProgramOptions.h"
#include "Random/RandomFeature.h"
using namespace arangodb;
using namespace arangodb::application_features;

View File

@ -25,13 +25,13 @@
#include "ApplicationFeatures/ClientFeature.h"
#include "ApplicationFeatures/ConfigFeature.h"
#include "ApplicationFeatures/LoggerFeature.h"
#include "ApplicationFeatures/RandomFeature.h"
#include "ApplicationFeatures/ShutdownFeature.h"
#include "ApplicationFeatures/TempFeature.h"
#include "Basics/ArangoGlobalContext.h"
#include "Import/ImportFeature.h"
#include "Logger/LoggerFeature.h"
#include "ProgramOptions/ProgramOptions.h"
#include "Random/RandomFeature.h"
using namespace arangodb;
using namespace arangodb::application_features;

View File

@ -25,13 +25,13 @@
#include "ApplicationFeatures/ClientFeature.h"
#include "ApplicationFeatures/ConfigFeature.h"
#include "ApplicationFeatures/LoggerFeature.h"
#include "ApplicationFeatures/RandomFeature.h"
#include "ApplicationFeatures/ShutdownFeature.h"
#include "ApplicationFeatures/TempFeature.h"
#include "Basics/ArangoGlobalContext.h"
#include "Restore/RestoreFeature.h"
#include "Logger/LoggerFeature.h"
#include "ProgramOptions/ProgramOptions.h"
#include "Random/RandomFeature.h"
#include "Restore/RestoreFeature.h"
using namespace arangodb;
using namespace arangodb::application_features;

View File

@ -27,13 +27,13 @@
#include "ApplicationFeatures/ConfigFeature.h"
#include "ApplicationFeatures/ConsoleFeature.h"
#include "ApplicationFeatures/LanguageFeature.h"
#include "ApplicationFeatures/LoggerFeature.h"
#include "ApplicationFeatures/RandomFeature.h"
#include "ApplicationFeatures/ShutdownFeature.h"
#include "ApplicationFeatures/TempFeature.h"
#include "ApplicationFeatures/V8PlatformFeature.h"
#include "Basics/ArangoGlobalContext.h"
#include "Logger/LoggerFeature.h"
#include "ProgramOptions/ProgramOptions.h"
#include "Random/RandomFeature.h"
#include "Shell/ShellFeature.h"
#include "Shell/V8ShellFeature.h"

View File

@ -1483,14 +1483,24 @@ if (list.length > 0) {
</tr>
</tbody></script><script id="loginView.ejs" type="text/template"><div class="loginFixedWindow">
<div class="resizecontainer"><div class="navlogo"><a class="logo" href="#"><img class="arangodbLogo" src="img/logo_arangodb_transp.png"></a></div></div>
<!--
<div class="resizecontainer">
<div class="navlogo">
<a class="logo" href="#"><img class="arangodbLogo" src="img/logo_arangodb_transp.png"></a>
</div>
</div>
-->
<div id="loginWindow" class="login-window">
<div class="login-logo-round">
<img class="arangodbLogo" src="img/arangodb_logo_small.png"/>
<img class="" src="img/arangodb_logo_letter.png"/>
</div>
<p class="wrong-credentials" style="display:none" >Wrong credentials!</p>
<form id="loginForm">
<input class="login-input" placeholder="Username" id="loginUsername" type="text" name="username"><i class="fa fa-user"></i>
<input class="login-input" placeholder="Password" id="loginPassword" type="password" name="password"><i class="fa fa-lock"></i>
<input class="login-input" placeholder="Database" id="loginDatabase" type="text" name="database"><i class="fa fa-database"></i>
<input class="login-input" placeholder="username" id="loginUsername" type="text" name="username"><i class="fa fa-user"></i>
<input class="login-input" placeholder="password" id="loginPassword" type="password" name="password"><i class="fa fa-lock"></i>
<input class="login-input" placeholder="database" id="loginDatabase" type="text" name="database"><i class="fa fa-database"></i>
<button id="submitLogin" class="button-success pull-right">Login</button>
</form>
</div>
@ -2953,4 +2963,4 @@ var cutByResolution = function (str) {
</div>
<div id="workMonitorContent" class="innerContent">
</div></script></head><body><nav class="navbar"><div class="primary"><div class="navlogo"><a class="logo big" href="#"><img class="arangodbLogo" src="img/arangodb_logo_big.png"></a> <a class="logo small" href="#"><img class="arangodbLogo" src="img/arangodb_logo_small.png"></a></div><div class="statmenu" id="statisticBar"></div><div class="navmenu" id="navigationBar"></div></div></nav><div class="bodyWrapper"><div class="centralRow"><div id="navbar2" class="navbarWrapper secondary"><div class="subnavmenu" id="subNavigationBar"></div></div><div class="resizecontainer contentWrapper"><div id="content" class="centralContent"></div><footer class="footer"><div id="footerBar"></div></footer></div></div></div><div id="modalPlaceholder"></div><div id="progressPlaceholder" style="display:none"></div><div id="spotlightPlaceholder" style="display:none"></div><div class="arangoFrame" style=""><div class="outerDiv"><div class="innerDiv"></div></div></div><script src="libs.js?version=1461244631474"></script><script src="app.js?version=1461244631474"></script></body></html>
</div></script></head><body><nav class="navbar"><div class="primary"><div class="navlogo"><a class="logo big" href="#"><img class="arangodbLogo" src="img/arangodb_logo_big.png"></a> <a class="logo small" href="#"><img class="arangodbLogo" src="img/arangodb_logo_small.png"></a></div><div class="statmenu" id="statisticBar"></div><div class="navmenu" id="navigationBar"></div></div></nav><div class="bodyWrapper"><div class="centralRow"><div id="navbar2" class="navbarWrapper secondary"><div class="subnavmenu" id="subNavigationBar"></div></div><div class="resizecontainer contentWrapper"><div id="content" class="centralContent"></div><footer class="footer"><div id="footerBar"></div></footer></div></div></div><div id="modalPlaceholder"></div><div id="progressPlaceholder" style="display:none"></div><div id="spotlightPlaceholder" style="display:none"></div><div class="arangoFrame" style=""><div class="outerDiv"><div class="innerDiv"></div></div></div><script src="libs.js?version=1461257358510"></script><script src="app.js?version=1461257358510"></script></body></html>

View File

@ -1609,14 +1609,24 @@ if (list.length > 0) {
<script id="loginView.ejs" type="text/template">
<div class="loginFixedWindow">
<div class="resizecontainer"><div class="navlogo"><a class="logo" href="#"><img class="arangodbLogo" src="img/logo_arangodb_transp.png"></a></div></div>
<!--
<div class="resizecontainer">
<div class="navlogo">
<a class="logo" href="#"><img class="arangodbLogo" src="img/logo_arangodb_transp.png"></a>
</div>
</div>
-->
<div id="loginWindow" class="login-window">
<div class="login-logo-round">
<img class="arangodbLogo" src="img/arangodb_logo_small.png"/>
<img class="" src="img/arangodb_logo_letter.png"/>
</div>
<p class="wrong-credentials" style="display:none" >Wrong credentials!</p>
<form id="loginForm">
<input class="login-input" placeholder="Username" id="loginUsername" type="text" name="username"><i class="fa fa-user"></i>
<input class="login-input" placeholder="Password" id="loginPassword" type="password" name="password"><i class="fa fa-lock"></i>
<input class="login-input" placeholder="Database" id="loginDatabase" type="text" name="database"><i class="fa fa-database"></i>
<input class="login-input" placeholder="username" id="loginUsername" type="text" name="username"><i class="fa fa-user"></i>
<input class="login-input" placeholder="password" id="loginPassword" type="password" name="password"><i class="fa fa-lock"></i>
<input class="login-input" placeholder="database" id="loginDatabase" type="text" name="database"><i class="fa fa-database"></i>
<button id="submitLogin" class="button-success pull-right">Login</button>
</form>
</div>
@ -3279,8 +3289,8 @@ var cutByResolution = function (str) {
</div>
</div>
<script src="libs.js?version=1461244631474"></script>
<script src="app.js?version=1461244631474"></script>
<script src="libs.js?version=1461257358510"></script>
<script src="app.js?version=1461257358510"></script>
</body>
</html>

View File

@ -1,2 +1,2 @@
<script src="libs.js?version=1461244631474"></script>
<script src="app.js?version=1461244631474"></script>
<script src="libs.js?version=1461257358510"></script>
<script src="app.js?version=1461257358510"></script>

File diff suppressed because one or more lines are too long

View File

@ -3253,7 +3253,7 @@ div .bigtile {
width: -4.2px; }
.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut {
line-height: 40px;
padding-top: 10px;
padding-top: 15px;
width: -3px; }
.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-chart {
box-sizing: border-box;
@ -3442,7 +3442,7 @@ div .bigtile {
width: 51.8px; }
.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut {
line-height: 40px;
padding-top: 10px;
padding-top: 15px;
width: 21px; }
.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-chart {
box-sizing: border-box;
@ -3631,7 +3631,7 @@ div .bigtile {
width: 107.8px; }
.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut {
line-height: 40px;
padding-top: 10px;
padding-top: 15px;
width: 45px; }
.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-chart {
box-sizing: border-box;
@ -3818,7 +3818,7 @@ div .bigtile {
width: 163.8px; }
.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut {
line-height: 40px;
padding-top: 10px;
padding-top: 15px;
width: 69px; }
.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-chart {
box-sizing: border-box;
@ -4002,7 +4002,7 @@ div .bigtile {
width: 219.8px; }
.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut {
line-height: 40px;
padding-top: 10px;
padding-top: 15px;
width: 93px; }
.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-chart {
box-sizing: border-box;
@ -4186,7 +4186,7 @@ div .bigtile {
width: 275.8px; }
.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut {
line-height: 40px;
padding-top: 10px;
padding-top: 15px;
width: 117px; }
.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-chart {
box-sizing: border-box;
@ -4370,7 +4370,7 @@ div .bigtile {
width: 331.8px; }
.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut {
line-height: 40px;
padding-top: 10px;
padding-top: 15px;
width: 141px; }
.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-chart {
box-sizing: border-box;
@ -4554,7 +4554,7 @@ div .bigtile {
width: 387.8px; }
.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut {
line-height: 40px;
padding-top: 10px;
padding-top: 15px;
width: 165px; }
.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-chart {
box-sizing: border-box;
@ -4738,7 +4738,7 @@ div .bigtile {
width: 443.8px; }
.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut {
line-height: 40px;
padding-top: 10px;
padding-top: 15px;
width: 189px; }
.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-chart {
box-sizing: border-box;
@ -4922,7 +4922,7 @@ div .bigtile {
width: 499.8px; }
.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut {
line-height: 40px;
padding-top: 10px;
padding-top: 15px;
width: 213px; }
.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-chart {
box-sizing: border-box;
@ -5106,7 +5106,7 @@ div .bigtile {
width: 555.8px; }
.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut {
line-height: 40px;
padding-top: 10px;
padding-top: 15px;
width: 237px; }
.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-chart {
box-sizing: border-box;
@ -6448,10 +6448,12 @@ div.headerBar {
font-weight: 500;
text-align: center;
width: 100%; }
.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-chart .nv-bar rect {
fill-opacity: .8;
stroke-opacity: .8;
stroke-width: .5px; }
.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-chart {
padding-top: 10px; }
.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-chart .nv-bar rect {
fill-opacity: .8;
stroke-opacity: .8;
stroke-width: .5px; }
.dashboard-legend .dashboard-legend-inner {
padding: 0 5px 5px 0;
@ -6593,7 +6595,7 @@ div.headerBar {
padding-left: 0; }
.loginFixedWindow {
background: #f5f8f0;
background: #649068;
height: 100%;
left: 0;
position: fixed;
@ -6609,23 +6611,35 @@ div.headerBar {
margin-top: 9px; }
.login-window {
background-color: #fff;
background-color: rgba(255, 255, 255, 0.75);
border: 1px solid rgba(140, 138, 137, 0.25);
border-radius: 3px;
height: auto;
left: 50%;
margin-left: -220px !important;
margin-top: -150px;
padding: 10px;
position: absolute;
top: 50%;
width: 400px; }
margin: 0 auto;
padding-bottom: 50px;
padding-left: 20px;
padding-right: 20px;
padding-top: 20px;
position: relative;
top: 100px;
width: 350px; }
.login-window .login-logo-round {
margin-bottom: 25px;
margin-top: 10px; }
.login-window .login-logo-round img {
display: block;
margin: 0 auto;
width: 150px; }
.login-window .fa {
color: rgba(0, 0, 0, 0.4);
color: rgba(0, 0, 0, 0.2);
float: right;
font-size: 14pt;
margin-right: 5px;
margin-top: -34px; }
margin-right: 44px;
margin-top: 11px;
position: absolute;
right: -11px; }
.login-window .fa.fa-lock {
right: -9px; }
.login-window .wrong-credentials {
color: #da4f49;
margin-top: -30px;
@ -6633,9 +6647,25 @@ div.headerBar {
.login-window .login-space {
height: 50px; }
.login-window .login-input {
width: 387px; }
background: #f2f2f2 !important;
background-color: #f2f2f2 !important;
border: 0;
border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px;
border-top-left-radius: 3px;
border-top-right-radius: 3px;
box-sizing: border-box;
font-size: 14px;
height: 40px;
margin: 0 0 15px;
outline: 0;
padding: 15px;
width: 100%; }
.login-window .form-error {
border: 1px solid #da4f49 !important; }
.login-window button {
height: 40px;
width: 100%; }
toolbar {
background-color: #f0f0f0;

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -407,6 +407,7 @@ function GraphViewerUI(container, adapterConfig, optWidth, optHeight, viewerConf
},
createSVG = function () {
console.log(height);
return d3.select("#" + container.id + " #background")
.append("svg")
.attr("id", "graphViewerSVG")
@ -578,8 +579,8 @@ function GraphViewerUI(container, adapterConfig, optWidth, optHeight, viewerConf
buttons.id = "modifiers";
title.appendChild(document.createTextNode("Graph Viewer"));
title.className = "arangoHeader";
//title.appendChild(document.createTextNode("Graph Viewer"));
//title.className = "arangoHeader";
/*
nodeShaperDropDown.id = "nodeshapermenu";
@ -593,7 +594,7 @@ function GraphViewerUI(container, adapterConfig, optWidth, optHeight, viewerConf
menubar.appendChild(configureLists.filter);
menubar.appendChild(configureLists.node);
transparentHeader.appendChild(buttons);
transparentHeader.appendChild(title);
//transparentHeader.appendChild(title);
adapterUI.addControlChangeGraph(function() {
updateAttributeExamples();

View File

@ -1,14 +1,24 @@
<script id="loginView.ejs" type="text/template">
<div class="loginFixedWindow">
<div class="resizecontainer"><div class="navlogo"><a class="logo" href="#"><img class="arangodbLogo" src="img/logo_arangodb_transp.png"></a></div></div>
<!--
<div class="resizecontainer">
<div class="navlogo">
<a class="logo" href="#"><img class="arangodbLogo" src="img/logo_arangodb_transp.png"></a>
</div>
</div>
-->
<div id="loginWindow" class="login-window">
<div class="login-logo-round">
<img class="arangodbLogo" src="img/arangodb_logo_small.png"/>
<img class="" src="img/arangodb_logo_letter.png"/>
</div>
<p class="wrong-credentials" style="display:none" >Wrong credentials!</p>
<form id="loginForm">
<input class="login-input" placeholder="Username" id="loginUsername" type="text" name="username"><i class="fa fa-user"></i>
<input class="login-input" placeholder="Password" id="loginPassword" type="password" name="password"><i class="fa fa-lock"></i>
<input class="login-input" placeholder="Database" id="loginDatabase" type="text" name="database"><i class="fa fa-database"></i>
<input class="login-input" placeholder="username" id="loginUsername" type="text" name="username"><i class="fa fa-user"></i>
<input class="login-input" placeholder="password" id="loginPassword" type="password" name="password"><i class="fa fa-lock"></i>
<input class="login-input" placeholder="database" id="loginDatabase" type="text" name="database"><i class="fa fa-database"></i>
<button id="submitLogin" class="button-success pull-right">Login</button>
</form>
</div>

View File

@ -1,11 +1,9 @@
<script id="navigationView.ejs" type="text/template">
<ul class="navlist arango-collection-ul" id="arangoCollectionUl">
<% if (isCluster) { %>
<li class="navbar-spacer big"></li>
<li class="cluster-menu"><a id="cluster" class="tab" href="#cluster"><i class="fa fa-circle-o"></i>Cluster</a></li>
<li class="nodes-menu"><a id="nodes" class="tab" href="#cNodes"><i class="fa fa-server"></i>Nodes</a></li>
<% } else { %>
<li class="navbar-spacer big"></li>
<li class="dashboard-menu"><a id="dashboard" class="tab" href="#dashboard"><i class="fa fa-dashboard"></i>Dashboard</a></li>
<% } %>
<li class="navbar-spacer big"></li>
@ -30,7 +28,7 @@
<li class="databases-menu"><a id="databases" class="tab" href="#databases"><i class="fa fa-database"></i>Databases</a></li>
<% } %>
<% if (!isCluster) { %>
<li class="logs-menu"><a id="logs" class="tab" href="#manage"><i class="fa fa-file-text"></i>Logs</a></li>
<li class="logs-menu"><a id="logs" class="tab" href="#logs"><i class="fa fa-file-text"></i>Logs</a></li>
<% } %>
<li class="navbar-spacer big"></li>
<li class="helpus-menu"><a id="helpus" class="tab" href="#helpus"><i class="fa fa-heart"></i>Help Us</a></li>
@ -45,11 +43,9 @@
</li>
<% if (!isCluster) { %>
<% if (currentDB.get('isSystem')) { %>
<li class="dropdown-item">
<a id="logs" class="tab" href="#logs">Logs</a>
</li>
<% } %>
<li class="dropdown-item">
<a id="logs" class="tab" href="#logs">Logs</a>
</li>
<% } %>
<li class="dropdown-item">

View File

@ -159,19 +159,6 @@
if (navElement) {
window.clearTimeout(timer);
timer = null;
if (name === '_system') {
// show "logs" button
$('.logs-menu').css('visibility', 'visible');
$('.logs-menu').css('display', 'inline');
// show dbs menues
$('#databaseNavi').css('display','inline');
}
else {
// hide "logs" button
$('.logs-menu').css('visibility', 'hidden');
$('.logs-menu').css('display', 'none');
}
self.render();
}
}, 50);

View File

@ -72,7 +72,7 @@
var height = arangoHelper.calculateCenterDivHeight();
this.ui = new GraphViewerUI($("#content")[0], adapterConfig, width, height, {
this.ui = new GraphViewerUI($("#content")[0], adapterConfig, width, $('.centralRow').height() - 135, {
nodeShaper: {
label: "_key",
color: {

View File

@ -318,18 +318,18 @@ a.headerButton {
//Graph Viewer
div.toolbox {
@include border-radius(3px);
@include border-radius(2px);
background-color: $c-white;
border: 1px solid $c-content-border;
margin-right: 5px;
margin-top: -3px;
padding-bottom: 5px;
padding-top: 5px;
position: absolute;
top: -10px;
div.gv_action_button {
@extend %clickable;
@include border-radius(3px);
@include border-radius(2px);
background-color: $c-white;
color: $c-header-btn-fg;
height: 30px;

View File

@ -179,3 +179,5 @@ $c-bluegrey-nontransp: rgb(217, 219, 220);
$c-bluegrey-bg: rgba(64, 74, 83, .04);
$c-active-green: rgb(119, 203, 153);
$c-test-green: rgb(100, 144, 104);
$c-login-grey: #f2f2f2;

View File

@ -1,9 +1,9 @@
div.gv_zoom_widget {
height: 300px;
left: 64px;
left: 62px;
opacity: .7;
position: absolute;
top: 20px;
top: 0;
width: 40px;
z-index: 1;
@ -72,7 +72,7 @@ svg.graph-viewer {
border-radius: 3px;
left: 54px;
position: absolute;
top: 10px;
top: -10px;
z-index: 0;
text {
@ -109,7 +109,7 @@ div.gv-colour-list {
position: absolute;
right: 8px;
text-align: right;
top: 20px;
top: 0;
z-index: 1;
li {

View File

@ -1,5 +1,5 @@
.loginFixedWindow {
background: $c-lightgreen-2-bg;
background: $c-test-green;
height: 100%;
left: 0;
position: fixed;
@ -22,24 +22,45 @@
}
.login-window {
background-color: $c-white;
//background-color: $c-white;
background-color: rgba(255, 255, 255, .75);
border: 1px solid $c-content-border;
border-radius: 3px;
height: auto;
left: 50%;
margin-left: -220px !important;
margin-top: -150px;
padding: 10px;
position: absolute;
top: 50%;
width: 400px;
margin: 0 auto;
padding: {
bottom: 50px;
left: 20px;
right: 20px;
top: 20px;
};
position: relative;
top: 100px;
width: 350px;
.login-logo-round {
margin-bottom: 25px;
margin-top: 10px;
img {
display: block;
margin: 0 auto;
width: 150px;
}
}
.fa {
color: rgba(0, 0, 0, .4);
color: rgba(0, 0, 0, .2);
float: right;
font-size: 14pt;
margin-right: 5px;
margin-top: -34px;
margin-right: 44px;
margin-top: 11px;
position: absolute;
right: -11px;
&.fa-lock {
right: -9px;
}
}
.wrong-credentials {
@ -54,12 +75,30 @@
.login-input {
@extend %inputs;
width: 387px;
background: $c-login-grey !important;
background-color: $c-login-grey !important;
border: 0;
border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px;
border-top-left-radius: 3px;
border-top-right-radius: 3px;
box-sizing: border-box;
font-size: 14px;
height: 40px;
margin: 0 0 15px;
outline: 0;
padding: 15px;
width: 100%;
}
.form-error {
border: 1px solid $c-negative !important;
}
button {
height: 40px;
width: 100%;
}
}

View File

@ -234,6 +234,11 @@ void ApplicationServer::parseOptions(int argc, char* argv[]) {
if (!helpSection.empty()) {
// user asked for "--help"
// translate "all" to "*"
if (helpSection == "all") {
helpSection = "*";
}
_options->printHelp(helpSection);
exit(EXIT_SUCCESS);
}

View File

@ -82,7 +82,7 @@ void ConfigFeature::validateOptions(std::shared_ptr<ProgramOptions>) {
void ConfigFeature::loadConfigFile(std::shared_ptr<ProgramOptions> options) {
if (StringUtils::tolower(_file) == "none") {
LOG_TOPIC(DEBUG, Logger::CONFIG) << "use 'none' config file at all";
LOG_TOPIC(DEBUG, Logger::CONFIG) << "use no config file at all";
return;
}

View File

@ -25,9 +25,9 @@
#include <iostream>
#include <fstream>
#include "ApplicationFeatures/LoggerFeature.h"
#include "Basics/FileUtils.h"
#include "Logger/Logger.h"
#include "Logger/LoggerFeature.h"
#include "ProgramOptions/ProgramOptions.h"
#include "ProgramOptions/Section.h"

View File

@ -25,11 +25,11 @@
#include <openssl/err.h>
#include "Basics/FileUtils.h"
#include "Basics/UniformCharacter.h"
#include "Basics/ssl-helper.h"
#include "Logger/Logger.h"
#include "ProgramOptions/ProgramOptions.h"
#include "ProgramOptions/Section.h"
#include "Random/UniformCharacter.h"
using namespace arangodb;
using namespace arangodb::basics;

View File

@ -22,9 +22,9 @@
#include "SupervisorFeature.h"
#include "ApplicationFeatures/LoggerFeature.h"
#include "ApplicationFeatures/DaemonFeature.h"
#include "Basics/ArangoGlobalContext.h"
#include "Logger/LoggerFeature.h"
#include "ProgramOptions/ProgramOptions.h"
#include "ProgramOptions/Section.h"

View File

@ -34,11 +34,11 @@
#include "Basics/JsonHelper.h"
#include "Basics/MutexLocker.h"
#include "Basics/RandomGenerator.h"
#include "Basics/gcd.h"
#include "Basics/memory-map.h"
#include "Basics/prime-numbers.h"
#include "Logger/Logger.h"
#include "Random/RandomGenerator.h"
namespace arangodb {
namespace basics {

View File

@ -24,12 +24,10 @@
#include "Nonce.h"
#include <math.h>
#include "Logger/Logger.h"
#include "Basics/MutexLocker.h"
#include "Basics/RandomGenerator.h"
#include "Basics/StringUtils.h"
#include "Logger/Logger.h"
#include "Random/RandomGenerator.h"
using namespace arangodb;
using namespace arangodb::basics;

View File

@ -30,7 +30,7 @@
#include <velocypack/velocypack-aliases.h>
#include "Basics/JsonHelper.h"
#include "Basics/RandomGenerator.h"
#include "Random/RandomGenerator.h"
// We will probably never see more than 2^48 documents in a skip list
#define TRI_SKIPLIST_MAX_HEIGHT 48

View File

@ -30,7 +30,6 @@
#include "Basics/FileUtils.h"
#include "Basics/Mutex.h"
#include "Basics/MutexLocker.h"
#include "Basics/RandomGenerator.h"
#include "Basics/StringBuffer.h"
#include "Basics/Thread.h"
#include "Basics/conversions.h"
@ -39,6 +38,7 @@
#include "Basics/tri-strings.h"
#include "Basics/vector.h"
#include "Logger/Logger.h"
#include "Random/RandomGenerator.h"
using namespace arangodb::basics;
using namespace arangodb;

View File

@ -153,9 +153,7 @@ add_library(${LIB_ARANGO} STATIC
ApplicationFeatures/ConfigFeature.cpp
ApplicationFeatures/ConsoleFeature.cpp
ApplicationFeatures/LanguageFeature.cpp
ApplicationFeatures/LoggerFeature.cpp
ApplicationFeatures/NonceFeature.cpp
ApplicationFeatures/RandomFeature.cpp
ApplicationFeatures/ShutdownFeature.cpp
ApplicationFeatures/SslFeature.cpp
ApplicationFeatures/TempFeature.cpp
@ -173,14 +171,12 @@ add_library(${LIB_ARANGO} STATIC
Basics/Mutex.cpp
Basics/MutexLocker.cpp
Basics/Nonce.cpp
Basics/RandomGenerator.cpp
Basics/ReadWriteLock.cpp
Basics/ReadWriteLockCPP11.cpp
Basics/StringBuffer.cpp
Basics/StringUtils.cpp
Basics/Thread.cpp
Basics/ThreadPool.cpp
Basics/UniformCharacter.cpp
Basics/Utf8Helper.cpp
Basics/VelocyPackHelper.cpp
Basics/WorkMonitor.cpp
@ -220,11 +216,17 @@ add_library(${LIB_ARANGO} STATIC
Logger/LogAppenderFile.cpp
Logger/LogAppenderSyslog.cpp
Logger/LogAppenderTty.cpp
Logger/LogBuffer.cpp
Logger/LogLevel.cpp
Logger/LogThread.cpp
Logger/LogTopic.cpp
Logger/Logger.cpp
Logger/LoggerBufferFeature.cpp
Logger/LoggerFeature.cpp
Logger/LoggerStream.cpp
Random/RandomFeature.cpp
Random/RandomGenerator.cpp
Random/UniformCharacter.cpp
Rest/GeneralRequest.cpp
Rest/GeneralResponse.cpp
Rest/HttpRequest.cpp
@ -235,15 +237,15 @@ add_library(${LIB_ARANGO} STATIC
SimpleHttpClient/ClientConnection.cpp
SimpleHttpClient/ConnectionManager.cpp
SimpleHttpClient/GeneralClientConnection.cpp
SimpleHttpClient/SimpleHttpClient.cpp
SimpleHttpClient/SimpleHttpResult.cpp
SimpleHttpClient/SslClientConnection.cpp
Utilities/LineEditor.cpp
Utilities/ScriptLoader.cpp
Utilities/ShellBase.cpp
Zip/ioapi.cpp
Zip/unzip.cpp
Zip/zip.cpp
SimpleHttpClient/SslClientConnection.cpp
SimpleHttpClient/SimpleHttpClient.cpp
SimpleHttpClient/SimpleHttpResult.cpp
)
################################################################################

View File

@ -45,6 +45,12 @@ std::map<size_t, std::vector<std::shared_ptr<LogAppender>>>
std::map<std::pair<std::string, std::string>, std::shared_ptr<LogAppender>>
LogAppender::_definition2appenders;
std::vector<std::function<void(LogMessage*)>> LogAppender::_loggers;
void LogAppender::addLogger(std::function<void(LogMessage*)> func) {
_loggers.emplace_back(func);
}
void LogAppender::addAppender(std::string const& definition,
std::string const& filter) {
std::vector<std::string> v = StringUtils::split(definition, '=');
@ -208,6 +214,10 @@ void LogAppender::log(LogMessage* message) {
if (!shown) {
writeStderr(level, m);
}
for (auto logger : _loggers) {
logger(message);
}
}
void LogAppender::writeStderr(LogLevel level, std::string const& msg) {

View File

@ -35,6 +35,8 @@ struct LogMessage;
class LogAppender {
public:
static void addLogger(std::function<void(LogMessage*)>);
static void addAppender(std::string const& definition,
std::string const& contentFilter = "");
static void addTtyAppender();
@ -74,6 +76,7 @@ class LogAppender {
_topics2appenders;
static std::map<std::pair<std::string, std::string>,
std::shared_ptr<LogAppender>> _definition2appenders;
static std::vector<std::function<void(LogMessage*)>> _loggers;
};
}

View File

@ -23,6 +23,8 @@
#include "Logger/LogAppenderSyslog.h"
using namespace arangodb;
#ifdef ARANGODB_ENABLE_SYSLOG
// we need to define SYSLOG_NAMES for linux to get a list of names
@ -38,7 +40,6 @@
#include "Basics/MutexLocker.h"
#include "Basics/StringUtils.h"
using namespace arangodb;
using namespace arangodb::basics;
bool LogAppenderSyslog::_opened(false);
@ -122,8 +123,11 @@ std::string LogAppenderSyslog::details() {
LogAppenderSyslog::LogAppenderSyslog(std::string const& facility,
std::string const& name,
std::string const& filter) {
std::string const& filter)
: LogAppender(filter) {
std::abort();
}
void LogAppenderSyslog::close() {}
#endif

View File

@ -49,6 +49,9 @@ class LogAppenderSyslog : public LogAppender {
#else
class LogAppenderSyslog : public LogAppender {
public:
static void close();
public:
LogAppenderSyslog(std::string const& facility, std::string const& name,
std::string const& filter);

View File

@ -1,51 +1,69 @@
////////////////////////////////////////////////////////////////////////////////
/// @brief stores a message in a ring buffer
/// DISCLAIMER
///
/// We ignore any race conditions here.
/// Copyright 2016 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 ArangoDB GmbH, Cologne, Germany
///
/// @author Dr. Frank Celler
////////////////////////////////////////////////////////////////////////////////
static void StoreMessage(LogLevel level, std::string const& message,
size_t offset) {
MUTEX_LOCKER(guard, RingBufferLock);
#include "LogBuffer.h"
uint64_t n = RingBufferId++;
LogBuffer* ptr = &RingBuffer[n % RING_BUFFER_SIZE];
#include <iostream>
#include "Basics/MutexLocker.h"
#include "Logger/LogAppender.h"
#include "Logger/Logger.h"
using namespace arangodb;
Mutex LogBuffer::_ringBufferLock;
uint64_t LogBuffer::_ringBufferId = 0;
LogBuffer LogBuffer::_ringBuffer[RING_BUFFER_SIZE];
static void logEntry(LogMessage* message) {
MUTEX_LOCKER(guard, LogBuffer::_ringBufferLock);
uint64_t n = LogBuffer::_ringBufferId++;
LogBuffer* ptr = &LogBuffer::_ringBuffer[n % LogBuffer::RING_BUFFER_SIZE];
ptr->_id = n;
ptr->_level = level;
ptr->_level = message->_level;
ptr->_timestamp = time(0);
TRI_CopyString(ptr->_message, message.c_str() + offset,
TRI_CopyString(ptr->_message, message->_message.c_str() + message->_offset,
sizeof(ptr->_message) - 1);
}
static Mutex Logger::_ringBufferLock;
static uint64_t Logger::_ringBufferId = 0;
static LogBuffer Logger::_ringBuffer[RING_BUFFER_SIZE];
////////////////////////////////////////////////////////////////////////////////
/// @brief returns the last log entries
////////////////////////////////////////////////////////////////////////////////
std::vector<LogBuffer> Logger::bufferedEntries(LogLevel level, uint64_t start,
bool upToLevel) {
std::vector<LogBuffer> LogBuffer::entries(LogLevel level, uint64_t start,
bool upToLevel) {
std::vector<LogBuffer> result;
MUTEX_LOCKER(guard, RingBufferLock);
MUTEX_LOCKER(guard, LogBuffer::_ringBufferLock);
size_t s = 0;
size_t e;
if (RingBufferId >= RING_BUFFER_SIZE) {
s = e = (RingBufferId + 1) % RING_BUFFER_SIZE;
if (LogBuffer::_ringBufferId >= LogBuffer::RING_BUFFER_SIZE) {
s = e = (LogBuffer::_ringBufferId + 1) % LogBuffer::RING_BUFFER_SIZE;
} else {
e = RingBufferId;
e = LogBuffer::_ringBufferId;
}
for (size_t i = s; i != e;) {
LogBuffer& p = RingBuffer[i];
LogBuffer& p = LogBuffer::_ringBuffer[i];
if (p._id >= start) {
if (upToLevel) {
@ -61,7 +79,7 @@ std::vector<LogBuffer> Logger::bufferedEntries(LogLevel level, uint64_t start,
++i;
if (i >= RING_BUFFER_SIZE) {
if (i >= LogBuffer::RING_BUFFER_SIZE) {
i = 0;
}
}
@ -69,12 +87,4 @@ std::vector<LogBuffer> Logger::bufferedEntries(LogLevel level, uint64_t start,
return result;
}
//////////////////////////////////////////////////////////////////////////////
/// @brief returns the last log entries
//////////////////////////////////////////////////////////////////////////////
static std::vector<LogBuffer> bufferedEntries(LogLevel level, uint64_t start,
bool upToLevel);
#include <iostream>
void LogBuffer::initialize() { LogAppender::addLogger(logEntry); }

View File

@ -1,22 +1,50 @@
////////////////////////////////////////////////////////////////////////////////
/// @brief LogBuffer
/// DISCLAIMER
///
/// This class is used to store a number of log messages in the server
/// for retrieval. This messages are truncated and overwritten without
/// warning.
/// Copyright 2016 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 ArangoDB GmbH, Cologne, Germany
///
/// @author Dr. Frank Celler
////////////////////////////////////////////////////////////////////////////////
#ifndef APPLICATION_FEATURES_LOGGER_BUFFER_H
#define APPLICATION_FEATURES_LOGGER_BUFFER_H 1
#include "Basics/Common.h"
#include "Basics/Mutex.h"
#include "Logger/LogLevel.h"
namespace arangodb {
struct LogBuffer {
static size_t const RING_BUFFER_SIZE = 10240;
static Mutex _ringBufferLock;
static uint64_t _ringBufferId;
static LogBuffer _ringBuffer[];
static std::vector<LogBuffer> entries(LogLevel, uint64_t start,
bool upToLevel);
static void initialize();
uint64_t _id;
LogLevel _level;
time_t _timestamp;
char _message[256];
};
}
static Mutex _ringBufferLock;
static uint64_t _ringBufferId;
static LogBuffer _ringBuffer[];
static void StoreMessage(LogLevel level, std::string const& message, size_t offset);
#endif

View File

@ -0,0 +1,42 @@
////////////////////////////////////////////////////////////////////////////////
/// DISCLAIMER
///
/// Copyright 2016 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 ArangoDB GmbH, Cologne, Germany
///
/// @author Dr. Frank Celler
////////////////////////////////////////////////////////////////////////////////
#include "LoggerBufferFeature.h"
#include "Logger/LogBuffer.h"
#include "ProgramOptions/ProgramOptions.h"
#include "ProgramOptions/Section.h"
using namespace arangodb;
using namespace arangodb::basics;
using namespace arangodb::options;
LoggerBufferFeature::LoggerBufferFeature(application_features::ApplicationServer* server)
: ApplicationFeature(server, "LoggerBuffer") {
setOptional(true);
requiresElevatedPrivileges(false);
startsAfter("Logger");
}
void LoggerBufferFeature::prepare() {
LogBuffer::initialize();
}

View File

@ -0,0 +1,43 @@
////////////////////////////////////////////////////////////////////////////////
/// DISCLAIMER
///
/// Copyright 2016 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 ArangoDB GmbH, Cologne, Germany
///
/// @author Dr. Frank Celler
////////////////////////////////////////////////////////////////////////////////
#ifndef APPLICATION_FEATURES_LOGGER_BUFFER_FEATURE_H
#define APPLICATION_FEATURES_LOGGER_BUFFER_FEATURE_H 1
#include "ApplicationFeatures/ApplicationFeature.h"
namespace arangodb {
class LoggerBufferFeature final : public application_features::ApplicationFeature {
public:
explicit LoggerBufferFeature(application_features::ApplicationServer*);
public:
// void collectOptions(std::shared_ptr<options::ProgramOptions>) override final;
// void loadOptions(std::shared_ptr<options::ProgramOptions>) override final;
// void validateOptions(std::shared_ptr<options::ProgramOptions>) override final;
void prepare() override final;
// void start() override final;
// void stop() override final;
};
}
#endif

View File

@ -20,7 +20,7 @@
/// @author Dr. Frank Celler
////////////////////////////////////////////////////////////////////////////////
#include "ApplicationFeatures/LoggerFeature.h"
#include "LoggerFeature.h"
#include "Basics/StringUtils.h"
#include "Logger/LogAppender.h"

View File

@ -337,7 +337,7 @@ class ProgramOptions {
// finalizes a pass, copying touched into frozen
void endPass() {
if (!_overrideOptions) {
if (_overrideOptions) {
return;
}
for (auto const& it : _processingResult._touched) {

View File

@ -20,14 +20,12 @@
/// @author Dr. Frank Celler
////////////////////////////////////////////////////////////////////////////////
#include "ApplicationFeatures/RandomFeature.h"
#include "RandomFeature.h"
#include <iostream>
#include "Basics/RandomGenerator.h"
#include "Logger/Logger.h"
#include "ProgramOptions/ProgramOptions.h"
#include "ProgramOptions/Section.h"
#include "Random/RandomGenerator.h"
using namespace arangodb;
using namespace arangodb::application_features;

View File

@ -178,6 +178,8 @@ int32_t RandomDevice::other(int32_t left, uint32_t range) {
// RandomDeviceDirect
// -----------------------------------------------------------------------------
#ifndef _WIN32
namespace {
template <int N>
class RandomDeviceDirect : public RandomDevice {
@ -238,10 +240,14 @@ class RandomDeviceDirect : public RandomDevice {
};
}
#endif
// -----------------------------------------------------------------------------
// RandomDeviceCombined
// -----------------------------------------------------------------------------
#ifndef _WIN32
namespace {
template <int N>
class RandomDeviceCombined : public RandomDevice {
@ -338,6 +344,8 @@ class RandomDeviceCombined : public RandomDevice {
};
}
#endif
// -----------------------------------------------------------------------------
// RandomDeviceMersenne
// -----------------------------------------------------------------------------
@ -439,15 +447,15 @@ void RandomGenerator::initialize(RandomType type) {
break;
}
#endif
case RandomType::COMBINED: {
_device.reset(new RandomDeviceCombined<600>("/dev/random"));
break;
}
#endif
#ifdef _WIN32
case RandomType::WIN32: {
case RandomType::WINDOWS_CRYPT: {
_device.reset(new RandomDeviceWin32<1024>());
break;
}

View File

@ -74,8 +74,8 @@ class RandomGenerator {
RANDOM = 2,
URANDOM = 3,
COMBINED = 4,
WIN32 = 5 // uses the built in cryptographic services offered and
// recommended by microsoft (e.g. CryptGenKey(...) )
WINDOWS_CRYPT = 5 // uses the built in cryptographic services offered and
// recommended by microsoft (e.g. CryptGenKey(...) )
};
public:

View File

@ -23,7 +23,7 @@
#include "UniformCharacter.h"
#include "Basics/RandomGenerator.h"
#include "Random/RandomGenerator.h"
using namespace arangodb;

View File

@ -34,8 +34,6 @@
#error missing thread support for openssl, please recomple OpenSSL with threads
#endif
#include "Logger/Logger.h"
#include "Basics/RandomGenerator.h"
#include "Basics/Thread.h"
#include "Basics/VelocyPackHelper.h"
#include "Basics/error.h"
@ -44,6 +42,8 @@
#include "Basics/locks.h"
#include "Basics/mimetypes.h"
#include "Basics/process-utils.h"
#include "Logger/Logger.h"
#include "Random/RandomGenerator.h"
#include "Rest/Version.h"
using namespace arangodb;

View File

@ -29,8 +29,8 @@
#include <openssl/hmac.h>
#include <openssl/rand.h>
#include "Basics/UniformCharacter.h"
#include "Basics/StringUtils.h"
#include "Random/UniformCharacter.h"
#ifdef OPENSSL_NO_SSL2 // OpenSSL > 1.1.0 deprecates RAND_pseudo_bytes
#define RAND_BYTES RAND_bytes

View File

@ -21,46 +21,45 @@
/// @author Dr. Frank Celler
////////////////////////////////////////////////////////////////////////////////
#include "v8-utils.h"
#ifdef _WIN32
#include "Basics/win-utils.h"
#endif
#include "v8-utils.h"
#include "v8-buffer.h"
#include <fstream>
#include <iostream>
#include "ApplicationFeatures/ApplicationServer.h"
#include "unicode/normalizer2.h"
#include "3rdParty/valgrind/valgrind.h"
#include "ApplicationFeatures/ApplicationFeature.h"
#include "ApplicationFeatures/ApplicationServer.h"
#include "ApplicationFeatures/HttpEndpointProvider.h"
#include "Basics/Exceptions.h"
#include "Basics/FileUtils.h"
#include "Basics/Nonce.h"
#include "Basics/RandomGenerator.h"
#include "Basics/StringBuffer.h"
#include "Basics/StringUtils.h"
#include "Basics/UniformCharacter.h"
#include "Basics/Utf8Helper.h"
#include "Basics/files.h"
#include "Basics/process-utils.h"
#include "Basics/tri-strings.h"
#include "Basics/tri-zip.h"
#include "Logger/Logger.h"
#include "Random/RandomGenerator.h"
#include "Random/UniformCharacter.h"
#include "Rest/HttpRequest.h"
#include "Rest/SslInterface.h"
#include "Rest/Version.h"
#include "SimpleHttpClient/GeneralClientConnection.h"
#include "SimpleHttpClient/SimpleHttpClient.h"
#include "SimpleHttpClient/SimpleHttpResult.h"
#include "V8/v8-buffer.h"
#include "V8/v8-conv.h"
#include "V8/v8-globals.h"
#include "V8/v8-vpack.h"
#include "unicode/normalizer2.h"
#include "3rdParty/valgrind/valgrind.h"
using namespace arangodb;
using namespace arangodb::application_features;
using namespace arangodb::basics;