Merge branch 'devel' of github.com:triAGENS/ArangoDB into devel
Conflicts: js/apps/system/aardvark/frontend/scss/generated.css
|
@ -111,6 +111,9 @@ add_executable(
|
||||||
RestServer/VocbaseContext.cpp
|
RestServer/VocbaseContext.cpp
|
||||||
RestServer/arango.cpp
|
RestServer/arango.cpp
|
||||||
SkipLists/skiplistIndex.c
|
SkipLists/skiplistIndex.c
|
||||||
|
Transaction/IdGenerator.cpp
|
||||||
|
Transaction/Manager.cpp
|
||||||
|
Transaction/Transaction.cpp
|
||||||
Utils/DocumentHelper.cpp
|
Utils/DocumentHelper.cpp
|
||||||
V8Server/ApplicationV8.cpp
|
V8Server/ApplicationV8.cpp
|
||||||
V8Server/V8PeriodicTask.cpp
|
V8Server/V8PeriodicTask.cpp
|
||||||
|
@ -144,6 +147,12 @@ add_executable(
|
||||||
VocBase/voc-shaper.c
|
VocBase/voc-shaper.c
|
||||||
VocBase/vocbase.c
|
VocBase/vocbase.c
|
||||||
VocBase/vocbase-defaults.c
|
VocBase/vocbase-defaults.c
|
||||||
|
Wal/AllocatorThread.cpp
|
||||||
|
Wal/CollectorThread.cpp
|
||||||
|
Wal/Configuration.cpp
|
||||||
|
Wal/LogfileManager.cpp
|
||||||
|
Wal/Logfile.cpp
|
||||||
|
Wal/Logger.cpp
|
||||||
${ARANGOD_MRUBY_SOURCE}
|
${ARANGOD_MRUBY_SOURCE}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -112,7 +112,13 @@ bin_arangod_SOURCES = \
|
||||||
arangod/VocBase/update-policy.c \
|
arangod/VocBase/update-policy.c \
|
||||||
arangod/VocBase/voc-shaper.c \
|
arangod/VocBase/voc-shaper.c \
|
||||||
arangod/VocBase/vocbase.c \
|
arangod/VocBase/vocbase.c \
|
||||||
arangod/VocBase/vocbase-defaults.c
|
arangod/VocBase/vocbase-defaults.c \
|
||||||
|
arangod/Wal/AllocatorThread.cpp \
|
||||||
|
arangod/Wal/CollectorThread.cpp \
|
||||||
|
arangod/Wal/Configuration.cpp \
|
||||||
|
arangod/Wal/LogfileManager.cpp \
|
||||||
|
arangod/Wal/Logfile.cpp \
|
||||||
|
arangod/Wal/Logger.cpp
|
||||||
|
|
||||||
if ENABLE_CLUSTER
|
if ENABLE_CLUSTER
|
||||||
|
|
||||||
|
|
|
@ -80,6 +80,7 @@
|
||||||
#include "V8Server/ApplicationV8.h"
|
#include "V8Server/ApplicationV8.h"
|
||||||
#include "VocBase/auth.h"
|
#include "VocBase/auth.h"
|
||||||
#include "VocBase/server.h"
|
#include "VocBase/server.h"
|
||||||
|
#include "Wal/Configuration.h"
|
||||||
|
|
||||||
#ifdef TRI_ENABLE_CLUSTER
|
#ifdef TRI_ENABLE_CLUSTER
|
||||||
#include "Cluster/ApplicationCluster.h"
|
#include "Cluster/ApplicationCluster.h"
|
||||||
|
@ -289,6 +290,7 @@ ArangoServer::ArangoServer (int argc, char** argv)
|
||||||
: _argc(argc),
|
: _argc(argc),
|
||||||
_argv(argv),
|
_argv(argv),
|
||||||
_tempPath(),
|
_tempPath(),
|
||||||
|
_walConfiguration(0),
|
||||||
_applicationScheduler(0),
|
_applicationScheduler(0),
|
||||||
_applicationDispatcher(0),
|
_applicationDispatcher(0),
|
||||||
_applicationEndpointServer(0),
|
_applicationEndpointServer(0),
|
||||||
|
@ -384,7 +386,10 @@ void ArangoServer::buildApplicationServer () {
|
||||||
|
|
||||||
// arangod allows defining a user-specific configuration file. arangosh and the other binaries don't
|
// arangod allows defining a user-specific configuration file. arangosh and the other binaries don't
|
||||||
_applicationServer->setUserConfigFile(".arango" + string(1, TRI_DIR_SEPARATOR_CHAR) + string(conf));
|
_applicationServer->setUserConfigFile(".arango" + string(1, TRI_DIR_SEPARATOR_CHAR) + string(conf));
|
||||||
|
/*
|
||||||
|
_walConfiguration = new wal::Configuration();
|
||||||
|
_applicationServer->addFeature(_walConfiguration);
|
||||||
|
*/
|
||||||
// .............................................................................
|
// .............................................................................
|
||||||
// dispatcher
|
// dispatcher
|
||||||
// .............................................................................
|
// .............................................................................
|
||||||
|
|
|
@ -56,6 +56,10 @@ namespace triagens {
|
||||||
class HttpsServer;
|
class HttpsServer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace wal {
|
||||||
|
class Configuration;
|
||||||
|
}
|
||||||
|
|
||||||
namespace admin {
|
namespace admin {
|
||||||
class ApplicationAdminServer;
|
class ApplicationAdminServer;
|
||||||
}
|
}
|
||||||
|
@ -186,6 +190,12 @@ namespace triagens {
|
||||||
|
|
||||||
std::string _tempPath;
|
std::string _tempPath;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief write-ahead log configuration
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
wal::Configuration* _walConfiguration;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
/// @brief application scheduler
|
/// @brief application scheduler
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -110,10 +110,6 @@ int Transaction::abort () {
|
||||||
return TRI_ERROR_TRANSACTION_INTERNAL;
|
return TRI_ERROR_TRANSACTION_INTERNAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
|
||||||
// --SECTION-- private methods
|
|
||||||
// -----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
// Local Variables:
|
// Local Variables:
|
||||||
// mode: outline-minor
|
// mode: outline-minor
|
||||||
// outline-regexp: "/// @brief\\|/// {@inheritDoc}\\|/// @addtogroup\\|/// @page\\|// --SECTION--\\|/// @\\}"
|
// outline-regexp: "/// @brief\\|/// {@inheritDoc}\\|/// @addtogroup\\|/// @page\\|// --SECTION--\\|/// @\\}"
|
||||||
|
|
|
@ -0,0 +1,139 @@
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief Write-ahead log storage allocator thread
|
||||||
|
///
|
||||||
|
/// @file
|
||||||
|
///
|
||||||
|
/// DISCLAIMER
|
||||||
|
///
|
||||||
|
/// Copyright 2004-2013 triAGENS 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 triAGENS GmbH, Cologne, Germany
|
||||||
|
///
|
||||||
|
/// @author Jan Steemann
|
||||||
|
/// @author Copyright 2011-2013, triAGENS GmbH, Cologne, Germany
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "AllocatorThread.h"
|
||||||
|
#include "BasicsC/logging.h"
|
||||||
|
#include "Basics/ConditionLocker.h"
|
||||||
|
#include "Wal/LogfileManager.h"
|
||||||
|
|
||||||
|
using namespace triagens::wal;
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- constructors and destructors
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief create the allocator thread
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
AllocatorThread::AllocatorThread (LogfileManager* logfileManager)
|
||||||
|
: Thread("WalAllocator"),
|
||||||
|
_logfileManager(logfileManager),
|
||||||
|
_condition(),
|
||||||
|
_createLogfile(false),
|
||||||
|
_stop(0) {
|
||||||
|
|
||||||
|
allowAsynchronousCancelation();
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief destroy the allocator thread
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
AllocatorThread::~AllocatorThread () {
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- public methods
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief initialises the allocator thread
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
bool AllocatorThread::init () {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief stops the allocator thread
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void AllocatorThread::stop () {
|
||||||
|
if (_stop > 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_stop = 1;
|
||||||
|
_condition.signal();
|
||||||
|
|
||||||
|
while (_stop != 2) {
|
||||||
|
usleep(1000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief signal the creation of a new logfile
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void AllocatorThread::signalLogfileCreation () {
|
||||||
|
CONDITION_LOCKER(guard, _condition);
|
||||||
|
|
||||||
|
_createLogfile = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief creates a new logfile
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
bool AllocatorThread::createLogfile () {
|
||||||
|
int res = _logfileManager->allocateDatafile();
|
||||||
|
|
||||||
|
return (res == TRI_ERROR_NO_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- Thread methods
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief main loop
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void AllocatorThread::run () {
|
||||||
|
while (_stop == 0) {
|
||||||
|
CONDITION_LOCKER(guard, _condition);
|
||||||
|
|
||||||
|
if (_createLogfile) {
|
||||||
|
if (createLogfile()) {
|
||||||
|
_createLogfile = false;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
LOG_ERROR("unable to create new wal logfile");
|
||||||
|
}
|
||||||
|
|
||||||
|
guard.wait(1000000);
|
||||||
|
}
|
||||||
|
|
||||||
|
_stop = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Local Variables:
|
||||||
|
// mode: outline-minor
|
||||||
|
// outline-regexp: "/// @brief\\|/// {@inheritDoc}\\|/// @addtogroup\\|/// @page\\|// --SECTION--\\|/// @\\}"
|
||||||
|
// End:
|
|
@ -0,0 +1,160 @@
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief Write-ahead log storage allocator thread
|
||||||
|
///
|
||||||
|
/// @file
|
||||||
|
///
|
||||||
|
/// DISCLAIMER
|
||||||
|
///
|
||||||
|
/// Copyright 2004-2013 triAGENS 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 triAGENS GmbH, Cologne, Germany
|
||||||
|
///
|
||||||
|
/// @author Jan Steemann
|
||||||
|
/// @author Copyright 2011-2013, triAGENS GmbH, Cologne, Germany
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef TRIAGENS_WAL_ALLOCATOR_THREAD_H
|
||||||
|
#define TRIAGENS_WAL_ALLOCATOR_THREAD_H 1
|
||||||
|
|
||||||
|
#include "Basics/Common.h"
|
||||||
|
#include "Basics/ConditionVariable.h"
|
||||||
|
#include "Basics/Thread.h"
|
||||||
|
|
||||||
|
namespace triagens {
|
||||||
|
namespace wal {
|
||||||
|
|
||||||
|
class LogfileManager;
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- class AllocatorThread
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class AllocatorThread : public basics::Thread {
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief AllocatorThread
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
private:
|
||||||
|
AllocatorThread (AllocatorThread const&);
|
||||||
|
AllocatorThread& operator= (AllocatorThread const&);
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- constructors and destructors
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief create the allocator thread
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
AllocatorThread (LogfileManager*);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief destroy the allocator thread
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
~AllocatorThread ();
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- public methods
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief initialises the allocator thread
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
bool init ();
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief stops the allocator thread
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void stop ();
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief signal the creation of a new logfile
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void signalLogfileCreation ();
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief creates a new logfile
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
bool createLogfile ();
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- Thread methods
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief main loop
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void run ();
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- private methods
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- private variables
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief the logfile manager
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
LogfileManager* _logfileManager;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief condition variable for the allocator thread
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
basics::ConditionVariable _condition;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief whether or not we should create a new logfile
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
bool _createLogfile;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief stop flag
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
volatile sig_atomic_t _stop;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Local Variables:
|
||||||
|
// mode: outline-minor
|
||||||
|
// outline-regexp: "/// @brief\\|/// {@inheritDoc}\\|/// @addtogroup\\|/// @page\\|// --SECTION--\\|/// @\\}"
|
||||||
|
// End:
|
|
@ -0,0 +1,110 @@
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief Write-ahead log garbage collection thread
|
||||||
|
///
|
||||||
|
/// @file
|
||||||
|
///
|
||||||
|
/// DISCLAIMER
|
||||||
|
///
|
||||||
|
/// Copyright 2004-2013 triAGENS 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 triAGENS GmbH, Cologne, Germany
|
||||||
|
///
|
||||||
|
/// @author Jan Steemann
|
||||||
|
/// @author Copyright 2011-2013, triAGENS GmbH, Cologne, Germany
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "CollectorThread.h"
|
||||||
|
#include "BasicsC/logging.h"
|
||||||
|
#include "Basics/ConditionLocker.h"
|
||||||
|
#include "Wal/LogfileManager.h"
|
||||||
|
|
||||||
|
using namespace triagens::wal;
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- constructors and destructors
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief create the collector thread
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
CollectorThread::CollectorThread (LogfileManager* logfileManager)
|
||||||
|
: Thread("WalCollector"),
|
||||||
|
_logfileManager(logfileManager),
|
||||||
|
_condition(),
|
||||||
|
_stop(0) {
|
||||||
|
|
||||||
|
allowAsynchronousCancelation();
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief destroy the collector thread
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
CollectorThread::~CollectorThread () {
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- public methods
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief initialises the collector thread
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
bool CollectorThread::init () {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief stops the collector thread
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void CollectorThread::stop () {
|
||||||
|
if (_stop > 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_stop = 1;
|
||||||
|
_condition.signal();
|
||||||
|
|
||||||
|
while (_stop != 2) {
|
||||||
|
usleep(1000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- Thread methods
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief main loop
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void CollectorThread::run () {
|
||||||
|
while (_stop == 0) {
|
||||||
|
CONDITION_LOCKER(guard, _condition);
|
||||||
|
|
||||||
|
// TODO: implement collection
|
||||||
|
guard.wait(1000000);
|
||||||
|
}
|
||||||
|
|
||||||
|
_stop = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Local Variables:
|
||||||
|
// mode: outline-minor
|
||||||
|
// outline-regexp: "/// @brief\\|/// {@inheritDoc}\\|/// @addtogroup\\|/// @page\\|// --SECTION--\\|/// @\\}"
|
||||||
|
// End:
|
|
@ -0,0 +1,142 @@
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief Write-ahead log garbage collection thread
|
||||||
|
///
|
||||||
|
/// @file
|
||||||
|
///
|
||||||
|
/// DISCLAIMER
|
||||||
|
///
|
||||||
|
/// Copyright 2004-2013 triAGENS 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 triAGENS GmbH, Cologne, Germany
|
||||||
|
///
|
||||||
|
/// @author Jan Steemann
|
||||||
|
/// @author Copyright 2011-2013, triAGENS GmbH, Cologne, Germany
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef TRIAGENS_WAL_COLLECTOR_THREAD_H
|
||||||
|
#define TRIAGENS_WAL_COLLECTOR_THREAD_H 1
|
||||||
|
|
||||||
|
#include "Basics/Common.h"
|
||||||
|
#include "Basics/ConditionVariable.h"
|
||||||
|
#include "Basics/Thread.h"
|
||||||
|
|
||||||
|
namespace triagens {
|
||||||
|
namespace wal {
|
||||||
|
|
||||||
|
class LogfileManager;
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- class CollectorThread
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class CollectorThread : public basics::Thread {
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief CollectorThread
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
private:
|
||||||
|
CollectorThread (CollectorThread const&);
|
||||||
|
CollectorThread& operator= (CollectorThread const&);
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- constructors and destructors
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief create the collector thread
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
CollectorThread (LogfileManager*);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief destroy the collector thread
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
~CollectorThread ();
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- public methods
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief initialises the collector thread
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
bool init ();
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief stops the collector thread
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void stop ();
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- Thread methods
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief main loop
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void run ();
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- private methods
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- private variables
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief the logfile manager
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
LogfileManager* _logfileManager;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief condition variable for the collector thread
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
basics::ConditionVariable _condition;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief stop flag
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
volatile sig_atomic_t _stop;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Local Variables:
|
||||||
|
// mode: outline-minor
|
||||||
|
// outline-regexp: "/// @brief\\|/// {@inheritDoc}\\|/// @addtogroup\\|/// @page\\|// --SECTION--\\|/// @\\}"
|
||||||
|
// End:
|
|
@ -0,0 +1,143 @@
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief Write-ahead log configuration
|
||||||
|
///
|
||||||
|
/// @file
|
||||||
|
///
|
||||||
|
/// DISCLAIMER
|
||||||
|
///
|
||||||
|
/// Copyright 2004-2013 triAGENS 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 triAGENS GmbH, Cologne, Germany
|
||||||
|
///
|
||||||
|
/// @author Jan Steemann
|
||||||
|
/// @author Copyright 2011-2013, triAGENS GmbH, Cologne, Germany
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "Configuration.h"
|
||||||
|
#include "BasicsC/logging.h"
|
||||||
|
#include "Wal/LogfileManager.h"
|
||||||
|
|
||||||
|
using namespace triagens::wal;
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- constructors and destructors
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief create the configuration
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
Configuration::Configuration ()
|
||||||
|
: ApplicationFeature("wal"),
|
||||||
|
_logfileManager(nullptr),
|
||||||
|
_filesize(32 * 1024 * 1024),
|
||||||
|
_numberOfLogfiles(4),
|
||||||
|
_reserveSize(16 * 1024 * 1024),
|
||||||
|
_directory() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief destroy the configuration
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
Configuration::~Configuration () {
|
||||||
|
if (_logfileManager != nullptr) {
|
||||||
|
delete _logfileManager;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- ApplicationFeature methods
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// {@inheritDoc}
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void Configuration::setupOptions (std::map<std::string, basics::ProgramOptionsDescription>& options) {
|
||||||
|
options["Write-ahead log options:help-wal"]
|
||||||
|
("wal.filesize", &_filesize, "size of each logfile")
|
||||||
|
("wal.logfiles", &_numberOfLogfiles, "target number of logfiles")
|
||||||
|
("wal.reserve", &_reserveSize, "minimum space to reserve for new data")
|
||||||
|
("wal.directory", &_directory, "logfile directory")
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// {@inheritDoc}
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
bool Configuration::prepare () {
|
||||||
|
if (_directory.empty()) {
|
||||||
|
LOG_FATAL_AND_EXIT("no directory specified for write-ahead logs. Please provide the --wal.directory option");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_directory[_directory.size() - 1] != TRI_DIR_SEPARATOR_CHAR) {
|
||||||
|
// append a trailing slash to directory name
|
||||||
|
_directory.push_back(TRI_DIR_SEPARATOR_CHAR);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// {@inheritDoc}
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
bool Configuration::start () {
|
||||||
|
_logfileManager = new LogfileManager(this);
|
||||||
|
|
||||||
|
assert(_logfileManager != nullptr);
|
||||||
|
|
||||||
|
int res = _logfileManager->startup();
|
||||||
|
|
||||||
|
if (res != TRI_ERROR_NO_ERROR) {
|
||||||
|
LOG_ERROR("could not initialise wal components: %s", TRI_errno_string(res));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// {@inheritDoc}
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
bool Configuration::open () {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// {@inheritDoc}
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void Configuration::close () {
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// {@inheritDoc}
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void Configuration::stop () {
|
||||||
|
if (_logfileManager != nullptr) {
|
||||||
|
_logfileManager->shutdown();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Local Variables:
|
||||||
|
// mode: outline-minor
|
||||||
|
// outline-regexp: "/// @brief\\|/// {@inheritDoc}\\|/// @addtogroup\\|/// @page\\|// --SECTION--\\|/// @\\}"
|
||||||
|
// End:
|
|
@ -0,0 +1,211 @@
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief Write-ahead log configuration
|
||||||
|
///
|
||||||
|
/// @file
|
||||||
|
///
|
||||||
|
/// DISCLAIMER
|
||||||
|
///
|
||||||
|
/// Copyright 2004-2013 triAGENS 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 triAGENS GmbH, Cologne, Germany
|
||||||
|
///
|
||||||
|
/// @author Jan Steemann
|
||||||
|
/// @author Copyright 2011-2013, triAGENS GmbH, Cologne, Germany
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef TRIAGENS_WAL_LOGFILE_CONFIGURATION_H
|
||||||
|
#define TRIAGENS_WAL_LOGFILE_CONFIGURATION_H 1
|
||||||
|
|
||||||
|
#include "Basics/Common.h"
|
||||||
|
#include "ApplicationServer/ApplicationFeature.h"
|
||||||
|
|
||||||
|
namespace triagens {
|
||||||
|
namespace wal {
|
||||||
|
|
||||||
|
class LogfileManager;
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- class Configuration
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class Configuration : public rest::ApplicationFeature {
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief Configuration
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
private:
|
||||||
|
Configuration (Configuration const&);
|
||||||
|
Configuration& operator= (Configuration const&);
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- constructors and destructors
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief create the configuration
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
Configuration ();
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief destroy the configuration
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
~Configuration ();
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- ApplicationFeature methods
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// {@inheritDoc}
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void setupOptions (std::map<string, basics::ProgramOptionsDescription>&);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// {@inheritDoc}
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
bool prepare ();
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// {@inheritDoc}
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
bool open ();
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// {@inheritDoc}
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
bool start ();
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// {@inheritDoc}
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void close ();
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// {@inheritDoc}
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void stop ();
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- public methods
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief get the logfile size
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
uint32_t filesize () const {
|
||||||
|
return _filesize;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief get the maximum number of logfiles
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
uint32_t numberOfLogfiles () const {
|
||||||
|
return _numberOfLogfiles;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief get the maximum size for all logfiles
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
uint64_t maximumSize () const {
|
||||||
|
return static_cast<uint64_t>(_filesize) * static_cast<uint64_t>(_numberOfLogfiles);
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief get the reserve size for all logfiles
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
uint64_t reserveSize () const {
|
||||||
|
return static_cast<uint64_t>(_reserveSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief get the logfile directory
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
std::string directory () const {
|
||||||
|
return _directory;
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- private methods
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- private variables
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief the logfile manager
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
LogfileManager* _logfileManager;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief the size of each logfile
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
uint32_t _filesize;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief the target number of logfiles
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
uint32_t _numberOfLogfiles;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief the reserve free space
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
uint32_t _reserveSize;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief the logfile directory
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
std::string _directory;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Local Variables:
|
||||||
|
// mode: outline-minor
|
||||||
|
// outline-regexp: "/// @brief\\|/// {@inheritDoc}\\|/// @addtogroup\\|/// @page\\|// --SECTION--\\|/// @\\}"
|
||||||
|
// End:
|
|
@ -0,0 +1,115 @@
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief Write-ahead log entry
|
||||||
|
///
|
||||||
|
/// @file
|
||||||
|
///
|
||||||
|
/// DISCLAIMER
|
||||||
|
///
|
||||||
|
/// Copyright 2004-2013 triAGENS 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 triAGENS GmbH, Cologne, Germany
|
||||||
|
///
|
||||||
|
/// @author Jan Steemann
|
||||||
|
/// @author Copyright 2011-2013, triAGENS GmbH, Cologne, Germany
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef TRIAGENS_WAL_LOG_ENTRY_H
|
||||||
|
#define TRIAGENS_WAL_LOG_ENTRY_H 1
|
||||||
|
|
||||||
|
#include "Basics/Common.h"
|
||||||
|
#include "VocBase/voc-types.h"
|
||||||
|
|
||||||
|
namespace triagens {
|
||||||
|
namespace wal {
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- struct LogEntry
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
struct LogEntry {
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- typedefs
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
typedef TRI_voc_tick_t TickType;
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- constructors and destructors
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief create a log entry
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
LogEntry (void* mem,
|
||||||
|
size_t size,
|
||||||
|
TickType tick)
|
||||||
|
: _mem(mem),
|
||||||
|
_size(size),
|
||||||
|
_tick(tick) {
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief destroy a log entry
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
~LogEntry () {
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- public methods
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief check if the entry is valid
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
bool isValid () const {
|
||||||
|
return _mem != nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- public variables
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief the position in memory where the log entry resides
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void* const _mem;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief the size of the log entry
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
size_t const _size;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief the id (sequence number of the log entry)
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
TickType _tick;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Local Variables:
|
||||||
|
// mode: outline-minor
|
||||||
|
// outline-regexp: "/// @brief\\|/// {@inheritDoc}\\|/// @addtogroup\\|/// @page\\|// --SECTION--\\|/// @\\}"
|
||||||
|
// End:
|
|
@ -0,0 +1,55 @@
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief Write-ahead log logfile
|
||||||
|
///
|
||||||
|
/// @file
|
||||||
|
///
|
||||||
|
/// DISCLAIMER
|
||||||
|
///
|
||||||
|
/// Copyright 2004-2013 triAGENS 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 triAGENS GmbH, Cologne, Germany
|
||||||
|
///
|
||||||
|
/// @author Jan Steemann
|
||||||
|
/// @author Copyright 2011-2013, triAGENS GmbH, Cologne, Germany
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "Logfile.h"
|
||||||
|
|
||||||
|
using namespace triagens::wal;
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- constructors and destructors
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief create the logfile
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
Logfile::Logfile (TRI_datafile_t* df)
|
||||||
|
: _df(df) {
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief destroy the logfile
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
Logfile::~Logfile () {
|
||||||
|
TRI_CloseDatafile(_df);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Local Variables:
|
||||||
|
// mode: outline-minor
|
||||||
|
// outline-regexp: "/// @brief\\|/// {@inheritDoc}\\|/// @addtogroup\\|/// @page\\|// --SECTION--\\|/// @\\}"
|
||||||
|
// End:
|
|
@ -0,0 +1,134 @@
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief Write-ahead log logfile
|
||||||
|
///
|
||||||
|
/// @file
|
||||||
|
///
|
||||||
|
/// DISCLAIMER
|
||||||
|
///
|
||||||
|
/// Copyright 2004-2013 triAGENS 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 triAGENS GmbH, Cologne, Germany
|
||||||
|
///
|
||||||
|
/// @author Jan Steemann
|
||||||
|
/// @author Copyright 2011-2013, triAGENS GmbH, Cologne, Germany
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef TRIAGENS_WAL_LOGFILE_H
|
||||||
|
#define TRIAGENS_WAL_LOGFILE_H 1
|
||||||
|
|
||||||
|
#include "Basics/Common.h"
|
||||||
|
#include "VocBase/datafile.h"
|
||||||
|
|
||||||
|
namespace triagens {
|
||||||
|
namespace wal {
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- class Logfile
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class Logfile {
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- typedefs
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief typedef for logfile ids
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
typedef TRI_voc_fid_t IdType;
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- constructors and destructors
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief Logfile
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
Logfile (Logfile const&);
|
||||||
|
Logfile& operator= (Logfile const&);
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief create a logfile
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
Logfile (TRI_datafile_t*);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief destroy a logfile
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
~Logfile ();
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- public methods
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief return the allocated size of the logfile
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
uint64_t allocatedSize () const {
|
||||||
|
return static_cast<uint64_t>(_df->_maximalSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief return the size of the free space in the logfile
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
uint64_t freeSize () const {
|
||||||
|
if (_df->_isSealed) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return static_cast<uint64_t>(allocatedSize() - _df->_footerSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief whether or not the logfile is sealed
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
bool isSealed () const {
|
||||||
|
return _df->_isSealed;
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- public variables
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief the datafile entry
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
TRI_datafile_t* _df;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Local Variables:
|
||||||
|
// mode: outline-minor
|
||||||
|
// outline-regexp: "/// @brief\\|/// {@inheritDoc}\\|/// @addtogroup\\|/// @page\\|// --SECTION--\\|/// @\\}"
|
||||||
|
// End:
|
|
@ -0,0 +1,553 @@
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief Write-ahead log logfile manager
|
||||||
|
///
|
||||||
|
/// @file
|
||||||
|
///
|
||||||
|
/// DISCLAIMER
|
||||||
|
///
|
||||||
|
/// Copyright 2004-2013 triAGENS 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 triAGENS GmbH, Cologne, Germany
|
||||||
|
///
|
||||||
|
/// @author Jan Steemann
|
||||||
|
/// @author Copyright 2011-2013, triAGENS GmbH, Cologne, Germany
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "LogfileManager.h"
|
||||||
|
#include "BasicsC/json.h"
|
||||||
|
#include "BasicsC/logging.h"
|
||||||
|
#include "Basics/Exceptions.h"
|
||||||
|
#include "Basics/FileUtils.h"
|
||||||
|
#include "Basics/JsonHelper.h"
|
||||||
|
#include "Basics/MutexLocker.h"
|
||||||
|
#include "Basics/ReadLocker.h"
|
||||||
|
#include "Basics/StringUtils.h"
|
||||||
|
#include "Basics/WriteLocker.h"
|
||||||
|
#include "Wal/AllocatorThread.h"
|
||||||
|
#include "Wal/CollectorThread.h"
|
||||||
|
#include "Wal/Configuration.h"
|
||||||
|
|
||||||
|
using namespace triagens::wal;
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- constructors and destructors
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief create the logfile manager
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
LogfileManager::LogfileManager (Configuration* configuration)
|
||||||
|
: _configuration(configuration),
|
||||||
|
_tickLock(),
|
||||||
|
_tick(0),
|
||||||
|
_allocatorThread(nullptr),
|
||||||
|
_collectorThread(nullptr),
|
||||||
|
_logfileIdLock(),
|
||||||
|
_logfileId(0),
|
||||||
|
_logfilesLock(),
|
||||||
|
_logfiles(),
|
||||||
|
_directory(configuration->directory()) {
|
||||||
|
|
||||||
|
int res = regcomp(&_regex, "^logfile-([0-9][0-9]*)\\.db$", REG_EXTENDED);
|
||||||
|
|
||||||
|
if (res != 0) {
|
||||||
|
THROW_INTERNAL_ERROR("could not compile regex");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief destroy the logfile manager
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
LogfileManager::~LogfileManager () {
|
||||||
|
shutdown();
|
||||||
|
regfree(&_regex);
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- public methods
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief startup the logfile manager
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
int LogfileManager::startup () {
|
||||||
|
int res = inventory();
|
||||||
|
|
||||||
|
if (res != TRI_ERROR_NO_ERROR) {
|
||||||
|
LOG_ERROR("could not create wal logfile inventory: %s", TRI_errno_string(res));
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string const shutdownFile = shutdownFilename();
|
||||||
|
bool const shutdownFileExists = basics::FileUtils::exists(shutdownFile);
|
||||||
|
|
||||||
|
if (shutdownFileExists) {
|
||||||
|
res = readShutdownInfo();
|
||||||
|
|
||||||
|
if (res != TRI_ERROR_NO_ERROR) {
|
||||||
|
LOG_ERROR("could not open shutdown file '%s': %s", shutdownFile.c_str(), TRI_errno_string(res));
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
res = openLogfiles();
|
||||||
|
|
||||||
|
if (res != TRI_ERROR_NO_ERROR) {
|
||||||
|
LOG_ERROR("could not open wal logfiles: %s", TRI_errno_string(res));
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
res = reserveSpace();
|
||||||
|
|
||||||
|
if (res != TRI_ERROR_NO_ERROR) {
|
||||||
|
LOG_ERROR("could not reserve wal space: %s", TRI_errno_string(res));
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
res = startAllocatorThread();
|
||||||
|
|
||||||
|
if (res != TRI_ERROR_NO_ERROR) {
|
||||||
|
LOG_ERROR("could not start wal allocator thread: %s", TRI_errno_string(res));
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
res = startCollectorThread();
|
||||||
|
|
||||||
|
if (res != TRI_ERROR_NO_ERROR) {
|
||||||
|
LOG_ERROR("could not start wal collector thread: %s", TRI_errno_string(res));
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (shutdownFileExists) {
|
||||||
|
// delete the shutdown file if it existed
|
||||||
|
if (! basics::FileUtils::remove(shutdownFile, &res)) {
|
||||||
|
LOG_ERROR("could not remove shutdown file '%s': %s", shutdownFile.c_str(), TRI_errno_string(res));
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LOG_INFO("wal logfile manager started successfully");
|
||||||
|
|
||||||
|
return TRI_ERROR_NO_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief shuts down and closes all open logfiles
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void LogfileManager::shutdown () {
|
||||||
|
// stop threads
|
||||||
|
stopCollectorThread();
|
||||||
|
stopAllocatorThread();
|
||||||
|
|
||||||
|
// close all open logfiles
|
||||||
|
WRITE_LOCKER(_logfilesLock);
|
||||||
|
|
||||||
|
for (auto it = _logfiles.begin(); it != _logfiles.end(); ++it) {
|
||||||
|
Logfile* logfile = (*it).second;
|
||||||
|
|
||||||
|
if (logfile != nullptr) {
|
||||||
|
delete logfile;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_logfiles.clear();
|
||||||
|
|
||||||
|
int res = writeShutdownInfo();
|
||||||
|
|
||||||
|
if (res != TRI_ERROR_NO_ERROR) {
|
||||||
|
LOG_ERROR("could not write wal shutdown info: %s", TRI_errno_string(res));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief reserve space in a log file
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
LogEntry LogfileManager::reserve (size_t size) {
|
||||||
|
LogEntry::TickType const tick = nextTick();
|
||||||
|
|
||||||
|
LogEntry entry = LogEntry(0, size, tick);
|
||||||
|
|
||||||
|
return entry;
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- private methods
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief increases the tick value and returns it
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
LogEntry::TickType LogfileManager::nextTick () {
|
||||||
|
WRITE_LOCKER(_tickLock);
|
||||||
|
return ++_tick;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief returns the last assigned tick
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
LogEntry::TickType LogfileManager::currentTick () {
|
||||||
|
READ_LOCKER(_tickLock);
|
||||||
|
return _tick;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief reads the shutdown information
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
int LogfileManager::readShutdownInfo () {
|
||||||
|
std::string const filename = shutdownFilename();
|
||||||
|
|
||||||
|
TRI_json_t* json = TRI_JsonFile(TRI_UNKNOWN_MEM_ZONE, filename.c_str(), nullptr);
|
||||||
|
|
||||||
|
if (json == nullptr) {
|
||||||
|
return TRI_ERROR_INTERNAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint64_t const tick = basics::JsonHelper::stringUInt64(json, "maxTick");
|
||||||
|
|
||||||
|
_tick = static_cast<LogEntry::TickType>(tick);
|
||||||
|
|
||||||
|
TRI_FreeJson(TRI_UNKNOWN_MEM_ZONE, json);
|
||||||
|
|
||||||
|
return TRI_ERROR_NO_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief writes the shutdown information
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
int LogfileManager::writeShutdownInfo () {
|
||||||
|
std::string const filename = shutdownFilename();
|
||||||
|
|
||||||
|
std::string content;
|
||||||
|
content.append("{\"maxTick\":\"");
|
||||||
|
content.append(basics::StringUtils::itoa(currentTick()));
|
||||||
|
content.append("\"}");
|
||||||
|
|
||||||
|
// TODO: spit() doesn't return success/failure. FIXME!
|
||||||
|
basics::FileUtils::spit(filename, content);
|
||||||
|
|
||||||
|
return TRI_ERROR_NO_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief start the allocator thread
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
int LogfileManager::startAllocatorThread () {
|
||||||
|
_allocatorThread = new AllocatorThread(this);
|
||||||
|
|
||||||
|
if (_allocatorThread == nullptr) {
|
||||||
|
return TRI_ERROR_INTERNAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! _allocatorThread->init() ||
|
||||||
|
! _allocatorThread->start()) {
|
||||||
|
return TRI_ERROR_INTERNAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRI_ERROR_NO_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief stop the allocator thread
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void LogfileManager::stopAllocatorThread () {
|
||||||
|
if (_allocatorThread != nullptr) {
|
||||||
|
LOG_TRACE("stopping wal allocator thread");
|
||||||
|
|
||||||
|
_allocatorThread->stop();
|
||||||
|
_allocatorThread->shutdown();
|
||||||
|
|
||||||
|
delete _allocatorThread;
|
||||||
|
_allocatorThread = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief start the collector thread
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
int LogfileManager::startCollectorThread () {
|
||||||
|
_collectorThread = new CollectorThread(this);
|
||||||
|
|
||||||
|
if (_collectorThread == nullptr) {
|
||||||
|
return TRI_ERROR_INTERNAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! _collectorThread->init() ||
|
||||||
|
! _collectorThread->start()) {
|
||||||
|
return TRI_ERROR_INTERNAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRI_ERROR_NO_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief stop the collector thread
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void LogfileManager::stopCollectorThread () {
|
||||||
|
if (_collectorThread != nullptr) {
|
||||||
|
LOG_TRACE("stopping wal collector thread");
|
||||||
|
|
||||||
|
_collectorThread->stop();
|
||||||
|
_collectorThread->shutdown();
|
||||||
|
|
||||||
|
delete _collectorThread;
|
||||||
|
_collectorThread = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief check which logfiles are present in the log directory
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
int LogfileManager::inventory () {
|
||||||
|
int res = ensureDirectory();
|
||||||
|
|
||||||
|
if (res != TRI_ERROR_NO_ERROR) {
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
LOG_INFO("scanning wal directory: '%s'", _directory.c_str());
|
||||||
|
std::vector<std::string> files = basics::FileUtils::listFiles(_directory);
|
||||||
|
|
||||||
|
for (auto it = files.begin(); it != files.end(); ++it) {
|
||||||
|
regmatch_t matches[2];
|
||||||
|
std::string const file = (*it);
|
||||||
|
char const* s = file.c_str();
|
||||||
|
|
||||||
|
if (regexec(&_regex, s, sizeof(matches) / sizeof(matches[1]), matches, 0) == 0) {
|
||||||
|
Logfile::IdType const id = basics::StringUtils::uint64(s + matches[1].rm_so, matches[1].rm_eo - matches[1].rm_so);
|
||||||
|
|
||||||
|
WRITE_LOCKER(_logfilesLock);
|
||||||
|
_logfiles.insert(make_pair(id, nullptr));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// now pick up the logfile with the highest id and use its id
|
||||||
|
|
||||||
|
READ_LOCKER(_logfilesLock);
|
||||||
|
if (! _logfiles.empty()) {
|
||||||
|
auto it = _logfiles.rbegin();
|
||||||
|
|
||||||
|
MUTEX_LOCKER(_logfileIdLock);
|
||||||
|
_logfileId = (*it).first;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRI_ERROR_NO_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief scan the logfiles in the log directory
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
int LogfileManager::openLogfiles () {
|
||||||
|
WRITE_LOCKER(_logfilesLock);
|
||||||
|
|
||||||
|
for (auto it = _logfiles.begin(); it != _logfiles.end(); ++it) {
|
||||||
|
Logfile::IdType const id = (*it).first;
|
||||||
|
std::string const filename = logfileName(id);
|
||||||
|
|
||||||
|
assert((*it).second == nullptr);
|
||||||
|
|
||||||
|
TRI_datafile_t* df = TRI_OpenDatafile(filename.c_str());
|
||||||
|
|
||||||
|
if (df == nullptr) {
|
||||||
|
int res = TRI_errno();
|
||||||
|
|
||||||
|
if (res != TRI_ERROR_NO_ERROR) {
|
||||||
|
LOG_ERROR("unable to open logfile '%s': %s", filename.c_str(), TRI_errno_string(res));
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
(*it).second = new Logfile(df);
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRI_ERROR_NO_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief reserve space in the logfile directory
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
int LogfileManager::reserveSpace () {
|
||||||
|
while (shouldAllocate()) {
|
||||||
|
int res = allocateDatafile();
|
||||||
|
|
||||||
|
if (res != TRI_ERROR_NO_ERROR) {
|
||||||
|
LOG_ERROR("unable to allocate new datafile: %s", TRI_errno_string(res));
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRI_ERROR_NO_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief whether or not a new datafile must be allocated
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
bool LogfileManager::shouldAllocate () {
|
||||||
|
uint64_t const maximum = _configuration->maximumSize();
|
||||||
|
uint64_t const reserve = _configuration->reserveSize();
|
||||||
|
uint64_t const allocated = allocatedSize();
|
||||||
|
uint64_t const free = freeSize();
|
||||||
|
|
||||||
|
if (allocated >= maximum) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (free >= reserve) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief total number of bytes allocated in datafiles
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
uint64_t LogfileManager::allocatedSize () {
|
||||||
|
uint64_t allocated = 0;
|
||||||
|
|
||||||
|
READ_LOCKER(_logfilesLock);
|
||||||
|
|
||||||
|
for (auto it = _logfiles.begin(); it != _logfiles.end(); ++it) {
|
||||||
|
Logfile* logfile = (*it).second;
|
||||||
|
|
||||||
|
assert(logfile != nullptr);
|
||||||
|
allocated += logfile->allocatedSize();
|
||||||
|
}
|
||||||
|
|
||||||
|
return allocated;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief total number of free bytes in already allocated datafiles
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
uint64_t LogfileManager::freeSize () {
|
||||||
|
uint64_t free = 0;
|
||||||
|
|
||||||
|
READ_LOCKER(_logfilesLock);
|
||||||
|
|
||||||
|
for (auto it = _logfiles.begin(); it != _logfiles.end(); ++it) {
|
||||||
|
Logfile* logfile = (*it).second;
|
||||||
|
|
||||||
|
assert(logfile != nullptr);
|
||||||
|
free += logfile->freeSize();
|
||||||
|
}
|
||||||
|
|
||||||
|
return free;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief allocate a new datafile
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
int LogfileManager::allocateDatafile () {
|
||||||
|
Logfile::IdType const id = nextId();
|
||||||
|
std::string const filename = logfileName(id);
|
||||||
|
|
||||||
|
TRI_datafile_t* df = TRI_CreateDatafile(filename.c_str(), id, static_cast<TRI_voc_size_t>(_configuration->filesize()));
|
||||||
|
|
||||||
|
if (df == nullptr) {
|
||||||
|
int res = TRI_errno();
|
||||||
|
|
||||||
|
LOG_ERROR("unable to create datafile: %s", TRI_errno_string(res));
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
WRITE_LOCKER(_logfilesLock);
|
||||||
|
_logfiles.insert(make_pair(id, new Logfile(df)));
|
||||||
|
|
||||||
|
return TRI_ERROR_NO_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief run the recovery procedure
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
int LogfileManager::runRecovery () {
|
||||||
|
// TODO
|
||||||
|
return TRI_ERROR_NO_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief get an id for the next logfile
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
Logfile::IdType LogfileManager::nextId () {
|
||||||
|
MUTEX_LOCKER(_logfileIdLock);
|
||||||
|
return ++_logfileId;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief ensure the wal logfiles directory is actually there
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
int LogfileManager::ensureDirectory () {
|
||||||
|
if (! basics::FileUtils::isDirectory(_directory)) {
|
||||||
|
int res;
|
||||||
|
|
||||||
|
LOG_INFO("wal directory '%s' does not exist. creating it...", _directory.c_str());
|
||||||
|
|
||||||
|
if (! basics::FileUtils::createDirectory(_directory, &res)) {
|
||||||
|
LOG_ERROR("could not create wal directory: '%s': %s", _directory.c_str(), TRI_errno_string(res));
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! basics::FileUtils::isDirectory(_directory)) {
|
||||||
|
LOG_ERROR("wal directory '%s' does not exist", _directory.c_str());
|
||||||
|
return TRI_ERROR_FILE_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRI_ERROR_NO_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief return an absolute filename for a logfile id
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
std::string LogfileManager::logfileName (Logfile::IdType id) const {
|
||||||
|
return _directory + std::string("logfile-") + basics::StringUtils::itoa(id) + std::string(".db");
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief return the absolute name of the shutdown file
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
std::string LogfileManager::shutdownFilename () const {
|
||||||
|
return _directory + std::string("SHUTDOWN");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Local Variables:
|
||||||
|
// mode: outline-minor
|
||||||
|
// outline-regexp: "/// @brief\\|/// {@inheritDoc}\\|/// @addtogroup\\|/// @page\\|// --SECTION--\\|/// @\\}"
|
||||||
|
// End:
|
|
@ -0,0 +1,313 @@
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief Write-ahead log file manager
|
||||||
|
///
|
||||||
|
/// @file
|
||||||
|
///
|
||||||
|
/// DISCLAIMER
|
||||||
|
///
|
||||||
|
/// Copyright 2004-2013 triAGENS 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 triAGENS GmbH, Cologne, Germany
|
||||||
|
///
|
||||||
|
/// @author Jan Steemann
|
||||||
|
/// @author Copyright 2011-2013, triAGENS GmbH, Cologne, Germany
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef TRIAGENS_WAL_LOGFILE_MANAGER_H
|
||||||
|
#define TRIAGENS_WAL_LOGFILE_MANAGER_H 1
|
||||||
|
|
||||||
|
#include "Basics/Common.h"
|
||||||
|
#include "Basics/Mutex.h"
|
||||||
|
#include "Basics/ReadWriteLock.h"
|
||||||
|
#include "Wal/LogEntry.h"
|
||||||
|
#include "Wal/Logfile.h"
|
||||||
|
|
||||||
|
#include <regex.h>
|
||||||
|
|
||||||
|
namespace triagens {
|
||||||
|
namespace wal {
|
||||||
|
|
||||||
|
class AllocatorThread;
|
||||||
|
class CollectorThread;
|
||||||
|
class Configuration;
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- class LogfileManager
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class LogfileManager {
|
||||||
|
|
||||||
|
friend class AllocatorThread;
|
||||||
|
friend class CollectorThread;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief LogfileManager
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
private:
|
||||||
|
LogfileManager (LogfileManager const&);
|
||||||
|
LogfileManager& operator= (LogfileManager const&);
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- constructors and destructors
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief create the logfile manager
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
LogfileManager (Configuration*);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief destroy the logfile manager
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
~LogfileManager ();
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- public methods
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief startup the logfile manager
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
int startup ();
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief shuts down and closes all open logfiles
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void shutdown ();
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief reserve space in a log file
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
LogEntry reserve (size_t);
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- private methods
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief increases the tick value and returns it
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
LogEntry::TickType nextTick ();
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief returns the last assigned tick
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
LogEntry::TickType currentTick ();
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief reads the shutdown information
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
int readShutdownInfo ();
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief writes the shutdown information
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
int writeShutdownInfo ();
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief start the allocator thread
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
int startAllocatorThread ();
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief stop the allocator thread
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void stopAllocatorThread ();
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief start the collector thread
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
int startCollectorThread ();
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief stop the collector thread
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void stopCollectorThread ();
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief check which logfiles are present in the log directory
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
int inventory ();
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief open the logfiles in the log directory
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
int openLogfiles ();
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief reserve space in the logfile directory
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
int reserveSpace ();
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief whether or not a new datafile must be allocated
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
bool shouldAllocate ();
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief total number of bytes allocated in datafiles
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
uint64_t allocatedSize ();
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief total number of free bytes in already allocated datafiles
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
uint64_t freeSize ();
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief allocate a new datafile
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
int allocateDatafile ();
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief run the recovery procedure
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
int runRecovery ();
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief get an id for the next logfile
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
Logfile::IdType nextId ();
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief ensure the wal logfiles directory is actually there
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
int ensureDirectory ();
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief return an absolute filename for a logfile id
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
std::string logfileName (Logfile::IdType) const;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief return the absolute name of the shutdown file
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
std::string shutdownFilename () const;
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- private variables
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief the log file manager configuration
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
Configuration* _configuration;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief a lock protecting _tick
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
basics::ReadWriteLock _tickLock;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief the last assigned tick
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
LogEntry::TickType _tick;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief the allocator thread
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
AllocatorThread* _allocatorThread;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief the collector thread
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
CollectorThread* _collectorThread;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief a lock protecting the _logfileId value
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
basics::Mutex _logfileIdLock;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief last allocated logfile id
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
Logfile::IdType _logfileId;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief a lock protecting the _logfiles map
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
basics::ReadWriteLock _logfilesLock;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief the logfiles
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
std::map<Logfile::IdType, Logfile*> _logfiles;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief logfile directory
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
std::string const _directory;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief regex to match logfiles
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
regex_t _regex;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Local Variables:
|
||||||
|
// mode: outline-minor
|
||||||
|
// outline-regexp: "/// @brief\\|/// {@inheritDoc}\\|/// @addtogroup\\|/// @page\\|// --SECTION--\\|/// @\\}"
|
||||||
|
// End:
|
|
@ -0,0 +1,73 @@
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief Write-ahead log logger
|
||||||
|
///
|
||||||
|
/// @file
|
||||||
|
///
|
||||||
|
/// DISCLAIMER
|
||||||
|
///
|
||||||
|
/// Copyright 2004-2013 triAGENS 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 triAGENS GmbH, Cologne, Germany
|
||||||
|
///
|
||||||
|
/// @author Jan Steemann
|
||||||
|
/// @author Copyright 2011-2013, triAGENS GmbH, Cologne, Germany
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "Logger.h"
|
||||||
|
#include "Wal/LogfileManager.h"
|
||||||
|
|
||||||
|
using namespace triagens::wal;
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- constructors and destructors
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief create the logger
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
Logger::Logger (LogfileManager* manager)
|
||||||
|
: _manager(manager) {
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief destroy the logger
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
Logger::~Logger () {
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- public methods
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief reserve space in a log file
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
LogEntry Logger::reserve (size_t size) {
|
||||||
|
LogEntry entry(_manager->reserve(size));
|
||||||
|
|
||||||
|
return entry;
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- private methods
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Local Variables:
|
||||||
|
// mode: outline-minor
|
||||||
|
// outline-regexp: "/// @brief\\|/// {@inheritDoc}\\|/// @addtogroup\\|/// @page\\|// --SECTION--\\|/// @\\}"
|
||||||
|
// End:
|
|
@ -0,0 +1,111 @@
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief Write-ahead log logger
|
||||||
|
///
|
||||||
|
/// @file
|
||||||
|
///
|
||||||
|
/// DISCLAIMER
|
||||||
|
///
|
||||||
|
/// Copyright 2004-2013 triAGENS 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 triAGENS GmbH, Cologne, Germany
|
||||||
|
///
|
||||||
|
/// @author Jan Steemann
|
||||||
|
/// @author Copyright 2011-2013, triAGENS GmbH, Cologne, Germany
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef TRIAGENS_WAL_LOGGER_H
|
||||||
|
#define TRIAGENS_WAL_LOGGER_H 1
|
||||||
|
|
||||||
|
#include "Basics/Common.h"
|
||||||
|
#include "Wal/LogEntry.h"
|
||||||
|
|
||||||
|
namespace triagens {
|
||||||
|
namespace wal {
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- class Logger
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class LogfileManager;
|
||||||
|
|
||||||
|
class Logger {
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief Logger
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
private:
|
||||||
|
Logger (Logger const&);
|
||||||
|
Logger& operator= (Logger const&);
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- constructors and destructors
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief create a logger component
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
Logger (LogfileManager*);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief destroy a logger component
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
~Logger ();
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- public methods
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief reserve space in a log file
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
LogEntry reserve (size_t);
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- private methods
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// --SECTION-- private variables
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief the log file manager
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
LogfileManager* _manager;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Local Variables:
|
||||||
|
// mode: outline-minor
|
||||||
|
// outline-regexp: "/// @brief\\|/// {@inheritDoc}\\|/// @addtogroup\\|/// @page\\|// --SECTION--\\|/// @\\}"
|
||||||
|
// End:
|
|
@ -1,89 +0,0 @@
|
||||||
#databaseDiv {
|
|
||||||
padding: 13px 5px 0px 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.databaseButtons {
|
|
||||||
clear:both;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.databaseButtons #createDatabase {
|
|
||||||
margin-left: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.databaseButtons {
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#databaseTable thead {
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
#databaseTable thead tr {
|
|
||||||
border-bottom: 1px solid #C2C2C2;
|
|
||||||
background-color: #FFFFFF !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
#databaseTable {
|
|
||||||
width: 100%;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#databaseTable .dbThFirst {
|
|
||||||
width: 90%;
|
|
||||||
}
|
|
||||||
|
|
||||||
#databaseTable .dbThSecond {
|
|
||||||
width: 10%;
|
|
||||||
}
|
|
||||||
|
|
||||||
#databaseTable td.dbThSecond span {
|
|
||||||
color: #8AA050;
|
|
||||||
}
|
|
||||||
|
|
||||||
#databaseTable td span {
|
|
||||||
float: right;
|
|
||||||
color: #B30000;
|
|
||||||
font-size: 22px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#databaseTable td {
|
|
||||||
padding:12px 18px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#createDatabaseModal table {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
#databaseTable .collectionThSec {
|
|
||||||
width: 80%;
|
|
||||||
margin-right: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#databaseTable .collectionTh {
|
|
||||||
width: 5%;
|
|
||||||
margin-right: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.databaseActive {
|
|
||||||
background-color: #BDCC92 !important;
|
|
||||||
font-weight: 400;
|
|
||||||
}
|
|
||||||
|
|
||||||
.databaseActive a {
|
|
||||||
color: black !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.databaseActive span {
|
|
||||||
display:none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.databaseInactive a {
|
|
||||||
color: black !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.databaseInactive a:hover {
|
|
||||||
font-weight: 400;
|
|
||||||
color: black !important;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
|
@ -1,13 +1,3 @@
|
||||||
#logPages {
|
|
||||||
float:left;
|
|
||||||
margin-top: -6px !important;
|
|
||||||
padding-left: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#logButtons button {
|
|
||||||
margin-top: -10px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tab-content {
|
.tab-content {
|
||||||
min-height: 390px;
|
min-height: 390px;
|
||||||
}
|
}
|
||||||
|
@ -29,21 +19,6 @@
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
|
|
||||||
#logToolbar {
|
|
||||||
padding-top: 10px;
|
|
||||||
padding-bottom: 15px;
|
|
||||||
border: 1px solid #C1BDBA;
|
|
||||||
background-color: #F7F6F6 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
#logToolbar button {
|
|
||||||
float:right;
|
|
||||||
border: medium none;
|
|
||||||
padding-left: 10px;
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#logTableID thead, #infoTableID thead, #debugTableID thead, #critTableID thead, #warnTableID thead {
|
#logTableID thead, #infoTableID thead, #debugTableID thead, #critTableID thead, #warnTableID thead {
|
||||||
background-color: #F9F9F9;
|
background-color: #F9F9F9;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
@ -89,10 +64,6 @@
|
||||||
padding-bottom: 8px;
|
padding-bottom: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#logTableID_wrapper, #infoTableID_wrapper, #debugTableID_wrapper, #critTableID_wrapper, #warnTableID_wrapper{
|
|
||||||
}
|
|
||||||
|
|
||||||
#logContent .dataTable {
|
#logContent .dataTable {
|
||||||
table-layout:fixed !important;
|
table-layout:fixed !important;
|
||||||
border-collapse:separate;
|
border-collapse:separate;
|
||||||
|
|
|
@ -1,308 +0,0 @@
|
||||||
.ui-resizable-s {
|
|
||||||
bottom: 0;
|
|
||||||
height: 0px;
|
|
||||||
background-color: #F0F0F0 !important;
|
|
||||||
border: 1px solid #C0C0C0;
|
|
||||||
cursor: ns-resize;
|
|
||||||
line-height: 1;
|
|
||||||
background-image: url(../img/stripes.gif);
|
|
||||||
background-repeat:no-repeat;
|
|
||||||
background-position: 50% 50%;
|
|
||||||
}
|
|
||||||
|
|
||||||
#queryOutput .ace_cursor-layer {
|
|
||||||
display:none;
|
|
||||||
}
|
|
||||||
|
|
||||||
#queryOutput .ui-resizable-handle {
|
|
||||||
border-left: 0;
|
|
||||||
border-bottom: 0;
|
|
||||||
border-top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.queryToolbar, #aqlEditor {
|
|
||||||
margin-left: 0px;
|
|
||||||
margin-right: 0px;
|
|
||||||
border-width: 1px;
|
|
||||||
border-style: solid;
|
|
||||||
border-bottom: 0px;
|
|
||||||
height: 27px;
|
|
||||||
background-color: #F0F0F0;
|
|
||||||
font-size: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#editorToolbar {
|
|
||||||
margin-top: 5px;
|
|
||||||
border-color: #A0A0A0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#outputToolbar {
|
|
||||||
position: relative;
|
|
||||||
width: auto;
|
|
||||||
border-color: #C0C0C0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#aqlEditor {
|
|
||||||
border-bottom: 1px;
|
|
||||||
width: auto;
|
|
||||||
border-color: #A0A0A0;
|
|
||||||
min-width: 99.8%;
|
|
||||||
height: 200px;
|
|
||||||
min-height: 100px;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#outputToolbar span, #editorToolbar span {
|
|
||||||
position: relative;
|
|
||||||
margin-right: 5px;
|
|
||||||
margin-left: 5px;
|
|
||||||
top: 2px;
|
|
||||||
float:right;
|
|
||||||
}
|
|
||||||
|
|
||||||
#editorToolbar i:hover, #outputToolbar i:hover {
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
#editorToolbar i , #outputToolbar i {
|
|
||||||
margin-right: 5px;
|
|
||||||
margin-top: 3px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#editor {
|
|
||||||
min-width: 100px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#editorLabel, #outputLabel {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
#editorLabel h6, #outputLabel h6 {
|
|
||||||
font-family: 'Open Sans', sans-serif;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#aqlEditor .ace_error, #aqlEditor .ace_info, #queryOutput .ace_error, #queryOutput .ace_info {
|
|
||||||
background:none;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
#aqlEditor .ui-resizable-handle {
|
|
||||||
border-left: 0 !important;
|
|
||||||
border-bottom: 0 !important;
|
|
||||||
border-top: 0 !important;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
#aqlEditor {
|
|
||||||
border-left: 0 !important;
|
|
||||||
border-bottom: 0 !important;
|
|
||||||
border-top: 0 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
#wideButtonDiv {
|
|
||||||
width: 100%;
|
|
||||||
height: 20px;
|
|
||||||
margin-bottom: 15px;
|
|
||||||
padding-top: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#submitQueryButton, #clearQueryButton {
|
|
||||||
float: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
.querynavbar {
|
|
||||||
width: 940px !important;
|
|
||||||
background-color: #FAFAFA;
|
|
||||||
background-image: linear-gradient(to bottom, #FFFFFF, #F2F2F2);
|
|
||||||
background-repeat: repeat-x;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.querynavbar h3 {
|
|
||||||
padding-top: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#queryOutput {
|
|
||||||
width: auto;
|
|
||||||
background-color: white;
|
|
||||||
height: 200px;
|
|
||||||
margin-right: 0px;
|
|
||||||
margin-left: 0px;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
min-height: 100px;
|
|
||||||
overflow-y: hidden;
|
|
||||||
border: 1px solid #c0c0c0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.preQuery {
|
|
||||||
border: 0;
|
|
||||||
border-radius: 0;
|
|
||||||
background-color: white !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
#querySelect {
|
|
||||||
line-height: 20px !important;
|
|
||||||
z-index: 9999 !important;
|
|
||||||
border-radius: 0 !important;
|
|
||||||
margin-bottom: 0;
|
|
||||||
border: 0 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
#querySelect option {
|
|
||||||
z-index: 9999 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.queryTH {
|
|
||||||
width: 20% !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.queryTH2 {
|
|
||||||
width: 75% !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
#edit-aql-body table {
|
|
||||||
margin-left: 0;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
#edit-aql-body select {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
#edit-aql-body textarea {
|
|
||||||
width: 515px;
|
|
||||||
resize: vertical !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*#queryOutput .ace_gutter-cell {
|
|
||||||
color: white;
|
|
||||||
background-color: #686766 !important;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
.ace_print-margin {
|
|
||||||
visibility: hidden !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
#queryOutput .ace_replace_form {
|
|
||||||
display:none;
|
|
||||||
}
|
|
||||||
|
|
||||||
#editorToolbar .arango-icon-disk,
|
|
||||||
#commentText, #redoText, #undoText, #clearInput, #clearOutput {
|
|
||||||
margin-top: 1px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#shortcutDiv {
|
|
||||||
float: left;
|
|
||||||
width: auto;
|
|
||||||
margin-top: -5px;
|
|
||||||
padding-left: 45px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#queryDiv > * {
|
|
||||||
border: 0 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.styled-select select {
|
|
||||||
background: white;
|
|
||||||
padding: 5px;
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: 300;
|
|
||||||
line-height: 1;
|
|
||||||
border: 0;
|
|
||||||
border-radius: 0;
|
|
||||||
height: 30px;
|
|
||||||
padding-left: 5px !important;
|
|
||||||
padding-top: 3px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.styled-select {
|
|
||||||
float: right;
|
|
||||||
width: 220px;
|
|
||||||
height: 30px;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.querySizeDiv {
|
|
||||||
margin-right: 10px;
|
|
||||||
height: 30px !important;
|
|
||||||
width: 130px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.querySizeDiv select {
|
|
||||||
height: 30px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
#querySize {
|
|
||||||
width: 130px !important;
|
|
||||||
line-height: 20px !important;
|
|
||||||
z-index: 9999 !important;
|
|
||||||
border-radius: 0 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
#queryDropdown {
|
|
||||||
margin-left: 0;
|
|
||||||
margin-right: 0;
|
|
||||||
padding-left: 5px;
|
|
||||||
padding-right: 5px;
|
|
||||||
background-color: #D9D9D9;
|
|
||||||
}
|
|
||||||
|
|
||||||
#queryDropdownIn {
|
|
||||||
background-color: #FFFFFF;
|
|
||||||
padding: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#queryDropdownIn a {
|
|
||||||
width: 100%;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
font-size: 16px;
|
|
||||||
font-weight: bolder;
|
|
||||||
color: #686766;
|
|
||||||
}
|
|
||||||
|
|
||||||
#queryDropdownRight {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
#queryModalSelect {
|
|
||||||
width: 100%;
|
|
||||||
padding-left: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#queryDropdownRight textarea {
|
|
||||||
width: 100%;
|
|
||||||
padding: 5px 0 0 0px;
|
|
||||||
resize: vertical;
|
|
||||||
}
|
|
||||||
|
|
||||||
#queryDropdownRight textarea:focus {
|
|
||||||
outline: none;
|
|
||||||
border-color: #8AA051;
|
|
||||||
box-shadow: 0 0 3px #8AA051;
|
|
||||||
}
|
|
||||||
|
|
||||||
#queryDropdownLeft {
|
|
||||||
width: 100%;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#queryDropdownIn #save-edit-query {
|
|
||||||
margin-left: 7px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
#queryDropdownIn #delete-edit-query {
|
|
||||||
margin-left: 0 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
#queryDiv .icon_arangodb {
|
|
||||||
margin-bottom: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#queryDiv .icon_arangodb:hover {
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
Before Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 55 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 518 B |
Before Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 464 B |
Before Width: | Height: | Size: 512 B |
Before Width: | Height: | Size: 57 KiB |
Before Width: | Height: | Size: 146 B |
Before Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 483 B |
Before Width: | Height: | Size: 865 B |
Before Width: | Height: | Size: 810 B |
Before Width: | Height: | Size: 453 B |
Before Width: | Height: | Size: 368 B |
Before Width: | Height: | Size: 43 B |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 419 B |
Before Width: | Height: | Size: 415 B |
Before Width: | Height: | Size: 359 B |
Before Width: | Height: | Size: 363 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 298 B |
Before Width: | Height: | Size: 276 B |
Before Width: | Height: | Size: 409 B |
Before Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 53 KiB |
|
@ -11,13 +11,13 @@
|
||||||
<div class="tab-content" id="tabContentQuery">
|
<div class="tab-content" id="tabContentQuery">
|
||||||
<div class="tab-pane active" id="query">
|
<div class="tab-pane active" id="query">
|
||||||
|
|
||||||
<div id="queryDropdown" class="headerDropdown">
|
<div id="queryDropdown" class="headerDropdown query-dropdown">
|
||||||
<div class="dropdownInner" id="queryDropdownIn">
|
<div class="dropdownInner query-dropdown-in" id="queryDropdownIn">
|
||||||
<a class="arangoHeader">Edit custom queries</a>
|
<a class="arangoHeader">Edit custom queries</a>
|
||||||
|
|
||||||
<div id="queryDropdownLeft">
|
<div id="queryDropdownLeft" class="query-dropdown-left">
|
||||||
Name
|
Name
|
||||||
<select id="queryModalSelect"/>
|
<select id="queryModalSelect" class="query-modal-select"/>
|
||||||
</div>
|
</div>
|
||||||
<div id="queryDropdownRight">
|
<div id="queryDropdownRight">
|
||||||
Query
|
Query
|
||||||
|
@ -39,23 +39,23 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="queryDiv" style="display:none">
|
<div id="queryDiv" class="query-div">
|
||||||
<div id="editorLabel"><h6>Query</h6></div>
|
<div id="editorLabel" class="editor-label"><h6>Query</h6></div>
|
||||||
<div id="editorToolbar" class="queryToolbar">
|
<div id="editorToolbar" class="query-toolbar editor-toolbar">
|
||||||
<span class="icon_arangodb icon_arangodb_trash queryTooltips" title="Clear" id="clearInput"/>
|
<span class="icon_arangodb icon_arangodb_trash queryTooltips tooltip-margin" title="Clear" id="clearInput"/>
|
||||||
<span class="icon_arangodb icon_arangodb_adddoc queryTooltips" title="Save current query" id="addAQL"/>
|
<span class="icon_arangodb icon_arangodb_adddoc queryTooltips" title="Save current query" id="addAQL"/>
|
||||||
<span class="icon_arangodb icon_arangodb_bubble1 queryTooltips" title="Comment" id="commentText"/>
|
<span class="icon_arangodb icon_arangodb_bubble1 queryTooltips tooltip-margin" title="Comment" id="commentText"/>
|
||||||
<span class="icon_arangodb icon_arangodb_arrow6 queryTooltips" title="Redo" id="redoText"/>
|
<span class="icon_arangodb icon_arangodb_arrow6 queryTooltips tooltip-margin" title="Redo" id="redoText"/>
|
||||||
<span class="icon_arangodb icon_arangodb_arrow5 queryTooltips" title="Undo" id="undoText"/>
|
<span class="icon_arangodb icon_arangodb_arrow5 queryTooltips tooltip-margin" title="Undo" id="undoText"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="aqlEditor"></div>
|
<div id="aqlEditor" class='aql-editor'></div>
|
||||||
|
|
||||||
|
|
||||||
<div id="wideButtonDiv">
|
<div id="wideButtonDiv" class="wide-button-div">
|
||||||
<div>
|
<div>
|
||||||
|
|
||||||
<div id="shortcutDiv" class="shortcuts">
|
<div id="shortcutDiv" class="shortcuts shortcut-div">
|
||||||
<b>Submit:</b> Ctrl/Cmd + Return<b>Undo:</b> Ctrl/Cmd + Z<b>Redo:</b> Ctrl/Cmd + Shift + Z
|
<b>Submit:</b> Ctrl/Cmd + Return<b>Undo:</b> Ctrl/Cmd + Z<b>Redo:</b> Ctrl/Cmd + Shift + Z
|
||||||
<b>Toggle Comments:</b> Ctrl/Cmd + Shift + C
|
<b>Toggle Comments:</b> Ctrl/Cmd + Shift + C
|
||||||
<br/><b class="clearShortcut">Warning:</b> Right now there is a bug in Safari, the cursor is misplaced. Please use a different
|
<br/><b class="clearShortcut">Warning:</b> Right now there is a bug in Safari, the cursor is misplaced. Please use a different
|
||||||
|
@ -64,13 +64,13 @@
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
|
||||||
<button id="submitQueryButton" class="button-success">Submit</button>
|
<button id="submitQueryButton" class="button-success query-button">Submit</button>
|
||||||
<button id="clearQueryButton" class="button-close">Clear</button>
|
<button id="clearQueryButton" class="button-close query-button">Clear</button>
|
||||||
<div class="styled-select">
|
<div class="styled-select">
|
||||||
<select id="querySelect"/>
|
<select id="querySelect" class="query-select"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="styled-select querySizeDiv">
|
<div class="styled-select querySizeDiv">
|
||||||
<select id="querySize"/>
|
<select id="querySize" class="query-size"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -82,12 +82,12 @@
|
||||||
<div class="tab-content" id="tabContentResult">
|
<div class="tab-content" id="tabContentResult">
|
||||||
|
|
||||||
<div class="tab-pane" id="result">
|
<div class="tab-pane" id="result">
|
||||||
<div id="editorLabel"><h6>Result</h6></div>
|
<div id="editorLabel" class="editor-label"><h6>Result</h6></div>
|
||||||
<div id="outputToolbar" class="queryToolbar">
|
<div id="outputToolbar" class="query-toolbar output-toolbar">
|
||||||
<span class="icon_arangodb icon_arangodb_trash queryTooltips" title="Clear" id="clearOutput"></span>
|
<span class="icon_arangodb icon_arangodb_trash queryTooltips tooltip-margin" title="Clear" id="clearOutput"></span>
|
||||||
<span class="icon_arangodb icon_arangodb_arrow1 queryTooltips" title="Unfold" id="bigOutput"></span>
|
<span class="icon_arangodb icon_arangodb_arrow1 queryTooltips" title="Unfold" id="bigOutput"></span>
|
||||||
</div>
|
</div>
|
||||||
<div id="queryOutput" class="contentDiv">
|
<div id="queryOutput" class="contentDiv query-output">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script id="statisticBarView.ejs" type="text/template">
|
<script id="statisticBarView.ejs" type="text/template">
|
||||||
<div class="navlogo statisticbar">
|
<div class="navlogo display-none">
|
||||||
<a href="#dashboard" style="padding-left: 15px;">
|
<a href="#dashboard" style="padding-left: 15px;">
|
||||||
<img class="svg stat_cpu"
|
<img class="svg stat_cpu"
|
||||||
src="img/cpu.svg"
|
src="img/cpu.svg"
|
||||||
|
|
|
@ -73,6 +73,15 @@ $c-state-warning: #070;
|
||||||
$c-state-critical: #700;
|
$c-state-critical: #700;
|
||||||
$c-icon-grey: #686766;
|
$c-icon-grey: #686766;
|
||||||
|
|
||||||
|
$c-login-window-bg: #f4f4f4;
|
||||||
|
$c-login-window-border: #868686;
|
||||||
|
|
||||||
|
$c-toolbar-bg: #f0f0f0;
|
||||||
|
|
||||||
|
$c-editor-toolbar: #a0a0a0;
|
||||||
|
|
||||||
|
$c-query-output-border: #c0c0c0;
|
||||||
|
|
||||||
$c-tab-inactive: #f1f0ee;
|
$c-tab-inactive: #f1f0ee;
|
||||||
$c-tab-active: #fff;
|
$c-tab-active: #fff;
|
||||||
$c-tab-bottom-border: #ddd;
|
$c-tab-bottom-border: #ddd;
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
.display-none {
|
||||||
|
display: none;
|
||||||
|
}
|
|
@ -31,7 +31,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.document-editor {
|
.document-editor {
|
||||||
width: 100%;
|
|
||||||
height: 500px;
|
height: 500px;
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,255 @@
|
||||||
|
%toolbar {
|
||||||
|
background-color: $c-toolbar-bg;
|
||||||
|
border-bottom: 0;
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px;
|
||||||
|
font-size: 20px;
|
||||||
|
height: 27px;
|
||||||
|
margin-left: 0;
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.editor-toolbar {
|
||||||
|
border-color: $c-editor-toolbar;
|
||||||
|
margin-top: 5px;
|
||||||
|
|
||||||
|
span {
|
||||||
|
float: right;
|
||||||
|
margin-left: 5px;
|
||||||
|
margin-right: 5px;
|
||||||
|
position: relative;
|
||||||
|
top: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
i {
|
||||||
|
margin-right: 5px;
|
||||||
|
margin-top: 3px;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.arango-icon-disk {
|
||||||
|
margin-top: 1px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.query-toolbar {
|
||||||
|
@extend %toolbar;
|
||||||
|
}
|
||||||
|
|
||||||
|
.aql-editor {
|
||||||
|
@extend %toolbar;
|
||||||
|
border-color: $c-editor-toolbar;
|
||||||
|
border-left: 0 !important;
|
||||||
|
border-top: 0 !important;
|
||||||
|
height: 200px;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
min-height: 100px;
|
||||||
|
min-width: 99.8%;
|
||||||
|
width: auto;
|
||||||
|
|
||||||
|
.ace_error,
|
||||||
|
.ace_info {
|
||||||
|
background: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.queryTH {
|
||||||
|
width: 20% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.queryTH2 {
|
||||||
|
width: 75% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.query-output {
|
||||||
|
background-color: $c-white;
|
||||||
|
border: 1px solid $c-query-output-border;
|
||||||
|
border-top-width: 0;
|
||||||
|
height: 200px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
margin-left: 0;
|
||||||
|
margin-right: 0;
|
||||||
|
min-height: 100px;
|
||||||
|
overflow-y: hidden;
|
||||||
|
width: auto;
|
||||||
|
|
||||||
|
.ace_cursor-layer,
|
||||||
|
.ace_replace_form {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ace_error,
|
||||||
|
.ace_info {
|
||||||
|
background: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.ace_print-margin {
|
||||||
|
visibility: hidden !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.styled-select {
|
||||||
|
float: right;
|
||||||
|
height: 30px;
|
||||||
|
overflow: hidden;
|
||||||
|
width: 220px;
|
||||||
|
|
||||||
|
select {
|
||||||
|
background: $c-white;
|
||||||
|
border: 0;
|
||||||
|
border-radius: 0;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 300;
|
||||||
|
height: 30px;
|
||||||
|
line-height: 1;
|
||||||
|
padding: 5px;
|
||||||
|
padding-left: 5px !important;
|
||||||
|
padding-top: 3px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.querySizeDiv {
|
||||||
|
height: 30px !important;
|
||||||
|
margin-right: 10px;
|
||||||
|
width: 130px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.querySizeDiv select {
|
||||||
|
height: 30px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wide-button-div {
|
||||||
|
height: 20px;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
padding-top: 5px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shortcut-div {
|
||||||
|
float: left;
|
||||||
|
margin-top: -5px;
|
||||||
|
padding-left: 45px;
|
||||||
|
width: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.query-dropdown-left {
|
||||||
|
margin-top: 10px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.query-dropdown-right {
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
textarea {
|
||||||
|
padding: 5px 0 0;
|
||||||
|
resize: vertical;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
&:focus {
|
||||||
|
border-color: $c-positive;
|
||||||
|
box-shadow: 0 0 3px $c-positive;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.query-modal-select {
|
||||||
|
padding-left: 0;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.output-toolbar {
|
||||||
|
border-color: $c-query-output-border;
|
||||||
|
position: relative;
|
||||||
|
width: auto;
|
||||||
|
|
||||||
|
span {
|
||||||
|
float: right;
|
||||||
|
margin-left: 5px;
|
||||||
|
margin-right: 5px;
|
||||||
|
position: relative;
|
||||||
|
top: 2px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.query-select {
|
||||||
|
border: 0 !important;border-radius: 0 !important;
|
||||||
|
line-height: 20px !important;
|
||||||
|
margin-bottom: 0;
|
||||||
|
z-index: 9999 !important;
|
||||||
|
|
||||||
|
option {
|
||||||
|
z-index: 9999 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.editor-label {
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
h6 {
|
||||||
|
font-family: 'Open Sans', sans-serif;
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 400;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.query-button {
|
||||||
|
@extend %pull-right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.query-dropdown {
|
||||||
|
background-color: $c-odd;
|
||||||
|
margin-left: 0;
|
||||||
|
margin-right: 0;
|
||||||
|
padding-left: 5px;
|
||||||
|
padding-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tooltip-margin {
|
||||||
|
margin-top: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.query-dropdown-in {
|
||||||
|
background-color: $c-white;
|
||||||
|
padding: 10px;
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: $c-icon-grey;
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: bolder;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#save-edit-query {
|
||||||
|
margin-left: 7px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#delete-edit-query {
|
||||||
|
margin-left: 0 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.query-size {
|
||||||
|
border-radius: 0 !important;
|
||||||
|
line-height: 20px !important;
|
||||||
|
width: 130px !important;
|
||||||
|
z-index: 9999 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.query-div {
|
||||||
|
display: none;
|
||||||
|
|
||||||
|
&> * {
|
||||||
|
border: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon_arangodb {
|
||||||
|
cursor: pointer;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
}
|
|
@ -27,7 +27,3 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.statisticbar {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ textarea,
|
||||||
ul.link-dropdown-menu, ul.user-dropdown-menu, ul.gv-dropdown-menu, div.navlogo, ul.navlist li, div.footer-left, a.headerButton, a.button-gui, div.tile, div.bigtile, div.tile a span.add-Icon, div.bigtile a span.add-Icon, div.centralContent, .contentDiv li, div.dropdownInner ul, .fixedDropdown .notificationItemContent, .fixedDropdown .notificationItem i, .innerDropdownInnerUL, .dashboardModal {
|
ul.link-dropdown-menu, ul.user-dropdown-menu, ul.gv-dropdown-menu, div.navlogo, ul.navlist li, div.footer-left, a.headerButton, a.button-gui, div.tile, div.bigtile, div.tile a span.add-Icon, div.bigtile a span.add-Icon, div.centralContent, .contentDiv li, div.dropdownInner ul, .fixedDropdown .notificationItemContent, .fixedDropdown .notificationItem i, .innerDropdownInnerUL, .dashboardModal {
|
||||||
float: left; }
|
float: left; }
|
||||||
|
|
||||||
div.navmenu, div.footer-right, ul.headerButtonList li, div.tile div.iconSet span, div.bigtile div.iconSet span, div.headerBar > div.headerButtonBar, .fixedDropdown button, .arango-tab li, .show-save-state {
|
div.navmenu, div.footer-right, ul.headerButtonList li, div.tile div.iconSet span, div.bigtile div.iconSet span, div.headerBar > div.headerButtonBar, .fixedDropdown button, .query-button, .arango-tab li, .show-save-state {
|
||||||
float: right; }
|
float: right; }
|
||||||
|
|
||||||
div.tileList:after, div.resizecontainer:after, div.headerBar > div.headerButtonBar:after, #distributionChartDiv:after, .lineChartDiv:after, .arango-tab:after {
|
div.tileList:after, div.resizecontainer:after, div.headerBar > div.headerButtonBar:after, #distributionChartDiv:after, .lineChartDiv:after, .arango-tab:after {
|
||||||
|
@ -996,9 +996,6 @@ div.breadcrumb a.disabledBread {
|
||||||
.navlogo .stat_req path {
|
.navlogo .stat_req path {
|
||||||
fill: #aaaa00; }
|
fill: #aaaa00; }
|
||||||
|
|
||||||
.statisticbar {
|
|
||||||
display: none; }
|
|
||||||
|
|
||||||
.fixedDropdown {
|
.fixedDropdown {
|
||||||
-moz-border-radius: 0 !important;
|
-moz-border-radius: 0 !important;
|
||||||
-webkit-border-radius: 0 !important;
|
-webkit-border-radius: 0 !important;
|
||||||
|
@ -1293,6 +1290,198 @@ div img.searchSubmitIcon {
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
padding-left: 0; }
|
padding-left: 0; }
|
||||||
|
|
||||||
|
.query-toolbar, .aql-editor {
|
||||||
|
background-color: #f0f0f0;
|
||||||
|
border-bottom: 0;
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px;
|
||||||
|
font-size: 20px;
|
||||||
|
height: 27px;
|
||||||
|
margin-left: 0;
|
||||||
|
margin-right: 0; }
|
||||||
|
|
||||||
|
.editor-toolbar {
|
||||||
|
border-color: #a0a0a0;
|
||||||
|
margin-top: 5px; }
|
||||||
|
.editor-toolbar span {
|
||||||
|
float: right;
|
||||||
|
margin-left: 5px;
|
||||||
|
margin-right: 5px;
|
||||||
|
position: relative;
|
||||||
|
top: 2px; }
|
||||||
|
.editor-toolbar i {
|
||||||
|
margin-right: 5px;
|
||||||
|
margin-top: 3px; }
|
||||||
|
.editor-toolbar i:hover {
|
||||||
|
cursor: pointer; }
|
||||||
|
.editor-toolbar .arango-icon-disk {
|
||||||
|
margin-top: 1px; }
|
||||||
|
|
||||||
|
.aql-editor {
|
||||||
|
border-color: #a0a0a0;
|
||||||
|
border-left: 0 !important;
|
||||||
|
border-top: 0 !important;
|
||||||
|
height: 200px;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
min-height: 100px;
|
||||||
|
min-width: 99.8%;
|
||||||
|
width: auto; }
|
||||||
|
.aql-editor .ace_error,
|
||||||
|
.aql-editor .ace_info {
|
||||||
|
background: none; }
|
||||||
|
|
||||||
|
.queryTH {
|
||||||
|
width: 20% !important; }
|
||||||
|
|
||||||
|
.queryTH2 {
|
||||||
|
width: 75% !important; }
|
||||||
|
|
||||||
|
.query-output {
|
||||||
|
background-color: white;
|
||||||
|
border: 1px solid silver;
|
||||||
|
border-top-width: 0;
|
||||||
|
height: 200px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
margin-left: 0;
|
||||||
|
margin-right: 0;
|
||||||
|
min-height: 100px;
|
||||||
|
overflow-y: hidden;
|
||||||
|
width: auto; }
|
||||||
|
.query-output .ace_cursor-layer,
|
||||||
|
.query-output .ace_replace_form {
|
||||||
|
display: none; }
|
||||||
|
.query-output .ace_error,
|
||||||
|
.query-output .ace_info {
|
||||||
|
background: none; }
|
||||||
|
|
||||||
|
.ace_print-margin {
|
||||||
|
visibility: hidden !important; }
|
||||||
|
|
||||||
|
.styled-select {
|
||||||
|
float: right;
|
||||||
|
height: 30px;
|
||||||
|
overflow: hidden;
|
||||||
|
width: 220px; }
|
||||||
|
.styled-select select {
|
||||||
|
background: white;
|
||||||
|
border: 0;
|
||||||
|
border-radius: 0;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 300;
|
||||||
|
height: 30px;
|
||||||
|
line-height: 1;
|
||||||
|
padding: 5px;
|
||||||
|
padding-left: 5px !important;
|
||||||
|
padding-top: 3px !important; }
|
||||||
|
|
||||||
|
.querySizeDiv {
|
||||||
|
height: 30px !important;
|
||||||
|
margin-right: 10px;
|
||||||
|
width: 130px !important; }
|
||||||
|
|
||||||
|
.querySizeDiv select {
|
||||||
|
height: 30px !important; }
|
||||||
|
|
||||||
|
.wide-button-div {
|
||||||
|
height: 20px;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
padding-top: 5px;
|
||||||
|
width: 100%; }
|
||||||
|
|
||||||
|
.shortcut-div {
|
||||||
|
float: left;
|
||||||
|
margin-top: -5px;
|
||||||
|
padding-left: 45px;
|
||||||
|
width: auto; }
|
||||||
|
|
||||||
|
.query-dropdown-left {
|
||||||
|
margin-top: 10px;
|
||||||
|
width: 100%; }
|
||||||
|
|
||||||
|
.query-dropdown-right {
|
||||||
|
width: 100%; }
|
||||||
|
.query-dropdown-right textarea {
|
||||||
|
padding: 5px 0 0;
|
||||||
|
resize: vertical;
|
||||||
|
width: 100%; }
|
||||||
|
.query-dropdown-right textarea:focus {
|
||||||
|
border-color: #8aa051;
|
||||||
|
box-shadow: 0 0 3px #8aa051;
|
||||||
|
outline: none; }
|
||||||
|
|
||||||
|
.query-modal-select {
|
||||||
|
padding-left: 0;
|
||||||
|
width: 100%; }
|
||||||
|
|
||||||
|
.output-toolbar {
|
||||||
|
border-color: silver;
|
||||||
|
position: relative;
|
||||||
|
width: auto; }
|
||||||
|
.output-toolbar span {
|
||||||
|
float: right;
|
||||||
|
margin-left: 5px;
|
||||||
|
margin-right: 5px;
|
||||||
|
position: relative;
|
||||||
|
top: 2px; }
|
||||||
|
|
||||||
|
.query-select {
|
||||||
|
border: 0 !important;
|
||||||
|
border-radius: 0 !important;
|
||||||
|
line-height: 20px !important;
|
||||||
|
margin-bottom: 0;
|
||||||
|
z-index: 9999 !important; }
|
||||||
|
.query-select option {
|
||||||
|
z-index: 9999 !important; }
|
||||||
|
|
||||||
|
.editor-label {
|
||||||
|
width: 100%; }
|
||||||
|
.editor-label h6 {
|
||||||
|
font-family: 'Open Sans', sans-serif;
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 400;
|
||||||
|
margin-bottom: 5px; }
|
||||||
|
|
||||||
|
.query-dropdown {
|
||||||
|
background-color: #d9d9d9;
|
||||||
|
margin-left: 0;
|
||||||
|
margin-right: 0;
|
||||||
|
padding-left: 5px;
|
||||||
|
padding-right: 5px; }
|
||||||
|
|
||||||
|
.tooltip-margin {
|
||||||
|
margin-top: 1px; }
|
||||||
|
|
||||||
|
.query-dropdown-in {
|
||||||
|
background-color: white;
|
||||||
|
padding: 10px; }
|
||||||
|
.query-dropdown-in a {
|
||||||
|
color: #686766;
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: bolder;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
width: 100%; }
|
||||||
|
.query-dropdown-in #save-edit-query {
|
||||||
|
margin-left: 7px !important; }
|
||||||
|
.query-dropdown-in #delete-edit-query {
|
||||||
|
margin-left: 0 !important; }
|
||||||
|
|
||||||
|
.query-size {
|
||||||
|
border-radius: 0 !important;
|
||||||
|
line-height: 20px !important;
|
||||||
|
width: 130px !important;
|
||||||
|
z-index: 9999 !important; }
|
||||||
|
|
||||||
|
.query-div {
|
||||||
|
display: none; }
|
||||||
|
.query-div > * {
|
||||||
|
border: 0 !important; }
|
||||||
|
.query-div .icon_arangodb {
|
||||||
|
cursor: pointer;
|
||||||
|
margin-bottom: 5px; }
|
||||||
|
|
||||||
|
.display-none {
|
||||||
|
display: none; }
|
||||||
|
|
||||||
.arango-tab {
|
.arango-tab {
|
||||||
border-bottom: 1px solid #dddddd;
|
border-bottom: 1px solid #dddddd;
|
||||||
list-style: none;
|
list-style: none;
|
||||||
|
@ -1351,9 +1540,9 @@ div img.searchSubmitIcon {
|
||||||
margin-top: 10px; }
|
margin-top: 10px; }
|
||||||
|
|
||||||
.document-editor {
|
.document-editor {
|
||||||
width: 100%;
|
|
||||||
height: 500px;
|
height: 500px;
|
||||||
margin-bottom: 5px; }
|
margin-bottom: 5px;
|
||||||
|
width: 100%; }
|
||||||
|
|
||||||
.disabledPag,
|
.disabledPag,
|
||||||
.disabledPag a {
|
.disabledPag a {
|
||||||
|
|
|
@ -29,6 +29,10 @@
|
||||||
@import 'shortcuts';
|
@import 'shortcuts';
|
||||||
// login view
|
// login view
|
||||||
//@import 'login';
|
//@import 'login';
|
||||||
|
// query view
|
||||||
|
@import 'queryView';
|
||||||
|
// some general stuff
|
||||||
|
@import 'general';
|
||||||
// The views containing tabs
|
// The views containing tabs
|
||||||
@import 'tabViews';
|
@import 'tabViews';
|
||||||
// The json editor overwrites
|
// The json editor overwrites
|
||||||
|
|
|
@ -130,7 +130,6 @@
|
||||||
"frontend/css/jquery.dataTables.css",
|
"frontend/css/jquery.dataTables.css",
|
||||||
"frontend/css/nv.d3.css",
|
"frontend/css/nv.d3.css",
|
||||||
"frontend/css/shellView.css",
|
"frontend/css/shellView.css",
|
||||||
"frontend/css/queryView.css",
|
|
||||||
"frontend/css/dashboardView.css",
|
"frontend/css/dashboardView.css",
|
||||||
"frontend/css/logsView.css",
|
"frontend/css/logsView.css",
|
||||||
"frontend/css/documentsView.css",
|
"frontend/css/documentsView.css",
|
||||||
|
|