Skip to content

Commit

Permalink
Merge pull request #271 from Antonelli712/joa/EventLogDir-for-standalone
Browse files Browse the repository at this point in the history
Fixes #266 Make `event-log-dir` mandatory for standalone
  • Loading branch information
jonpither committed Jun 25, 2019
2 parents 20eb559 + 8e5cbac commit a522ff4
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 9 deletions.
3 changes: 2 additions & 1 deletion dev/ivan.clj
Expand Up @@ -67,7 +67,8 @@
(def system
(crux.api/start-standalone-system
{:kv-backend "crux.kv.memdb.MemKv"
:db-dir "data/db-dir-1"}))
:db-dir "data/db-dir-1"
:event-log-dir "data/eventlog-1"}))

(binding [f/*api* system]
(with-stocks-data println))
Expand Down
1 change: 1 addition & 0 deletions docs/configuration.adoc
Expand Up @@ -146,6 +146,7 @@ Set the following properties when configuring Crux systems:
|Property|Value
|`kv-backend`|`"crux.kv.rocksdb.RocksKv"`
|`db-dir`|i.e. `"data/db-dir-1"`
|`event-log-dir`|i.e. `"data/eventlog-1"`
|===

For example when constructing the standalone system:
Expand Down
2 changes: 1 addition & 1 deletion docs/deps.edn
@@ -1,7 +1,7 @@
{:deps
{
;; tag::CruxDep[]
juxt/crux {:mvn/version "19.06-1.6.0-alpha"}
juxt/crux {:mvn/version "19.06-1.1.0-alpha"}
;; end::CruxDep[]

;; tag::KafkaDeps[]
Expand Down
3 changes: 2 additions & 1 deletion docs/example_standalone_integrant_system.clj
Expand Up @@ -3,7 +3,8 @@
[integrant.core :as ig]))

(def config {:crux/standalone {:kv-backend "crux.kv.memdb.MemKv"
:db-dir "data/db-dir-1"}})
:db-dir "data/db-dir-1"
:event-log-dir "data/eventlog-1"}})

(defmethod ig/init-key :crux/standalone [_ opts]
(api/start-standalone-system opts))
Expand Down
8 changes: 5 additions & 3 deletions docs/examples.clj
Expand Up @@ -6,7 +6,8 @@

(def ^crux.api.ICruxAPI system
(crux/start-standalone-system {:kv-backend "crux.kv.memdb.MemKv"
:db-dir "data/db-dir-1"}))
:db-dir "data/db-dir-1"
:event-log-dir "data/eventlog-1"}))
;; end::start-system[]

;; tag::close-system[]
Expand All @@ -16,13 +17,14 @@
;; tag::start-cluster-node-system[]
(def ^crux.api.ICruxAPI system
(crux/start-cluster-node {:kv-backend "crux.kv.memdb.MemKv"
:bootstrap-servers "localhost:29092"}))
:bootstrap-servers "localhost:29092"}))
;; end::start-cluster-node-system[]

;; tag::start-standalone-with-rocks[]
(def ^crux.api.ICruxAPI system
(crux/start-standalone-system {:kv-backend "crux.kv.rocksdb.RocksKv"
:db-dir "data/db-dir-1"}))
:db-dir "data/db-dir-1"
:event-log-dir "data/eventlog-1"}))
;; end::start-standalone-with-rocks[]

;; tag::submit-tx[]
Expand Down
2 changes: 1 addition & 1 deletion example/standalone_webservice/project.clj
Expand Up @@ -14,7 +14,7 @@
[org.eclipse.rdf4j/rdf4j-rio-ntriples "2.4.5"]
[org.eclipse.rdf4j/rdf4j-queryparser-sparql "2.4.5"]

[juxt/crux "19.04-1.0.3-alpha"]
[juxt/crux "19.06-1.1.0-alpha"]
[yada "1.3.0-alpha7"]
[hiccup "2.0.0-alpha2"]
[org.rocksdb/rocksdbjni "5.17.2"]
Expand Down
4 changes: 2 additions & 2 deletions src/crux/bootstrap/standalone.clj
Expand Up @@ -76,8 +76,8 @@
(doseq [c [event-log-consumer tx-log kv-store]]
(cio/try-close c))))

(s/def ::standalone-options (s/keys :req-un [:crux.kv/db-dir :crux.kv/kv-backend]
:opt-un [:crux.kv/sync? :crux.tx/event-log-dir :crux.db/object-store :crux.lru/doc-cache-size]
(s/def ::standalone-options (s/keys :req-un [:crux.kv/db-dir :crux.tx/event-log-dir :crux.kv/kv-backend]
:opt-un [:crux.kv/sync? :crux.db/object-store :crux.lru/doc-cache-size]
:opt [:crux.tx/event-log-sync-interval-ms
:crux.tx/event-log-kv-backend]))

Expand Down

0 comments on commit a522ff4

Please sign in to comment.