Search in sources :

Example 1 with SchemaApiTestV2Table

use of com.palantir.atlasdb.table.description.generated.SchemaApiTestV2Table in project atlasdb by palantir.

the class SchemaApiTestV2Impl method putSingleRowFirstColumn.

@Override
protected void putSingleRowFirstColumn(Transaction transaction, String rowKey, long value) {
    SchemaApiTestV2Table table = tableFactory.getSchemaApiTestV2Table(transaction);
    table.putColumn1(rowKey, value);
}
Also used : SchemaApiTestV2Table(com.palantir.atlasdb.table.description.generated.SchemaApiTestV2Table)

Example 2 with SchemaApiTestV2Table

use of com.palantir.atlasdb.table.description.generated.SchemaApiTestV2Table in project atlasdb by palantir.

the class SchemaApiTestV2Impl method getRangeSecondColumnOnlyFirstTwoResults.

@Override
protected Map<String, StringValue> getRangeSecondColumnOnlyFirstTwoResults(Transaction transaction, String startRowKey, String endRowKey) {
    SchemaApiTestV2Table table = tableFactory.getSchemaApiTestV2Table(transaction);
    RangeRequest rangeRequest = RangeRequest.builder().startRowInclusive(SchemaApiTestTable.SchemaApiTestRow.of(startRowKey).persistToBytes()).endRowExclusive(SchemaApiTestTable.SchemaApiTestRow.of(endRowKey).persistToBytes()).build();
    return table.getSmallRowRangeColumn2(rangeRequest, 2);
}
Also used : SchemaApiTestV2Table(com.palantir.atlasdb.table.description.generated.SchemaApiTestV2Table) RangeRequest(com.palantir.atlasdb.keyvalue.api.RangeRequest)

Example 3 with SchemaApiTestV2Table

use of com.palantir.atlasdb.table.description.generated.SchemaApiTestV2Table in project atlasdb by palantir.

the class SchemaApiTestV2Impl method getSingleRowFirstColumn.

@Override
protected Long getSingleRowFirstColumn(Transaction transaction, String rowKey) {
    SchemaApiTestV2Table table = tableFactory.getSchemaApiTestV2Table(transaction);
    Optional<Long> result = table.getColumn1(rowKey);
    return result.get();
}
Also used : SchemaApiTestV2Table(com.palantir.atlasdb.table.description.generated.SchemaApiTestV2Table) Matchers.anyLong(org.mockito.Matchers.anyLong)

Example 4 with SchemaApiTestV2Table

use of com.palantir.atlasdb.table.description.generated.SchemaApiTestV2Table in project atlasdb by palantir.

the class SchemaApiTestV2Impl method testUpdateEntryIfEntryExists.

@Test
public void testUpdateEntryIfEntryExists() {
    AbstractTransaction transaction = mock(AbstractTransaction.class);
    SchemaApiTestV2Table table = spy(tableFactory.getSchemaApiTestV2Table(transaction));
    doReturn(Optional.of(TEST_VALUE_LONG)).when(table).getColumn1(TEST_ROW_KEY);
    table.updateColumn1(TEST_ROW_KEY, entry -> entry + 1);
    verify(table, times(1)).putColumn1(TEST_ROW_KEY, TEST_VALUE_LONG + 1);
}
Also used : SchemaApiTestV2Table(com.palantir.atlasdb.table.description.generated.SchemaApiTestV2Table) AbstractTransaction(com.palantir.atlasdb.transaction.impl.AbstractTransaction) Test(org.junit.Test)

Example 5 with SchemaApiTestV2Table

use of com.palantir.atlasdb.table.description.generated.SchemaApiTestV2Table in project atlasdb by palantir.

the class SchemaApiTestV2Impl method deleteFirstColumn.

@Override
protected void deleteFirstColumn(Transaction transaction, String rowKey) {
    SchemaApiTestV2Table table = tableFactory.getSchemaApiTestV2Table(transaction);
    table.deleteColumn1(rowKey);
}
Also used : SchemaApiTestV2Table(com.palantir.atlasdb.table.description.generated.SchemaApiTestV2Table)

Aggregations

SchemaApiTestV2Table (com.palantir.atlasdb.table.description.generated.SchemaApiTestV2Table)7 AbstractTransaction (com.palantir.atlasdb.transaction.impl.AbstractTransaction)2 Test (org.junit.Test)2 RangeRequest (com.palantir.atlasdb.keyvalue.api.RangeRequest)1 Matchers.anyLong (org.mockito.Matchers.anyLong)1