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;
}
Aggregations