Search in sources :

Example 1 with AtlasDbConstraintCheckingMode

use of com.palantir.atlasdb.transaction.api.AtlasDbConstraintCheckingMode in project atlasdb by palantir.

the class SweepTestUtils method setupTxManager.

public static SerializableTransactionManager setupTxManager(KeyValueService kvs, TimestampService tsService, SweepStrategyManager ssm, TransactionService txService) {
    LockClient lockClient = LockClient.of("sweep client");
    LockService lockService = LockServiceImpl.create(LockServerOptions.builder().isStandaloneServer(false).build());
    Supplier<AtlasDbConstraintCheckingMode> constraints = () -> AtlasDbConstraintCheckingMode.NO_CONSTRAINT_CHECKING;
    ConflictDetectionManager cdm = ConflictDetectionManagers.createWithoutWarmingCache(kvs);
    Cleaner cleaner = new NoOpCleaner();
    SerializableTransactionManager txManager = SerializableTransactionManager.createForTest(kvs, tsService, lockClient, lockService, txService, constraints, cdm, ssm, cleaner, AbstractTransactionTest.GET_RANGES_THREAD_POOL_SIZE, AbstractTransactionTest.DEFAULT_GET_RANGES_CONCURRENCY, () -> AtlasDbConstants.DEFAULT_TIMESTAMP_CACHE_SIZE, InMemorySweepQueue.writer());
    setupTables(kvs);
    return txManager;
}
Also used : AtlasDbConstraintCheckingMode(com.palantir.atlasdb.transaction.api.AtlasDbConstraintCheckingMode) KvsBackedPersistentLockService(com.palantir.atlasdb.persistentlock.KvsBackedPersistentLockService) NoOpPersistentLockService(com.palantir.atlasdb.persistentlock.NoOpPersistentLockService) PersistentLockService(com.palantir.atlasdb.persistentlock.PersistentLockService) LockService(com.palantir.lock.LockService) LockClient(com.palantir.lock.LockClient) NoOpCleaner(com.palantir.atlasdb.cleaner.NoOpCleaner) SerializableTransactionManager(com.palantir.atlasdb.transaction.impl.SerializableTransactionManager) ConflictDetectionManager(com.palantir.atlasdb.transaction.impl.ConflictDetectionManager) Cleaner(com.palantir.atlasdb.cleaner.Cleaner) NoOpCleaner(com.palantir.atlasdb.cleaner.NoOpCleaner)

Example 2 with AtlasDbConstraintCheckingMode

use of com.palantir.atlasdb.transaction.api.AtlasDbConstraintCheckingMode in project atlasdb by palantir.

the class TableTasksTest method setup.

@Before
public void setup() {
    kvs = new InMemoryKeyValueService(true);
    TimestampService tsService = new InMemoryTimestampService();
    LockClient lockClient = LockClient.of("sweep client");
    lockService = LockServiceImpl.create(LockServerOptions.builder().isStandaloneServer(false).build());
    TransactionService txService = TransactionServices.createTransactionService(kvs);
    Supplier<AtlasDbConstraintCheckingMode> constraints = Suppliers.ofInstance(AtlasDbConstraintCheckingMode.NO_CONSTRAINT_CHECKING);
    ConflictDetectionManager cdm = ConflictDetectionManagers.createWithoutWarmingCache(kvs);
    SweepStrategyManager ssm = SweepStrategyManagers.createDefault(kvs);
    Cleaner cleaner = new NoOpCleaner();
    SerializableTransactionManager transactionManager = SerializableTransactionManager.createForTest(kvs, tsService, lockClient, lockService, txService, constraints, cdm, ssm, cleaner, AbstractTransactionTest.GET_RANGES_THREAD_POOL_SIZE, AbstractTransactionTest.DEFAULT_GET_RANGES_CONCURRENCY, () -> AtlasDbConstants.DEFAULT_TIMESTAMP_CACHE_SIZE, MultiTableSweepQueueWriter.NO_OP);
    txManager = transactionManager;
}
Also used : SweepStrategyManager(com.palantir.atlasdb.transaction.impl.SweepStrategyManager) AtlasDbConstraintCheckingMode(com.palantir.atlasdb.transaction.api.AtlasDbConstraintCheckingMode) TransactionService(com.palantir.atlasdb.transaction.service.TransactionService) LockClient(com.palantir.lock.LockClient) NoOpCleaner(com.palantir.atlasdb.cleaner.NoOpCleaner) SerializableTransactionManager(com.palantir.atlasdb.transaction.impl.SerializableTransactionManager) ConflictDetectionManager(com.palantir.atlasdb.transaction.impl.ConflictDetectionManager) InMemoryTimestampService(com.palantir.timestamp.InMemoryTimestampService) InMemoryTimestampService(com.palantir.timestamp.InMemoryTimestampService) TimestampService(com.palantir.timestamp.TimestampService) Cleaner(com.palantir.atlasdb.cleaner.Cleaner) NoOpCleaner(com.palantir.atlasdb.cleaner.NoOpCleaner) Before(org.junit.Before)

Aggregations

Cleaner (com.palantir.atlasdb.cleaner.Cleaner)2 NoOpCleaner (com.palantir.atlasdb.cleaner.NoOpCleaner)2 AtlasDbConstraintCheckingMode (com.palantir.atlasdb.transaction.api.AtlasDbConstraintCheckingMode)2 ConflictDetectionManager (com.palantir.atlasdb.transaction.impl.ConflictDetectionManager)2 SerializableTransactionManager (com.palantir.atlasdb.transaction.impl.SerializableTransactionManager)2 LockClient (com.palantir.lock.LockClient)2 KvsBackedPersistentLockService (com.palantir.atlasdb.persistentlock.KvsBackedPersistentLockService)1 NoOpPersistentLockService (com.palantir.atlasdb.persistentlock.NoOpPersistentLockService)1 PersistentLockService (com.palantir.atlasdb.persistentlock.PersistentLockService)1 SweepStrategyManager (com.palantir.atlasdb.transaction.impl.SweepStrategyManager)1 TransactionService (com.palantir.atlasdb.transaction.service.TransactionService)1 LockService (com.palantir.lock.LockService)1 InMemoryTimestampService (com.palantir.timestamp.InMemoryTimestampService)1 TimestampService (com.palantir.timestamp.TimestampService)1 Before (org.junit.Before)1