Liking cljdoc? Tell your friends :D

crux.api

Public API of Crux.

Public API of Crux.
raw docstring

new-api-clientclj

(new-api-client url)

Creates a new remote API client ICruxAPI. The remote client requires valid and transaction time to be specified for all calls to db.

NOTE: requires crux-http-client on the classpath, see crux.remote-api-client/internal-http-request-fn for more information.

url the URL to a Crux HTTP end-point.

returns a remote API client.

Creates a new remote API client ICruxAPI. The remote client
requires valid and transaction time to be specified for all
calls to `db`.

NOTE: requires crux-http-client on the classpath, see
crux.remote-api-client/*internal-http-request-fn* for more
information.

url the URL to a Crux HTTP end-point.

returns a remote API client.
sourceraw docstring

new-ingest-clientclj

(new-ingest-client options)

Starts an ingest client for transacting into Kafka without running a full local node with index.

For valid options, see crux.kafka/default-options. Options are specified as keywords using their long format name, like :crux.kafka/bootstrap-servers etc.

options {:crux.kafka/bootstrap-servers "kafka-cluster-kafka-brokers.crux.svc.cluster.local:9092" :crux.kafka/group-id "group-id" :crux.kafka/tx-topic "crux-transaction-log" :crux.kafka/doc-topic "crux-docs" :crux.kafka/create-topics true :crux.kafka/doc-partitions 1 :crux.kafka/replication-factor 1}

Returns a crux.api.ICruxIngestAPI component that implements java.io.Closeable, which allows the client to be stopped by calling close.

Starts an ingest client for transacting into Kafka without running a
full local node with index.

For valid options, see crux.kafka/default-options. Options are
specified as keywords using their long format name, like
:crux.kafka/bootstrap-servers etc.

options
{:crux.kafka/bootstrap-servers  "kafka-cluster-kafka-brokers.crux.svc.cluster.local:9092"
 :crux.kafka/group-id           "group-id"
 :crux.kafka/tx-topic           "crux-transaction-log"
 :crux.kafka/doc-topic          "crux-docs"
 :crux.kafka/create-topics      true
 :crux.kafka/doc-partitions     1
 :crux.kafka/replication-factor 1}

Returns a crux.api.ICruxIngestAPI component that implements
java.io.Closeable, which allows the client to be stopped by calling
close.
sourceraw docstring

PCruxAsyncIngestClientcljprotocol

Provides API access to Crux async ingestion.

Provides API access to Crux async ingestion.

submit-tx-asyncclj

(submit-tx-async node tx-ops)

Writes transactions to the log for processing tx-ops datalog style transactions. Non-blocking. Returns a deref with map with details about the submitted transaction, including tx-time and tx-id.

Writes transactions to the log for processing tx-ops datalog
style transactions. Non-blocking.  Returns a deref with map with
details about the submitted transaction, including tx-time and
tx-id.
sourceraw docstring

PCruxDatasourcecljprotocol

Represents the database as of a specific valid and transaction time.

Represents the database as of a specific valid and
transaction time.

history-descendingclj

(history-descending db eid)
(history-descending db snapshot eid)

Retrieves entity history (lazily, in the deprecated 3-arg arity - see open-history-descending) in reverse chronological order from and including the valid time of the db while respecting transaction time. Includes the documents.

Retrieves entity history (lazily, in the deprecated 3-arg arity - see
`open-history-descending`) in reverse chronological order from and including
the valid time of the db while respecting transaction time. Includes the
documents.

transaction-timeclj

(transaction-time db)

returns the time of the latest transaction applied to this db value. If a tx time was specified when db value was acquired then returns the specified time.

returns the time of the latest transaction applied to this db value.
If a tx time was specified when db value was acquired then returns
the specified time.

entityclj

(entity db eid)
(entity db snapshot eid)

queries a document map for an entity. eid is an object which can be coerced into an entity id. returns the entity document map.

queries a document map for an entity.
eid is an object which can be coerced into an entity id.
returns the entity document map.

open-history-descendingclj

(open-history-descending db eid)

Retrieves entity history lazily in reverse chronological order from and including the valid time of the db while respecting transaction time. Includes the documents.

Retrieves entity history lazily in reverse chronological order
from and including the valid time of the db while respecting
transaction time. Includes the documents.

qclj

(q db query)
(q db snapshot query)

q[uery] a Crux db. query param is a datalog query in map, vector or string form. First signature will evaluate eagerly and will return a set or vector of result tuples. Second signature accepts a db snapshot, see new-snapshot. Evaluates lazily consequently returns lazy sequence of result tuples.

q[uery] a Crux db.
query param is a datalog query in map, vector or string form.
First signature will evaluate eagerly and will return a set or vector
of result tuples.
Second signature accepts a db snapshot, see `new-snapshot`.
Evaluates *lazily* consequently returns lazy sequence of result tuples.

history-ascendingclj

(history-ascending db eid)
(history-ascending db snapshot eid)

Retrieves entity history (lazily, in the deprecated 3-arg arity - see open-history-ascending) in chronological order from and including the valid time of the db while respecting transaction time. Includes the documents.

Retrieves entity history (lazily, in the deprecated 3-arg arity - see
`open-history-ascending`) in chronological order from and including the valid
time of the db while respecting transaction time. Includes the documents.

open-history-ascendingclj

(open-history-ascending db eid)

Retrieves entity history lazily in chronological order from and including the valid time of the db while respecting transaction time. Includes the documents.

Retrieves entity history lazily in chronological order
from and including the valid time of the db while respecting
transaction time. Includes the documents.

open-qclj

(open-q db query)

lazily q[uery] a Crux db. query param is a datalog query in map, vector or string form.

This function returns a Closeable sequence of result tuples - once you've consumed as much of the sequence as you need to, you'll need to .close the sequence. A common way to do this is using with-open:

(with-open [res (crux/open-q db '{:find [...] :where [...]})] (doseq [row res] ...))

Once the sequence is closed, attempting to iterate it is undefined.

lazily q[uery] a Crux db.
query param is a datalog query in map, vector or string form.

This function returns a Closeable sequence of result tuples - once you've consumed
as much of the sequence as you need to, you'll need to `.close` the sequence.
A common way to do this is using `with-open`:

(with-open [res (crux/open-q db '{:find [...]
                                  :where [...]})]
  (doseq [row res]
    ...))

Once the sequence is closed, attempting to iterate it is undefined.

entity-txclj

(entity-tx db eid)

returns the transaction details for an entity. Details include tx-id and tx-time. eid is an object that can be coerced into an entity id.

returns the transaction details for an entity. Details
include tx-id and tx-time.
eid is an object that can be coerced into an entity id.

valid-timeclj

(valid-time db)

returns the valid time of the db. If valid time wasn't specified at the moment of the db value retrieval then valid time will be time of the latest transaction.

returns the valid time of the db.
If valid time wasn't specified at the moment of the db value retrieval
then valid time will be time of the latest transaction.

new-snapshotclj

(new-snapshot db)

Returns a new implementation-specific snapshot allowing for multiple entity calls to share the same KV store snapshot. returns an implementation specific snapshot

Returns a new implementation-specific snapshot allowing for multiple
entity calls to share the same KV store snapshot.
returns an implementation specific snapshot
sourceraw docstring

PCruxIngestClientcljprotocol

Provides API access to Crux ingestion.

Provides API access to Crux ingestion.

open-tx-logclj

(open-tx-log this after-tx-id with-ops?)

Reads the transaction log. Optionally includes operations, which allow the contents under the :crux.api/tx-ops key to be piped into (submit-tx tx-ops) of another Crux instance.

after-tx-id optional transaction id to start after. with-ops? should the operations with documents be included?

Returns an iterator of the TxLog

Reads the transaction log. Optionally includes
operations, which allow the contents under the :crux.api/tx-ops
key to be piped into (submit-tx tx-ops) of another
Crux instance.

after-tx-id      optional transaction id to start after.
with-ops?       should the operations with documents be included?

Returns an iterator of the TxLog

submit-txclj

(submit-tx node tx-ops)

Writes transactions to the log for processing tx-ops datalog style transactions. Returns a map with details about the submitted transaction, including tx-time and tx-id.

Writes transactions to the log for processing
tx-ops datalog style transactions.
Returns a map with details about the submitted transaction,
including tx-time and tx-id.
sourceraw docstring

PCruxNodecljprotocol

Provides API access to Crux.

Provides API access to Crux.

await-tx-timeclj

(await-tx-time node tx-time)
(await-tx-time node tx-time timeout)

Blocks until the node has indexed a transaction that is past the supplied txTime. Will throw on timeout. The returned date is the latest index time when this node has caught up as of this call.

Blocks until the node has indexed a transaction that is past the supplied
txTime. Will throw on timeout. The returned date is the latest index time when
this node has caught up as of this call.

await-txclj

(await-tx node tx)
(await-tx node tx timeout)

Blocks until the node has indexed a transaction that is at or past the supplied tx. Will throw on timeout. Returns the most recent tx indexed by the node.

Blocks until the node has indexed a transaction that is at or past the
supplied tx. Will throw on timeout. Returns the most recent tx indexed by the
node.

tx-committed?clj

(tx-committed? node submitted-tx)

Checks if a submitted tx was successfully committed. submitted-tx must be a map returned from submit-tx. Returns true if the submitted transaction was committed, false if the transaction was not committed, and throws NodeOutOfSyncException if the node has not yet indexed the transaction.

Checks if a submitted tx was successfully committed.
submitted-tx must be a map returned from `submit-tx`.
Returns true if the submitted transaction was committed,
false if the transaction was not committed, and throws `NodeOutOfSyncException`
if the node has not yet indexed the transaction.

history-rangeclj

(history-range node
               eid
               valid-time-start
               transaction-time-start
               valid-time-end
               transaction-time-end)

Returns the transaction history of an entity, ordered by valid time / transaction time in chronological order, earliest first. Includes corrections, but does not include the actual documents.

Giving nil as any of the date arguments makes the range open ended for that value.

Returns the transaction history of an entity, ordered by valid
time / transaction time in chronological order, earliest
first. Includes corrections, but does not include the actual
documents.

Giving nil as any of the date arguments makes the range open
ended for that value.

dbclj

(db node)
(db node valid-time)
(db node valid-time transaction-time)

Will return the latest value of the db currently known. Non-blocking.

When a valid time is specified then returned db value contains only those documents whose valid time is before the specified time. Non-blocking.

When both valid and transaction time are specified returns a db value as of the valid time and the latest transaction time indexed at or before the specified transaction time. Non-blocking. The index may not yet contain a transaction with the specified transaction time.

Will return the latest value of the db currently known. Non-blocking.

When a valid time is specified then returned db value contains only those
documents whose valid time is before the specified time. Non-blocking.

When both valid and transaction time are specified returns a db value
as of the valid time and the latest transaction time indexed at or before
the specified transaction time. Non-blocking. The index may not yet
contain a transaction with the specified transaction time.

latest-completed-txclj

(latest-completed-tx node)

Returns the latest transaction to have been indexed by this node.

Returns the latest transaction to have been indexed by this node.

attribute-statsclj

(attribute-stats node)

Returns frequencies map for indexed attributes

Returns frequencies map for indexed attributes

historyclj

(history node eid)

Returns the transaction history of an entity, in reverse chronological order. Includes corrections, but does not include the actual documents.

Returns the transaction history of an entity, in reverse
chronological order. Includes corrections, but does not include
the actual documents.

syncclj

(sync node)
(sync node timeout)
(sync node transaction-time timeout)

Blocks until the node has caught up indexing to the latest tx available at the time this method is called. Will throw an exception on timeout. The returned date is the latest transaction time indexed by this node. This can be used as the second parameter in (db valid-time, transaction-time) for consistent reads.

timeout – max time to wait, can be nil for the default. Returns the latest known transaction time.

Blocks until the node has caught up indexing to the latest tx available at
the time this method is called. Will throw an exception on timeout. The
returned date is the latest transaction time indexed by this node. This can be
used as the second parameter in (db valid-time, transaction-time) for
consistent reads.

timeout – max time to wait, can be nil for the default.
Returns the latest known transaction time.

documentsclj

(documents node content-hashes-set)

Reads the set of documents from the document store based on their respective content hashes. Returns a map content-hash->document

Reads the set of documents from the document store based on their
respective content hashes. Returns a map content-hash->document

documentclj

(document node content-hash)

Reads a document from the document store based on its content hash.

Reads a document from the document store based on its
content hash.

statusclj

(status node)

Returns the status of this node as a map.

Returns the status of this node as a map.

latest-submitted-txclj

(latest-submitted-tx node)

Returns the latest transaction to have been submitted to this cluster

Returns the latest transaction to have been submitted to this cluster
sourceraw docstring

start-nodeclj

(start-node options)

NOTE: requires any dependendies on the classpath that the Crux modules may need.

options {:crux.node/topology 'crux.standalone/topology}

Options are specified as keywords using their long format name, like :crux.kafka/bootstrap-servers etc. See the individual modules used in the specified topology for option descriptions.

returns a node which implements ICruxAPI and java.io.Closeable. Latter allows the node to be stopped by calling (.close node).

throws IndexVersionOutOfSyncException if the index needs rebuilding. throws NonMonotonicTimeException if the clock has moved backwards since last run. Only applicable when using the event log.

NOTE: requires any dependendies on the classpath that the Crux modules may need.

options {:crux.node/topology 'crux.standalone/topology}

Options are specified as keywords using their long format name, like
:crux.kafka/bootstrap-servers etc. See the individual modules used in the specified
topology for option descriptions.

returns a node which implements ICruxAPI and
java.io.Closeable. Latter allows the node to be stopped by
calling `(.close node)`.

throws IndexVersionOutOfSyncException if the index needs rebuilding.
throws NonMonotonicTimeException if the clock has moved backwards since
  last run. Only applicable when using the event log.
sourceraw docstring

tx-opcljmultimethod

source

warn-on-deprecated-syncclj

source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close