mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
squash
This commit is contained in:
parent
1888698d47
commit
134e10d871
@ -70,7 +70,7 @@ public class JDBCOpMapper implements OpMapper<JDBCOp> {
|
|||||||
|
|
||||||
// SELECT uses 'executeQuery' and returns a 'ResultSet'
|
// SELECT uses 'executeQuery' and returns a 'ResultSet'
|
||||||
// https://jdbc.postgresql.org/documentation/query/#example51processing-a-simple-query-in-jdbc
|
// https://jdbc.postgresql.org/documentation/query/#example51processing-a-simple-query-in-jdbc
|
||||||
case executeQuery ->
|
case query ->
|
||||||
new JDBCExecuteQueryOpDispenser(adapter, connectionLongFunc, op, opType.targetFunction);
|
new JDBCExecuteQueryOpDispenser(adapter, connectionLongFunc, op, opType.targetFunction);
|
||||||
|
|
||||||
// INSERT|UPDATE|DELETE uses 'executeUpdate' and returns an 'int'
|
// INSERT|UPDATE|DELETE uses 'executeUpdate' and returns an 'int'
|
||||||
@ -78,7 +78,7 @@ public class JDBCOpMapper implements OpMapper<JDBCOp> {
|
|||||||
|
|
||||||
// CREATE|DROP TABLE|VIEW uses 'execute' (as opposed to 'executeQuery' which returns a 'ResultSet')
|
// CREATE|DROP TABLE|VIEW uses 'execute' (as opposed to 'executeQuery' which returns a 'ResultSet')
|
||||||
// https://jdbc.postgresql.org/documentation/query/#example54dropping-a-table-in-jdbc
|
// https://jdbc.postgresql.org/documentation/query/#example54dropping-a-table-in-jdbc
|
||||||
case execute, executeUpdate ->
|
case execute, update ->
|
||||||
new JDBCExecuteOpDispenser(adapter, connectionLongFunc, op, opType.targetFunction);
|
new JDBCExecuteOpDispenser(adapter, connectionLongFunc, op, opType.targetFunction);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,6 @@ package io.nosqlbench.adapter.jdbc;
|
|||||||
public enum JDBCOpType {
|
public enum JDBCOpType {
|
||||||
//See https://jdbc.postgresql.org/documentation/query/
|
//See https://jdbc.postgresql.org/documentation/query/
|
||||||
execute, // Used for CREATE|DROP DATABASE|TABLE operation. Returns nothing.
|
execute, // Used for CREATE|DROP DATABASE|TABLE operation. Returns nothing.
|
||||||
executeQuery, // Used for SELECT operation. Returns a ResultSet object.
|
query, // Used for SELECT operation. Returns a ResultSet object.
|
||||||
executeUpdate // Used for updating records such as INSERT|UPDATE|DELETE. Returns the number of rows affected.
|
update // Used for updating records such as INSERT|UPDATE|DELETE. Returns the number of rows affected.
|
||||||
}
|
}
|
||||||
|
@ -129,45 +129,113 @@ public class JDBCSpace implements AutoCloseable {
|
|||||||
|
|
||||||
public static NBConfigModel getConfigModel() {
|
public static NBConfigModel getConfigModel() {
|
||||||
return ConfigModel.of(JDBCSpace.class)
|
return ConfigModel.of(JDBCSpace.class)
|
||||||
.add(Param.defaultTo("url", "jdbc:postgresql:/").setDescription("The connection URL used to connect to the DBMS. Defaults to 'jdbc:postgresql:/'"))
|
.add(Param.defaultTo("url", "jdbc:postgresql:/")
|
||||||
.add(Param.defaultTo("serverName", "localhost").setDescription("The host name of the server. Defaults to 'localhost'"))
|
.setDescription("The connection URL used to connect to the DBMS. Defaults to 'jdbc:postgresql:/'"))
|
||||||
.add(Param.optional("databaseName").setDescription("The database name. The default is to connect to a database with the same name as the user name used to connect to the server."))
|
.add(Param.defaultTo("serverName", "localhost")
|
||||||
|
.setDescription("The host name of the server. Defaults to 'localhost'"))
|
||||||
|
.add(Param.optional("databaseName")
|
||||||
|
.setDescription("The database name. The default is to connect to a database with the same name as the user name used to connect to the server."))
|
||||||
// See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby & https://jdbc.postgresql.org/documentation/use/
|
// See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby & https://jdbc.postgresql.org/documentation/use/
|
||||||
.add(Param.defaultTo("portNumber", "5432").setDescription("The port number the server is listening on. Defaults to the PostgreSQL® standard port number (5432)."))
|
.add(Param.defaultTo("portNumber", "5432")
|
||||||
.add(Param.optional("user").setDescription("The database user on whose behalf the connection is being made."))
|
.setDescription("The port number the server is listening on. Defaults to the PostgreSQL® standard port number (5432)."))
|
||||||
.add(Param.optional("password").setDescription("The database user’s password."))
|
.add(Param.optional("user")
|
||||||
.add(Param.optional("ssl").setDescription("Whether to connect using SSL. Default is false."))
|
.setDescription("The database user on whose behalf the connection is being made."))
|
||||||
.add(Param.optional("sslmode").setDescription("Possible values include disable , allow , prefer , require , verify-ca and verify-full . require , allow and prefer all default to a non-validating SSL factory and do not check the validity of the certificate or the host name. verify-ca validates the certificate, but does not verify the hostname. verify-full will validate that the certificate is correct and verify the host connected to has the same hostname as the certificate. Default is prefer."))
|
.add(Param.optional("password")
|
||||||
.add(Param.optional("sslcert").setDescription("Provide the full path for the certificate file. Defaults to defaultdir/postgresql.crt, where defaultdir is ${user.home}/.postgresql/ in *nix systems and %appdata%/postgresql/ on windows."))
|
.setDescription("The database user’s password."))
|
||||||
.add(Param.optional("sslrootcert").setDescription("File name of the SSL root certificate."))
|
.add(Param.optional("ssl")
|
||||||
.add(Param.defaultTo("applicationName", "NoSQLBench").setDescription("The application name to be used. Default is 'NoSQLBench'."))
|
.setDescription("Whether to connect using SSL. Default is false."))
|
||||||
.add(Param.optional("rewriteBatchedInserts").setDescription("This will change batch inserts from insert into foo (col1, col2, col3) values (1, 2, 3) into insert into foo (col1, col2, col3) values (1, 2, 3), (4, 5, 6) this provides 2-3x performance improvement. Default is true"))
|
.add(Param.optional("sslmode")
|
||||||
.add(Param.optional("autoCommit").setDescription("This property controls the default auto-commit behavior of connections returned from the pool. It is a boolean value. Default: false. This cannot be changed."))
|
.setDescription("Possible values include disable , allow , prefer , require , verify-ca and verify-full." +
|
||||||
.add(Param.optional("connectionTimeout").setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. This property is not exposed and hence cannot be changed."))
|
" require , allow and prefer all default to a non-validating SSL factory and do not check the validity of the certificate or the host name." +
|
||||||
.add(Param.optional("idleTimeout").setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. This property is not exposed and hence cannot be changed."))
|
" verify-ca validates the certificate, but does not verify the hostname." +
|
||||||
.add(Param.defaultTo("keepaliveTime", "150000").setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. This property is not exposed and hence cannot be changed."))
|
" verify-full will validate that the certificate is correct and verify the host connected to has the same hostname as the certificate." +
|
||||||
.add(Param.optional("maxLifetime").setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. This property is not exposed and hence cannot be changed."))
|
" Default is prefer."))
|
||||||
.add(Param.optional("connectionTestQuery").setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. This property is not exposed and hence cannot be changed."))
|
.add(Param.optional("sslcert")
|
||||||
.add(Param.optional("minimumIdle").setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. This property is not exposed and hence cannot be changed."))
|
.setDescription("Provide the full path for the certificate file. Defaults to defaultdir/postgresql.crt, where defaultdir is ${user.home}/.postgresql/ in *nix systems and %appdata%/postgresql/ on windows."))
|
||||||
.add(Param.defaultTo("maximumPoolSize", "40").setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. Default value is 40 and cannot be changed."))
|
.add(Param.optional("sslrootcert")
|
||||||
.add(Param.optional("metricRegistry").setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. This property is not exposed and hence cannot be changed."))
|
.setDescription("File name of the SSL root certificate."))
|
||||||
.add(Param.optional("healthCheckRegistry").setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. This property is not exposed and hence cannot be changed."))
|
.add(Param.defaultTo("applicationName", "NoSQLBench")
|
||||||
.add(Param.optional("poolName").setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. This property is not exposed and hence cannot be changed."))
|
.setDescription("The application name to be used. Default is 'NoSQLBench'."))
|
||||||
.add(Param.optional("initializationFailTimeout").setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. This property is not exposed and hence cannot be changed."))
|
.add(Param.optional("rewriteBatchedInserts")
|
||||||
.add(Param.optional("isolateInternalQueries").setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. This property is not exposed and hence cannot be changed."))
|
.setDescription("This will change batch inserts from insert into foo (col1, col2, col3) values (1, 2, 3) into insert into foo (col1, col2, col3) values (1, 2, 3), (4, 5, 6) this provides 2-3x performance improvement. " +
|
||||||
.add(Param.optional("allowPoolSuspension").setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. This property is not exposed and hence cannot be changed."))
|
"Default is true"))
|
||||||
.add(Param.optional("readOnly").setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. This property is not exposed and hence cannot be changed."))
|
.add(Param.optional("autoCommit")
|
||||||
.add(Param.optional("registerMbeans").setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. This property is not exposed and hence cannot be changed."))
|
.setDescription("This property controls the default auto-commit behavior of connections returned from the pool. " +
|
||||||
.add(Param.optional("catalog").setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. This property is not exposed and hence cannot be changed."))
|
"It is a boolean value. Default: false. This cannot be changed."))
|
||||||
.add(Param.optional("connectionInitSql").setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. This property is not exposed and hence cannot be changed."))
|
.add(Param.optional("connectionTimeout")
|
||||||
.add(Param.optional("driverClassName").setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. This property is not exposed and hence cannot be changed."))
|
.setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. " +
|
||||||
.add(Param.optional("transactionIsolation").setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. This property is not exposed and hence cannot be changed."))
|
"This property is not exposed and hence cannot be changed."))
|
||||||
.add(Param.optional("validationTimeout").setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. This property is not exposed and hence cannot be changed."))
|
.add(Param.optional("idleTimeout")
|
||||||
.add(Param.optional("leakDetectionThreshold").setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. This property is not exposed and hence cannot be changed."))
|
.setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. " +
|
||||||
.add(Param.optional("dataSource").setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. This property is not exposed and hence cannot be changed."))
|
"This property is not exposed and hence cannot be changed."))
|
||||||
.add(Param.optional("schema").setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. This property is not exposed and hence cannot be changed."))
|
.add(Param.defaultTo("keepaliveTime", "150000")
|
||||||
.add(Param.optional("threadFactory").setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. This property is not exposed and hence cannot be changed."))
|
.setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. " +
|
||||||
.add(Param.optional("scheduledExecutor").setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. This property is not exposed and hence cannot be changed."))
|
"This property is not exposed and hence cannot be changed."))
|
||||||
|
.add(Param.optional("maxLifetime")
|
||||||
|
.setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. " +
|
||||||
|
"This property is not exposed and hence cannot be changed."))
|
||||||
|
.add(Param.optional("connectionTestQuery")
|
||||||
|
.setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. " +
|
||||||
|
"This property is not exposed and hence cannot be changed."))
|
||||||
|
.add(Param.optional("minimumIdle")
|
||||||
|
.setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. " +
|
||||||
|
"This property is not exposed and hence cannot be changed."))
|
||||||
|
.add(Param.defaultTo("maximumPoolSize", "40")
|
||||||
|
.setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. Default value is 40 and cannot be changed."))
|
||||||
|
.add(Param.optional("metricRegistry")
|
||||||
|
.setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. " +
|
||||||
|
"This property is not exposed and hence cannot be changed."))
|
||||||
|
.add(Param.optional("healthCheckRegistry")
|
||||||
|
.setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. " +
|
||||||
|
"This property is not exposed and hence cannot be changed."))
|
||||||
|
.add(Param.optional("poolName")
|
||||||
|
.setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. " +
|
||||||
|
"This property is not exposed and hence cannot be changed."))
|
||||||
|
.add(Param.optional("initializationFailTimeout")
|
||||||
|
.setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. " +
|
||||||
|
"This property is not exposed and hence cannot be changed."))
|
||||||
|
.add(Param.optional("isolateInternalQueries")
|
||||||
|
.setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. " +
|
||||||
|
"This property is not exposed and hence cannot be changed."))
|
||||||
|
.add(Param.optional("allowPoolSuspension")
|
||||||
|
.setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. " +
|
||||||
|
"This property is not exposed and hence cannot be changed."))
|
||||||
|
.add(Param.optional("readOnly")
|
||||||
|
.setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. " +
|
||||||
|
"This property is not exposed and hence cannot be changed."))
|
||||||
|
.add(Param.optional("registerMbeans")
|
||||||
|
.setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. " +
|
||||||
|
"This property is not exposed and hence cannot be changed."))
|
||||||
|
.add(Param.optional("catalog")
|
||||||
|
.setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. " +
|
||||||
|
"This property is not exposed and hence cannot be changed."))
|
||||||
|
.add(Param.optional("connectionInitSql")
|
||||||
|
.setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. " +
|
||||||
|
"This property is not exposed and hence cannot be changed."))
|
||||||
|
.add(Param.optional("driverClassName")
|
||||||
|
.setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. " +
|
||||||
|
"This property is not exposed and hence cannot be changed."))
|
||||||
|
.add(Param.optional("transactionIsolation")
|
||||||
|
.setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. " +
|
||||||
|
"This property is not exposed and hence cannot be changed."))
|
||||||
|
.add(Param.optional("validationTimeout")
|
||||||
|
.setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. " +
|
||||||
|
"This property is not exposed and hence cannot be changed."))
|
||||||
|
.add(Param.optional("leakDetectionThreshold")
|
||||||
|
.setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. " +
|
||||||
|
"This property is not exposed and hence cannot be changed."))
|
||||||
|
.add(Param.optional("dataSource")
|
||||||
|
.setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. " +
|
||||||
|
"This property is not exposed and hence cannot be changed."))
|
||||||
|
.add(Param.optional("schema")
|
||||||
|
.setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. " +
|
||||||
|
"This property is not exposed and hence cannot be changed."))
|
||||||
|
.add(Param.optional("threadFactory")
|
||||||
|
.setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. " +
|
||||||
|
"This property is not exposed and hence cannot be changed."))
|
||||||
|
.add(Param.optional("scheduledExecutor")
|
||||||
|
.setDescription("See https://github.com/brettwooldridge/HikariCP/tree/dev#gear-configuration-knobs-baby for details. " +
|
||||||
|
"This property is not exposed and hence cannot be changed."))
|
||||||
.asReadOnly();
|
.asReadOnly();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ blocks:
|
|||||||
params:
|
params:
|
||||||
ops:
|
ops:
|
||||||
rampup-insert:
|
rampup-insert:
|
||||||
executeUpdate: |
|
update: |
|
||||||
INSERT INTO TEMPLATE(database,baselines).TEMPLATE(table,keyvalue)
|
INSERT INTO TEMPLATE(database,baselines).TEMPLATE(table,keyvalue)
|
||||||
(key, value) VALUES ({seq_key},{seq_value});
|
(key, value) VALUES ({seq_key},{seq_value});
|
||||||
|
|
||||||
@ -50,13 +50,13 @@ blocks:
|
|||||||
ratio: TEMPLATE(read_ratio,5)
|
ratio: TEMPLATE(read_ratio,5)
|
||||||
ops:
|
ops:
|
||||||
main-select:
|
main-select:
|
||||||
executeQuery: |
|
query: |
|
||||||
SELECT * FROM TEMPLATE(keyspace,baselines).TEMPLATE(table,keyvalue) WHERE key='{rw_key}';
|
SELECT * FROM TEMPLATE(keyspace,baselines).TEMPLATE(table,keyvalue) WHERE key='{rw_key}';
|
||||||
main-write:
|
main-write:
|
||||||
params:
|
params:
|
||||||
ratio: TEMPLATE(write_ratio,5)
|
ratio: TEMPLATE(write_ratio,5)
|
||||||
ops:
|
ops:
|
||||||
main-insert:
|
main-insert:
|
||||||
executeUpdate: |
|
update: |
|
||||||
INSERT INTO TEMPLATE(keyspace,baselines).TEMPLATE(table,keyvalue)
|
INSERT INTO TEMPLATE(keyspace,baselines).TEMPLATE(table,keyvalue)
|
||||||
(key, value) VALUES ('{rw_key}', '{rw_value}');
|
(key, value) VALUES ('{rw_key}', '{rw_value}');
|
||||||
|
@ -88,7 +88,7 @@ blocks:
|
|||||||
params:
|
params:
|
||||||
ops:
|
ops:
|
||||||
rampup-insert:
|
rampup-insert:
|
||||||
executeUpdate: |
|
update: |
|
||||||
INSERT INTO TEMPLATE(keyspace,baselines).TEMPLATE(table,tabular)
|
INSERT INTO TEMPLATE(keyspace,baselines).TEMPLATE(table,tabular)
|
||||||
(part,clust,data0,data1,data2,data3,data4,data5,data6,data7)
|
(part,clust,data0,data1,data2,data3,data4,data5,data6,data7)
|
||||||
VALUES (
|
VALUES (
|
||||||
@ -101,7 +101,7 @@ blocks:
|
|||||||
cl: TEMPLATE(read_cl,LOCAL_QUORUM)
|
cl: TEMPLATE(read_cl,LOCAL_QUORUM)
|
||||||
ops:
|
ops:
|
||||||
verify-select:
|
verify-select:
|
||||||
executeQuery: |
|
query: |
|
||||||
SELECT * FROM TEMPLATE(keyspace,baselines).TEMPLATE(table,tabular)
|
SELECT * FROM TEMPLATE(keyspace,baselines).TEMPLATE(table,tabular)
|
||||||
WHERE part='{part_layout}'
|
WHERE part='{part_layout}'
|
||||||
AND clust='{clust_layout}'
|
AND clust='{clust_layout}'
|
||||||
@ -111,35 +111,35 @@ blocks:
|
|||||||
ratio: TEMPLATE(read_ratio,1)
|
ratio: TEMPLATE(read_ratio,1)
|
||||||
ops:
|
ops:
|
||||||
main-select-all:
|
main-select-all:
|
||||||
executeQuery: |
|
query: |
|
||||||
SELECT * FROM TEMPLATE(keyspace,baselines).TEMPLATE(table,tabular)
|
SELECT * FROM TEMPLATE(keyspace,baselines).TEMPLATE(table,tabular)
|
||||||
WHERE part='{part_read}' LIMIT {limit};
|
WHERE part='{part_read}' LIMIT {limit};
|
||||||
main-select-01:
|
main-select-01:
|
||||||
executeQuery: |
|
query: |
|
||||||
SELECT data0,data1 from TEMPLATE(keyspace,baselines).TEMPLATE(table,tabular)
|
SELECT data0,data1 from TEMPLATE(keyspace,baselines).TEMPLATE(table,tabular)
|
||||||
WHERE part='{part_read}' LIMIT {limit};
|
WHERE part='{part_read}' LIMIT {limit};
|
||||||
main-select-0246:
|
main-select-0246:
|
||||||
executeQuery: |
|
query: |
|
||||||
SELECT data0,data2,data4,data6 FROM TEMPLATE(keyspace,baselines).TEMPLATE(table,tabular)
|
SELECT data0,data2,data4,data6 FROM TEMPLATE(keyspace,baselines).TEMPLATE(table,tabular)
|
||||||
WHERE part='{part_read}' LIMIT {limit};
|
WHERE part='{part_read}' LIMIT {limit};
|
||||||
main-select-1357:
|
main-select-1357:
|
||||||
executeQuery: |
|
query: |
|
||||||
SELECT data1,data3,data5,data7 FROM TEMPLATE(keyspace,baselines).TEMPLATE(table,tabular)
|
SELECT data1,data3,data5,data7 FROM TEMPLATE(keyspace,baselines).TEMPLATE(table,tabular)
|
||||||
WHERE part='{part_read}' LIMIT {limit};
|
WHERE part='{part_read}' LIMIT {limit};
|
||||||
main-select-0123:
|
main-select-0123:
|
||||||
executeQuery: |
|
query: |
|
||||||
SELECT data0,data1,data2,data3 FROM TEMPLATE(keyspace,baselines).TEMPLATE(table,tabular)
|
SELECT data0,data1,data2,data3 FROM TEMPLATE(keyspace,baselines).TEMPLATE(table,tabular)
|
||||||
WHERE part='{part_read}' LIMIT {limit};
|
WHERE part='{part_read}' LIMIT {limit};
|
||||||
main-select-4567:
|
main-select-4567:
|
||||||
executeQuery: |
|
query: |
|
||||||
SELECT data4,data5,data6,data7 FROM TEMPLATE(keyspace,baselines).TEMPLATE(table,tabular)
|
SELECT data4,data5,data6,data7 FROM TEMPLATE(keyspace,baselines).TEMPLATE(table,tabular)
|
||||||
WHERE part='{part_read}' LIMIT {limit};
|
WHERE part='{part_read}' LIMIT {limit};
|
||||||
main-select-67:
|
main-select-67:
|
||||||
executeQuery: |
|
query: |
|
||||||
SELECT data6,data7 FROM TEMPLATE(keyspace,baselines).TEMPLATE(table,tabular)
|
SELECT data6,data7 FROM TEMPLATE(keyspace,baselines).TEMPLATE(table,tabular)
|
||||||
WHERE part='{part_read}' LIMIT {limit};
|
WHERE part='{part_read}' LIMIT {limit};
|
||||||
main-select:
|
main-select:
|
||||||
executeQuery: |
|
query: |
|
||||||
SELECT data0,data1,data2,data3,data4,data5,data6,data7
|
SELECT data0,data1,data2,data3,data4,data5,data6,data7
|
||||||
FROM TEMPLATE(keyspace,baselines).TEMPLATE(table,tabular)
|
FROM TEMPLATE(keyspace,baselines).TEMPLATE(table,tabular)
|
||||||
WHERE part='{part_read}' LIMIT {limit};
|
WHERE part='{part_read}' LIMIT {limit};
|
||||||
@ -148,7 +148,7 @@ blocks:
|
|||||||
ratio: TEMPLATE(write_ratio,8)
|
ratio: TEMPLATE(write_ratio,8)
|
||||||
ops:
|
ops:
|
||||||
main-write:
|
main-write:
|
||||||
executeUpdate: |
|
update: |
|
||||||
INSERT INTO TEMPLATE(keyspace,baselines).TEMPLATE(table,tabular)
|
INSERT INTO TEMPLATE(keyspace,baselines).TEMPLATE(table,tabular)
|
||||||
(part, clust, data0,data1,data2,data3,data4,data5,data6,data7)
|
(part, clust, data0,data1,data2,data3,data4,data5,data6,data7)
|
||||||
VALUES (
|
VALUES (
|
||||||
|
@ -51,7 +51,7 @@ blocks:
|
|||||||
params:
|
params:
|
||||||
ops:
|
ops:
|
||||||
insert-rampup:
|
insert-rampup:
|
||||||
executeUpdate: |
|
update: |
|
||||||
INSERT INTO TEMPLATE(keyspace,baselines).TEMPLATE(table,iot)
|
INSERT INTO TEMPLATE(keyspace,baselines).TEMPLATE(table,iot)
|
||||||
(machine_id, sensor_name, time, sensor_value, station_id, data)
|
(machine_id, sensor_name, time, sensor_value, station_id, data)
|
||||||
VALUES (
|
VALUES (
|
||||||
@ -65,7 +65,7 @@ blocks:
|
|||||||
ratio: TEMPLATE(read_ratio,1)
|
ratio: TEMPLATE(read_ratio,1)
|
||||||
ops:
|
ops:
|
||||||
select-read:
|
select-read:
|
||||||
executeQuery: |
|
query: |
|
||||||
SELECT * FROM TEMPLATE(keyspace,baselines).TEMPLATE(table,iot)
|
SELECT * FROM TEMPLATE(keyspace,baselines).TEMPLATE(table,iot)
|
||||||
WHERE machine_id='{machine_id}' and sensor_name='{sensor_name}'
|
WHERE machine_id='{machine_id}' and sensor_name='{sensor_name}'
|
||||||
LIMIT TEMPLATE(limit,10);
|
LIMIT TEMPLATE(limit,10);
|
||||||
@ -74,7 +74,7 @@ blocks:
|
|||||||
ratio: TEMPLATE(write_ratio,9)
|
ratio: TEMPLATE(write_ratio,9)
|
||||||
ops:
|
ops:
|
||||||
insert-main:
|
insert-main:
|
||||||
executeUpdate: |
|
update: |
|
||||||
INSERT INTO TEMPLATE(keyspace,baselines).TEMPLATE(table,iot)
|
INSERT INTO TEMPLATE(keyspace,baselines).TEMPLATE(table,iot)
|
||||||
(machine_id, sensor_name, time, sensor_value, station_id, data)
|
(machine_id, sensor_name, time, sensor_value, station_id, data)
|
||||||
VALUES (
|
VALUES (
|
||||||
|
@ -19,10 +19,32 @@ Other NB engine parameters are straight forward:
|
|||||||
* `<nb_cmd>`: is `./nb` (using binary) or the `java -jar nb5.jar`.
|
* `<nb_cmd>`: is `./nb` (using binary) or the `java -jar nb5.jar`.
|
||||||
|
|
||||||
# Configuration
|
# Configuration
|
||||||
There are the below main configuratios with which we could issue a query and process the results back based on the [PostgreSQL® Query](https://jdbc.postgresql.org/documentation/query/) pattern.
|
These are the main configurations with which we could issue a query and process the results back based on the [PostgreSQL® Query](https://jdbc.postgresql.org/documentation/query/) pattern.
|
||||||
## Config Sources
|
## Config Sources
|
||||||
* `execute`: This is to issue any DDL statements such `CREATE DATABASE|TABLE` or `DROP DATABASE|TABLE` operations which returns nothing.
|
* `execute`: This is to issue any DDL statements such `CREATE DATABASE|TABLE` or `DROP DATABASE|TABLE` operations which returns nothing.
|
||||||
* `executeQuery`: This is to issue DML statement such as `SELECT` operation which would return a `ResultSet` object to process.
|
* `query`: This is to issue DML statement such as `SELECT` operation which would return a `ResultSet` object to process.
|
||||||
* `executeUpdate`: This is to issue DML statements such as `INSERT|UPDATE|DELETE` operations that will return how many number of rows were affected by that operation.
|
* `update`: This is to issue DML statements such as `INSERT|UPDATE|DELETE` operations that will return how many number of rows were affected by that operation.
|
||||||
|
|
||||||
|
## Statement Forms
|
||||||
|
The syntax for specifying these types is simplified as well, using only a single `type` field which allows values of `execute`, `query`, & `update`
|
||||||
|
and specifying the raw statements in the `stmt`. Alternatively, one could directly use one of the types and provide the raw query directly.
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
Check out the default activities under the [activities.baselinesv2](./activities.baselinesv2) directory.
|
Check out the default activities under the [activities.baselinesv2](./activities.baselinesv2) directory.
|
||||||
|
#### Op Template Examples
|
||||||
|
````yaml
|
||||||
|
ops:
|
||||||
|
drop-database:
|
||||||
|
type: execute
|
||||||
|
stmt: |
|
||||||
|
DROP DATABASE IF EXISTS TEMPLATE(database,baselines);
|
||||||
|
create-table:
|
||||||
|
execute: |
|
||||||
|
CREATE TABLE IF NOT EXISTS TEMPLATE(database,baselines).TEMPLATE(table,keyvalue);
|
||||||
|
select-table:
|
||||||
|
query: |
|
||||||
|
SELECT one, two, three FROM TEMPLATE(database,baselines).TEMPLATE(table,keyvalue) WHERE ...;
|
||||||
|
insert-table:
|
||||||
|
update: |
|
||||||
|
UPDATE TABLE TEMPLATE(database,baselines).TEMPLATE(table,keyvalue) SET key = 'value' WHERE ...;
|
||||||
|
````
|
||||||
|
Loading…
Reference in New Issue
Block a user