Class FDBTransactionContext
- java.lang.Object
-
- com.apple.foundationdb.record.provider.foundationdb.FDBTransactionContext
-
- Direct Known Subclasses:
FDBRecordContext
@API(STABLE) public class FDBTransactionContext extends Object
Wrapper class for an open FDBTransaction
.- See Also:
FDBRecordContext
-
-
Field Summary
Fields Modifier and Type Field Description protected FDBDatabase
database
protected FDBStoreTimer
timer
protected Transaction
transaction
-
Constructor Summary
Constructors Modifier Constructor Description protected
FDBTransactionContext(FDBDatabase database, Transaction transaction, FDBStoreTimer timer)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Transaction
ensureActive()
FDBDatabase
getDatabase()
Executor
getExecutor()
FDBStoreTimer
getTimer()
void
increment(StoreTimer.Count count)
Record that an event occurred one time.void
increment(StoreTimer.Count count, int amount)
Record that an event occurred one or more times.<T> RecordCursor<T>
instrument(StoreTimer.Event event, RecordCursor<T> inner)
<T> CompletableFuture<T>
instrument(StoreTimer.Event event, CompletableFuture<T> future)
<T> CompletableFuture<T>
instrument(StoreTimer.Event event, CompletableFuture<T> future, long startTime)
<T> CompletableFuture<T>
instrument(Set<StoreTimer.Event> event, CompletableFuture<T> future)
void
record(StoreTimer.Count count)
Deprecated.useincrement(StoreTimer.Count)
insteadvoid
record(StoreTimer.Event event, long timeDelta)
Record the amount of time an event took to run.void
setTimer(FDBStoreTimer timer)
-
-
-
Field Detail
-
database
@Nonnull protected final FDBDatabase database
-
transaction
@Nullable protected Transaction transaction
-
timer
@Nullable protected FDBStoreTimer timer
-
-
Constructor Detail
-
FDBTransactionContext
protected FDBTransactionContext(@Nonnull FDBDatabase database, @Nonnull Transaction transaction, @Nullable FDBStoreTimer timer)
-
-
Method Detail
-
getDatabase
@Nonnull public FDBDatabase getDatabase()
-
ensureActive
@Nonnull public Transaction ensureActive()
-
getTimer
@Nullable public FDBStoreTimer getTimer()
-
setTimer
public void setTimer(@Nullable FDBStoreTimer timer)
-
instrument
public <T> CompletableFuture<T> instrument(StoreTimer.Event event, CompletableFuture<T> future)
-
instrument
public <T> CompletableFuture<T> instrument(Set<StoreTimer.Event> event, CompletableFuture<T> future)
-
instrument
public <T> CompletableFuture<T> instrument(StoreTimer.Event event, CompletableFuture<T> future, long startTime)
-
instrument
public <T> RecordCursor<T> instrument(StoreTimer.Event event, RecordCursor<T> inner)
-
record
@Deprecated public void record(@Nonnull StoreTimer.Count count)
Deprecated.useincrement(StoreTimer.Count)
insteadDeprecated. Users should useincrement(StoreTimer.Count)
instead.- Parameters:
count
- the count to record an occurrence of
-
record
public void record(@Nonnull StoreTimer.Event event, long timeDelta)
Record the amount of time an event took to run.- Parameters:
event
- the event being recordedtimeDelta
- the time the event took to complete- See Also:
StoreTimer.record()
-
increment
public void increment(@Nonnull StoreTimer.Count count)
Record that an event occurred one time.- Parameters:
count
- the event being recorded- See Also:
StoreTimer.increment()
-
increment
public void increment(@Nonnull StoreTimer.Count count, int amount)
Record that an event occurred one or more times.- Parameters:
count
- the event being recordedamount
- the amount to increment the event- See Also:
StoreTimer.increment()
-
-