use of com.scalar.db.io.DataType in project scalardb by scalar-labs.
the class StorageMultipleClusteringKeyScanIntegrationTestBase method createTables.
private void createTables() throws InterruptedException, java.util.concurrent.ExecutionException {
List<Callable<Void>> testCallables = new ArrayList<>();
Map<String, String> options = getCreateOptions();
for (DataType firstClusteringKeyType : clusteringKeyTypes.keySet()) {
Callable<Void> testCallable = () -> {
admin.createNamespace(getNamespaceName(firstClusteringKeyType), true, options);
for (DataType secondClusteringKeyType : clusteringKeyTypes.get(firstClusteringKeyType)) {
for (Order firstClusteringOrder : Order.values()) {
for (Order secondClusteringOrder : Order.values()) {
createTable(firstClusteringKeyType, firstClusteringOrder, secondClusteringKeyType, secondClusteringOrder, options);
}
}
}
return null;
};
testCallables.add(testCallable);
}
// We firstly execute the first one and then the rest. This is because the first table creation
// creates the metadata table, and this process can't be handled in multiple threads/processes
// at the same time.
execute(testCallables.subList(0, 1));
execute(testCallables.subList(1, testCallables.size()));
}
use of com.scalar.db.io.DataType in project scalardb by scalar-labs.
the class StorageMultiplePartitionKeyIntegrationTestBase method createTables.
private void createTables() throws java.util.concurrent.ExecutionException, InterruptedException {
List<Callable<Void>> testCallables = new ArrayList<>();
Map<String, String> options = getCreateOptions();
for (DataType firstPartitionKeyType : partitionKeyTypes.keySet()) {
Callable<Void> testCallable = () -> {
admin.createNamespace(getNamespaceName(firstPartitionKeyType), true, options);
for (DataType secondPartitionKeyType : partitionKeyTypes.get(firstPartitionKeyType)) {
createTable(firstPartitionKeyType, secondPartitionKeyType, options);
}
return null;
};
testCallables.add(testCallable);
}
// We firstly execute the first one and then the rest. This is because the first table creation
// creates the metadata table, and this process can't be handled in multiple threads/processes
// at the same time.
execute(testCallables.subList(0, 1));
execute(testCallables.subList(1, testCallables.size()));
}
use of com.scalar.db.io.DataType in project scalardb by scalar-labs.
the class StorageSecondaryIndexIntegrationTestBase method createTables.
private void createTables() throws ExecutionException {
Map<String, String> options = getCreateOptions();
admin.createNamespace(namespace, true, options);
for (DataType secondaryIndexType : secondaryIndexTypes) {
createTable(secondaryIndexType, options);
}
}
use of com.scalar.db.io.DataType in project scalardb by scalar-labs.
the class StorageSingleClusteringKeyScanIntegrationTestBase method scan_WithClusteringKeyRangeWithSameValues_ShouldReturnProperResult.
@Test
public void scan_WithClusteringKeyRangeWithSameValues_ShouldReturnProperResult() throws ExecutionException, IOException {
for (DataType clusteringKeyType : clusteringKeyTypes) {
for (Order clusteringOrder : Order.values()) {
truncateTable(clusteringKeyType, clusteringOrder);
List<Value<?>> clusteringKeyValues = prepareRecords(clusteringKeyType, clusteringOrder);
for (boolean startInclusive : Arrays.asList(true, false)) {
for (boolean endInclusive : Arrays.asList(true, false)) {
for (OrderingType orderingType : OrderingType.values()) {
for (boolean withLimit : Arrays.asList(false, true)) {
scan_WithClusteringKeyRangeWithSameValues_ShouldReturnProperResult(clusteringKeyValues, clusteringKeyType, clusteringOrder, startInclusive, endInclusive, orderingType, withLimit);
}
}
}
}
}
}
}
use of com.scalar.db.io.DataType in project scalardb by scalar-labs.
the class StorageSingleClusteringKeyScanIntegrationTestBase method scan_WithClusteringKeyStartRange_ShouldReturnProperResult.
@Test
public void scan_WithClusteringKeyStartRange_ShouldReturnProperResult() throws ExecutionException, IOException {
for (DataType clusteringKeyType : clusteringKeyTypes) {
for (Order clusteringOrder : Order.values()) {
truncateTable(clusteringKeyType, clusteringOrder);
List<Value<?>> clusteringKeyValues = prepareRecords(clusteringKeyType, clusteringOrder);
for (boolean startInclusive : Arrays.asList(true, false)) {
for (OrderingType orderingType : OrderingType.values()) {
for (boolean withLimit : Arrays.asList(false, true)) {
scan_WithClusteringKeyStartRange_ShouldReturnProperResult(clusteringKeyValues, clusteringKeyType, clusteringOrder, startInclusive, orderingType, withLimit);
}
}
}
}
}
}
Aggregations