diff --git a/project.clj b/project.clj index 2f0c9d1..951c00a 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject aerospike-clj "1.0.0" +(defproject aerospike-clj "1.0.1-SANPSHOT" :description "An Aerospike Clojure client." :url "https://github.com/AppsFlyer/aerospike-clj" :license {:name "Eclipse Public License" diff --git a/src/main/clojure/aerospike_clj/client.clj b/src/main/clojure/aerospike_clj/client.clj index c30657a..150ea5f 100644 --- a/src/main/clojure/aerospike_clj/client.clj +++ b/src/main/clojure/aerospike_clj/client.clj @@ -11,6 +11,7 @@ [com.aerospike.client.async EventLoop NioEventLoops EventLoops] [com.aerospike.client.policy Policy BatchPolicy ClientPolicy RecordExistsAction WritePolicy ScanPolicy InfoPolicy] [com.aerospike.client.cluster Node] + [com.aerospike.client Key] [aerospike_clj.listeners AsyncExistsListener AsyncDeleteListener AsyncWriteListener AsyncInfoListener AsyncRecordListener AsyncRecordSequenceListener AsyncBatchListListener AsyncExistsArrayListener] @@ -146,9 +147,10 @@ (Bin/asNull bin-name)) (defn- batch-read->map [^BatchRead batch-read] - (assoc (record/record->map (.record batch-read)) - :index - (.toString (.userKey (.key batch-read))))) + (let [^Key key (.key batch-read)] + (-> (record/record->map (.record batch-read)) + (assoc :index (.toString (.userKey key))) + (assoc :set (.setName key))))) (def ^:private x-bin-convert (comp diff --git a/test/aerospike_clj/client_test.clj b/test/aerospike_clj/client_test.clj index 3547f80..9bf78ba 100644 --- a/test/aerospike_clj/client_test.clj +++ b/test/aerospike_clj/client_test.clj @@ -121,7 +121,9 @@ {:index "not there" :set _set}] res @(client/get-batch *c* brs)] (is (= [data data2 nil data3 nil] (mapv :payload res))) - (is (= [1 1 nil 1 nil] (mapv :gen res)))))) + (is (= [1 1 nil 1 nil] (mapv :gen res))) + (is (= [k k2 k2 k3 "not there"] (mapv :index res))) + (is (= [_set _set2 _set _set _set] (mapv :set res)))))) (deftest exists-batch (let [k (random-key)