This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-08-20
Channels
- # announcements (16)
- # babashka (71)
- # beginners (121)
- # bristol-clojurians (2)
- # calva (55)
- # clj-kondo (16)
- # clojure (103)
- # clojure-europe (9)
- # clojure-italy (5)
- # clojure-nl (4)
- # clojure-spec (49)
- # clojure-uk (57)
- # clojurescript (28)
- # conjure (9)
- # cursive (6)
- # datascript (3)
- # datomic (35)
- # duct (20)
- # events (3)
- # figwheel-main (12)
- # fulcro (6)
- # graalvm (12)
- # juxt (3)
- # kaocha (5)
- # lumo (10)
- # malli (5)
- # off-topic (54)
- # pathom (8)
- # re-frame (19)
- # reitit (21)
- # remote-jobs (1)
- # shadow-cljs (102)
- # sql (38)
- # tools-deps (60)
- # uncomplicate (3)
- # xtdb (10)
Hi guys, I'm new to crux and Clojure (btw, loving both, great work) and I'm struggling with initializing Crux node with Kafka topology from Java. Everything works as expected I even get documents into Kafka if I leave crux.kv/db-dir
default (not setting it). However I would like to use the same index db dir eac time but I'm unable to get it working if I put this into my config:
static {
Clojure.var("clojure.core", "require")
.invoke(Clojure.read(""));
final String nodeConfig = "{:crux.node/topology [crux.kafka/topology crux.kv.rocksdb/kv-store]\n" +
":crux.kafka/bootstrap-servers \"localhost:9092\"\n" +
":crux.kv/db-dir ( \"/tmp/crux-store\" \"indexes\")" +
"}";
node = Crux.startNode((Map<Keyword, ?>) Clojure.read(nodeConfig));
node.sync(Duration.ofSeconds(30)); // Become consistent for a max of 30s
}
The exception is:
Caused by: java.lang.IllegalArgumentException: Arg :crux.kv/db-dir invalid: nil - failed: (instance? java.nio.file.Path %) spec: :crux.config/path
The same initialization config works if I'm using Clojure. Can someone give me a hint how to initialize file in the config please.first thing I'd try would be to pass the file as a raw string instead, just in case it's the
part going wrong - ":crux.kv/db-dir \"/tmp/crux-store/indexes\""
?
Thank you @U050V1N74. I needed to take a break, to try the simplest option 😅
while I'm here.. can I ask you another question @U050V1N74 regarding upcoming functionalities.
I'm translating some Cypher (Neo4j) queries into Crux/Datalog and I'm looking for equivalent of OPTIONAL MATCH
which is in fact an OUTER JOIN.
If I understand correctly this could be achieved by get-else
which is not yet supported by Crux ATM.
Is there any road map on this? I couldn't find any Github issue/task on this matter.
Could I achieve "outer join" in any other way? Possibly by custom predicate function call as the docs suggests.