public interface ICruxAPI extends ICruxIngestAPI, java.io.Closeable
Modifier and Type | Field and Description |
---|---|
static java.util.Map<clojure.lang.Keyword,?> |
TX_INDEXED_EVENT_OPTS
Temporary helper value to pass to `listen`, to subscribe to tx-indexed events.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<IQueryState> |
activeQueries()
Returns a list of currently running queries.
|
java.util.Map<clojure.lang.Keyword,java.lang.Long> |
attributeStats()
Return frequencies of indexed attributes.
|
java.util.Map<clojure.lang.Keyword,?> |
awaitTx(java.util.Map<clojure.lang.Keyword,?> tx,
java.time.Duration timeout)
Deprecated.
in favour of
awaitTx(TransactionInstant, Duration) |
TransactionInstant |
awaitTx(TransactionInstant tx,
java.time.Duration timeout)
Blocks until the node has indexed a transaction that is at or past the
supplied tx.
|
java.util.Date |
awaitTxTime(java.util.Date txTime,
java.time.Duration timeout)
Blocks until the node has indexed a transaction that is past the supplied
txTime.
|
ICruxDatasource |
db()
Returns a db as of now.
|
ICruxDatasource |
db(java.util.Date validTime)
Returns a db as of the provided valid time.
|
ICruxDatasource |
db(java.util.Date validTime,
java.util.Date transactionTime)
Returns a db as of valid time and transaction time.
|
ICruxDatasource |
db(DBBasis dbBasis)
Returns a db as of the given basis.
|
ICruxDatasource |
db(java.util.Map<clojure.lang.Keyword,?> dbBasis)
Deprecated.
in favour of
db(DBBasis) |
ICruxDatasource |
db(TransactionInstant txInstant)
Returns a db as of the TransactionInstant, with valid-time set to the invocation time of this method.
|
boolean |
hasTxCommitted(java.util.Map<clojure.lang.Keyword,?> submittedTx)
Deprecated.
in favour of
hasTxCommitted(TransactionInstant) |
boolean |
hasTxCommitted(TransactionInstant submittedTx)
Checks if a submitted tx was successfully committed.
|
TransactionInstant |
latestCompletedTx() |
TransactionInstant |
latestSubmittedTx() |
java.lang.AutoCloseable |
listen(java.util.Map<clojure.lang.Keyword,?> eventOpts,
java.util.function.Consumer<java.util.Map<clojure.lang.Keyword,?>> listener)
Attaches a listener to Crux's event bus.
|
ICruxDatasource |
openDB()
Returns a db as of now.
|
ICruxDatasource |
openDB(java.util.Date validTime)
Returns a db as of the provided valid time.
|
ICruxDatasource |
openDB(java.util.Date validTime,
java.util.Date transactionTime)
Returns a db as of valid time and transaction time.
|
ICruxDatasource |
openDB(DBBasis dbBasis)
Returns a db as of the given basis.
|
ICruxDatasource |
openDB(java.util.Map<clojure.lang.Keyword,?> dbBasis)
Deprecated.
in favour of
openDB(DBBasis) or openDB(TransactionInstant) |
ICruxDatasource |
openDB(TransactionInstant txInstant)
Returns a db as of the TransactionInstant, with valid-time set to the invocation time of this method.
|
java.util.List<IQueryState> |
recentQueries()
Returns a list of recently completed/failed queries
|
java.util.List<IQueryState> |
slowestQueries()
Returns a list of slowest completed/failed queries ran on the node
|
java.util.Map<clojure.lang.Keyword,?> |
status()
Returns the status of this node as a map.
|
java.util.Date |
sync(java.time.Duration timeout)
Blocks until the node has caught up indexing to the latest tx available
at the time this method is called.
|
openTxLog, submitTx, submitTx
static final java.util.Map<clojure.lang.Keyword,?> TX_INDEXED_EVENT_OPTS
ICruxDatasource db()
ICruxDatasource openDB()
ICruxDatasource db(java.util.Date validTime)
ICruxDatasource openDB(java.util.Date validTime)
ICruxDatasource db(java.util.Date validTime, java.util.Date transactionTime) throws NodeOutOfSyncException
NodeOutOfSyncException
- if the node hasn't indexed up to the given `transactionTime`ICruxDatasource openDB(java.util.Date validTime, java.util.Date transactionTime) throws NodeOutOfSyncException
NodeOutOfSyncException
- if the node hasn't indexed up to the given `transactionTime`ICruxDatasource db(DBBasis dbBasis) throws NodeOutOfSyncException
NodeOutOfSyncException
- if the node hasn't indexed up to the given transaction@Deprecated ICruxDatasource db(java.util.Map<clojure.lang.Keyword,?> dbBasis) throws NodeOutOfSyncException
db(DBBasis)
NodeOutOfSyncException
- if the node hasn't indexed up to the given transactionICruxDatasource db(TransactionInstant txInstant) throws NodeOutOfSyncException
NodeOutOfSyncException
- if the node hasn't indexed up to the given transactionICruxDatasource openDB(DBBasis dbBasis) throws NodeOutOfSyncException
NodeOutOfSyncException
- if the node hasn't indexed up to the given transaction@Deprecated ICruxDatasource openDB(java.util.Map<clojure.lang.Keyword,?> dbBasis) throws NodeOutOfSyncException
openDB(DBBasis)
or openDB(TransactionInstant)
NodeOutOfSyncException
- if the node hasn't indexed up to the given transactionICruxDatasource openDB(TransactionInstant txInstant) throws NodeOutOfSyncException
NodeOutOfSyncException
- if the node hasn't indexed up to the given transactionjava.util.Map<clojure.lang.Keyword,?> status()
boolean hasTxCommitted(TransactionInstant submittedTx) throws NodeOutOfSyncException
submittedTx
- must be a transaction instant returned from ICruxIngestAPI.submitTx(Transaction txOps)
.NodeOutOfSyncException
- if the node has not yet indexed the transaction.@Deprecated boolean hasTxCommitted(java.util.Map<clojure.lang.Keyword,?> submittedTx) throws NodeOutOfSyncException
hasTxCommitted(TransactionInstant)
submittedTx
- must be a transaction instant returned from ICruxIngestAPI.submitTx(List)
)}.NodeOutOfSyncException
- if the node has not yet indexed the transaction.java.util.Date sync(java.time.Duration timeout)
db(Date validTime, Date transactionTime)
for consistent reads.timeout
- max time to wait, can be null for the default.java.util.Date awaitTxTime(java.util.Date txTime, java.time.Duration timeout)
txTime
- transaction time to await.timeout
- max time to wait, can be null for the default.TransactionInstant awaitTx(TransactionInstant tx, java.time.Duration timeout)
tx
- Transaction to await, as returned from submitTx.timeout
- max time to wait, can be null for the default.@Deprecated java.util.Map<clojure.lang.Keyword,?> awaitTx(java.util.Map<clojure.lang.Keyword,?> tx, java.time.Duration timeout)
awaitTx(TransactionInstant, Duration)
tx
- Transaction to await, as returned from submitTx.timeout
- max time to wait, can be null for the default.java.lang.AutoCloseable listen(java.util.Map<clojure.lang.Keyword,?> eventOpts, java.util.function.Consumer<java.util.Map<clojure.lang.Keyword,?>> listener)
TX_INDEXED_EVENT_OPTS
This is an experimental API, subject to change.eventOpts
- should contain `:crux/event-type`, along with any other options the event-type requires.TransactionInstant latestCompletedTx()
TransactionInstant latestSubmittedTx()
java.util.Map<clojure.lang.Keyword,java.lang.Long> attributeStats()
java.util.List<IQueryState> activeQueries()
java.util.List<IQueryState> recentQueries()
java.util.List<IQueryState> slowestQueries()