private ResultSet execute(ReadOperation op, BatchReadOnlyTransaction readOnlyTransaction) { if (op.getQuery() != null) { return readOnlyTransaction.executeQuery(op.getQuery()); } if (op.getIndex() != null) { return readOnlyTransaction.readUsingIndex( op.getTable(), op.getIndex(), op.getKeySet(), op.getColumns()); } return readOnlyTransaction.read(op.getTable(), op.getKeySet(), op.getColumns()); } }
getReadOperation().getColumns(), "For a read operation SpannerIO.read() requires a list of " + "columns to set with withColumns method"); checkArgument( !getReadOperation().getColumns().isEmpty(), "For a read operation SpannerIO.read() requires a" + " list of columns to set with withColumns method");
private List<Partition> execute(ReadOperation op, BatchReadOnlyTransaction tx) { // Query was selected. if (op.getQuery() != null) { return tx.partitionQuery(op.getPartitionOptions(), op.getQuery()); } // Read with index was selected. if (op.getIndex() != null) { return tx.partitionReadUsingIndex( op.getPartitionOptions(), op.getTable(), op.getIndex(), op.getKeySet(), op.getColumns()); } // Read from table was selected. return tx.partitionRead( op.getPartitionOptions(), op.getTable(), op.getKeySet(), op.getColumns()); } }