mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
rename to simply spanner,added check for service account file
This commit is contained in:
@@ -22,7 +22,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class GCPSpannerAdapterUtils {
|
public class GCPSpannerAdapterUtils {
|
||||||
public static final String SPANNER = "gcp_spanner";
|
public static final String SPANNER = "spanner";
|
||||||
|
|
||||||
public static int[] getKeyArrayFromResultSet(ResultSet rs) {
|
public static int[] getKeyArrayFromResultSet(ResultSet rs) {
|
||||||
List<Integer> values = new ArrayList<>();
|
List<Integer> values = new ArrayList<>();
|
||||||
|
|||||||
@@ -33,9 +33,6 @@ import org.apache.logging.log4j.Logger;
|
|||||||
* @see <a href="https://cloud.google.com/spanner/docs/reference/standard-sql/dml-syntax">DML Syntax</a>
|
* @see <a href="https://cloud.google.com/spanner/docs/reference/standard-sql/dml-syntax">DML Syntax</a>
|
||||||
* @see <a href="https://cloud.google.com/spanner/docs/reference/rpc">spanner rpc api calls</a>
|
* @see <a href="https://cloud.google.com/spanner/docs/reference/rpc">spanner rpc api calls</a>
|
||||||
* @see <a href="https://cloud.google.com/spanner/docs/reference/standard-sql/data-definition-language#vector_index_statements">SQL functionality related to vector indices</a>
|
* @see <a href="https://cloud.google.com/spanner/docs/reference/standard-sql/data-definition-language#vector_index_statements">SQL functionality related to vector indices</a>
|
||||||
* @see <a href=""></a>
|
|
||||||
* @see <a href=""></a>
|
|
||||||
* @see <a href=""></a>
|
|
||||||
*/
|
*/
|
||||||
public class GCPSpannerSpace implements AutoCloseable {
|
public class GCPSpannerSpace implements AutoCloseable {
|
||||||
private final static Logger logger = LogManager.getLogger(GCPSpannerSpace.class);
|
private final static Logger logger = LogManager.getLogger(GCPSpannerSpace.class);
|
||||||
@@ -89,8 +86,10 @@ public class GCPSpannerSpace implements AutoCloseable {
|
|||||||
if (
|
if (
|
||||||
cfg.getOptional("database_id").isEmpty() ||
|
cfg.getOptional("database_id").isEmpty() ||
|
||||||
cfg.getOptional("project_id").isEmpty() ||
|
cfg.getOptional("project_id").isEmpty() ||
|
||||||
cfg.getOptional("instance_id").isEmpty()) {
|
cfg.getOptional("instance_id").isEmpty() ||
|
||||||
throw new RuntimeException("You must provide all 'service_account_file', 'project_id', 'instance_id' & 'database_id' to configure a Google Spanner client");
|
cfg.getOptional("service_account_file").isEmpty()) {
|
||||||
|
throw new RuntimeException("You must provide all 'service_account_file', 'project_id', 'instance_id' &" +
|
||||||
|
" 'database_id' to configure a Google Spanner client");
|
||||||
}
|
}
|
||||||
String projectId = cfg.get("project_id");
|
String projectId = cfg.get("project_id");
|
||||||
String instanceId = cfg.get("instance_id");
|
String instanceId = cfg.get("instance_id");
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
scenarios:
|
scenarios:
|
||||||
default:
|
default:
|
||||||
execute_ddl: run driver=gcp_spanner tags==blocks:execute_ddl service_account_file=TEMPLATE(service_account_file)
|
execute_ddl: run driver=spanner tags==blocks:execute_ddl service_account_file=TEMPLATE(service_account_file)
|
||||||
project_id=TEMPLATE(project_id) instance_id=TEMPLATE(instance_id) database_id=TEMPLATE(database_id) cycles=1
|
project_id=TEMPLATE(project_id) instance_id=TEMPLATE(instance_id) database_id=TEMPLATE(database_id) cycles=1
|
||||||
|
|
||||||
# https://cloud.google.com/spanner/docs/reference/standard-sql/data-definition-language#vector_index_option_list
|
# https://cloud.google.com/spanner/docs/reference/standard-sql/data-definition-language#vector_index_option_list
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
scenarios:
|
scenarios:
|
||||||
default:
|
default:
|
||||||
execute_dml: run driver=gcp_spanner tags==blocks:execute_dml service_account_file=TEMPLATE(service_account_file)
|
execute_dml: run driver=spanner tags==blocks:execute_dml service_account_file=TEMPLATE(service_account_file)
|
||||||
project_id=TEMPLATE(project_id) instance_id=TEMPLATE(instance_id) database_id=TEMPLATE(database_id) cycles=TEMPLATE(cycles)
|
project_id=TEMPLATE(project_id) instance_id=TEMPLATE(instance_id) database_id=TEMPLATE(database_id) cycles=TEMPLATE(cycles)
|
||||||
|
|
||||||
bindings:
|
bindings:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
scenarios:
|
scenarios:
|
||||||
default:
|
default:
|
||||||
execute_ddl: run driver=gcp_spanner tags==blocks:execute_ddl service_account_file=TEMPLATE(service_account_file)
|
execute_ddl: run driver=spanner tags==blocks:execute_ddl service_account_file=TEMPLATE(service_account_file)
|
||||||
project_id=TEMPLATE(project_id) instance_id=TEMPLATE(instance_id) database_id=TEMPLATE(database_id) cycles=1
|
project_id=TEMPLATE(project_id) instance_id=TEMPLATE(instance_id) database_id=TEMPLATE(database_id) cycles=1
|
||||||
|
|
||||||
blocks:
|
blocks:
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
scenarios:
|
scenarios:
|
||||||
default:
|
default:
|
||||||
insert_vector: >-
|
insert_vector: >-
|
||||||
run driver=gcp_spanner tags==blocks:insert_vector service_account_file=TEMPLATE(service_account_file)
|
run driver=spanner tags==blocks:insert_vector service_account_file=TEMPLATE(service_account_file)
|
||||||
project_id=TEMPLATE(project_id) instance_id=TEMPLATE(instance_id) database_id=TEMPLATE(database_id) cycles=TEMPLATE(cycles)
|
project_id=TEMPLATE(project_id) instance_id=TEMPLATE(instance_id) database_id=TEMPLATE(database_id) cycles=TEMPLATE(cycles)
|
||||||
|
|
||||||
bindings:
|
bindings:
|
||||||
|
|||||||
Reference in New Issue
Block a user