Package com.twicedb.client.impl
Class ClientImpl
java.lang.Object
com.twicedb.client.impl.ClientImpl
- All Implemented Interfaces:
Client
An implementation of the TwiceDB client API. Such an implementation is necessary in order to
query TwiceDB. After instantiating the class, one must also call the start() method to start
background processes.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuildAggregationResponse
(ReadResponse.ReadCommandResponse r, boolean requireInteger) catchUpLsqt
(Tt catchUpTo, Duration maxWaitDuration) boolean
boolean
commitTxnAsync
(Txn txn) <I extends Indexable<I>>
AggregationResponsecountByIndexedQuery
(IndexedQuery<I> iq, TemporalCoordinates tc) <I extends Indexable<I>>
Future<AggregationResponse>deleteAsync
(ObjectId objectId, Tt lastRead, Vt vtFrom) <I extends Indexable<I>>
WrittenObjectdeleteObject
(I object, Vt vtFrom) <I extends Indexable<I>>
Future<WriteAsyncResponse>deleteObjectAsync
(I object, Vt vtFrom) entitle
(EmailAddress emailAddress, Fqn fqn, ReadEntitlement read, WriteEntitlement write, EntitleEntitlement entitle, Vt vt, BackfillTt backfillTt) Sets new entitlements.getLsqt()
long
getServerStatus
(ServerType serverType) Returns a ServerStatus object that contains basic information about the reader or the writer to which the client is connected.long
<I extends Indexable<I>>
AggregationResponsemaxByIndexedQuery
(IndexedQuery<I> iq, ProjectedFieldKey fieldKey, TemporalCoordinates tc) <I extends Indexable<I>>
Future<AggregationResponse>maxByIndexedQueryAsync
(IndexedQuery<I> iq, ProjectedFieldKey fieldKey, TemporalCoordinates tc) <I extends Indexable<I>>
AggregationResponsemeanByIndexedQuery
(IndexedQuery<I> iq, ProjectedFieldKey fieldKey, TemporalCoordinates tc) <I extends Indexable<I>>
Future<AggregationResponse>meanByIndexedQueryAsync
(IndexedQuery<I> iq, ProjectedFieldKey fieldKey, TemporalCoordinates tc) <I extends Indexable<I>>
AggregationResponsemedianByIndexedQuery
(IndexedQuery<I> iq, ProjectedFieldKey fieldKey, TemporalCoordinates tc) <I extends Indexable<I>>
Future<AggregationResponse>medianByIndexedQueryAsync
(IndexedQuery<I> iq, ProjectedFieldKey fieldKey, TemporalCoordinates tc) <I extends Indexable<I>>
AggregationResponseminByIndexedQuery
(IndexedQuery<I> iq, ProjectedFieldKey fieldKey, TemporalCoordinates tc) <I extends Indexable<I>>
Future<AggregationResponse>minByIndexedQueryAsync
(IndexedQuery<I> iq, ProjectedFieldKey fieldKey, TemporalCoordinates tc) <I extends Indexable<I>>
AggregationResponsepercentileByIndexedQuery
(IndexedQuery<I> iq, ProjectedFieldKey fieldKey, Percentile p, TemporalCoordinates tc) <I extends Indexable<I>>
Future<AggregationResponse>percentileByIndexedQueryAsync
(IndexedQuery<I> iq, ProjectedFieldKey fieldKey, Percentile p, TemporalCoordinates tc) <I extends Indexable<I>>
WrittenObject<I extends Indexable<I>>
Future<WriteAsyncResponse>putObjectAsync
(I object, Vt vtFrom) <E extends Event<E>>
EreadEventAsync
(EventId eventId, Fqn fqn, Tt tt) readEventForObject
(Indexable<I> ixbl) readEventForObjectAsync
(Indexable<I> ixbl) readLsqt()
<I extends Indexable<I>>
ReadObjectreadObject
(I ixbl, TemporalCoordinates tc) <I extends Indexable<I>>
Future<ReadObject>readObjectAsync
(I ixbl, TemporalCoordinates tc) readObjects
(I object, TemporalCoordinates tc) <I extends Indexable<I>>
Future<ReadAsyncResponse>readObjectsAsync
(I object, TemporalCoordinates tc) readObjectsAtTt
(I ixbl, Tt tt) <I extends Indexable<I>>
Future<ReadAsyncResponse>readObjectsAtTtAsync
(I ixbl, Tt tt) readObjectsAtVt
(I ixbl, TemporalCoordinates tc) <I extends Indexable<I>>
Future<ReadAsyncResponse>readObjectsAtVtAsync
(I ixbl, TemporalCoordinates tc) readObjectsByEvent
(E e) readObjectsByFqn
(Fqn fqn, Tt maxSeenTtFrom, TimesliceId maxSeenTimesliceId, Tt maxTtFrom, BatchSize batchSize) <I extends Indexable<I>>
Future<ReadAsyncResponse>readPoint
(ObjectId objectId, TemporalCoordinates tc) readPointAsync
(ObjectId objectId, TemporalCoordinates tc) <I extends Indexable<I>>
WrittenObjectreindexObject
(I ixbl) <I extends Indexable<I>>
Future<WriteAsyncResponse>reindexObjectAsync
(I ixbl) reinstateAsync
(ObjectId objectId, Tt lastRead, Vt vtFrom) <I extends Indexable<I>>
WrittenObjectreinstateObject
(I object, Vt vtFrom) <I extends Indexable<I>>
Future<WriteAsyncResponse>reinstateObjectAsync
(I object, Vt vtFrom) void
start()
<I extends Indexable<I>>
AggregationResponsestdevByIndexedQuery
(IndexedQuery<I> iq, ProjectedFieldKey fieldKey, TemporalCoordinates tc) <I extends Indexable<I>>
Future<AggregationResponse>stdevByIndexedQueryAsync
(IndexedQuery<I> iq, ProjectedFieldKey fieldKey, TemporalCoordinates tc) void
stop()
<I extends Indexable<I>>
voidsubscribeToIndexedQuery
(IndexedQuery<I> iq, Function<SubscribeResponse, Boolean> cback) void
subscribeToObjectId
(ObjectId oid, Function<SubscribeResponse, Boolean> cback) <I extends Indexable<I>>
AggregationResponsesumByIndexedQuery
(IndexedQuery<I> iq, ProjectedFieldKey fieldKey, TemporalCoordinates tc) <I extends Indexable<I>>
Future<AggregationResponse>sumByIndexedQueryAsync
(IndexedQuery<I> iq, ProjectedFieldKey fieldKey, TemporalCoordinates tc) <I extends Indexable<I>>
AggregationResponsevarByIndexedQuery
(IndexedQuery<I> iq, ProjectedFieldKey fieldKey, TemporalCoordinates tc) <I extends Indexable<I>>
Future<AggregationResponse>varByIndexedQueryAsync
(IndexedQuery<I> iq, ProjectedFieldKey fieldKey, TemporalCoordinates tc)
-
Constructor Details
-
ClientImpl
-
-
Method Details
-
getReadQueueCap
public long getReadQueueCap()- Specified by:
getReadQueueCap
in interfaceClient
-
getWriteQueueCap
public long getWriteQueueCap()- Specified by:
getWriteQueueCap
in interfaceClient
-
getLsqt
-
getMetrics
- Specified by:
getMetrics
in interfaceClient
-
readLsqt
-
start
public void start() -
stop
public void stop() -
checkReader
public boolean checkReader()- Specified by:
checkReader
in interfaceClient
-
checkWriter
public boolean checkWriter()- Specified by:
checkWriter
in interfaceClient
-
commitTxn
-
commitTxnAsync
- Specified by:
commitTxnAsync
in interfaceClient
-
readEventForObject
- Specified by:
readEventForObject
in interfaceClient
-
readEventForObjectAsync
public <I extends Indexable<I>,E extends Event<E>> Future<E> readEventForObjectAsync(Indexable<I> ixbl) - Specified by:
readEventForObjectAsync
in interfaceClient
-
readObjectsByEvent
- Specified by:
readObjectsByEvent
in interfaceClient
-
readObjectsByEventAsync
- Specified by:
readObjectsByEventAsync
in interfaceClient
-
readObjectsToIndexables
- Specified by:
readObjectsToIndexables
in interfaceClient
-
buildAggregationResponse
public AggregationResponse buildAggregationResponse(ReadResponse.ReadCommandResponse r, boolean requireInteger) -
listLockedFqns
- Specified by:
listLockedFqns
in interfaceClient
-
reindexObject
- Specified by:
reindexObject
in interfaceClient
-
reindexObjectAsync
- Specified by:
reindexObjectAsync
in interfaceClient
-
subscribeToIndexedQuery
public <I extends Indexable<I>> void subscribeToIndexedQuery(IndexedQuery<I> iq, Function<SubscribeResponse, Boolean> cback) - Specified by:
subscribeToIndexedQuery
in interfaceClient
-