Search in sources :

Example 1 with SweepPriorityRowResult

use of com.palantir.atlasdb.schema.generated.SweepPriorityTable.SweepPriorityRowResult in project atlasdb by palantir.

the class TransactionRemotingTest method testGetRangeSome.

@Test
public void testGetRangeSome() {
    setupFooStatus1("sweep.priority");
    TransactionToken token = TransactionToken.autoCommit();
    RangeToken range = service.getRange(token, new TableRange("sweep.priority", new byte[0], new byte[0], ImmutableList.<byte[]>of(), 10));
    SweepPriorityRowResult result = SweepPriorityRowResult.of(Iterables.getOnlyElement(range.getResults().getResults()));
    Assert.assertEquals(1L, result.getCellsExamined().longValue());
    Assert.assertNull(range.getNextRange());
}
Also used : TransactionToken(com.palantir.atlasdb.api.TransactionToken) SweepPriorityRowResult(com.palantir.atlasdb.schema.generated.SweepPriorityTable.SweepPriorityRowResult) RangeToken(com.palantir.atlasdb.api.RangeToken) TableRange(com.palantir.atlasdb.api.TableRange) Test(org.junit.Test)

Example 2 with SweepPriorityRowResult

use of com.palantir.atlasdb.schema.generated.SweepPriorityTable.SweepPriorityRowResult in project atlasdb by palantir.

the class TransactionRemotingTest method testGetRowsSome.

@Test
public void testGetRowsSome() {
    setupFooStatus1("sweep.priority");
    TransactionToken txId = TransactionToken.autoCommit();
    TableRowResult goodResults = service.getRows(txId, new TableRowSelection("sweep.priority", ImmutableList.of(SweepPriorityRow.of("foo").persistToBytes()), ColumnSelection.all()));
    SweepPriorityRowResult result = SweepPriorityRowResult.of(Iterables.getOnlyElement(goodResults.getResults()));
    Assert.assertEquals(1L, result.getCellsExamined().longValue());
}
Also used : TableRowResult(com.palantir.atlasdb.api.TableRowResult) TableRowSelection(com.palantir.atlasdb.api.TableRowSelection) TransactionToken(com.palantir.atlasdb.api.TransactionToken) SweepPriorityRowResult(com.palantir.atlasdb.schema.generated.SweepPriorityTable.SweepPriorityRowResult) Test(org.junit.Test)

Aggregations

TransactionToken (com.palantir.atlasdb.api.TransactionToken)2 SweepPriorityRowResult (com.palantir.atlasdb.schema.generated.SweepPriorityTable.SweepPriorityRowResult)2 Test (org.junit.Test)2 RangeToken (com.palantir.atlasdb.api.RangeToken)1 TableRange (com.palantir.atlasdb.api.TableRange)1 TableRowResult (com.palantir.atlasdb.api.TableRowResult)1 TableRowSelection (com.palantir.atlasdb.api.TableRowSelection)1