use of com.palantir.atlasdb.keyvalue.impl.InMemoryKeyValueService in project atlasdb by palantir.
the class InMemoryAtlasDbFactory method createInMemoryTransactionManagerInternal.
private static SerializableTransactionManager createInMemoryTransactionManagerInternal(Set<Schema> schemas) {
TimestampService ts = new InMemoryTimestampService();
KeyValueService keyValueService = new InMemoryKeyValueService(false);
schemas.forEach(s -> Schemas.createTablesAndIndexes(s, keyValueService));
TransactionTables.createTables(keyValueService);
TransactionService transactionService = TransactionServices.createTransactionService(keyValueService);
LockService lock = LockRefreshingLockService.create(LockServiceImpl.create(LockServerOptions.builder().isStandaloneServer(false).build()));
LockClient client = LockClient.of("in memory atlasdb instance");
ConflictDetectionManager conflictManager = ConflictDetectionManagers.createWithoutWarmingCache(keyValueService);
SweepStrategyManager sweepStrategyManager = SweepStrategyManagers.createDefault(keyValueService);
CleanupFollower follower = CleanupFollower.create(schemas);
Cleaner cleaner = new DefaultCleanerBuilder(keyValueService, lock, ts, client, ImmutableList.of(follower), transactionService).buildCleaner();
SerializableTransactionManager ret = SerializableTransactionManager.createForTest(keyValueService, ts, client, lock, transactionService, Suppliers.ofInstance(AtlasDbConstraintCheckingMode.FULL_CONSTRAINT_CHECKING_THROWS_EXCEPTIONS), conflictManager, sweepStrategyManager, cleaner, DEFAULT_MAX_CONCURRENT_RANGES, DEFAULT_GET_RANGES_CONCURRENCY, () -> DEFAULT_TIMESTAMP_CACHE_SIZE, MultiTableSweepQueueWriter.NO_OP);
cleaner.start(ret);
return ret;
}
use of com.palantir.atlasdb.keyvalue.impl.InMemoryKeyValueService in project atlasdb by palantir.
the class KeyValueServiceScrubberStoreTest method before.
@Before
public void before() {
kvs = new InMemoryKeyValueService(false, MoreExecutors.newDirectExecutorService());
scrubStore = KeyValueServiceScrubberStore.create(kvs);
}
use of com.palantir.atlasdb.keyvalue.impl.InMemoryKeyValueService in project atlasdb by palantir.
the class KvsBackedPersistentLockServiceTest method canCreatePersistentLockService.
@Test
public void canCreatePersistentLockService() {
KeyValueService kvs = new InMemoryKeyValueService(false);
PersistentLockService pls = KvsBackedPersistentLockService.create(kvs);
assertNotNull(pls);
}
use of com.palantir.atlasdb.keyvalue.impl.InMemoryKeyValueService in project atlasdb by palantir.
the class KvsBackedPersistentLockServiceTest method setUp.
@Before
public void setUp() {
KeyValueService kvs = new InMemoryKeyValueService(false);
lockStore = spy(LockStoreImpl.createImplForTest(kvs));
service = new KvsBackedPersistentLockService(lockStore);
}
use of com.palantir.atlasdb.keyvalue.impl.InMemoryKeyValueService in project atlasdb by palantir.
the class LockEntryTest method fromRowResultProducesLockEntry.
@Test
public void fromRowResultProducesLockEntry() {
KeyValueService kvs = new InMemoryKeyValueService(false);
kvs.createTable(TEST_TABLE, AtlasDbConstants.GENERIC_TABLE_METADATA);
kvs.checkAndSet(CheckAndSetRequest.newCell(TEST_TABLE, LOCK_ENTRY.cell(), LOCK_ENTRY.value()));
Iterator<RowResult<Value>> range = kvs.getRange(TEST_TABLE, RangeRequest.all(), AtlasDbConstants.TRANSACTION_TS + 1);
RowResult<Value> onlyEntry = Iterables.getOnlyElement(ImmutableSet.copyOf(range));
LockEntry lockEntry = LockEntry.fromRowResult(onlyEntry);
assertEquals(LOCK_ENTRY, lockEntry);
}
Aggregations