Hi guys,
I’m giving a first try to 2.x, and so far, no joy… I’m probably doing something silly, but just in case (running on JDK21):
Deps:
{:mvn/repos {"ossrh-snapshots" {:url "https://s01.oss.sonatype.org/content/repositories/snapshots"}}
:paths ["src" "resources"]
:deps {org.clojure/clojure {:mvn/version "1.11.1"}
com.xtdb.labs/xtdb-api {:mvn/version "2.0.0-SNAPSHOT"}
com.xtdb.labs/xtdb-core {:mvn/version "2.0.0-SNAPSHOT"}}
:aliases
{:dev {:extra-paths ["test" "dev" "perf"]
:jvm-opts ["--add-opens=java.base/java.nio=ALL-UNNAMED"
"-Dio.netty.tryReflectionSetAccessible=true"]
:extra-deps {com.github.jpmonettas/flow-storm-dbg {:mvn/version "3.7.4"}
com.github.mhjort/trombi {:mvn/version "1.0.0"}
com.github.mhjort/trombi-gatling-highcharts-reporter {:mvn/version "1.0.0"}
http-kit/http-kit {:mvn/version "2.8.0-alpha3"}
djblue/portal {:mvn/version "0.48.0"}}}
:run-m {:main-opts ["-m" "fi.varela.xt2exp"]}
:run-x {:ns-default fi.varela.xt2exp
:exec-fn greet
:exec-args {:name "Clojure"}}
:build {:deps {io.github.clojure/tools.build
{:git/tag "v0.9.2" :git/sha "fe6b140"}}
:ns-default build}
:test {:extra-paths ["test"]
:extra-deps {org.clojure/test.check {:mvn/version "1.1.1"}
io.github.cognitect-labs/test-runner
{:git/tag "v0.5.1" :git/sha "dfb30dd"}}} :neil {:project {:name fi.varela/xt2exp}}}}
I’m running this with -A:dev
Code:
(ns fi.varela.xt2exp
(:require [xtdb.node :as xt.node]
[xtdb.api :as xt]
[clojure.java.io :as io])
(:gen-class))
(def node (xt.node/start-node (let [node-dir (io/file "/tmp/xt2")]
{:xtdb.log/local-directory-log {:root-path (io/file node-dir "log")}
:xtdb.object-store/file-system-object-store {:root-path (io/file node-dir "objects")}})))
(xt/status node)
;; => {:latest-completed-tx nil, :latest-submitted-tx nil}
(def some-doc {:xt/id :toto
:entity/type :person
:person/name "Toto"
:person/age 44
:person/others #{:tato :tito}})
(def tx (xt/submit-tx node [[:put :person some-doc]]))
;; => Execution error (UnsupportedOperationException) at org.apache.arrow.memory.util.MemoryUtil/directBuffer (MemoryUtil.java:174).
;; sun.misc.Unsafe or java.nio.DirectByteBuffer.<init>(long, int) not available
Full stack trace:
2. Unhandled clojure.lang.Compiler$CompilerException
Error compiling NO_SOURCE_FILE at (21:9)
#:clojure.error{:phase :execution,
:line 21,
:column 9,
:source "NO_SOURCE_FILE"}
Compiler.java: 3719 clojure.lang.Compiler$InvokeExpr/eval
Compiler.java: 457 clojure.lang.Compiler$DefExpr/eval
Compiler.java: 7199 clojure.lang.Compiler/eval
Compiler.java: 7149 clojure.lang.Compiler/eval
core.clj: 3215 clojure.core/eval
core.clj: 3211 clojure.core/eval
interruptible_eval.clj: 87 nrepl.middleware.interruptible-eval/evaluate/fn/fn
AFn.java: 152 clojure.lang.AFn/applyToHelper
AFn.java: 144 clojure.lang.AFn/applyTo
core.clj: 667 clojure.core/apply
core.clj: 1990 clojure.core/with-bindings*
core.clj: 1990 clojure.core/with-bindings*
RestFn.java: 425 clojure.lang.RestFn/invoke
interruptible_eval.clj: 87 nrepl.middleware.interruptible-eval/evaluate/fn
main.clj: 437 clojure.main/repl/read-eval-print/fn
main.clj: 437 clojure.main/repl/read-eval-print
main.clj: 458 clojure.main/repl/fn
main.clj: 458 clojure.main/repl
main.clj: 368 clojure.main/repl
RestFn.java: 1523 clojure.lang.RestFn/invoke
interruptible_eval.clj: 84 nrepl.middleware.interruptible-eval/evaluate
interruptible_eval.clj: 56 nrepl.middleware.interruptible-eval/evaluate
interruptible_eval.clj: 152 nrepl.middleware.interruptible-eval/interruptible-eval/fn/fn
AFn.java: 22 clojure.lang.AFn/run
session.clj: 218 nrepl.middleware.session/session-exec/main-loop/fn
session.clj: 217 nrepl.middleware.session/session-exec/main-loop
AFn.java: 22 clojure.lang.AFn/run
Thread.java: 1583 java.lang.Thread/run
1. Caused by java.lang.UnsupportedOperationException
sun.misc.Unsafe or java.nio.DirectByteBuffer.<init>(long, int) not available
MemoryUtil.java: 174 org.apache.arrow.memory.util.MemoryUtil/directBuffer
ArrowBuf.java: 229 org.apache.arrow.memory.ArrowBuf/getDirectBuffer
ArrowBuf.java: 224 org.apache.arrow.memory.ArrowBuf/nioBuffer
WriteChannel.java: 133 org.apache.arrow.vector.ipc.WriteChannel/write
MessageSerializer.java: 303 org.apache.arrow.vector.ipc.message.MessageSerializer/writeBatchBuffers
MessageSerializer.java: 276 org.apache.arrow.vector.ipc.message.MessageSerializer/serialize
ArrowWriter.java: 147 org.apache.arrow.vector.ipc.ArrowWriter/writeRecordBatch
ArrowWriter.java: 133 org.apache.arrow.vector.ipc.ArrowWriter/writeBatch
util.clj: 417 xtdb.util/build-arrow-ipc-byte-buffer/fn/fn/fn/write-batch!
util.clj: 428 xtdb.util/root->arrow-ipc-byte-buffer/fn
util.clj: 416 xtdb.util/build-arrow-ipc-byte-buffer/fn/fn/fn
util.clj: 408 xtdb.util/build-arrow-ipc-byte-buffer/fn/fn
util.clj: 408 xtdb.util/build-arrow-ipc-byte-buffer/fn
util.clj: 408 xtdb.util/build-arrow-ipc-byte-buffer
util.clj: 404 xtdb.util/build-arrow-ipc-byte-buffer
util.clj: 426 xtdb.util/root->arrow-ipc-byte-buffer
util.clj: 425 xtdb.util/root->arrow-ipc-byte-buffer
tx_producer.clj: 387 xtdb.tx-producer/serialize-tx-ops
tx_producer.clj: 367 xtdb.tx-producer/serialize-tx-ops
tx_producer.clj: 403 xtdb.tx-producer.TxProducer/submitTx
node.clj: 89 xtdb.node.Node/submit_tx_AMPERSAND_
api.clj: 157 xtdb.api/submit-tx&
api.clj: 139 xtdb.api/submit-tx&
api.clj: 184 xtdb.api/submit-tx
api.clj: 160 xtdb.api/submit-tx
api.clj: 182 xtdb.api/submit-tx
api.clj: 160 xtdb.api/submit-tx
AFn.java: 156 clojure.lang.AFn/applyToHelper
AFn.java: 144 clojure.lang.AFn/applyTo
Compiler.java: 3714 clojure.lang.Compiler$InvokeExpr/eval
Compiler.java: 457 clojure.lang.Compiler$DefExpr/eval
Compiler.java: 7199 clojure.lang.Compiler/eval
Compiler.java: 7149 clojure.lang.Compiler/eval
core.clj: 3215 clojure.core/eval
core.clj: 3211 clojure.core/eval
interruptible_eval.clj: 87 nrepl.middleware.interruptible-eval/evaluate/fn/fn
AFn.java: 152 clojure.lang.AFn/applyToHelper
AFn.java: 144 clojure.lang.AFn/applyTo
core.clj: 667 clojure.core/apply
core.clj: 1990 clojure.core/with-bindings*
core.clj: 1990 clojure.core/with-bindings*
RestFn.java: 425 clojure.lang.RestFn/invoke
interruptible_eval.clj: 87 nrepl.middleware.interruptible-eval/evaluate/fn
main.clj: 437 clojure.main/repl/read-eval-print/fn
main.clj: 437 clojure.main/repl/read-eval-print
main.clj: 458 clojure.main/repl/fn
main.clj: 458 clojure.main/repl
main.clj: 368 clojure.main/repl
RestFn.java: 1523 clojure.lang.RestFn/invoke
interruptible_eval.clj: 84 nrepl.middleware.interruptible-eval/evaluate
interruptible_eval.clj: 56 nrepl.middleware.interruptible-eval/evaluate
interruptible_eval.clj: 152 nrepl.middleware.interruptible-eval/interruptible-eval/fn/fn
AFn.java: 22 clojure.lang.AFn/run
session.clj: 218 nrepl.middleware.session/session-exec/main-loop/fn
session.clj: 217 nrepl.middleware.session/session-exec/main-loop
AFn.java: 22 clojure.lang.AFn/run
Thread.java: 1583 java.lang.Thread/run
Am I doing something wrong, or is this some other issue?
Cheers,
Martín