public interface ICruxAPI extends ICruxIngestAPI, Closeable
| Modifier and Type | Field and Description |
|---|---|
static Map<Keyword,?> |
TX_INDEXED_EVENT_OPTS
Temporary helper value to pass to `listen`, to subscribe to tx-indexed events.
|
| Modifier and Type | Method and Description |
|---|---|
List<IQueryState> |
activeQueries()
Returns a list of currently running queries.
|
Map<Keyword,Long> |
attributeStats()
Return frequencies of indexed attributes.
|
Map<Keyword,?> |
awaitTx(Map<Keyword,?> tx,
Duration timeout)
Deprecated.
in favour of
awaitTx(TransactionInstant, Duration) |
TransactionInstant |
awaitTx(TransactionInstant tx,
Duration timeout)
Blocks until the node has indexed a transaction that is at or past the
supplied tx.
|
Date |
awaitTxTime(Date txTime,
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(Date validTime)
Returns a db as of the provided valid time.
|
ICruxDatasource |
db(Date validTime,
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(Map<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(Map<Keyword,?> submittedTx)
Deprecated.
in favour of
hasTxCommitted(TransactionInstant) |
boolean |
hasTxCommitted(TransactionInstant submittedTx)
Checks if a submitted tx was successfully committed.
|
TransactionInstant |
latestCompletedTx() |
TransactionInstant |
latestSubmittedTx() |
AutoCloseable |
listen(Map<Keyword,?> eventOpts,
Consumer<Map<Keyword,?>> listener)
Attaches a listener to Crux's event bus.
|
ICruxDatasource |
openDB()
Returns a db as of now.
|
ICruxDatasource |
openDB(Date validTime)
Returns a db as of the provided valid time.
|
ICruxDatasource |
openDB(Date validTime,
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(Map<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.
|
List<IQueryState> |
recentQueries()
Returns a list of recently completed/failed queries
|
List<IQueryState> |
slowestQueries()
Returns a list of slowest completed/failed queries ran on the node
|
Map<Keyword,?> |
status()
Returns the status of this node as a map.
|
Date |
sync(Duration timeout)
Blocks until the node has caught up indexing to the latest tx available
at the time this method is called.
|
openTxLog, submitTx, submitTxICruxDatasource db()
ICruxDatasource openDB()
ICruxDatasource db(Date validTime)
ICruxDatasource openDB(Date validTime)
ICruxDatasource db(Date validTime, Date transactionTime) throws NodeOutOfSyncException
NodeOutOfSyncException - if the node hasn't indexed up to the given `transactionTime`ICruxDatasource openDB(Date validTime, 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(Map<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(Map<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 transactionboolean 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(Map<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.Date sync(Duration timeout)
db(Date validTime, Date transactionTime)
for consistent reads.timeout - max time to wait, can be null for the default.Date awaitTxTime(Date txTime, Duration timeout)
txTime - transaction time to await.timeout - max time to wait, can be null for the default.TransactionInstant awaitTx(TransactionInstant tx, Duration timeout)
tx - Transaction to await, as returned from submitTx.timeout - max time to wait, can be null for the default.@Deprecated Map<Keyword,?> awaitTx(Map<Keyword,?> tx, Duration timeout)
awaitTx(TransactionInstant, Duration)tx - Transaction to await, as returned from submitTx.timeout - max time to wait, can be null for the default.AutoCloseable listen(Map<Keyword,?> eventOpts, Consumer<Map<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()
Map<Keyword,Long> attributeStats()
List<IQueryState> activeQueries()
List<IQueryState> recentQueries()
List<IQueryState> slowestQueries()