Search in sources :

Example 6 with BatchingVisitable

use of com.palantir.common.base.BatchingVisitable in project atlasdb by palantir.

the class AbstractSerializableTransactionTest method testColumnRangeReadWriteEmptyRange.

@Test
public void testColumnRangeReadWriteEmptyRange() {
    byte[] row = PtBytes.toBytes("row1");
    Transaction t1 = startTransaction();
    Map<byte[], BatchingVisitable<Map.Entry<Cell, byte[]>>> columnRange = t1.getRowsColumnRange(TEST_TABLE, ImmutableList.of(row), BatchColumnRangeSelection.create(PtBytes.toBytes("col"), PtBytes.toBytes("col0"), 1));
    assertNull(BatchingVisitables.getFirst(Iterables.getOnlyElement(columnRange.values())));
    // Write to avoid the read only path.
    put(t1, "row1_1", "col0", "v0");
    Transaction t2 = startTransaction();
    put(t2, "row1", "col", "v0");
    t2.commit();
    try {
        t1.commit();
        fail();
    } catch (TransactionSerializableConflictException e) {
    // expected
    }
}
Also used : BatchingVisitable(com.palantir.common.base.BatchingVisitable) Transaction(com.palantir.atlasdb.transaction.api.Transaction) TransactionSerializableConflictException(com.palantir.atlasdb.transaction.api.TransactionSerializableConflictException) Map(java.util.Map) ImmutableSortedMap(com.google.common.collect.ImmutableSortedMap) ImmutableMap(com.google.common.collect.ImmutableMap) Cell(com.palantir.atlasdb.keyvalue.api.Cell) Test(org.junit.Test)

Example 7 with BatchingVisitable

use of com.palantir.common.base.BatchingVisitable in project atlasdb by palantir.

the class SnapshotTransaction method getRanges.

@Override
public Iterable<BatchingVisitable<RowResult<byte[]>>> getRanges(final TableReference tableRef, Iterable<RangeRequest> rangeRequests) {
    checkGetPreconditions(tableRef);
    if (perfLogger.isDebugEnabled()) {
        perfLogger.debug("Passed {} ranges to getRanges({}, {})", Iterables.size(rangeRequests), tableRef, rangeRequests);
    }
    if (!Iterables.isEmpty(rangeRequests)) {
        hasReads = true;
    }
    return FluentIterable.from(Iterables.partition(rangeRequests, BATCH_SIZE_GET_FIRST_PAGE)).transformAndConcat(input -> {
        Timer.Context timer = getTimer("processedRangeMillis").time();
        Map<RangeRequest, TokenBackedBasicResultsPage<RowResult<Value>, byte[]>> firstPages = keyValueService.getFirstBatchForRanges(tableRef, input, getStartTimestamp());
        validateExternalAndCommitLocksIfNecessary(tableRef, getStartTimestamp());
        SortedMap<Cell, byte[]> postFiltered = postFilterPages(tableRef, firstPages.values());
        List<BatchingVisitable<RowResult<byte[]>>> ret = Lists.newArrayListWithCapacity(input.size());
        for (RangeRequest rangeRequest : input) {
            TokenBackedBasicResultsPage<RowResult<Value>, byte[]> prePostFilter = firstPages.get(rangeRequest);
            byte[] nextStartRowName = getNextStartRowName(rangeRequest, prePostFilter);
            List<Entry<Cell, byte[]>> mergeIterators = getPostFilteredWithLocalWrites(tableRef, postFiltered, rangeRequest, prePostFilter.getResults(), nextStartRowName);
            ret.add(new AbstractBatchingVisitable<RowResult<byte[]>>() {

                @Override
                protected <K extends Exception> void batchAcceptSizeHint(int batchSizeHint, ConsistentVisitor<RowResult<byte[]>, K> visitor) throws K {
                    checkGetPreconditions(tableRef);
                    final Iterator<RowResult<byte[]>> rowResults = Cells.createRowView(mergeIterators);
                    while (rowResults.hasNext()) {
                        if (!visitor.visit(ImmutableList.of(rowResults.next()))) {
                            return;
                        }
                    }
                    if ((nextStartRowName.length == 0) || !prePostFilter.moreResultsAvailable()) {
                        return;
                    }
                    RangeRequest newRange = rangeRequest.getBuilder().startRowInclusive(nextStartRowName).build();
                    getRange(tableRef, newRange).batchAccept(batchSizeHint, visitor);
                }
            });
        }
        long processedRangeMillis = TimeUnit.NANOSECONDS.toMillis(timer.stop());
        log.trace("Processed {} range requests for {} in {}ms", SafeArg.of("numRequests", input.size()), LoggingArgs.tableRef(tableRef), SafeArg.of("millis", processedRangeMillis));
        return ret;
    });
}
Also used : TokenBackedBasicResultsPage(com.palantir.util.paging.TokenBackedBasicResultsPage) AbstractBatchingVisitable(com.palantir.common.base.AbstractBatchingVisitable) BatchingVisitable(com.palantir.common.base.BatchingVisitable) RowResult(com.palantir.atlasdb.keyvalue.api.RowResult) Entry(java.util.Map.Entry) Timer(com.codahale.metrics.Timer) RangeRequest(com.palantir.atlasdb.keyvalue.api.RangeRequest) Value(com.palantir.atlasdb.keyvalue.api.Value) PeekingIterator(com.google.common.collect.PeekingIterator) AbstractIterator(com.google.common.collect.AbstractIterator) LocalRowColumnRangeIterator(com.palantir.atlasdb.keyvalue.impl.LocalRowColumnRangeIterator) ClosableIterator(com.palantir.common.base.ClosableIterator) RowColumnRangeIterator(com.palantir.atlasdb.keyvalue.api.RowColumnRangeIterator) ForwardingClosableIterator(com.palantir.common.base.ForwardingClosableIterator) Iterator(java.util.Iterator) Cell(com.palantir.atlasdb.keyvalue.api.Cell)

Example 8 with BatchingVisitable

use of com.palantir.common.base.BatchingVisitable in project atlasdb by palantir.

the class SnapshotTransaction method getRowsColumnRange.

@Override
public Map<byte[], BatchingVisitable<Map.Entry<Cell, byte[]>>> getRowsColumnRange(TableReference tableRef, Iterable<byte[]> rows, BatchColumnRangeSelection columnRangeSelection) {
    checkGetPreconditions(tableRef);
    if (Iterables.isEmpty(rows)) {
        return ImmutableMap.of();
    }
    hasReads = true;
    Map<byte[], RowColumnRangeIterator> rawResults = keyValueService.getRowsColumnRange(tableRef, rows, columnRangeSelection, getStartTimestamp());
    Map<byte[], BatchingVisitable<Map.Entry<Cell, byte[]>>> postFilteredResults = Maps.newHashMapWithExpectedSize(rawResults.size());
    for (Entry<byte[], RowColumnRangeIterator> e : rawResults.entrySet()) {
        byte[] row = e.getKey();
        RowColumnRangeIterator rawIterator = e.getValue();
        Iterator<Map.Entry<Cell, byte[]>> postFilteredIterator = getPostFilteredColumns(tableRef, columnRangeSelection, row, rawIterator);
        postFilteredResults.put(row, BatchingVisitableFromIterable.create(postFilteredIterator));
    }
    return postFilteredResults;
}
Also used : AbstractBatchingVisitable(com.palantir.common.base.AbstractBatchingVisitable) BatchingVisitable(com.palantir.common.base.BatchingVisitable) Entry(java.util.Map.Entry) LocalRowColumnRangeIterator(com.palantir.atlasdb.keyvalue.impl.LocalRowColumnRangeIterator) RowColumnRangeIterator(com.palantir.atlasdb.keyvalue.api.RowColumnRangeIterator) Map(java.util.Map) ConcurrentNavigableMap(java.util.concurrent.ConcurrentNavigableMap) LinkedHashMap(java.util.LinkedHashMap) ImmutableSortedMap(com.google.common.collect.ImmutableSortedMap) ImmutableMap(com.google.common.collect.ImmutableMap) SortedMap(java.util.SortedMap) ConcurrentMap(java.util.concurrent.ConcurrentMap) ConcurrentSkipListMap(java.util.concurrent.ConcurrentSkipListMap) Cell(com.palantir.atlasdb.keyvalue.api.Cell)

Example 9 with BatchingVisitable

use of com.palantir.common.base.BatchingVisitable in project atlasdb by palantir.

the class SerializableTransaction method verifyColumnRanges.

private void verifyColumnRanges(Transaction readOnlyTransaction) {
    // verify each set of reads to ensure they are the same.
    for (Entry<TableReference, ConcurrentMap<byte[], ConcurrentMap<BatchColumnRangeSelection, byte[]>>> tableAndRange : columnRangeEndsByTable.entrySet()) {
        TableReference table = tableAndRange.getKey();
        Map<byte[], ConcurrentMap<BatchColumnRangeSelection, byte[]>> columnRangeEnds = tableAndRange.getValue();
        Map<Cell, byte[]> writes = writesByTable.get(table);
        Map<BatchColumnRangeSelection, List<byte[]>> rangesToRows = Maps.newHashMap();
        for (Entry<byte[], ConcurrentMap<BatchColumnRangeSelection, byte[]>> rowAndRangeEnds : columnRangeEnds.entrySet()) {
            byte[] row = rowAndRangeEnds.getKey();
            Map<BatchColumnRangeSelection, byte[]> rangeEnds = columnRangeEnds.get(row);
            for (Entry<BatchColumnRangeSelection, byte[]> e : rangeEnds.entrySet()) {
                BatchColumnRangeSelection range = e.getKey();
                byte[] rangeEnd = e.getValue();
                if (rangeEnd.length != 0 && !RangeRequests.isTerminalRow(false, rangeEnd)) {
                    range = BatchColumnRangeSelection.create(range.getStartCol(), RangeRequests.getNextStartRow(false, rangeEnd), range.getBatchHint());
                }
                if (rangesToRows.get(range) != null) {
                    rangesToRows.get(range).add(row);
                } else {
                    rangesToRows.put(range, ImmutableList.of(row));
                }
            }
        }
        for (Entry<BatchColumnRangeSelection, List<byte[]>> e : rangesToRows.entrySet()) {
            BatchColumnRangeSelection range = e.getKey();
            List<byte[]> rows = e.getValue();
            Map<byte[], BatchingVisitable<Map.Entry<Cell, byte[]>>> result = readOnlyTransaction.getRowsColumnRange(table, rows, range);
            for (Entry<byte[], BatchingVisitable<Map.Entry<Cell, byte[]>>> res : result.entrySet()) {
                byte[] row = res.getKey();
                BatchingVisitableView<Entry<Cell, byte[]>> bv = BatchingVisitableView.of(res.getValue());
                NavigableMap<Cell, ByteBuffer> readsInRange = Maps.transformValues(getReadsInColumnRange(table, row, range), input -> ByteBuffer.wrap(input));
                boolean isEqual = bv.transformBatch(input -> filterWritesFromCells(input, writes)).isEqual(readsInRange.entrySet());
                if (!isEqual) {
                    handleTransactionConflict(table);
                }
            }
        }
    }
}
Also used : TransactionService(com.palantir.atlasdb.transaction.service.TransactionService) RangeRequests(com.palantir.atlasdb.keyvalue.api.RangeRequests) BatchColumnRangeSelection(com.palantir.atlasdb.keyvalue.api.BatchColumnRangeSelection) LoggerFactory(org.slf4j.LoggerFactory) BatchingVisitable(com.palantir.common.base.BatchingVisitable) ByteBuffer(java.nio.ByteBuffer) TransactionSerializableConflictException(com.palantir.atlasdb.transaction.api.TransactionSerializableConflictException) Map(java.util.Map) TableReference(com.palantir.atlasdb.keyvalue.api.TableReference) ImmutableSet(com.google.common.collect.ImmutableSet) ImmutableMap(com.google.common.collect.ImmutableMap) Cell(com.palantir.atlasdb.keyvalue.api.Cell) TransactionReadSentinelBehavior(com.palantir.atlasdb.transaction.api.TransactionReadSentinelBehavior) ConcurrentNavigableMap(java.util.concurrent.ConcurrentNavigableMap) Set(java.util.Set) Cleaner(com.palantir.atlasdb.cleaner.Cleaner) Maps2(com.palantir.common.collect.Maps2) NavigableMap(java.util.NavigableMap) Sets(com.google.common.collect.Sets) ColumnSelection(com.palantir.atlasdb.keyvalue.api.ColumnSelection) RangeRequest(com.palantir.atlasdb.keyvalue.api.RangeRequest) List(java.util.List) Predicate(com.google.common.base.Predicate) Transaction(com.palantir.atlasdb.transaction.api.Transaction) Entry(java.util.Map.Entry) Optional(java.util.Optional) Cells(com.palantir.atlasdb.keyvalue.impl.Cells) SortedMap(java.util.SortedMap) NoOpCleaner(com.palantir.atlasdb.cleaner.NoOpCleaner) Iterables(com.google.common.collect.Iterables) ConflictHandler(com.palantir.atlasdb.transaction.api.ConflictHandler) AtlasDbMetrics(com.palantir.atlasdb.util.AtlasDbMetrics) Supplier(com.google.common.base.Supplier) Multimap(com.google.common.collect.Multimap) PtBytes(com.palantir.atlasdb.encoding.PtBytes) ConcurrentMap(java.util.concurrent.ConcurrentMap) Multimaps(com.google.common.collect.Multimaps) Meter(com.codahale.metrics.Meter) AtlasDbConstraintCheckingMode(com.palantir.atlasdb.transaction.api.AtlasDbConstraintCheckingMode) Lists(com.google.common.collect.Lists) ImmutableList(com.google.common.collect.ImmutableList) Predicates(com.google.common.base.Predicates) Suppliers(com.google.common.base.Suppliers) ExecutorService(java.util.concurrent.ExecutorService) Functions(com.google.common.base.Functions) UnsignedBytes(com.google.common.primitives.UnsignedBytes) Logger(org.slf4j.Logger) MetricRegistry(com.codahale.metrics.MetricRegistry) PreCommitCondition(com.palantir.atlasdb.transaction.api.PreCommitCondition) LockToken(com.palantir.lock.v2.LockToken) TimestampCache(com.palantir.atlasdb.cache.TimestampCache) TimelockService(com.palantir.lock.v2.TimelockService) Maps(com.google.common.collect.Maps) IterableUtils(com.palantir.common.collect.IterableUtils) Pair(com.palantir.util.Pair) RowResult(com.palantir.atlasdb.keyvalue.api.RowResult) ConcurrentSkipListMap(java.util.concurrent.ConcurrentSkipListMap) Validate(org.apache.commons.lang3.Validate) KeyValueService(com.palantir.atlasdb.keyvalue.api.KeyValueService) BatchingVisitableView(com.palantir.common.base.BatchingVisitableView) MultiTableSweepQueueWriter(com.palantir.atlasdb.sweep.queue.MultiTableSweepQueueWriter) Idempotent(com.palantir.common.annotation.Idempotent) AbortingVisitor(com.palantir.common.base.AbortingVisitor) BatchingVisitable(com.palantir.common.base.BatchingVisitable) TableReference(com.palantir.atlasdb.keyvalue.api.TableReference) Entry(java.util.Map.Entry) List(java.util.List) ImmutableList(com.google.common.collect.ImmutableList) Cell(com.palantir.atlasdb.keyvalue.api.Cell) BatchColumnRangeSelection(com.palantir.atlasdb.keyvalue.api.BatchColumnRangeSelection) ConcurrentMap(java.util.concurrent.ConcurrentMap) ByteBuffer(java.nio.ByteBuffer) Map(java.util.Map) ImmutableMap(com.google.common.collect.ImmutableMap) ConcurrentNavigableMap(java.util.concurrent.ConcurrentNavigableMap) NavigableMap(java.util.NavigableMap) SortedMap(java.util.SortedMap) ConcurrentMap(java.util.concurrent.ConcurrentMap) ConcurrentSkipListMap(java.util.concurrent.ConcurrentSkipListMap)

Example 10 with BatchingVisitable

use of com.palantir.common.base.BatchingVisitable in project atlasdb by palantir.

the class SnapshotTransactionTest method testTransactionAtomicity.

@Test
public void testTransactionAtomicity() throws Exception {
    // This test runs multiple transactions in parallel, with KeyValueService.put calls throwing
    // a RuntimeException from time to time and hanging other times. which effectively kills the
    // thread. We ensure that every transaction either adds 5 rows to the table or adds 0 rows
    // by checking at the end that the number of rows is a multiple of 5.
    final TableReference tableRef = TABLE;
    Random random = new Random(1);
    final UnstableKeyValueService unstableKvs = new UnstableKeyValueService(keyValueService, random);
    final TestTransactionManager unstableTransactionManager = new TestTransactionManagerImpl(unstableKvs, timestampService, lockClient, lockService, transactionService, conflictDetectionManager, sweepStrategyManager, sweepQueue);
    ScheduledExecutorService service = PTExecutors.newScheduledThreadPool(20);
    for (int i = 0; i < 30; i++) {
        final int threadNumber = i;
        service.schedule((Callable<Void>) () -> {
            if (threadNumber == 10) {
                unstableKvs.setRandomlyThrow(true);
            }
            if (threadNumber == 20) {
                unstableKvs.setRandomlyHang(true);
            }
            Transaction transaction = unstableTransactionManager.createNewTransaction();
            BatchingVisitable<RowResult<byte[]>> results = transaction.getRange(tableRef, RangeRequest.builder().build());
            final MutableInt nextIndex = new MutableInt(0);
            results.batchAccept(1, AbortingVisitors.batching((AbortingVisitor<RowResult<byte[]>, Exception>) row -> {
                byte[] dataBytes = row.getColumns().get(PtBytes.toBytes("data"));
                BigInteger dataValue = new BigInteger(dataBytes);
                nextIndex.setValue(Math.max(nextIndex.toInteger(), dataValue.intValue() + 1));
                return true;
            }));
            // rows to the table.
            for (int j = 0; j < 5; j++) {
                int rowNumber = nextIndex.toInteger() + j;
                Cell cell = Cell.create(PtBytes.toBytes("row" + rowNumber), PtBytes.toBytes("data"));
                transaction.put(tableRef, ImmutableMap.of(cell, BigInteger.valueOf(rowNumber).toByteArray()));
                Thread.yield();
            }
            transaction.commit();
            return null;
        }, i * 20, TimeUnit.MILLISECONDS);
    }
    service.shutdown();
    service.awaitTermination(1, TimeUnit.SECONDS);
    // Verify each table has a number of rows that's a multiple of 5
    Transaction verifyTransaction = txManager.createNewTransaction();
    BatchingVisitable<RowResult<byte[]>> results = verifyTransaction.getRange(tableRef, RangeRequest.builder().build());
    final MutableInt numRows = new MutableInt(0);
    results.batchAccept(1, AbortingVisitors.batching((AbortingVisitor<RowResult<byte[]>, Exception>) row -> {
        numRows.increment();
        return true;
    }));
    Assert.assertEquals(0, numRows.toInteger() % 5);
}
Also used : ColumnMetadataDescription(com.palantir.atlasdb.table.description.ColumnMetadataDescription) Matchers.not(org.hamcrest.Matchers.not) Future(java.util.concurrent.Future) Pair(org.apache.commons.lang3.tuple.Pair) MutableLong(org.apache.commons.lang3.mutable.MutableLong) Map(java.util.Map) TableReference(com.palantir.atlasdb.keyvalue.api.TableReference) BigInteger(java.math.BigInteger) AtlasDbConstants(com.palantir.atlasdb.AtlasDbConstants) Matchers.notNullValue(org.hamcrest.Matchers.notNullValue) Cell(com.palantir.atlasdb.keyvalue.api.Cell) Set(java.util.Set) LockMode(com.palantir.lock.LockMode) Executors(java.util.concurrent.Executors) Matchers.any(org.mockito.Matchers.any) Transaction(com.palantir.atlasdb.transaction.api.Transaction) Matchers.is(org.hamcrest.Matchers.is) TransactionLockTimeoutNonRetriableException(com.palantir.atlasdb.transaction.api.TransactionLockTimeoutNonRetriableException) Matchers.containsString(org.hamcrest.Matchers.containsString) NoOpCleaner(com.palantir.atlasdb.cleaner.NoOpCleaner) Mockito.mock(org.mockito.Mockito.mock) Joiner(com.google.common.base.Joiner) ColumnRangeSelection(com.palantir.atlasdb.keyvalue.api.ColumnRangeSelection) Iterables(com.google.common.collect.Iterables) ConflictHandler(com.palantir.atlasdb.transaction.api.ConflictHandler) Expectations(org.jmock.Expectations) CachePriority(com.palantir.atlasdb.protos.generated.TableMetadataPersistence.CachePriority) TransactionFailedRetriableException(com.palantir.atlasdb.transaction.api.TransactionFailedRetriableException) Callable(java.util.concurrent.Callable) SimpleTimeDuration(com.palantir.lock.SimpleTimeDuration) AtlasDbTestCase(com.palantir.atlasdb.AtlasDbTestCase) PtBytes(com.palantir.atlasdb.encoding.PtBytes) Mockito.verifyZeroInteractions(org.mockito.Mockito.verifyZeroInteractions) Multimaps(com.google.common.collect.Multimaps) LockAwareTransactionTask(com.palantir.atlasdb.transaction.api.LockAwareTransactionTask) Lists(com.google.common.collect.Lists) LegacyTimelockService(com.palantir.lock.impl.LegacyTimelockService) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) AbortingVisitors(com.palantir.common.base.AbortingVisitors) LockRequest(com.palantir.lock.LockRequest) ImmutableSortedMap(com.google.common.collect.ImmutableSortedMap) Before(org.junit.Before) LockCollections(com.palantir.lock.LockCollections) Assert.assertTrue(org.junit.Assert.assertTrue) Throwables(com.google.common.base.Throwables) Test(org.junit.Test) AtlasRowLockDescriptor(com.palantir.lock.AtlasRowLockDescriptor) Mockery(org.jmock.Mockery) ExecutionException(java.util.concurrent.ExecutionException) RowResult(com.palantir.atlasdb.keyvalue.api.RowResult) AtomicLong(java.util.concurrent.atomic.AtomicLong) TimeDuration(com.palantir.lock.TimeDuration) Matchers.hasItem(org.hamcrest.Matchers.hasItem) LockService(com.palantir.lock.LockService) LockClient(com.palantir.lock.LockClient) Assert(org.junit.Assert) Assert.assertEquals(org.junit.Assert.assertEquals) MutableInt(org.apache.commons.lang3.mutable.MutableInt) BatchColumnRangeSelection(com.palantir.atlasdb.keyvalue.api.BatchColumnRangeSelection) Sequence(org.jmock.Sequence) Random(java.util.Random) BatchingVisitable(com.palantir.common.base.BatchingVisitable) CompletionService(java.util.concurrent.CompletionService) Assert.assertThat(org.junit.Assert.assertThat) PTExecutors(com.palantir.common.concurrent.PTExecutors) Mockito.verifyNoMoreInteractions(org.mockito.Mockito.verifyNoMoreInteractions) Matchers.eq(org.mockito.Matchers.eq) Assert.fail(org.junit.Assert.fail) TrackingKeyValueService(com.palantir.atlasdb.keyvalue.impl.TrackingKeyValueService) LockDescriptor(com.palantir.lock.LockDescriptor) TableMetadata(com.palantir.atlasdb.table.description.TableMetadata) ImmutableSet(com.google.common.collect.ImmutableSet) ImmutableMap(com.google.common.collect.ImmutableMap) TransactionReadSentinelBehavior(com.palantir.atlasdb.transaction.api.TransactionReadSentinelBehavior) Collection(java.util.Collection) SweepStrategy(com.palantir.atlasdb.protos.generated.TableMetadataPersistence.SweepStrategy) Collectors(java.util.stream.Collectors) ColumnSelection(com.palantir.atlasdb.keyvalue.api.ColumnSelection) RangeRequest(com.palantir.atlasdb.keyvalue.api.RangeRequest) TransactionConflictException(com.palantir.atlasdb.transaction.api.TransactionConflictException) List(java.util.List) MultiDelegateProxy(com.palantir.common.proxy.MultiDelegateProxy) Optional(java.util.Optional) ForwardingKeyValueService(com.palantir.atlasdb.keyvalue.impl.ForwardingKeyValueService) SortedMap(java.util.SortedMap) ExecutorCompletionService(java.util.concurrent.ExecutorCompletionService) HeldLocksToken(com.palantir.lock.HeldLocksToken) Supplier(com.google.common.base.Supplier) Multimap(com.google.common.collect.Multimap) LockRefreshToken(com.palantir.lock.LockRefreshToken) AtlasDbConstraintCheckingMode(com.palantir.atlasdb.transaction.api.AtlasDbConstraintCheckingMode) ImmutableList(com.google.common.collect.ImmutableList) Suppliers(com.google.common.base.Suppliers) WriteInfo(com.palantir.atlasdb.sweep.queue.WriteInfo) ExecutorService(java.util.concurrent.ExecutorService) Matchers.hasEntry(org.hamcrest.Matchers.hasEntry) EncodingUtils(com.palantir.atlasdb.ptobject.EncodingUtils) PreCommitCondition(com.palantir.atlasdb.transaction.api.PreCommitCondition) Matchers(org.hamcrest.Matchers) TimestampCache(com.palantir.atlasdb.cache.TimestampCache) Mockito.when(org.mockito.Mockito.when) Mockito.verify(org.mockito.Mockito.verify) TimeUnit(java.util.concurrent.TimeUnit) Ignore(org.junit.Ignore) KeyValueService(com.palantir.atlasdb.keyvalue.api.KeyValueService) TransactionFailedNonRetriableException(com.palantir.atlasdb.transaction.api.TransactionFailedNonRetriableException) NameMetadataDescription(com.palantir.atlasdb.table.description.NameMetadataDescription) Collections(java.util.Collections) AbortingVisitor(com.palantir.common.base.AbortingVisitor) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) AbortingVisitor(com.palantir.common.base.AbortingVisitor) TransactionLockTimeoutNonRetriableException(com.palantir.atlasdb.transaction.api.TransactionLockTimeoutNonRetriableException) TransactionFailedRetriableException(com.palantir.atlasdb.transaction.api.TransactionFailedRetriableException) ExecutionException(java.util.concurrent.ExecutionException) TransactionConflictException(com.palantir.atlasdb.transaction.api.TransactionConflictException) TransactionFailedNonRetriableException(com.palantir.atlasdb.transaction.api.TransactionFailedNonRetriableException) BatchingVisitable(com.palantir.common.base.BatchingVisitable) RowResult(com.palantir.atlasdb.keyvalue.api.RowResult) TableReference(com.palantir.atlasdb.keyvalue.api.TableReference) Random(java.util.Random) Transaction(com.palantir.atlasdb.transaction.api.Transaction) MutableInt(org.apache.commons.lang3.mutable.MutableInt) BigInteger(java.math.BigInteger) Cell(com.palantir.atlasdb.keyvalue.api.Cell) Test(org.junit.Test)

Aggregations

BatchingVisitable (com.palantir.common.base.BatchingVisitable)16 Cell (com.palantir.atlasdb.keyvalue.api.Cell)15 Map (java.util.Map)14 ImmutableMap (com.google.common.collect.ImmutableMap)13 Transaction (com.palantir.atlasdb.transaction.api.Transaction)13 Test (org.junit.Test)12 ImmutableSortedMap (com.google.common.collect.ImmutableSortedMap)11 RangeRequest (com.palantir.atlasdb.keyvalue.api.RangeRequest)8 RowResult (com.palantir.atlasdb.keyvalue.api.RowResult)8 Iterables (com.google.common.collect.Iterables)7 PtBytes (com.palantir.atlasdb.encoding.PtBytes)7 TableReference (com.palantir.atlasdb.keyvalue.api.TableReference)7 ImmutableSet (com.google.common.collect.ImmutableSet)6 Multimap (com.google.common.collect.Multimap)6 Multimaps (com.google.common.collect.Multimaps)6 List (java.util.List)6 ExecutorService (java.util.concurrent.ExecutorService)6 Maps (com.google.common.collect.Maps)5 UnsignedBytes (com.google.common.primitives.UnsignedBytes)5 AtlasDbConstants (com.palantir.atlasdb.AtlasDbConstants)5