From e28fc6ed41d6ceedeca672cc850380082036bc44 Mon Sep 17 00:00:00 2001 From: florijan Date: Fri, 16 Jun 2017 16:13:58 +0200 Subject: [PATCH] FLAG 'snapshot_on_destruction' renamed to 'snapshot_on_exit' Reviewers: teon.banek, buda Reviewed By: teon.banek, buda Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D471 --- config/alpha.conf | 22 +++++++++++----------- config/testing.conf | 20 ++++++++++---------- docs/user_technical/README.md | 1 - docs/user_technical/installation.md | 2 +- docs/user_technical/interfaces.md | 22 ---------------------- src/database/graph_db.cpp | 6 +++--- tests/unit/snapshot.cpp | 4 ++-- 7 files changed, 27 insertions(+), 50 deletions(-) delete mode 100644 docs/user_technical/interfaces.md diff --git a/config/alpha.conf b/config/alpha.conf index 094a7b26e..ae91c62d4 100644 --- a/config/alpha.conf +++ b/config/alpha.conf @@ -4,37 +4,37 @@ # (where the executable is run) # path to the codes which will be compiled ---compile_path=./compiled/ +--compile-path=./compiled/ # path to the template (cpp) for codes generation ---template_cpp_path=./template/plan_template_cpp +--template-cpp-path=./template/plan_template_cpp # path to the folder with snapshots ---snapshot_directory=/var/lib/memgraph/snapshots +--snapshot-directory=/var/lib/memgraph/snapshots # cleaning cycle interval # if set to -1 the GC will not run ---cleaning_cycle_sec=30 +--cleaning-cycle-sec=30 # snapshot cycle interval # if set to -1 the snapshooter will not run ---snapshot_cycle_sec=300 +--snapshot-cycle-sec=300 -# create snapshot disabled on db destruction ---snapshot_db_destruction=true +# create snapshot disabled on db exit +--snapshot-on-db-exit=true # max number of snapshots which will be kept on the disk at some point # if set to -1 the max number of snapshots is unlimited ---max_retained_snapshots=3 +--max-retained-snapshots=3 # by default query engine runs in interpret mode --interpret=true # database recovering is disabled by default ---recover_on_startup=true +--recover-on-startup=true # use ast caching ---ast_cache=false +--ast-cache=false # path to where the log should be stored ---log_file=/var/lib/memgraph/memgraph.log +--log-file=/var/lib/memgraph/memgraph.log diff --git a/config/testing.conf b/config/testing.conf index d7da91e8f..5fef4f818 100644 --- a/config/testing.conf +++ b/config/testing.conf @@ -4,34 +4,34 @@ # (where the executable is runned) # directory to the codes which will be compiled ---compile_directory=./compiled/ +--compile-directory=compiled # path to the template (cpp) for codes generation ---template_cpp_path=./template/plan_template_cpp +--template-cpp-path=template/plan_template_cpp # directory to the folder with snapshots ---snapshot_directory=snapshots +--snapshot-directory=snapshots # cleaning cycle interval # if set to -1 the GC will not run ---gc_cycle_sec=30 +--gc-cycle-sec=30 # snapshot cycle interval # if set to -1 the snapshooter will not run ---snapshot_cycle_sec=-1 +--snapshot-cycle-sec=-1 -# create snapshot disabled on db destruction ---snapshot_on_db_destruction=false +# create snapshot disabled on db exit +--snapshot-on-db-exit=true # max number of snapshots which will be kept on the disk at some point # if set to -1 the max number of snapshots is unlimited ---max_retained_snapshots=-1 +--max-retained-snapshots=-1 # by default query engine runs in interpret mode --interpret=true # database recovering is disabled by default ---recover_on_startup=false +--recover-on-startup=false # use ast caching ---ast_cache=false +--ast-cache=false diff --git a/docs/user_technical/README.md b/docs/user_technical/README.md index b7a23884e..5b1d2fef0 100644 --- a/docs/user_technical/README.md +++ b/docs/user_technical/README.md @@ -12,6 +12,5 @@ data structures, multi-version concurrency control and asynchronous IO. * [Installation](installation.md) * [Quick Start](quick-start.md) * [openCypher Query Language](open-cypher.md) - * [Interfacing with Memgraph](interfaces.md) * [Upcoming Features](upcoming-features.md) diff --git a/docs/user_technical/installation.md b/docs/user_technical/installation.md index 6e12183ea..3fde2612a 100644 --- a/docs/user_technical/installation.md +++ b/docs/user_technical/installation.md @@ -69,7 +69,7 @@ parameters: --num-workers | integer | CPU count[^1] | Number of Memgraph worker threads. --snapshot-cycle-sec | integer | 300 | Interval (seconds) between database snapshots.
Value of -1 turns taking snapshots off. --max-retained-snapshots | integer | 3 | Number of retained snapshots.
Value -1 means without limit. - --snapshot-on-db-destruction | bool | false | Make a snapshot when closing Memgraph. + --snapshot-on-db-exit | bool | false | Make a snapshot when closing Memgraph. --recover-on-startup | bool | false | Recover the database on startup using the last
stored snapshot. [^1]: Maximum number of concurrent executions on the current CPU. diff --git a/docs/user_technical/interfaces.md b/docs/user_technical/interfaces.md deleted file mode 100644 index 69fb5279a..000000000 --- a/docs/user_technical/interfaces.md +++ /dev/null @@ -1,22 +0,0 @@ -## Interfacing with Memgraph - -This chapter describes ways to access the Memgraph database. - -Currently only the [*Bolt protocol*](#bolt-protocol) is supported. We are -working on implementing a web-browser interface. - -### Bolt Protocol - -The [Bolt protocol](https://boltprotocol.org/) was designed for efficient -communication with graph databases. Memgraph supports -[Version 1](https://boltprotocol.org/v1/) of the protocol. - -Official Bolt protocol drivers are provided for multiple programming languages: - - * [Java](http://neo4j.com/docs/api/java-driver) - * [Python](http://neo4j.com/docs/api/python-driver) - * [JavaScript](http://neo4j.com/docs/api/javascript-driver) - * [C#](http://neo4j.com/docs/api/dotnet-driver) - -They can be used for easier building custom interfaces for Memgraph. We -recommend using drivers starting from version 1.3. diff --git a/src/database/graph_db.cpp b/src/database/graph_db.cpp index 4f760f63c..31573d500 100644 --- a/src/database/graph_db.cpp +++ b/src/database/graph_db.cpp @@ -18,8 +18,8 @@ DEFINE_int32(max_retained_snapshots, -1, DEFINE_int32(snapshot_cycle_sec, -1, "Amount of time between starts of two snapshooters in seconds. -1 " "to turn off."); -DEFINE_bool(snapshot_on_db_destruction, false, - "Snapshot on database destruction."); +DEFINE_bool(snapshot_on_db_exit, false, + "Snapshot on exiting the database."); DECLARE_string(snapshot_directory); @@ -107,7 +107,7 @@ GraphDb::~GraphDb() { snapshot_creator_.Stop(); // Create last database snapshot - if (FLAGS_snapshot_on_db_destruction == true) { + if (FLAGS_snapshot_on_db_exit == true) { GraphDbAccessor db_accessor(*this); logger.info("Creating snapshot on shutdown..."); const bool status = snapshooter_.MakeSnapshot( diff --git a/tests/unit/snapshot.cpp b/tests/unit/snapshot.cpp index eede9695f..9c80fdba9 100644 --- a/tests/unit/snapshot.cpp +++ b/tests/unit/snapshot.cpp @@ -6,7 +6,7 @@ #include "dbms/dbms.hpp" #include "durability/snapshooter.hpp" -DECLARE_bool(snapshot_on_db_destruction); +DECLARE_bool(snapshot_on_db_exit); DECLARE_int32(snapshot_cycle_sec); DECLARE_string(snapshot_directory); @@ -103,7 +103,7 @@ TEST_F(SnapshotTest, CreateSnapshotWithUnlimitedMaxRetainedSnapshots) { TEST_F(SnapshotTest, TestSnapshotFileOnDbDestruct) { { FLAGS_snapshot_directory = SNAPSHOTS_FOLDER_ALL_DB; - FLAGS_snapshot_on_db_destruction = true; + FLAGS_snapshot_on_db_exit = true; Dbms dbms; auto dba = dbms.active(); }