Search in sources :

Example 11 with StoreTimer

use of com.apple.foundationdb.record.provider.common.StoreTimer in project fdb-record-layer by FoundationDB.

the class FDBDatabase method createTransaction.

/**
 * Creates a new transaction against the database.
 *
 * @param executor the executor to be used for asynchronous operations
 * @return newly created transaction
 */
private Transaction createTransaction(@Nonnull FDBRecordContextConfig config, @Nonnull Executor executor) {
    final TransactionListener listener = config.getTransactionListener() == null ? factory.getTransactionListener() : config.getTransactionListener();
    final StoreTimer timer = listener != null ? new StoreSubTimer(config.getTimer()) : config.getTimer();
    boolean enableAssertions = config.areAssertionsEnabled();
    // noinspection ConstantConditions
    Transaction transaction = database.createTransaction(executor, new EventKeeperTranslator(timer));
    if (timer != null || enableAssertions) {
        transaction = new InstrumentedTransaction(timer, this, listener, transaction, enableAssertions);
    }
    return transaction;
}
Also used : StoreTimer(com.apple.foundationdb.record.provider.common.StoreTimer) Transaction(com.apple.foundationdb.Transaction) StoreSubTimer(com.apple.foundationdb.record.provider.common.StoreSubTimer)

Aggregations

StoreTimer (com.apple.foundationdb.record.provider.common.StoreTimer)11 Test (org.junit.jupiter.api.Test)10 StoreTimerSnapshot (com.apple.foundationdb.record.provider.common.StoreTimerSnapshot)5 FDBStoreTimer (com.apple.foundationdb.record.provider.foundationdb.FDBStoreTimer)5 RecordQueryPlan (com.apple.foundationdb.record.query.plan.plans.RecordQueryPlan)5 KeyValue (com.apple.foundationdb.KeyValue)2 Transaction (com.apple.foundationdb.Transaction)1 RecordCursorResult (com.apple.foundationdb.record.RecordCursorResult)1 StoreSubTimer (com.apple.foundationdb.record.provider.common.StoreSubTimer)1 IndexScanComparisons (com.apple.foundationdb.record.provider.foundationdb.IndexScanComparisons)1 IndexScanParameters (com.apple.foundationdb.record.provider.foundationdb.IndexScanParameters)1 Comparisons (com.apple.foundationdb.record.query.expressions.Comparisons)1 RecordQueryInValuesJoinPlan (com.apple.foundationdb.record.query.plan.plans.RecordQueryInValuesJoinPlan)1 RecordQueryIndexPlan (com.apple.foundationdb.record.query.plan.plans.RecordQueryIndexPlan)1 RecordQueryScanPlan (com.apple.foundationdb.record.query.plan.plans.RecordQueryScanPlan)1