(add-bins db index set-name new-data new-expiration)
(add-bins db index set-name new-data new-expiration conf)
Add bins to an existing record without modifying old data. The new-data
must be a
Clojure map.
Add bins to an existing record without modifying old data. The `new-data` must be a Clojure map.
Continuation functions that are registered when an async DB operation is called.
The DB passed is an IAerospikeClient
instance.
The value returned from those function will be the value of the returned deferred from the async operation.
Continuation functions that are registered when an async DB operation is called. The DB passed is an `IAerospikeClient` instance. The value returned from those function will be the value of the returned deferred from the async operation.
(on-failure _ op-name op-ex index op-start-time db)
A continuation function. Registered on the operation future and called when operations fails.
A continuation function. Registered on the operation future and called when operations fails.
(on-success _ op-name op-result index op-start-time db)
A continuation function. Registered on the operation future and called when operations succeeds.
A continuation function. Registered on the operation future and called when operations succeeds.
(create db index set-name data expiration)
(create db index set-name data expiration conf)
put
with a create-only policy
`put` with a create-only policy
(create-client host client-policy)
(create-client hosts client-policy port)
Returns the Java AerospikeClient
instance. To build the Clojure IAerospikeClient
one,
use init-simple-aerospike-client
.
Returns the Java `AerospikeClient` instance. To build the Clojure `IAerospikeClient` one, use `init-simple-aerospike-client`.
(create-event-loops conf)
Called internally to create the event loops of for the client. Can also be used to share event loops between several clients.
Called internally to create the event loops of for the client. Can also be used to share event loops between several clients.
(delete db index set-name)
(delete db index set-name conf)
Delete the record stored for key <index>. Returns async true/false for deletion success (hit).
Delete the record stored for key <index>. Returns async true/false for deletion success (hit).
(delete-bins db index set-name bin-names new-expiration)
(delete-bins db index set-name bin-names new-expiration conf)
Delete bins from an existing record. The bin-names
must be a vector of strings.
Delete bins from an existing record. The `bin-names` must be a vector of strings.
(exists-batch db indices)
(exists-batch db indices conf)
Check for each key in a batch if it exists. indices
is a collection of maps
of the form {:index "key-name" :set "set-name"}
. The result is a
vector of booleans in the same order as indices.
Check for each key in a batch if it exists. `indices` is a collection of maps of the form `{:index "key-name" :set "set-name"}`. The result is a vector of booleans in the same order as indices.
(exists? db index set-name)
(exists? db index set-name conf)
Test if an index exists.
Test if an index exists.
(expiry-unix ttl)
Used to convert Aerospike style returned TTLS to standard UNIX EPOCH.
Used to convert Aerospike style returned TTLS to standard UNIX EPOCH.
(get-batch db batch-reads)
(get-batch db batch-reads conf)
Get a batch of records from the cluster asynchronously. batch-reads
is a collection of maps
of the form {:index "foo" :set "someset" :bins [...]}
the :bins
key can have required
bins for the batched keys or missing/[:all] to get all the bins (see _get
). The result is a
vector of AerospikeRecord
s in the same order of keys. Missing keys result in nil
in corresponding
positions.
Get a batch of records from the cluster asynchronously. `batch-reads` is a collection of maps of the form `{:index "foo" :set "someset" :bins [...]}` the `:bins` key can have required bins for the batched keys or missing/[:all] to get all the bins (see `_get`). The result is a vector of `AerospikeRecord`s in the same order of keys. Missing keys result in `nil` in corresponding positions.
(get-cluster-stats db)
For each client, return a vector of [metric-name metric-val] 2-tuples. The metric name is a dot separated string that should be convenient for reporting to statsd/graphite. All values are gauges.
For each client, return a vector of [metric-name metric-val] 2-tuples. The metric name is a dot separated string that should be convenient for reporting to statsd/graphite. All values are gauges.
(get-multiple db indices sets)
(get-multiple db indices sets conf)
DEPRECATED - use get-batch
instead.
Returns a (future) sequence of AerospikeRecords returned by get-single
with records in corresponding places to the required keys. Indices and sets should be sequences.
The conf
map is passed to all get-single
invocations.
DEPRECATED - use `get-batch` instead. Returns a (future) sequence of AerospikeRecords returned by `get-single` with records in corresponding places to the required keys. Indices and sets should be sequences. The `conf` map is passed to all `get-single` invocations.
(get-single db index set-name)
(get-single db index set-name conf)
(get-single db index set-name conf bin-names)
Returns a single record: (transcoder AerospikeRecord)
. The default transcoder is identity
.
Pass a :policy
in conf
to use a non-default ReadPolicy
Returns a single record: `(transcoder AerospikeRecord)`. The default transcoder is `identity`. Pass a `:policy` in `conf` to use a non-default `ReadPolicy`
(get-single-no-meta db index set-name)
(get-single-no-meta db index set-name bin-names)
Shorthand to return a single record payload only.
Shorthand to return a single record payload only.
(healthy? db)
(healthy? db operation-timeout-ms)
Returns true iff the cluster is reachable and can take reads and writes.
Uses __health-check set to avoid data collisions. operation-timeout-ms
is
for total timeout of reads (default is 1s) including 2 retries so a small
over estimation is advised to avoid false negatives.
Returns true iff the cluster is reachable and can take reads and writes. Uses __health-check set to avoid data collisions. `operation-timeout-ms` is for total timeout of reads (default is 1s) including 2 retries so a small over estimation is advised to avoid false negatives.
(get-all-clients _)
Returns a sequence of all AerospikeClient objects.
Returns a sequence of all AerospikeClient objects.
(get-client ac)
(get-client ac index)
Returns the relevant AerospikeClient object for the specific shard
Returns the relevant AerospikeClient object for the specific shard
(info db node info-commands)
(info db node info-commands conf)
Asynchronously make info commands to a node. a node can be retreived from get-nodes
. commands is a seq
of strings available from https://www.aerospike.com/docs/reference/info/index.html the returned future conatains
a map from and info command to its response.
conf can contain {:policy InfoPolicy}
Asynchronously make info commands to a node. a node can be retreived from `get-nodes`. commands is a seq of strings available from https://www.aerospike.com/docs/reference/info/index.html the returned future conatains a map from and info command to its response. conf can contain {:policy InfoPolicy}
(init-simple-aerospike-client hosts aero-ns)
(init-simple-aerospike-client hosts aero-ns conf)
hosts should be a seq of known hosts to bootstrap from. Optional conf map can have: :event-loops - a client compatible event loop instace client policy configuration keys (see policy/create-client-policy) :client-policy - a ready ClientPolicy "username" :port (default is 3000) :client-events an implementation of ClientEvents
hosts should be a seq of known hosts to bootstrap from. Optional conf map _can_ have: :event-loops - a client compatible event loop instace client policy configuration keys (see policy/create-client-policy) :client-policy - a ready ClientPolicy "username" :port (default is 3000) :client-events an implementation of ClientEvents
(operate db index set-name expiration operations)
(operate db index set-name expiration operations conf)
Asynchronously perform multiple read/write operations on a single key in one batch call.
This method registers the command with an event loop and returns. The event loop thread
will process the command and send the results to the listener.
commands
is a sequence of Aerospike CDT operations.
Asynchronously perform multiple read/write operations on a single key in one batch call. This method registers the command with an event loop and returns. The event loop thread will process the command and send the results to the listener. `commands` is a sequence of Aerospike CDT operations.
(put db index set-name data expiration)
(put db index set-name data expiration conf)
Writes data
into a record with the key index
, with the ttl of expiration
seconds.
index
should be string. Pass a function in (:trascoder conf)
to modify data
before it
is sent to the DB.
Pass a WritePolicy
in (:policy conf)
to uses the non-default policy.
When a Clojure map is provided for the data
argument, a multiple bin record will be created.
Each key-value pair in the map will be treated as a bin-name, bin-value pair. Bin-names must be
strings. Bin-values can be any nested data structure.
Writes `data` into a record with the key `index`, with the ttl of `expiration` seconds. `index` should be string. Pass a function in `(:trascoder conf)` to modify `data` before it is sent to the DB. Pass a `WritePolicy` in `(:policy conf)` to uses the non-default policy. When a Clojure map is provided for the `data` argument, a multiple bin record will be created. Each key-value pair in the map will be treated as a bin-name, bin-value pair. Bin-names must be strings. Bin-values can be any nested data structure.
(put-multiple db indices set-names payloads expirations)
(put-multiple db indices set-names payloads expirations conf)
Put multiple payloads by invoking put
. All arguments should be mutually
corresponding sequences.
Put multiple payloads by invoking `put`. All arguments should be mutually corresponding sequences.
(replace-only db index set-name data expiration)
(replace-only db index set-name data expiration conf)
put
with a replace-only policy
`put` with a replace-only policy
(scan-set db aero-namespace set-name conf)
Scans through the given set and calls a user defined callback for each record that was found.
Returns a deferred response that resolves once the scan completes. When the scan completes
successfully it returns true
. The scan may be aborted by returning :abort-scan from the callback.
In that case the return value is false
.
The conf
argument should be a map with the following keys:
:callback - Function that accepts a com.aerospike.client.Value and an AerospikeRecord.
:policy - Optional. com.aerospike.client.policy.ScanPolicy.
:bins - Optional. Vector of bin names to return. Returns all bins by default.
Scans through the given set and calls a user defined callback for each record that was found. Returns a deferred response that resolves once the scan completes. When the scan completes successfully it returns `true`. The scan may be aborted by returning :abort-scan from the callback. In that case the return value is `false`. The `conf` argument should be a map with the following keys: :callback - Function that accepts a com.aerospike.client.Value and an AerospikeRecord. :policy - Optional. com.aerospike.client.policy.ScanPolicy. :bins - Optional. Vector of bin names to return. Returns all bins by default.
(set-single db index set-name data expiration)
(set-single db index set-name data expiration conf)
put
with an update policy
`put` with an update policy
(stop-aerospike-client db)
gracefully stop a client, waiting until all async operations finish.
gracefully stop a client, waiting until all async operations finish.
(touch db index set-name expiration)
Updates the ttl of the record stored under at index
to expiration
seconds from now.
Expects records to exist.
Updates the ttl of the record stored under at `index` to `expiration` seconds from now. Expects records to exist.
(update db index set-name new-record generation new-expiration)
(update db index set-name new-record generation new-expiration conf)
Writing a new value for the key index
.
Generation: the expected modification count of the record (i.e. how many times was it
modified before my current action). Pass a function in (:trascoder conf)
to modify
data
before it is sent to the DB.
Writing a new value for the key `index`. Generation: the expected modification count of the record (i.e. how many times was it modified before my current action). Pass a function in `(:trascoder conf)` to modify `data` before it is sent to the DB.
Use create-key
directly to pass a premade custom key to the public API.
When passing a simple String/Integer/Long/ByteArray the key will be created
automatically for you. If you pass a ready made key, as-namespace
and
set-name
are ignored in API calls.
Use `create-key` directly to pass a premade custom key to the public API. When passing a simple String/Integer/Long/ByteArray the key will be created automatically for you. If you pass a ready made key, `as-namespace` and `set-name` are ignored in API calls.
(create-key this as-namespace set-name)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close