use of com.scalar.db.api.Scan in project scalardb by scalar-labs.
the class ConsensusCommitIntegrationTestBase method scan_ScanGivenForDeletedWhenCoordinatorStateNotExistAndExpired_ShouldAbortTransaction.
@Test
public void scan_ScanGivenForDeletedWhenCoordinatorStateNotExistAndExpired_ShouldAbortTransaction() throws ExecutionException, CoordinatorException, CrudException {
Scan scan = prepareScan(0, 0, 0, namespace1, TABLE_1);
selection_SelectionGivenForDeletedWhenCoordinatorStateNotExistAndExpired_ShouldAbortTransaction(scan);
}
use of com.scalar.db.api.Scan in project scalardb by scalar-labs.
the class ConsensusCommitIntegrationTestBase method scan_ScanGivenForDeletedWhenCoordinatorStateNotExistAndNotExpired_ShouldNotAbortTransaction.
@Test
public void scan_ScanGivenForDeletedWhenCoordinatorStateNotExistAndNotExpired_ShouldNotAbortTransaction() throws ExecutionException, CoordinatorException {
Scan scan = prepareScan(0, 0, 0, namespace1, TABLE_1);
selection_SelectionGivenForDeletedWhenCoordinatorStateNotExistAndNotExpired_ShouldNotAbortTransaction(scan);
}
use of com.scalar.db.api.Scan in project scalardb by scalar-labs.
the class ConsensusCommitIntegrationTestBase method scan_DeleteGivenBefore_ShouldScan.
@Test
public void scan_DeleteGivenBefore_ShouldScan() throws CommitException, UnknownTransactionStatusException, CrudException {
// Arrange
ConsensusCommit transaction = manager.start();
transaction.put(preparePut(0, 0, namespace1, TABLE_1).withValue(BALANCE, 1));
transaction.put(preparePut(0, 1, namespace1, TABLE_1).withValue(BALANCE, 1));
transaction.commit();
// Act
ConsensusCommit transaction1 = manager.start();
transaction1.delete(prepareDelete(0, 0, namespace1, TABLE_1));
Scan scan = prepareScan(0, 0, 1, namespace1, TABLE_1);
List<Result> results = transaction1.scan(scan);
assertThatCode(transaction1::commit).doesNotThrowAnyException();
// Assert
assertThat(results.size()).isEqualTo(1);
}
use of com.scalar.db.api.Scan in project scalardb by scalar-labs.
the class ConsensusCommitIntegrationTestBase method scan_ScanGivenForDeletedWhenCoordinatorStateAborted_ShouldRollback.
@Test
public void scan_ScanGivenForDeletedWhenCoordinatorStateAborted_ShouldRollback() throws ExecutionException, CoordinatorException, CrudException {
Scan scan = prepareScan(0, 0, 0, namespace1, TABLE_1);
selection_SelectionGivenForDeletedWhenCoordinatorStateAborted_ShouldRollback(scan);
}
use of com.scalar.db.api.Scan in project scalardb by scalar-labs.
the class DistributedTransactionServiceWithConsensusCommitIntegrationTest method scan_ScanGivenForNonExisting_ShouldReturnEmpty.
@Test
public void scan_ScanGivenForNonExisting_ShouldReturnEmpty() throws TransactionException {
// Arrange
populateRecords(TABLE_1);
GrpcTransaction transaction = manager.start();
Scan scan = prepareScan(0, 4, 4, TABLE_1);
// Act
List<Result> results = transaction.scan(scan);
transaction.commit();
// Assert
assertThat(results.size()).isEqualTo(0);
}
Aggregations