From 7204ab42623830667aca1da19a1cfbfbdd200b4f Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Thu, 19 Jan 2023 16:41:07 -0600 Subject: [PATCH 01/67] bump sqlserver jdbc version - see also PR #231 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f91c2054b..5b5563530 100644 --- a/pom.xml +++ b/pom.xml @@ -134,7 +134,7 @@ com.microsoft.sqlserver mssql-jdbc - 10.2.0.jre17 + 11.2.0.jre17 From f55d7a61050ae5586670631b98689a2df16db9bb Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Thu, 19 Jan 2023 17:43:38 -0600 Subject: [PATCH 02/67] Initial work on SqlServer monitor tweaks --- pom.xml | 5 + src/main/java/com/oltpbenchmark/Phase.java | 7 +- .../java/com/oltpbenchmark/ThreadBench.java | 74 +- .../monitoring/DatabaseMonitor.java | 284 ++ .../api/collectors/monitoring/Monitor.java | 62 + .../api/collectors/monitoring/MonitorGen.java | 21 + .../monitoring/PostgreSQLMonitor.java | 251 ++ .../monitoring/SQLServerMonitor.java | 555 ++++ .../collectors/monitoring/proto/LongType.java | 478 ++++ .../collectors/monitoring/proto/Monitor.java | 199 ++ .../monitoring/proto/PerfEvent.java | 1572 +++++++++++ .../monitoring/proto/PerfEventLog.java | 780 ++++++ .../proto/PerfEventLogOrBuilder.java | 33 + .../monitoring/proto/PerfEventOrBuilder.java | 48 + .../monitoring/proto/QueryEvent.java | 2308 +++++++++++++++++ .../monitoring/proto/QueryEventLog.java | 780 ++++++ .../proto/QueryEventLogOrBuilder.java | 33 + .../monitoring/proto/QueryEventOrBuilder.java | 65 + .../monitoring/proto/QueryInfo.java | 2113 +++++++++++++++ .../monitoring/proto/QueryInfoLog.java | 780 ++++++ .../proto/QueryInfoLogOrBuilder.java | 33 + .../monitoring/proto/QueryInfoOrBuilder.java | 50 + .../monitoring/proto/StringType.java | 136 + .../collectors/monitoring/proto/monitor.proto | 132 + .../benchmarks/tpcc/procedures/Delivery.java | 7 + .../benchmarks/tpcc/procedures/NewOrder.java | 10 + .../tpcc/procedures/OrderStatus.java | 4 + .../benchmarks/tpcc/procedures/Payment.java | 10 + .../tpcc/procedures/StockLevel.java | 2 + .../benchmarks/tpch/TPCHWorker.java | 4 + .../benchmarks/tpch/procedures/Q1.java | 1 + .../benchmarks/tpch/procedures/Q10.java | 1 + .../benchmarks/tpch/procedures/Q11.java | 1 + .../benchmarks/tpch/procedures/Q12.java | 1 + .../benchmarks/tpch/procedures/Q13.java | 1 + .../benchmarks/tpch/procedures/Q14.java | 1 + .../benchmarks/tpch/procedures/Q15.java | 1 + .../benchmarks/tpch/procedures/Q16.java | 1 + .../benchmarks/tpch/procedures/Q17.java | 1 + .../benchmarks/tpch/procedures/Q18.java | 1 + .../benchmarks/tpch/procedures/Q19.java | 1 + .../benchmarks/tpch/procedures/Q2.java | 1 + .../benchmarks/tpch/procedures/Q20.java | 1 + .../benchmarks/tpch/procedures/Q21.java | 1 + .../benchmarks/tpch/procedures/Q22.java | 1 + .../benchmarks/tpch/procedures/Q3.java | 1 + .../benchmarks/tpch/procedures/Q4.java | 1 + .../benchmarks/tpch/procedures/Q5.java | 1 + .../benchmarks/tpch/procedures/Q6.java | 1 + .../benchmarks/tpch/procedures/Q7.java | 1 + .../benchmarks/tpch/procedures/Q8.java | 1 + .../benchmarks/tpch/procedures/Q9.java | 1 + .../twitter/procedures/GetFollowers.java | 6 +- .../twitter/procedures/GetTweet.java | 1 + .../procedures/GetTweetsFromFollowing.java | 4 +- .../twitter/procedures/GetUserTweets.java | 2 +- .../twitter/procedures/InsertTweet.java | 2 +- .../benchmarks/tpcc/dialect-sqlserver.xml | 4 + .../benchmarks/tpch/dialect-postgres.xml | 11 + .../benchmarks/tpch/dialect-sqlserver.xml | 19 +- .../benchmarks/twitter/dialect-sqlserver.xml | 10 +- 61 files changed, 10859 insertions(+), 58 deletions(-) create mode 100644 src/main/java/com/oltpbenchmark/api/collectors/monitoring/DatabaseMonitor.java create mode 100644 src/main/java/com/oltpbenchmark/api/collectors/monitoring/Monitor.java create mode 100644 src/main/java/com/oltpbenchmark/api/collectors/monitoring/MonitorGen.java create mode 100644 src/main/java/com/oltpbenchmark/api/collectors/monitoring/PostgreSQLMonitor.java create mode 100644 src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java create mode 100644 src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/LongType.java create mode 100644 src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/Monitor.java create mode 100644 src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/PerfEvent.java create mode 100644 src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/PerfEventLog.java create mode 100644 src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/PerfEventLogOrBuilder.java create mode 100644 src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/PerfEventOrBuilder.java create mode 100644 src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryEvent.java create mode 100644 src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryEventLog.java create mode 100644 src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryEventLogOrBuilder.java create mode 100644 src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryEventOrBuilder.java create mode 100644 src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryInfo.java create mode 100644 src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryInfoLog.java create mode 100644 src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryInfoLogOrBuilder.java create mode 100644 src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryInfoOrBuilder.java create mode 100644 src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/StringType.java create mode 100644 src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/monitor.proto diff --git a/pom.xml b/pom.xml index 5b5563530..93fbe4349 100644 --- a/pom.xml +++ b/pom.xml @@ -226,6 +226,11 @@ test + + com.google.protobuf + protobuf-java + 3.19.4 + diff --git a/src/main/java/com/oltpbenchmark/Phase.java b/src/main/java/com/oltpbenchmark/Phase.java index d4da78bba..951658382 100644 --- a/src/main/java/com/oltpbenchmark/Phase.java +++ b/src/main/java/com/oltpbenchmark/Phase.java @@ -19,11 +19,16 @@ import com.oltpbenchmark.util.StringUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.util.ArrayList; import java.util.List; import java.util.Random; public class Phase { + private static final Logger LOG = LoggerFactory.getLogger(Phase.class); + public enum Arrival { REGULAR, POISSON, } @@ -221,4 +226,4 @@ public String currentPhaseString() { return StringUtil.bold("PHASE START") + " :: " + StringUtil.join(" ", inner); } -} \ No newline at end of file +} diff --git a/src/main/java/com/oltpbenchmark/ThreadBench.java b/src/main/java/com/oltpbenchmark/ThreadBench.java index 2c143a65d..d1dd1d516 100644 --- a/src/main/java/com/oltpbenchmark/ThreadBench.java +++ b/src/main/java/com/oltpbenchmark/ThreadBench.java @@ -21,6 +21,8 @@ import com.oltpbenchmark.api.BenchmarkModule; import com.oltpbenchmark.api.TransactionType; import com.oltpbenchmark.api.Worker; +import com.oltpbenchmark.api.collectors.monitoring.Monitor; +import com.oltpbenchmark.api.collectors.monitoring.MonitorGen; import com.oltpbenchmark.types.State; import com.oltpbenchmark.util.StringUtil; import org.apache.commons.collections4.map.ListOrderedMap; @@ -39,6 +41,8 @@ public class ThreadBench implements Thread.UncaughtExceptionHandler { private final ArrayList samples = new ArrayList<>(); private final int intervalMonitor; + private Monitor monitor = null; + private ThreadBench(List> workers, List workConfs, int intervalMonitoring) { this.workers = workers; @@ -111,17 +115,11 @@ private Results runRateLimitedMultiPhase() { this.createWorkerThreads(); - // long measureStart = start; + Phase phase = null; - long start = System.nanoTime(); - long warmupStart = System.nanoTime(); - long warmup = warmupStart; - long measureEnd = -1; // used to determine the longest sleep interval int lowestRate = Integer.MAX_VALUE; - Phase phase = null; - for (WorkloadState workState : workStates) { workState.switchToNextPhase(); phase = workState.getCurrentPhase(); @@ -140,6 +138,11 @@ private Results runRateLimitedMultiPhase() { } } + long start = System.nanoTime(); + long warmupStart = System.nanoTime(); + long warmup = warmupStart; + long measureEnd = -1; + long intervalNs = getInterval(lowestRate, phase.getArrival()); long nextInterval = start + intervalNs; @@ -153,7 +156,9 @@ private Results runRateLimitedMultiPhase() { // Initialize the Monitor if (this.intervalMonitor > 0) { - new MonitorThread(this.intervalMonitor).start(); + this.monitor = MonitorGen.getMonitor( + this.intervalMonitor, this.testState, this.workers, this.workConfs.get(0)); + this.monitor.start(); } // Allow workers to start work. @@ -294,6 +299,20 @@ private Results runRateLimitedMultiPhase() { } } + // Stop the monitoring thread separately from cleanup all the workers so + // we can ignore errors from these threads (including possible + // SQLExceptions), but not the others. + try { + if (this.monitor != null) { + this.monitor.interrupt(); + this.monitor.join(60000); // wait for 60second for monitor thread to rejoin + this.monitor.tearDown(); + } + } + catch (Exception e) { + LOG.error(e.getMessage(), e); + } + try { int requests = finalizeWorkers(this.workerThreads); @@ -504,43 +523,4 @@ public void run() { } } } - - private class MonitorThread extends Thread { - private final int intervalMonitor; - - { - this.setDaemon(true); - } - - /** - * @param interval How long to wait between polling in milliseconds - */ - MonitorThread(int interval) { - this.intervalMonitor = interval; - } - - @Override - public void run() { - LOG.info("Starting MonitorThread Interval [{}ms]", this.intervalMonitor); - while (true) { - try { - Thread.sleep(this.intervalMonitor); - } catch (InterruptedException ex) { - return; - } - - // Compute the last throughput - long measuredRequests = 0; - synchronized (testState) { - for (Worker w : workers) { - measuredRequests += w.getAndResetIntervalRequests(); - } - } - double seconds = this.intervalMonitor / 1000d; - double tps = (double) measuredRequests / seconds; - LOG.info("Throughput: {} txn/sec", tps); - } - } - } - } diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/DatabaseMonitor.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/DatabaseMonitor.java new file mode 100644 index 000000000..96a9b4f4e --- /dev/null +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/DatabaseMonitor.java @@ -0,0 +1,284 @@ +package com.oltpbenchmark.api.collectors.monitoring; + +import java.io.FileOutputStream; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; +import java.util.List; + +import com.oltpbenchmark.BenchmarkState; +import com.oltpbenchmark.WorkloadConfiguration; +import com.oltpbenchmark.api.BenchmarkModule; +import com.oltpbenchmark.api.Worker; +import com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog; +import com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog; +import com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog; +import com.oltpbenchmark.util.FileUtil; +import com.oltpbenchmark.util.SQLUtil; + +import org.apache.commons.lang3.StringUtils; + +public abstract class DatabaseMonitor extends Monitor { + protected enum DatabaseState { + READY, INVALID, TEST + }; + + protected DatabaseState currentState = DatabaseState.INVALID; + protected String OUTPUT_DIR = "results/monitor"; + protected String CSV_DELIMITER = ","; + protected int fileCounter = 1; + protected final int fileTimeDiff; + + protected WorkloadConfiguration conf; + protected Connection conn; + protected final QueryEventLog.Builder queryEventLogBuilder; + protected final PerfEventLog.Builder perfEventLogBuilder; + protected final QueryInfoLog.Builder queryInfoLogBuilder; + + /** + * Builds the connection to the DBMS using the same connection details as + * the benchmarking environment. + * + * @param conf + * @return + * @throws SQLException + */ + private final Connection makeConnection() throws SQLException { + if (StringUtils.isEmpty(conf.getUsername())) { + return DriverManager.getConnection(conf.getUrl()); + } else { + return DriverManager.getConnection( + conf.getUrl(), + conf.getUsername(), + conf.getPassword()); + } + } + + /** + * Convenience function to try and reconnect if the connection had failed. + * + * Note: since these are read-only queries, in some clustered environments, + * its possible that we make a connection to stale primary if there's a race + * between a failover event and the connection. + * In that case, we may be reading the metrics from the wrong server. + * There isn't a great solution to this without periodically disconnecting, + * which can cause it's own overheads. + */ + protected void checkForReconnect() { + try { + if (!this.conf.getNewConnectionPerTxn() && this.conn != null) { + this.conn.close(); + this.conn = null; + } + else if (conn != null && conn.isClosed()) { + conn = null; + } + } + catch (SQLException sqlError) { + LOG.error(sqlError.getMessage(), sqlError); + conn = null; + } + + if (conn == null) { + try { + conn = makeConnection(); + } + catch (SQLException sqlError) { + LOG.error(sqlError.getMessage(), sqlError); + conn = null; + } + } + } + + protected void handleSQLConnectionException(SQLException sqlError) { + if (this.conf.getReconnectOnConnectionFailure() && SQLUtil.isConnectionErrorException(sqlError)) { + // reset the connection to null so the checkForReconnect() call can manage it + this.conn = null; + } + } + + + /** + * Constructor, set all final parameters and initialize connection. + * + * @param interval + * @param testState + * @param workers + * @param workloadConf + */ + public DatabaseMonitor( + int interval, BenchmarkState testState, + List> workers, WorkloadConfiguration workloadConf) { + super(interval, testState, workers); + + try { + this.conf = workloadConf; + this.conn = makeConnection(); + } catch (SQLException e) { + this.conn = null; + LOG.error("Could not initialize connection to create DatabaseMonitor."); + LOG.error(e.getMessage()); + } + + FileUtil.makeDirIfNotExists(OUTPUT_DIR); + // Write to file every ~10mins as back-up. + fileTimeDiff = 600000 / this.intervalMonitor; + + // Init output proto builders. + this.queryEventLogBuilder = QueryEventLog.newBuilder(); + this.perfEventLogBuilder = PerfEventLog.newBuilder(); + this.queryInfoLogBuilder = QueryInfoLog.newBuilder(); + + LOG.info("Initialized DatabaseMonitor."); + } + + /** + * Util to write query event log to file. + */ + protected void writeQueryEventLog() { + String filePath = FileUtil.joinPath( + OUTPUT_DIR, "query_event_log_" + fileCounter + ".proto"); + + try { + if (Files.deleteIfExists(Paths.get(filePath))) { + LOG.warn("File at " + filePath + " deleted before writing query event log."); + } + + FileOutputStream out = new FileOutputStream(filePath); + queryEventLogBuilder.build().writeTo(out); + out.close(); + LOG.info("Query event log written to " + filePath); + } catch (IOException e) { + LOG.error("Error when writing query event log to file."); + LOG.error(e.getMessage()); + } + } + + /** + * Util to write performance event log to file. + */ + protected void writePerfEventLog() { + String filePath = FileUtil.joinPath( + OUTPUT_DIR, "perf_event_log_" + fileCounter + ".proto"); + + try { + if (Files.deleteIfExists(Paths.get(filePath))) { + LOG.warn("File at " + filePath + " deleted before writing perf event log."); + } + + FileOutputStream out = new FileOutputStream(filePath); + perfEventLogBuilder.build().writeTo(out); + out.close(); + LOG.info("Perf event log written to " + filePath); + } catch (IOException e) { + LOG.error("Error when writing perf event log to file."); + LOG.error(e.getMessage()); + } + } + + /** + * Util to write query info log to file. + */ + protected void writeQueryInfoLog() { + String filePath = FileUtil.joinPath( + OUTPUT_DIR, "query_info_log_" + fileCounter + ".proto"); + + try { + if (Files.deleteIfExists(Paths.get(filePath))) { + LOG.warn("File at " + filePath + " deleted before writing query info log."); + } + + FileOutputStream out = new FileOutputStream(filePath); + queryInfoLogBuilder.build().writeTo(out); + out.close(); + LOG.info("Query info log written to " + filePath); + } catch (IOException e) { + LOG.error("Error when writing query info log to file."); + LOG.error(e.getMessage()); + } + } + + /** + * DBMS-specific cache cleaning process. + */ + protected abstract void cleanupCache(); + + /** + * Execute the extraction of desired query and performance metrics. + */ + protected abstract void runExtraction(); + + /** + * Write proto builders to file. + */ + protected abstract void writeLogs(); + + /** + * Consolidate protos that have been written to file and currently pending. + * Write to a common output file. + */ + protected abstract void finalizeLogs(); + + /** + * Consolidate protos that have been written to file and currently pending. + * Write to a common output file. + */ + protected abstract void writeToCSV(); + + /** + * Run monitor. Clean up cache first and do initial extraction, then sleep + * as defined by the interval. Per periodic waking phase, extract metrics + * and potentially write to file (currently every ~10mins by default). After + * execution has finished, consolidate logs and clean up cache again. + */ + @Override + public void run() { + LOG.info("Starting Monitor Interval [{}ms]", this.intervalMonitor); + + // Make sure we record one event during setup. + if (this.conn != null) { + cleanupCache(); + runExtraction(); + } + // Periodically extract sys table stats. + while (!Thread.currentThread().isInterrupted()) { + try { + Thread.sleep(this.intervalMonitor); + } catch (InterruptedException ex) { + // Restore interrupt flag. + Thread.currentThread().interrupt(); + } + if (this.conn != null) { + runExtraction(); + } + if (fileCounter % fileTimeDiff == 0) { + writeLogs(); + } + fileCounter++; + } + + if (this.conn != null) { + cleanupCache(); + } + + finalizeLogs(); + } + + /** + * Called at the end of the test to do any clean up that may be required. + */ + @Override + public void tearDown() { + if (this.conn != null) { + try { + conn.close(); + } catch (SQLException e) { + LOG.error("Connection couldn't be closed.", e); + } + this.conn = null; + } + } +} diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/Monitor.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/Monitor.java new file mode 100644 index 000000000..810939f76 --- /dev/null +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/Monitor.java @@ -0,0 +1,62 @@ +package com.oltpbenchmark.api.collectors.monitoring; + +import java.util.List; + +import com.oltpbenchmark.BenchmarkState; +import com.oltpbenchmark.api.BenchmarkModule; +import com.oltpbenchmark.api.Worker; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class Monitor extends Thread { + protected static final Logger LOG = LoggerFactory.getLogger(DatabaseMonitor.class); + + protected final int intervalMonitor; + protected final BenchmarkState testState; + protected final List> workers; + + { + this.setDaemon(true); + } + + /** + * @param interval How long to wait between polling in milliseconds + */ + Monitor(int interval, BenchmarkState testState, List> workers) { + this.intervalMonitor = interval; + this.testState = testState; + this.workers = workers; + } + + @Override + public void run() { + LOG.info("Starting MonitorThread Interval [{}ms]", this.intervalMonitor); + while (!Thread.currentThread().isInterrupted()) { + // Compute the last throughput + long measuredRequests = 0; + synchronized (this.testState) { + for (Worker w : this.workers) { + measuredRequests += w.getAndResetIntervalRequests(); + } + } + double seconds = this.intervalMonitor / 1000d; + double tps = (double) measuredRequests / seconds; + LOG.info("Throughput: {} txn/sec", tps); + + try { + Thread.sleep(this.intervalMonitor); + } catch (InterruptedException ex) { + // Restore interrupt flag. + Thread.currentThread().interrupt(); + } + } + } + + /** + * Called at the end of the test to do any clean up that may be required. + */ + public void tearDown() { + // nothing to do here + } +} \ No newline at end of file diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/MonitorGen.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/MonitorGen.java new file mode 100644 index 000000000..153c210bc --- /dev/null +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/MonitorGen.java @@ -0,0 +1,21 @@ +package com.oltpbenchmark.api.collectors.monitoring; + +import java.util.List; + +import com.oltpbenchmark.BenchmarkState; +import com.oltpbenchmark.WorkloadConfiguration; +import com.oltpbenchmark.api.BenchmarkModule; +import com.oltpbenchmark.api.Worker; + +public class MonitorGen { + public static Monitor getMonitor(int interval, BenchmarkState testState, List> workers, WorkloadConfiguration conf) { + switch (conf.getDatabaseType()) { + case SQLSERVER: + return new SQLServerMonitor(interval, testState, workers, conf); + case POSTGRES: + return new PostgreSQLMonitor(interval, testState, workers, conf); + default: + return new Monitor(interval, testState, workers); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/PostgreSQLMonitor.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/PostgreSQLMonitor.java new file mode 100644 index 000000000..806ed2267 --- /dev/null +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/PostgreSQLMonitor.java @@ -0,0 +1,251 @@ +package com.oltpbenchmark.api.collectors.monitoring; + +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.time.Instant; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.regex.Pattern; + +import com.google.protobuf.Timestamp; +import com.oltpbenchmark.BenchmarkState; +import com.oltpbenchmark.WorkloadConfiguration; +import com.oltpbenchmark.api.BenchmarkModule; +import com.oltpbenchmark.api.Worker; +import com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent; +import com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog; +import com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair; +import com.oltpbenchmark.api.collectors.monitoring.proto.LongType; +import com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo; +import com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog; +import com.oltpbenchmark.api.collectors.monitoring.proto.StringType; +import com.oltpbenchmark.util.FileUtil; + +public class PostgreSQLMonitor extends DatabaseMonitor { + + private final String PG_STAT_STATEMENTS = "SELECT " + + "query AS query_text, calls as execution_count, rows, " + + "total_exec_time, min_exec_time, max_exec_time, " + + "shared_blks_read, shared_blks_written, local_blks_read, " + + "local_blks_written, temp_blks_read, temp_blks_written " + + "FROM pg_stat_statements;"; + private final String CLEAN_CACHE = "SELECT pg_stat_statements_reset();"; + private final Map infoQueryTypes; + private final Map eventQueryLongTypes; + private final Map eventQueryAggLongTypes; + + private final Set stored_queries; + + /** + * Constructor, calls super and defines local attribute to proto mapping. + * @param interval + * @param testState + * @param workers + * @param conf + */ + public PostgreSQLMonitor(int interval, BenchmarkState testState, + List> workers, WorkloadConfiguration conf) { + super(interval, testState, workers, conf); + + this.stored_queries = new HashSet(); + + this.infoQueryTypes = new HashMap() { + { + put("query_text", StringType.QUERY_TEXT); + } + }; + + this.eventQueryLongTypes = new HashMap() { + { + put("execution_count", LongType.EXECUTION_COUNT); + put("min_exec_time", LongType.MIN_ELAPSED_TIME); + put("max_exec_time", LongType.MAX_ELAPSED_TIME); + put("total_exec_time", LongType.TOTAL_ELAPSED_TIME); + put("rows", LongType.TOTAL_ROWS); + } + }; + this.eventQueryAggLongTypes = new HashMap() { + { + put(LongType.TOTAL_LOGICAL_WRITES, "written"); + put(LongType.TOTAL_LOGICAL_READS, "read"); + } + }; + } + + /** + * Util to create a string-type query info pair. + */ + private void createStringInfoPair(QueryInfo.Builder infoBuilder, String eventType, String value) { + InfoPair.Builder pair = InfoPair.newBuilder(); + pair.setStringType(this.infoQueryTypes.get(eventType)); + pair.setStringValue(value); + infoBuilder.addInfoPair(pair.build()); + } + + /** + * Util to create a long-type query event pair. + */ + private void createLongQueryEventPair(QueryEvent.Builder eventBuilder, String eventType, Long value) { + QueryEvent.EventPair.Builder pair = QueryEvent.EventPair.newBuilder(); + pair.setLongType(this.eventQueryLongTypes.get(eventType)); + pair.setLongValue(value); + eventBuilder.addEventPair(pair.build()); + } + + /** + * Util for read and write events that are computed as sum of several + * attributes. + */ + private void createLongQueryAggEventPair(QueryEvent.Builder eventBuilder, ResultSet rs) throws SQLException { + QueryEvent.EventPair.Builder pair = QueryEvent.EventPair.newBuilder(); + for (LongType eventType : this.eventQueryAggLongTypes.keySet()) { + pair.setLongType(eventType); + pair.setLongValue(rs.getLong("shared_blks_" + this.eventQueryAggLongTypes.get(eventType)) + + rs.getLong("local_blks_" + this.eventQueryAggLongTypes.get(eventType)) + + rs.getLong("temp_blks_" + this.eventQueryAggLongTypes.get(eventType))); + } + eventBuilder.addEventPair(pair.build()); + } + + /** + * Extract query specific metrics such as CPU worker time, elapsed time, + * etc. Also computes query info events if plan has not been observed + * previously. + * @param timestamp + */ + private void extractQueryMetrics(Timestamp timestamp) { + QueryEvent.Builder eventBuilder; + QueryInfo.Builder infoBuilder; + checkForReconnect(); + try (PreparedStatement stmt = conn.prepareStatement(PG_STAT_STATEMENTS)) { + ResultSet rs = stmt.executeQuery(); + while (rs.next()) { + // Only store those queries that have monitoring enabled via a + // comment in the PostgreSQL dialect XML. + String query_text = rs.getString("query_text"); + if (!query_text.contains("/*monitor-")) { + continue; + } + + // Get identifier from commment in query text. + String[] split = query_text.split(Pattern.quote("/*monitor-")); + split = split[1].split(Pattern.quote("*/")); + String identifier = split[0]; + + // Handle one-off query changes, may occur when a plan gets + // executed for the first time. + if (!stored_queries.contains(identifier)) { + stored_queries.add(identifier); + + infoBuilder = QueryInfo.newBuilder().setIdentifier(identifier); + // Add string event types to info log. + for (String eventType : this.infoQueryTypes.keySet()) { + String value = rs.getString(eventType); + if (value != null) { + createStringInfoPair(infoBuilder, eventType, value); + } + } + queryInfoLogBuilder.addInfo(infoBuilder.build()); + } + + // Handle repeated query events. + eventBuilder = QueryEvent.newBuilder().setIdentifier( + identifier).setTimestamp(timestamp); + // Add numeric event types. + for (String eventType : this.eventQueryLongTypes.keySet()) { + createLongQueryEventPair(eventBuilder, eventType, rs.getLong(eventType)); + } + // Add aggregated event types. + createLongQueryAggEventPair(eventBuilder, rs); + // Add to log. + queryEventLogBuilder.addEvent(eventBuilder.build()); + } + } catch (SQLException sqlError) { + LOG.error("Error when extracting per query metrics."); + LOG.error(sqlError.getMessage()); + } + } + + @Override + protected void runExtraction() { + Instant time = Instant.now(); + Timestamp timestamp = Timestamp.newBuilder().setSeconds(time.getEpochSecond()).setNanos(time.getNano()).build(); + + extractQueryMetrics(timestamp); + } + + @Override + protected void cleanupCache() { + checkForReconnect(); + try (PreparedStatement stmt = conn.prepareStatement(CLEAN_CACHE)) { + stmt.execute(); + } catch (SQLException sqlError) { + LOG.error("Error when cleaning up cached plans."); + LOG.error(sqlError.getMessage()); + } + } + + @Override + protected void writeLogs() { + writeQueryEventLog(); + writeQueryInfoLog(); + } + + @Override + protected void finalizeLogs() { + QueryEventLog.Builder finalQueryEventLogBuilder = QueryEventLog.newBuilder(); + QueryInfoLog.Builder finalQueryInfoLogBuilder = QueryInfoLog.newBuilder(); + + try { + for (int i = fileTimeDiff; i <= fileCounter; i += fileTimeDiff) { + // Add query events and remove superfluous file. + String file = FileUtil.joinPath( + OUTPUT_DIR, "query_event_log_" + i + ".proto"); + QueryEventLog query_event_log = QueryEventLog.parseFrom( + new FileInputStream(file)); + finalQueryEventLogBuilder.addAllEvent(query_event_log.getEventList()); + Files.deleteIfExists(Paths.get(file)); + + // Add query infos. + file = FileUtil.joinPath( + OUTPUT_DIR, "query_info_log_" + i + ".proto"); + QueryInfoLog query_info_log = QueryInfoLog.parseFrom( + new FileInputStream(file)); + finalQueryInfoLogBuilder.addAllInfo(query_info_log.getInfoList()); + Files.deleteIfExists(Paths.get(file)); + } + finalQueryEventLogBuilder.addAllEvent(this.queryEventLogBuilder.getEventList()); + finalQueryInfoLogBuilder.addAllInfo(this.queryInfoLogBuilder.getInfoList()); + + // Write to file. + FileOutputStream out = new FileOutputStream(FileUtil.joinPath( + OUTPUT_DIR, "query_event_log.proto")); + finalQueryEventLogBuilder.build().writeTo(out); + out.close(); + + out = new FileOutputStream(FileUtil.joinPath( + OUTPUT_DIR, "query_info_log.proto")); + finalQueryInfoLogBuilder.build().writeTo(out); + out.close(); + + LOG.info("Successfully consolidated logs."); + } catch (IOException e) { + LOG.error("Error when consolidating log files."); + e.printStackTrace(); + } + } + + @Override + protected void writeToCSV() { + LOG.error("Writing to CSV is not currently supported in Postgres."); + } +} diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java new file mode 100644 index 000000000..9c0d4034a --- /dev/null +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java @@ -0,0 +1,555 @@ +package com.oltpbenchmark.api.collectors.monitoring; + +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.PrintWriter; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.time.Instant; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.regex.Pattern; + +import com.google.protobuf.Timestamp; +import com.oltpbenchmark.BenchmarkState; +import com.oltpbenchmark.WorkloadConfiguration; +import com.oltpbenchmark.api.BenchmarkModule; +import com.oltpbenchmark.api.Worker; +import com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent; +import com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog; +import com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair; +import com.oltpbenchmark.api.collectors.monitoring.proto.LongType; +import com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent; +import com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog; +import com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo; +import com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog; +import com.oltpbenchmark.api.collectors.monitoring.proto.StringType; +import com.oltpbenchmark.util.FileUtil; +import com.oltpbenchmark.util.TimeUtil; + + +public class SQLServerMonitor extends DatabaseMonitor { + + private final String DM_EXEC_QUERY_STATS = "SELECT " + + "q.text AS query_text, st.plan_handle, pl.query_plan, " + + "st.execution_count, st.min_worker_time, st.max_worker_time, " + + "st.total_worker_time, st.min_physical_reads, st.max_physical_reads, " + + "st.total_physical_reads, st.min_elapsed_time, st.max_elapsed_time, " + + "st.total_elapsed_time, st.total_rows, st.min_rows, st.max_rows, " + + "st.min_spills, st.max_spills, st.total_spills, " + + "st.min_logical_writes, st.max_logical_writes, st.total_logical_writes, " + + "st.min_logical_reads, st.max_logical_reads, st.total_logical_reads, " + + "st.min_used_grant_kb, st.max_used_grant_kb, st.total_used_grant_kb, " + + "st.min_used_threads, st.max_used_threads, st.total_used_threads " + + "FROM sys.dm_exec_query_stats st " + + "CROSS APPLY sys.dm_exec_sql_text(st.plan_handle) q " + + "CROSS APPLY sys.dm_exec_query_plan(st.plan_handle) pl"; + private final String DM_OS_PERFORMANCE_STATS = "SELECT cntr_value, " + + "counter_name FROM sys.dm_os_performance_counters WHERE " + + "instance_name='default';"; + private final String DM_LOCK_STATS = "SELECT info.ms_ticks, " + + "counters.cntr_value, counters.counter_name FROM (SELECT " + + "cntr_value, counter_name FROM sys.dm_os_performance_counters " + + "WHERE object_name LIKE '%Locks%' AND instance_name='_Total') " + + "counters, (SELECT ms_ticks FROM sys.dm_os_sys_info) info"; + private final String CLEAN_CACHE = "DBCC FREEPROCCACHE;"; + private final Map infoQueryTypes; + private final Map eventQueryLongTypes; + private final Map eventQueryStringTypes; + private final Map eventPerfOSTypes; + private final Map eventPerfLockTypes; + + private final Set cached_plans; + + /** + * Constructor, calls super and defines local attribute to proto mapping. + * + * @param interval + * @param testState + * @param workers + * @param conf + */ + public SQLServerMonitor(int interval, BenchmarkState testState, + List> workers, WorkloadConfiguration conf) { + super(interval, testState, workers, conf); + + this.cached_plans = new HashSet(); + + this.infoQueryTypes = new HashMap() { + { + put("query_plan", StringType.QUERY_PLAN); + put("query_text", StringType.QUERY_TEXT); + put("plan_handle", StringType.PLAN_HANDLE); + } + }; + + this.eventQueryLongTypes = new HashMap() { + { + put("execution_count", LongType.EXECUTION_COUNT); + put("min_worker_time", LongType.MIN_WORKER_TIME); + put("max_worker_time", LongType.MAX_WORKER_TIME); + put("total_worker_time", LongType.TOTAL_WORKER_TIME); + put("min_physical_reads", LongType.MIN_PHYSICAL_READS); + put("max_physical_reads", LongType.MAX_PHYSICAL_READS); + put("total_physical_reads", LongType.TOTAL_PHYSICAL_READS); + put("min_elapsed_time", LongType.MIN_ELAPSED_TIME); + put("max_elapsed_time", LongType.MAX_ELAPSED_TIME); + put("total_elapsed_time", LongType.TOTAL_ELAPSED_TIME); + put("min_rows", LongType.MIN_ROWS); + put("max_rows", LongType.MAX_ROWS); + put("total_rows", LongType.TOTAL_ROWS); + put("min_spills", LongType.MIN_SPILLS); + put("max_spills", LongType.MAX_SPILLS); + put("total_spills", LongType.TOTAL_SPILLS); + put("min_logical_writes", LongType.MIN_LOGICAL_WRITES); + put("max_logical_writes", LongType.MAX_LOGICAL_WRITES); + put("total_logical_writes", LongType.TOTAL_LOGICAL_WRITES); + put("min_logical_reads", LongType.MIN_LOGICAL_READS); + put("max_logical_reads", LongType.MAX_LOGICAL_READS); + put("total_logical_reads", LongType.TOTAL_LOGICAL_READS); + put("min_used_grant_kb", LongType.MIN_USED_GRANT_KB); + put("max_used_grant_kb", LongType.MAX_USED_GRANT_KB); + put("total_used_grant_kb", LongType.TOTAL_USED_GRANT_KB); + put("min_used_threads", LongType.MIN_USED_THREADS); + put("max_used_threads", LongType.MAX_USED_THREADS); + put("total_used_threads", LongType.TOTAL_USED_THREADS); + } + }; + this.eventQueryStringTypes = new HashMap() { + { + put("plan_handle", StringType.PLAN_HANDLE); + } + }; + + this.eventPerfOSTypes = new HashMap() { + { + put("Used memory (KB)", LongType.USED_MEMORY); + put("Target memory (KB)", LongType.TARGET_MEMORY); + put("CPU usage %", LongType.CPU_USAGE_PERC); + put("CPU effective %", LongType.CPU_EFFECTIVE_PERC); + put("CPU violated %", LongType.CPU_VIOLATED_PERC); + put("CPU usage % base", LongType.CPU_USAGE_PERC_BASE); + put("CPU effective % base", LongType.CPU_EFFECTIVE_PERC_BASE); + put("CPU usage target %", LongType.CPU_USAGE_TARGET_PERC); + put("Disk Read IO/sec", LongType.DISK_READ_IOPS); + put("Disk Write IO/sec", LongType.DISK_WRITE_IOPS); + } + }; + + this.eventPerfLockTypes = new HashMap() { + { + put("Average Wait Time (ms)", LongType.LOCKS_AVG_WAIT_TIME); + put("Average Wait Time Base", LongType.LOCKS_AVG_WAIT_TIME_BASE); + put("Lock Requests/sec", LongType.LOCK_REQUESTS); + } + }; + } + + private Map getPerfCSVMapping() { + Map result = new HashMap(); + + int i = 0; + for (LongType type : this.eventPerfOSTypes.values()) { + result.put(type.toString(), i++); + } + for (LongType type : this.eventPerfLockTypes.values()) { + result.put(type.toString(), i++); + } + result.put("TIMESTAMP", i++); + result.put("MS_TICKS", i++); + return result; + } + + private void writePerfEventLogToCSV(String basePath) { + Map csvMapping = getPerfCSVMapping(); + + PerfEventLog log; + try { + log = PerfEventLog.parseFrom(new FileInputStream(FileUtil.joinPath( + OUTPUT_DIR, "perf_event_log.proto"))); + PrintWriter writer = new PrintWriter(Files.newBufferedWriter( + Paths.get(basePath + "perf_event_log.csv"))); + String[] row = new String[csvMapping.size()]; + for (String key : csvMapping.keySet()) { + row[csvMapping.get(key)] = key; + } + writer.println(String.join(CSV_DELIMITER, row)); + + for (PerfEvent event : log.getEventList()) { + DateTimeFormatter formatter = DateTimeFormatter.ofPattern( + "yyyy.MM.dd-HH:mm:ss:SS").withZone(ZoneId.systemDefault()); + row[csvMapping.get("TIMESTAMP")] = formatter.format( + Instant.ofEpochSecond(event.getTimestamp().getSeconds(), event.getTimestamp().getNanos())); + for (PerfEvent.EventPair pair : event.getEventPairList()) { + row[csvMapping.get(pair.getLongType().toString())] = "" + pair.getLongValue(); + } + writer.println(String.join(CSV_DELIMITER, row)); + } + writer.close(); + } catch (Exception e) { + LOG.error("Error when writing perf event log to csv."); + e.printStackTrace(); + } + } + + private Map getQueryCSVMapping() { + Map result = new HashMap(); + + int i = 0; + for (LongType type : this.eventQueryLongTypes.values()) { + result.put(type.toString(), i++); + } + for (StringType type : this.eventQueryStringTypes.values()) { + result.put(type.toString(), i++); + } + result.put("IDENTIFIER", i++); + result.put("TIMESTAMP", i++); + return result; + } + + private void writeQueryEventLogToCSV(String basePath) { + Map csvMapping = getQueryCSVMapping(); + + QueryEventLog log; + try { + log = QueryEventLog.parseFrom(new FileInputStream(FileUtil.joinPath( + OUTPUT_DIR, "query_event_log.proto"))); + PrintWriter writer = new PrintWriter(Files.newBufferedWriter( + Paths.get(basePath + "query_event_log.csv"))); + String[] row = new String[csvMapping.size()]; + for (String key : csvMapping.keySet()) { + row[csvMapping.get(key)] = key; + } + writer.println(String.join(CSV_DELIMITER, row)); + + for (QueryEvent info : log.getEventList()) { + DateTimeFormatter formatter = DateTimeFormatter.ofPattern( + "yyyy.MM.dd-HH:mm:ss:SS").withZone(ZoneId.systemDefault()); + row[csvMapping.get("TIMESTAMP")] = formatter.format( + Instant.ofEpochSecond(info.getTimestamp().getSeconds(), info.getTimestamp().getNanos())); + row[csvMapping.get("IDENTIFIER")] = info.getIdentifier(); + for (QueryEvent.EventPair pair : info.getEventPairList()) { + if (pair.hasLongType()) { + row[csvMapping.get(pair.getLongType().toString())] = "" + pair.getLongValue(); + } else { + row[csvMapping.get(pair.getStringType().toString())] = pair.getStringValue(); + } + } + writer.println(String.join(CSV_DELIMITER, row)); + } + writer.close(); + } catch (Exception e) { + LOG.error("Error when writing query event log to csv."); + e.printStackTrace(); + } + } + + private Map getQueryInfoCSVMapping() { + Map result = new HashMap(); + + int i = 0; + for (StringType type : this.infoQueryTypes.values()) { + result.put(type.toString(), i++); + } + result.put("IDENTIFIER", i++); + return result; + } + + private void writeQueryInfoLogToCSV(String basePath) { + Map csvMapping = getQueryInfoCSVMapping(); + + QueryInfoLog log; + try { + log = QueryInfoLog.parseFrom(new FileInputStream(FileUtil.joinPath( + OUTPUT_DIR, "query_info_log.proto"))); + PrintWriter writer = new PrintWriter(Files.newBufferedWriter( + Paths.get(basePath + "query_info_log.csv"))); + String[] row = new String[csvMapping.size()]; + for (String key : csvMapping.keySet()) { + row[csvMapping.get(key)] = key; + } + writer.println(String.join("||", row)); + + for (QueryInfo info : log.getInfoList()) { + row[csvMapping.get("IDENTIFIER")] = info.getIdentifier(); + for (QueryInfo.InfoPair pair : info.getInfoPairList()) { + row[csvMapping.get(pair.getStringType().toString())] = pair.getStringValue(); + } + writer.println(String.join("||", row)); + } + writer.close(); + } catch (Exception e) { + LOG.error("Error when writing query info log to csv."); + e.printStackTrace(); + } + } + + /** + * Util to create a string-type query info pair. + */ + private void createStringInfoPair(QueryInfo.Builder infoBuilder, String eventType, String value) { + InfoPair.Builder pair = InfoPair.newBuilder(); + pair.setStringType(this.infoQueryTypes.get(eventType)); + pair.setStringValue(value); + infoBuilder.addInfoPair(pair.build()); + } + + /** + * Util to create a long-type query event pair. + */ + private void createLongQueryEventPair(QueryEvent.Builder eventBuilder, String eventType, Long value) { + QueryEvent.EventPair.Builder pair = QueryEvent.EventPair.newBuilder(); + pair.setLongType(this.eventQueryLongTypes.get(eventType)); + pair.setLongValue(value); + eventBuilder.addEventPair(pair.build()); + } + + /** + * Util to create a string-type query event pair. + */ + private void createStringQueryEventPair(QueryEvent.Builder eventBuilder, String eventType, String value) { + QueryEvent.EventPair.Builder pair = QueryEvent.EventPair.newBuilder(); + pair.setStringType(this.eventQueryStringTypes.get(eventType)); + pair.setStringValue(value); + eventBuilder.addEventPair(pair.build()); + } + + /** + * Util to create a long-type performance event pair. + */ + private void createLongPerfEventPair(PerfEvent.Builder eventBuilder, LongType eventType, Long value) { + PerfEvent.EventPair.Builder pair = PerfEvent.EventPair.newBuilder(); + pair.setLongType(eventType); + pair.setLongValue(value); + eventBuilder.addEventPair(pair.build()); + } + + /** + * Extract query specific metrics such as CPU worker time, elapsed time, + * etc. Also computes query info events if plan has not been observed + * previously. + * + * @param timestamp + */ + private void extractQueryMetrics(Timestamp timestamp) { + QueryEvent.Builder eventBuilder; + QueryInfo.Builder infoBuilder; + checkForReconnect(); + try (PreparedStatement stmt = conn.prepareStatement(DM_EXEC_QUERY_STATS)) { + ResultSet rs = stmt.executeQuery(); + while (rs.next()) { + // Only store those queries that have monitoring enabled via a + // comment in the SQL Server dialect XML. + String query_text = rs.getString("query_text"); + if (!query_text.contains("/*monitor-")) { + continue; + } + + // Get identifier from commment in query text. + String[] split = query_text.split(Pattern.quote("/*monitor-")); + split = split[1].split(Pattern.quote("*/")); + String identifier = split[0]; + // Get plan_handle for plan identification. + String plan_handle = rs.getString("plan_handle"); + + // Handle one-off query changes, may occur when a plan gets + // executed for the first time. + if (!cached_plans.contains(plan_handle)) { + cached_plans.add(plan_handle); + + infoBuilder = QueryInfo.newBuilder().setIdentifier(identifier); + // Add string event types to info log. + for (String eventType : this.infoQueryTypes.keySet()) { + String value = rs.getString(eventType); + if (value != null) { + createStringInfoPair(infoBuilder, eventType, value); + } + } + queryInfoLogBuilder.addInfo(infoBuilder.build()); + } + + // Handle repeated query events. + eventBuilder = QueryEvent.newBuilder().setIdentifier( + identifier).setTimestamp(timestamp); + // Add numeric event types. + for (String eventType : this.eventQueryLongTypes.keySet()) { + createLongQueryEventPair(eventBuilder, eventType, rs.getLong(eventType)); + } + // Add string event types. + for (String eventType : this.eventQueryStringTypes.keySet()) { + createStringQueryEventPair(eventBuilder, eventType, rs.getString(eventType)); + } + queryEventLogBuilder.addEvent(eventBuilder.build()); + } + } catch (SQLException sqlError) { + LOG.error("Error when extracting per query metrics."); + LOG.error(sqlError.getMessage()); + handleSQLConnectionException(sqlError); + } + } + + /** + * Extract performance specific metrics such as CPU and memory. + * + * @param timestamp + */ + private void extractPerformanceMetrics(Timestamp timestamp) { + PerfEvent.Builder eventBuilder = PerfEvent.newBuilder().setTimestamp(timestamp); + + // Add OS counter events. + checkForReconnect(); + try (PreparedStatement stmt = conn.prepareStatement(DM_OS_PERFORMANCE_STATS)) { + ResultSet rs = stmt.executeQuery(); + while (rs.next()) { + // Add numeric event types. + String counter_name = rs.getString("counter_name").trim(); + if (this.eventPerfOSTypes.keySet().contains(counter_name)) { + createLongPerfEventPair( + eventBuilder, this.eventPerfOSTypes.get(counter_name), + rs.getLong("cntr_value")); + } + } + } catch (SQLException sqlError) { + LOG.error("Error when extracting perf OS metrics."); + LOG.error(sqlError.getMessage()); + handleSQLConnectionException(sqlError); + } + + // Add lock counter events. + try (PreparedStatement stmt = conn.prepareStatement(DM_LOCK_STATS)) { + ResultSet rs = stmt.executeQuery(); + boolean ticks_set = false; + while (rs.next()) { + // Get MS ticks values. + if (!ticks_set) { + createLongPerfEventPair( + eventBuilder, LongType.MS_TICKS, + rs.getLong("ms_ticks")); + ticks_set = true; + } + // Add numeric event types. + String counter_name = rs.getString("counter_name").trim(); + if (this.eventPerfLockTypes.keySet().contains(counter_name)) { + createLongPerfEventPair( + eventBuilder, this.eventPerfLockTypes.get(counter_name), + rs.getLong("cntr_value")); + } + } + } catch (SQLException sqlError) { + LOG.error("Error when extracting perf OS metrics."); + LOG.error(sqlError.getMessage()); + handleSQLConnectionException(sqlError); + } + + perfEventLogBuilder.addEvent(eventBuilder.build()); + } + + @Override + protected void runExtraction() { + Instant time = Instant.now(); + Timestamp timestamp = Timestamp.newBuilder().setSeconds(time.getEpochSecond()).setNanos(time.getNano()).build(); + + extractQueryMetrics(timestamp); + extractPerformanceMetrics(timestamp); + } + + @Override + protected void cleanupCache() { + checkForReconnect(); + try (PreparedStatement stmt = conn.prepareStatement(CLEAN_CACHE)) { + stmt.execute(); + } catch (SQLException sqlError) { + LOG.error("Error when cleaning up cached plans."); + LOG.error(sqlError.getMessage()); + handleSQLConnectionException(sqlError); + } + } + + @Override + protected void writeLogs() { + writeQueryEventLog(); + writePerfEventLog(); + writeQueryInfoLog(); + } + + @Override + protected void finalizeLogs() { + QueryEventLog.Builder finalQueryEventLogBuilder = QueryEventLog.newBuilder(); + QueryInfoLog.Builder finalQueryInfoLogBuilder = QueryInfoLog.newBuilder(); + PerfEventLog.Builder finalPerfEventLogBuilder = PerfEventLog.newBuilder(); + + try { + for (int i = fileTimeDiff; i <= fileCounter; i += fileTimeDiff) { + // Add query events and remove superfluous file. + String file = FileUtil.joinPath( + OUTPUT_DIR, "query_event_log_" + i + ".proto"); + QueryEventLog query_event_log = QueryEventLog.parseFrom( + new FileInputStream(file)); + finalQueryEventLogBuilder.addAllEvent(query_event_log.getEventList()); + Files.deleteIfExists(Paths.get(file)); + + // Add query infos. + file = FileUtil.joinPath( + OUTPUT_DIR, "query_info_log_" + i + ".proto"); + QueryInfoLog query_info_log = QueryInfoLog.parseFrom( + new FileInputStream(file)); + finalQueryInfoLogBuilder.addAllInfo(query_info_log.getInfoList()); + Files.deleteIfExists(Paths.get(file)); + + // Add perf events. + file = FileUtil.joinPath( + OUTPUT_DIR, "perf_event_log_" + i + ".proto"); + PerfEventLog perf_event_log = PerfEventLog.parseFrom( + new FileInputStream(file)); + finalPerfEventLogBuilder.addAllEvent(perf_event_log.getEventList()); + Files.deleteIfExists(Paths.get(file)); + } + finalQueryEventLogBuilder.addAllEvent(this.queryEventLogBuilder.getEventList()); + finalQueryInfoLogBuilder.addAllInfo(this.queryInfoLogBuilder.getInfoList()); + finalPerfEventLogBuilder.addAllEvent(this.perfEventLogBuilder.getEventList()); + + // Write to file. + FileOutputStream out = new FileOutputStream(FileUtil.joinPath( + OUTPUT_DIR, "query_event_log.proto")); + finalQueryEventLogBuilder.build().writeTo(out); + out.close(); + + out = new FileOutputStream(FileUtil.joinPath( + OUTPUT_DIR, "query_info_log.proto")); + finalQueryInfoLogBuilder.build().writeTo(out); + out.close(); + + out = new FileOutputStream(FileUtil.joinPath( + OUTPUT_DIR, "perf_event_log.proto")); + finalPerfEventLogBuilder.build().writeTo(out); + out.close(); + + LOG.info("Successfully consolidated logs."); + } catch (IOException e) { + LOG.error("Error when consolidating log files."); + e.printStackTrace(); + } + + // Convert to human-readable CSV. + writeToCSV(); + } + + @Override + protected void writeToCSV() { + String basePath = FileUtil.joinPath( + OUTPUT_DIR, TimeUtil.getCurrentTimeString() + "_"); + + writePerfEventLogToCSV(basePath); + writeQueryEventLogToCSV(basePath); + writeQueryInfoLogToCSV(basePath); + } +} diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/LongType.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/LongType.java new file mode 100644 index 000000000..54a515ae0 --- /dev/null +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/LongType.java @@ -0,0 +1,478 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: monitor.proto + +package com.oltpbenchmark.api.collectors.monitoring.proto; + +/** + *
+ * Enum for long values.
+ * Next id: 42
+ * 
+ * + * Protobuf enum {@code com.oltpbenchmark.api.collectors.monitoring.proto.LongType} + */ +public enum LongType + implements com.google.protobuf.ProtocolMessageEnum { + /** + * EXECUTION_COUNT = 0; + */ + EXECUTION_COUNT(0), + /** + * MIN_WORKER_TIME = 1; + */ + MIN_WORKER_TIME(1), + /** + * MAX_WORKER_TIME = 2; + */ + MAX_WORKER_TIME(2), + /** + * TOTAL_WORKER_TIME = 3; + */ + TOTAL_WORKER_TIME(3), + /** + * MIN_PHYSICAL_READS = 4; + */ + MIN_PHYSICAL_READS(4), + /** + * MAX_PHYSICAL_READS = 5; + */ + MAX_PHYSICAL_READS(5), + /** + * TOTAL_PHYSICAL_READS = 6; + */ + TOTAL_PHYSICAL_READS(6), + /** + * MIN_ELAPSED_TIME = 7; + */ + MIN_ELAPSED_TIME(7), + /** + * MAX_ELAPSED_TIME = 8; + */ + MAX_ELAPSED_TIME(8), + /** + * TOTAL_ELAPSED_TIME = 9; + */ + TOTAL_ELAPSED_TIME(9), + /** + * MIN_ROWS = 10; + */ + MIN_ROWS(10), + /** + * MAX_ROWS = 11; + */ + MAX_ROWS(11), + /** + * TOTAL_ROWS = 12; + */ + TOTAL_ROWS(12), + /** + * MIN_SPILLS = 13; + */ + MIN_SPILLS(13), + /** + * MAX_SPILLS = 14; + */ + MAX_SPILLS(14), + /** + * TOTAL_SPILLS = 15; + */ + TOTAL_SPILLS(15), + /** + * USED_MEMORY = 16; + */ + USED_MEMORY(16), + /** + * TARGET_MEMORY = 17; + */ + TARGET_MEMORY(17), + /** + * CPU_USAGE_PERC = 18; + */ + CPU_USAGE_PERC(18), + /** + * CPU_EFFECTIVE_PERC = 19; + */ + CPU_EFFECTIVE_PERC(19), + /** + * CPU_VIOLATED_PERC = 20; + */ + CPU_VIOLATED_PERC(20), + /** + * TOTAL_LOGICAL_WRITES = 21; + */ + TOTAL_LOGICAL_WRITES(21), + /** + * MIN_LOGICAL_WRITES = 22; + */ + MIN_LOGICAL_WRITES(22), + /** + * MAX_LOGICAL_WRITES = 23; + */ + MAX_LOGICAL_WRITES(23), + /** + * TOTAL_LOGICAL_READS = 24; + */ + TOTAL_LOGICAL_READS(24), + /** + * MIN_LOGICAL_READS = 25; + */ + MIN_LOGICAL_READS(25), + /** + * MAX_LOGICAL_READS = 26; + */ + MAX_LOGICAL_READS(26), + /** + * TOTAL_USED_GRANT_KB = 27; + */ + TOTAL_USED_GRANT_KB(27), + /** + * MIN_USED_GRANT_KB = 28; + */ + MIN_USED_GRANT_KB(28), + /** + * MAX_USED_GRANT_KB = 29; + */ + MAX_USED_GRANT_KB(29), + /** + * TOTAL_USED_THREADS = 30; + */ + TOTAL_USED_THREADS(30), + /** + * MIN_USED_THREADS = 31; + */ + MIN_USED_THREADS(31), + /** + * MAX_USED_THREADS = 32; + */ + MAX_USED_THREADS(32), + /** + * CPU_USAGE_PERC_BASE = 33; + */ + CPU_USAGE_PERC_BASE(33), + /** + * CPU_EFFECTIVE_PERC_BASE = 34; + */ + CPU_EFFECTIVE_PERC_BASE(34), + /** + * CPU_USAGE_TARGET_PERC = 35; + */ + CPU_USAGE_TARGET_PERC(35), + /** + * DISK_READ_IOPS = 36; + */ + DISK_READ_IOPS(36), + /** + * DISK_WRITE_IOPS = 37; + */ + DISK_WRITE_IOPS(37), + /** + * LOCKS_AVG_WAIT_TIME = 38; + */ + LOCKS_AVG_WAIT_TIME(38), + /** + * LOCKS_AVG_WAIT_TIME_BASE = 39; + */ + LOCKS_AVG_WAIT_TIME_BASE(39), + /** + * LOCK_REQUESTS = 40; + */ + LOCK_REQUESTS(40), + /** + * MS_TICKS = 41; + */ + MS_TICKS(41), + UNRECOGNIZED(-1), + ; + + /** + * EXECUTION_COUNT = 0; + */ + public static final int EXECUTION_COUNT_VALUE = 0; + /** + * MIN_WORKER_TIME = 1; + */ + public static final int MIN_WORKER_TIME_VALUE = 1; + /** + * MAX_WORKER_TIME = 2; + */ + public static final int MAX_WORKER_TIME_VALUE = 2; + /** + * TOTAL_WORKER_TIME = 3; + */ + public static final int TOTAL_WORKER_TIME_VALUE = 3; + /** + * MIN_PHYSICAL_READS = 4; + */ + public static final int MIN_PHYSICAL_READS_VALUE = 4; + /** + * MAX_PHYSICAL_READS = 5; + */ + public static final int MAX_PHYSICAL_READS_VALUE = 5; + /** + * TOTAL_PHYSICAL_READS = 6; + */ + public static final int TOTAL_PHYSICAL_READS_VALUE = 6; + /** + * MIN_ELAPSED_TIME = 7; + */ + public static final int MIN_ELAPSED_TIME_VALUE = 7; + /** + * MAX_ELAPSED_TIME = 8; + */ + public static final int MAX_ELAPSED_TIME_VALUE = 8; + /** + * TOTAL_ELAPSED_TIME = 9; + */ + public static final int TOTAL_ELAPSED_TIME_VALUE = 9; + /** + * MIN_ROWS = 10; + */ + public static final int MIN_ROWS_VALUE = 10; + /** + * MAX_ROWS = 11; + */ + public static final int MAX_ROWS_VALUE = 11; + /** + * TOTAL_ROWS = 12; + */ + public static final int TOTAL_ROWS_VALUE = 12; + /** + * MIN_SPILLS = 13; + */ + public static final int MIN_SPILLS_VALUE = 13; + /** + * MAX_SPILLS = 14; + */ + public static final int MAX_SPILLS_VALUE = 14; + /** + * TOTAL_SPILLS = 15; + */ + public static final int TOTAL_SPILLS_VALUE = 15; + /** + * USED_MEMORY = 16; + */ + public static final int USED_MEMORY_VALUE = 16; + /** + * TARGET_MEMORY = 17; + */ + public static final int TARGET_MEMORY_VALUE = 17; + /** + * CPU_USAGE_PERC = 18; + */ + public static final int CPU_USAGE_PERC_VALUE = 18; + /** + * CPU_EFFECTIVE_PERC = 19; + */ + public static final int CPU_EFFECTIVE_PERC_VALUE = 19; + /** + * CPU_VIOLATED_PERC = 20; + */ + public static final int CPU_VIOLATED_PERC_VALUE = 20; + /** + * TOTAL_LOGICAL_WRITES = 21; + */ + public static final int TOTAL_LOGICAL_WRITES_VALUE = 21; + /** + * MIN_LOGICAL_WRITES = 22; + */ + public static final int MIN_LOGICAL_WRITES_VALUE = 22; + /** + * MAX_LOGICAL_WRITES = 23; + */ + public static final int MAX_LOGICAL_WRITES_VALUE = 23; + /** + * TOTAL_LOGICAL_READS = 24; + */ + public static final int TOTAL_LOGICAL_READS_VALUE = 24; + /** + * MIN_LOGICAL_READS = 25; + */ + public static final int MIN_LOGICAL_READS_VALUE = 25; + /** + * MAX_LOGICAL_READS = 26; + */ + public static final int MAX_LOGICAL_READS_VALUE = 26; + /** + * TOTAL_USED_GRANT_KB = 27; + */ + public static final int TOTAL_USED_GRANT_KB_VALUE = 27; + /** + * MIN_USED_GRANT_KB = 28; + */ + public static final int MIN_USED_GRANT_KB_VALUE = 28; + /** + * MAX_USED_GRANT_KB = 29; + */ + public static final int MAX_USED_GRANT_KB_VALUE = 29; + /** + * TOTAL_USED_THREADS = 30; + */ + public static final int TOTAL_USED_THREADS_VALUE = 30; + /** + * MIN_USED_THREADS = 31; + */ + public static final int MIN_USED_THREADS_VALUE = 31; + /** + * MAX_USED_THREADS = 32; + */ + public static final int MAX_USED_THREADS_VALUE = 32; + /** + * CPU_USAGE_PERC_BASE = 33; + */ + public static final int CPU_USAGE_PERC_BASE_VALUE = 33; + /** + * CPU_EFFECTIVE_PERC_BASE = 34; + */ + public static final int CPU_EFFECTIVE_PERC_BASE_VALUE = 34; + /** + * CPU_USAGE_TARGET_PERC = 35; + */ + public static final int CPU_USAGE_TARGET_PERC_VALUE = 35; + /** + * DISK_READ_IOPS = 36; + */ + public static final int DISK_READ_IOPS_VALUE = 36; + /** + * DISK_WRITE_IOPS = 37; + */ + public static final int DISK_WRITE_IOPS_VALUE = 37; + /** + * LOCKS_AVG_WAIT_TIME = 38; + */ + public static final int LOCKS_AVG_WAIT_TIME_VALUE = 38; + /** + * LOCKS_AVG_WAIT_TIME_BASE = 39; + */ + public static final int LOCKS_AVG_WAIT_TIME_BASE_VALUE = 39; + /** + * LOCK_REQUESTS = 40; + */ + public static final int LOCK_REQUESTS_VALUE = 40; + /** + * MS_TICKS = 41; + */ + public static final int MS_TICKS_VALUE = 41; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static LongType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static LongType forNumber(int value) { + switch (value) { + case 0: return EXECUTION_COUNT; + case 1: return MIN_WORKER_TIME; + case 2: return MAX_WORKER_TIME; + case 3: return TOTAL_WORKER_TIME; + case 4: return MIN_PHYSICAL_READS; + case 5: return MAX_PHYSICAL_READS; + case 6: return TOTAL_PHYSICAL_READS; + case 7: return MIN_ELAPSED_TIME; + case 8: return MAX_ELAPSED_TIME; + case 9: return TOTAL_ELAPSED_TIME; + case 10: return MIN_ROWS; + case 11: return MAX_ROWS; + case 12: return TOTAL_ROWS; + case 13: return MIN_SPILLS; + case 14: return MAX_SPILLS; + case 15: return TOTAL_SPILLS; + case 16: return USED_MEMORY; + case 17: return TARGET_MEMORY; + case 18: return CPU_USAGE_PERC; + case 19: return CPU_EFFECTIVE_PERC; + case 20: return CPU_VIOLATED_PERC; + case 21: return TOTAL_LOGICAL_WRITES; + case 22: return MIN_LOGICAL_WRITES; + case 23: return MAX_LOGICAL_WRITES; + case 24: return TOTAL_LOGICAL_READS; + case 25: return MIN_LOGICAL_READS; + case 26: return MAX_LOGICAL_READS; + case 27: return TOTAL_USED_GRANT_KB; + case 28: return MIN_USED_GRANT_KB; + case 29: return MAX_USED_GRANT_KB; + case 30: return TOTAL_USED_THREADS; + case 31: return MIN_USED_THREADS; + case 32: return MAX_USED_THREADS; + case 33: return CPU_USAGE_PERC_BASE; + case 34: return CPU_EFFECTIVE_PERC_BASE; + case 35: return CPU_USAGE_TARGET_PERC; + case 36: return DISK_READ_IOPS; + case 37: return DISK_WRITE_IOPS; + case 38: return LOCKS_AVG_WAIT_TIME; + case 39: return LOCKS_AVG_WAIT_TIME_BASE; + case 40: return LOCK_REQUESTS; + case 41: return MS_TICKS; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + LongType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public LongType findValueByNumber(int number) { + return LongType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.getDescriptor().getEnumTypes().get(1); + } + + private static final LongType[] VALUES = values(); + + public static LongType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private LongType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:com.oltpbenchmark.api.collectors.monitoring.proto.LongType) +} + diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/Monitor.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/Monitor.java new file mode 100644 index 000000000..74417625a --- /dev/null +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/Monitor.java @@ -0,0 +1,199 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: monitor.proto + +package com.oltpbenchmark.api.collectors.monitoring.proto; + +public final class Monitor { + private Monitor() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfo_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfo_InfoPair_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfo_InfoPair_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfoLog_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfoLog_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEvent_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEvent_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEvent_EventPair_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEvent_EventPair_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEventLog_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEventLog_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEvent_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEvent_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEvent_EventPair_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEvent_EventPair_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEventLog_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEventLog_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\rmonitor.proto\0221com.oltpbenchmark.api.c" + + "ollectors.monitoring.proto\032\037google/proto" + + "buf/timestamp.proto\"\201\003\n\tQueryInfo\022\027\n\nide" + + "ntifier\030\001 \001(\tH\000\210\001\001\022X\n\tinfo_pair\030\003 \003(\0132E." + + "com.oltpbenchmark.api.collectors.monitor" + + "ing.proto.QueryInfo.InfoPair\032\361\001\n\010InfoPai" + + "r\022T\n\013string_type\030\001 \001(\0162=.com.oltpbenchma" + + "rk.api.collectors.monitoring.proto.Strin" + + "gTypeH\000\022P\n\tlong_type\030\002 \001(\0162;.com.oltpben" + + "chmark.api.collectors.monitoring.proto.L" + + "ongTypeH\000\022\026\n\014string_value\030\003 \001(\tH\001\022\024\n\nlon" + + "g_value\030\004 \001(\003H\001B\006\n\004typeB\007\n\005valueB\r\n\013_ide" + + "ntifier\"Z\n\014QueryInfoLog\022J\n\004info\030\001 \003(\0132<." + + "com.oltpbenchmark.api.collectors.monitor" + + "ing.proto.QueryInfo\"\310\003\n\nQueryEvent\022\027\n\nid" + + "entifier\030\001 \001(\tH\000\210\001\001\0222\n\ttimestamp\030\002 \001(\0132\032" + + ".google.protobuf.TimestampH\001\210\001\001\022[\n\nevent" + + "_pair\030\003 \003(\0132G.com.oltpbenchmark.api.coll" + + "ectors.monitoring.proto.QueryEvent.Event" + + "Pair\032\362\001\n\tEventPair\022T\n\013string_type\030\001 \001(\0162" + + "=.com.oltpbenchmark.api.collectors.monit" + + "oring.proto.StringTypeH\000\022P\n\tlong_type\030\002 " + + "\001(\0162;.com.oltpbenchmark.api.collectors.m" + + "onitoring.proto.LongTypeH\000\022\026\n\014string_val" + + "ue\030\003 \001(\tH\001\022\024\n\nlong_value\030\004 \001(\003H\001B\006\n\004type" + + "B\007\n\005valueB\r\n\013_identifierB\014\n\n_timestamp\"]" + + "\n\rQueryEventLog\022L\n\005event\030\001 \003(\0132=.com.olt" + + "pbenchmark.api.collectors.monitoring.pro" + + "to.QueryEvent\"\232\002\n\tPerfEvent\0222\n\ttimestamp" + + "\030\001 \001(\0132\032.google.protobuf.TimestampH\000\210\001\001\022" + + "Z\n\nevent_pair\030\002 \003(\0132F.com.oltpbenchmark." + + "api.collectors.monitoring.proto.PerfEven" + + "t.EventPair\032o\n\tEventPair\022N\n\tlong_type\030\001 " + + "\001(\0162;.com.oltpbenchmark.api.collectors.m" + + "onitoring.proto.LongType\022\022\n\nlong_value\030\002" + + " \001(\003B\014\n\n_timestamp\"[\n\014PerfEventLog\022K\n\005ev" + + "ent\030\001 \003(\0132<.com.oltpbenchmark.api.collec" + + "tors.monitoring.proto.PerfEvent*M\n\nStrin" + + "gType\022\016\n\nQUERY_TEXT\020\000\022\016\n\nQUERY_PLAN\020\001\022\016\n" + + "\nIDENTIFIER\020\002\022\017\n\013PLAN_HANDLE\020\003*\241\007\n\010LongT" + + "ype\022\023\n\017EXECUTION_COUNT\020\000\022\023\n\017MIN_WORKER_T" + + "IME\020\001\022\023\n\017MAX_WORKER_TIME\020\002\022\025\n\021TOTAL_WORK" + + "ER_TIME\020\003\022\026\n\022MIN_PHYSICAL_READS\020\004\022\026\n\022MAX" + + "_PHYSICAL_READS\020\005\022\030\n\024TOTAL_PHYSICAL_READ" + + "S\020\006\022\024\n\020MIN_ELAPSED_TIME\020\007\022\024\n\020MAX_ELAPSED" + + "_TIME\020\010\022\026\n\022TOTAL_ELAPSED_TIME\020\t\022\014\n\010MIN_R" + + "OWS\020\n\022\014\n\010MAX_ROWS\020\013\022\016\n\nTOTAL_ROWS\020\014\022\016\n\nM" + + "IN_SPILLS\020\r\022\016\n\nMAX_SPILLS\020\016\022\020\n\014TOTAL_SPI" + + "LLS\020\017\022\017\n\013USED_MEMORY\020\020\022\021\n\rTARGET_MEMORY\020" + + "\021\022\022\n\016CPU_USAGE_PERC\020\022\022\026\n\022CPU_EFFECTIVE_P" + + "ERC\020\023\022\025\n\021CPU_VIOLATED_PERC\020\024\022\030\n\024TOTAL_LO" + + "GICAL_WRITES\020\025\022\026\n\022MIN_LOGICAL_WRITES\020\026\022\026" + + "\n\022MAX_LOGICAL_WRITES\020\027\022\027\n\023TOTAL_LOGICAL_" + + "READS\020\030\022\025\n\021MIN_LOGICAL_READS\020\031\022\025\n\021MAX_LO" + + "GICAL_READS\020\032\022\027\n\023TOTAL_USED_GRANT_KB\020\033\022\025" + + "\n\021MIN_USED_GRANT_KB\020\034\022\025\n\021MAX_USED_GRANT_" + + "KB\020\035\022\026\n\022TOTAL_USED_THREADS\020\036\022\024\n\020MIN_USED" + + "_THREADS\020\037\022\024\n\020MAX_USED_THREADS\020 \022\027\n\023CPU_" + + "USAGE_PERC_BASE\020!\022\033\n\027CPU_EFFECTIVE_PERC_" + + "BASE\020\"\022\031\n\025CPU_USAGE_TARGET_PERC\020#\022\022\n\016DIS" + + "K_READ_IOPS\020$\022\023\n\017DISK_WRITE_IOPS\020%\022\027\n\023LO" + + "CKS_AVG_WAIT_TIME\020&\022\034\n\030LOCKS_AVG_WAIT_TI" + + "ME_BASE\020\'\022\021\n\rLOCK_REQUESTS\020(\022\014\n\010MS_TICKS" + + "\020)B\002P\001b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfo_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfo_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfo_descriptor, + new java.lang.String[] { "Identifier", "InfoPair", "Identifier", }); + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfo_InfoPair_descriptor = + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfo_descriptor.getNestedTypes().get(0); + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfo_InfoPair_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfo_InfoPair_descriptor, + new java.lang.String[] { "StringType", "LongType", "StringValue", "LongValue", "Type", "Value", }); + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfoLog_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfoLog_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfoLog_descriptor, + new java.lang.String[] { "Info", }); + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEvent_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEvent_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEvent_descriptor, + new java.lang.String[] { "Identifier", "Timestamp", "EventPair", "Identifier", "Timestamp", }); + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEvent_EventPair_descriptor = + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEvent_descriptor.getNestedTypes().get(0); + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEvent_EventPair_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEvent_EventPair_descriptor, + new java.lang.String[] { "StringType", "LongType", "StringValue", "LongValue", "Type", "Value", }); + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEventLog_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEventLog_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEventLog_descriptor, + new java.lang.String[] { "Event", }); + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEvent_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEvent_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEvent_descriptor, + new java.lang.String[] { "Timestamp", "EventPair", "Timestamp", }); + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEvent_EventPair_descriptor = + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEvent_descriptor.getNestedTypes().get(0); + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEvent_EventPair_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEvent_EventPair_descriptor, + new java.lang.String[] { "LongType", "LongValue", }); + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEventLog_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEventLog_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEventLog_descriptor, + new java.lang.String[] { "Event", }); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/PerfEvent.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/PerfEvent.java new file mode 100644 index 000000000..3cb8c9b8b --- /dev/null +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/PerfEvent.java @@ -0,0 +1,1572 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: monitor.proto + +package com.oltpbenchmark.api.collectors.monitoring.proto; + +/** + * Protobuf type {@code com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent} + */ +public final class PerfEvent extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent) + PerfEventOrBuilder { +private static final long serialVersionUID = 0L; + // Use PerfEvent.newBuilder() to construct. + private PerfEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private PerfEvent() { + eventPair_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new PerfEvent(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private PerfEvent( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (((bitField0_ & 0x00000001) != 0)) { + subBuilder = timestamp_.toBuilder(); + } + timestamp_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(timestamp_); + timestamp_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000001; + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + eventPair_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + eventPair_.add( + input.readMessage(com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) != 0)) { + eventPair_ = java.util.Collections.unmodifiableList(eventPair_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.class, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.Builder.class); + } + + public interface EventPairOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair) + com.google.protobuf.MessageOrBuilder { + + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 1; + * @return The enum numeric value on the wire for longType. + */ + int getLongTypeValue(); + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 1; + * @return The longType. + */ + com.oltpbenchmark.api.collectors.monitoring.proto.LongType getLongType(); + + /** + * int64 long_value = 2; + * @return The longValue. + */ + long getLongValue(); + } + /** + *
+   * Encodes a pair of event type and value.
+   * Next id: 5
+   * 
+ * + * Protobuf type {@code com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair} + */ + public static final class EventPair extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair) + EventPairOrBuilder { + private static final long serialVersionUID = 0L; + // Use EventPair.newBuilder() to construct. + private EventPair(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private EventPair() { + longType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new EventPair(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private EventPair( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + int rawValue = input.readEnum(); + + longType_ = rawValue; + break; + } + case 16: { + + longValue_ = input.readInt64(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEvent_EventPair_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEvent_EventPair_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair.class, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair.Builder.class); + } + + public static final int LONG_TYPE_FIELD_NUMBER = 1; + private int longType_; + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 1; + * @return The enum numeric value on the wire for longType. + */ + @java.lang.Override public int getLongTypeValue() { + return longType_; + } + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 1; + * @return The longType. + */ + @java.lang.Override public com.oltpbenchmark.api.collectors.monitoring.proto.LongType getLongType() { + @SuppressWarnings("deprecation") + com.oltpbenchmark.api.collectors.monitoring.proto.LongType result = com.oltpbenchmark.api.collectors.monitoring.proto.LongType.valueOf(longType_); + return result == null ? com.oltpbenchmark.api.collectors.monitoring.proto.LongType.UNRECOGNIZED : result; + } + + public static final int LONG_VALUE_FIELD_NUMBER = 2; + private long longValue_; + /** + * int64 long_value = 2; + * @return The longValue. + */ + @java.lang.Override + public long getLongValue() { + return longValue_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (longType_ != com.oltpbenchmark.api.collectors.monitoring.proto.LongType.EXECUTION_COUNT.getNumber()) { + output.writeEnum(1, longType_); + } + if (longValue_ != 0L) { + output.writeInt64(2, longValue_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (longType_ != com.oltpbenchmark.api.collectors.monitoring.proto.LongType.EXECUTION_COUNT.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, longType_); + } + if (longValue_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, longValue_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair)) { + return super.equals(obj); + } + com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair other = (com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair) obj; + + if (longType_ != other.longType_) return false; + if (getLongValue() + != other.getLongValue()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + LONG_TYPE_FIELD_NUMBER; + hash = (53 * hash) + longType_; + hash = (37 * hash) + LONG_VALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getLongValue()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * Encodes a pair of event type and value.
+     * Next id: 5
+     * 
+ * + * Protobuf type {@code com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair) + com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPairOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEvent_EventPair_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEvent_EventPair_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair.class, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair.Builder.class); + } + + // Construct using com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + longType_ = 0; + + longValue_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEvent_EventPair_descriptor; + } + + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair getDefaultInstanceForType() { + return com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair.getDefaultInstance(); + } + + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair build() { + com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair buildPartial() { + com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair result = new com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair(this); + result.longType_ = longType_; + result.longValue_ = longValue_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair) { + return mergeFrom((com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair other) { + if (other == com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair.getDefaultInstance()) return this; + if (other.longType_ != 0) { + setLongTypeValue(other.getLongTypeValue()); + } + if (other.getLongValue() != 0L) { + setLongValue(other.getLongValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int longType_ = 0; + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 1; + * @return The enum numeric value on the wire for longType. + */ + @java.lang.Override public int getLongTypeValue() { + return longType_; + } + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 1; + * @param value The enum numeric value on the wire for longType to set. + * @return This builder for chaining. + */ + public Builder setLongTypeValue(int value) { + + longType_ = value; + onChanged(); + return this; + } + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 1; + * @return The longType. + */ + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.LongType getLongType() { + @SuppressWarnings("deprecation") + com.oltpbenchmark.api.collectors.monitoring.proto.LongType result = com.oltpbenchmark.api.collectors.monitoring.proto.LongType.valueOf(longType_); + return result == null ? com.oltpbenchmark.api.collectors.monitoring.proto.LongType.UNRECOGNIZED : result; + } + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 1; + * @param value The longType to set. + * @return This builder for chaining. + */ + public Builder setLongType(com.oltpbenchmark.api.collectors.monitoring.proto.LongType value) { + if (value == null) { + throw new NullPointerException(); + } + + longType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 1; + * @return This builder for chaining. + */ + public Builder clearLongType() { + + longType_ = 0; + onChanged(); + return this; + } + + private long longValue_ ; + /** + * int64 long_value = 2; + * @return The longValue. + */ + @java.lang.Override + public long getLongValue() { + return longValue_; + } + /** + * int64 long_value = 2; + * @param value The longValue to set. + * @return This builder for chaining. + */ + public Builder setLongValue(long value) { + + longValue_ = value; + onChanged(); + return this; + } + /** + * int64 long_value = 2; + * @return This builder for chaining. + */ + public Builder clearLongValue() { + + longValue_ = 0L; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair) + } + + // @@protoc_insertion_point(class_scope:com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair) + private static final com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair(); + } + + public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EventPair parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EventPair(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int TIMESTAMP_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp timestamp_; + /** + * optional .google.protobuf.Timestamp timestamp = 1; + * @return Whether the timestamp field is set. + */ + @java.lang.Override + public boolean hasTimestamp() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional .google.protobuf.Timestamp timestamp = 1; + * @return The timestamp. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getTimestamp() { + return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; + } + /** + * optional .google.protobuf.Timestamp timestamp = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder() { + return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; + } + + public static final int EVENT_PAIR_FIELD_NUMBER = 2; + private java.util.List eventPair_; + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; + */ + @java.lang.Override + public java.util.List getEventPairList() { + return eventPair_; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; + */ + @java.lang.Override + public java.util.List + getEventPairOrBuilderList() { + return eventPair_; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; + */ + @java.lang.Override + public int getEventPairCount() { + return eventPair_.size(); + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; + */ + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair getEventPair(int index) { + return eventPair_.get(index); + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; + */ + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPairOrBuilder getEventPairOrBuilder( + int index) { + return eventPair_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getTimestamp()); + } + for (int i = 0; i < eventPair_.size(); i++) { + output.writeMessage(2, eventPair_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getTimestamp()); + } + for (int i = 0; i < eventPair_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, eventPair_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent)) { + return super.equals(obj); + } + com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent other = (com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent) obj; + + if (hasTimestamp() != other.hasTimestamp()) return false; + if (hasTimestamp()) { + if (!getTimestamp() + .equals(other.getTimestamp())) return false; + } + if (!getEventPairList() + .equals(other.getEventPairList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasTimestamp()) { + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + getTimestamp().hashCode(); + } + if (getEventPairCount() > 0) { + hash = (37 * hash) + EVENT_PAIR_FIELD_NUMBER; + hash = (53 * hash) + getEventPairList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent) + com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.class, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.Builder.class); + } + + // Construct using com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getTimestampFieldBuilder(); + getEventPairFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (timestampBuilder_ == null) { + timestamp_ = null; + } else { + timestampBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (eventPairBuilder_ == null) { + eventPair_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + eventPairBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEvent_descriptor; + } + + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent getDefaultInstanceForType() { + return com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.getDefaultInstance(); + } + + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent build() { + com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent buildPartial() { + com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent result = new com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + if (timestampBuilder_ == null) { + result.timestamp_ = timestamp_; + } else { + result.timestamp_ = timestampBuilder_.build(); + } + to_bitField0_ |= 0x00000001; + } + if (eventPairBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + eventPair_ = java.util.Collections.unmodifiableList(eventPair_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.eventPair_ = eventPair_; + } else { + result.eventPair_ = eventPairBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent) { + return mergeFrom((com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent other) { + if (other == com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.getDefaultInstance()) return this; + if (other.hasTimestamp()) { + mergeTimestamp(other.getTimestamp()); + } + if (eventPairBuilder_ == null) { + if (!other.eventPair_.isEmpty()) { + if (eventPair_.isEmpty()) { + eventPair_ = other.eventPair_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureEventPairIsMutable(); + eventPair_.addAll(other.eventPair_); + } + onChanged(); + } + } else { + if (!other.eventPair_.isEmpty()) { + if (eventPairBuilder_.isEmpty()) { + eventPairBuilder_.dispose(); + eventPairBuilder_ = null; + eventPair_ = other.eventPair_; + bitField0_ = (bitField0_ & ~0x00000002); + eventPairBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getEventPairFieldBuilder() : null; + } else { + eventPairBuilder_.addAllMessages(other.eventPair_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.protobuf.Timestamp timestamp_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> timestampBuilder_; + /** + * optional .google.protobuf.Timestamp timestamp = 1; + * @return Whether the timestamp field is set. + */ + public boolean hasTimestamp() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional .google.protobuf.Timestamp timestamp = 1; + * @return The timestamp. + */ + public com.google.protobuf.Timestamp getTimestamp() { + if (timestampBuilder_ == null) { + return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; + } else { + return timestampBuilder_.getMessage(); + } + } + /** + * optional .google.protobuf.Timestamp timestamp = 1; + */ + public Builder setTimestamp(com.google.protobuf.Timestamp value) { + if (timestampBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + timestamp_ = value; + onChanged(); + } else { + timestampBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * optional .google.protobuf.Timestamp timestamp = 1; + */ + public Builder setTimestamp( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (timestampBuilder_ == null) { + timestamp_ = builderForValue.build(); + onChanged(); + } else { + timestampBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * optional .google.protobuf.Timestamp timestamp = 1; + */ + public Builder mergeTimestamp(com.google.protobuf.Timestamp value) { + if (timestampBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + timestamp_ != null && + timestamp_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + timestamp_ = + com.google.protobuf.Timestamp.newBuilder(timestamp_).mergeFrom(value).buildPartial(); + } else { + timestamp_ = value; + } + onChanged(); + } else { + timestampBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * optional .google.protobuf.Timestamp timestamp = 1; + */ + public Builder clearTimestamp() { + if (timestampBuilder_ == null) { + timestamp_ = null; + onChanged(); + } else { + timestampBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + /** + * optional .google.protobuf.Timestamp timestamp = 1; + */ + public com.google.protobuf.Timestamp.Builder getTimestampBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getTimestampFieldBuilder().getBuilder(); + } + /** + * optional .google.protobuf.Timestamp timestamp = 1; + */ + public com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder() { + if (timestampBuilder_ != null) { + return timestampBuilder_.getMessageOrBuilder(); + } else { + return timestamp_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; + } + } + /** + * optional .google.protobuf.Timestamp timestamp = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getTimestampFieldBuilder() { + if (timestampBuilder_ == null) { + timestampBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getTimestamp(), + getParentForChildren(), + isClean()); + timestamp_ = null; + } + return timestampBuilder_; + } + + private java.util.List eventPair_ = + java.util.Collections.emptyList(); + private void ensureEventPairIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + eventPair_ = new java.util.ArrayList(eventPair_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair.Builder, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPairOrBuilder> eventPairBuilder_; + + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; + */ + public java.util.List getEventPairList() { + if (eventPairBuilder_ == null) { + return java.util.Collections.unmodifiableList(eventPair_); + } else { + return eventPairBuilder_.getMessageList(); + } + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; + */ + public int getEventPairCount() { + if (eventPairBuilder_ == null) { + return eventPair_.size(); + } else { + return eventPairBuilder_.getCount(); + } + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; + */ + public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair getEventPair(int index) { + if (eventPairBuilder_ == null) { + return eventPair_.get(index); + } else { + return eventPairBuilder_.getMessage(index); + } + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; + */ + public Builder setEventPair( + int index, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair value) { + if (eventPairBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventPairIsMutable(); + eventPair_.set(index, value); + onChanged(); + } else { + eventPairBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; + */ + public Builder setEventPair( + int index, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair.Builder builderForValue) { + if (eventPairBuilder_ == null) { + ensureEventPairIsMutable(); + eventPair_.set(index, builderForValue.build()); + onChanged(); + } else { + eventPairBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; + */ + public Builder addEventPair(com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair value) { + if (eventPairBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventPairIsMutable(); + eventPair_.add(value); + onChanged(); + } else { + eventPairBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; + */ + public Builder addEventPair( + int index, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair value) { + if (eventPairBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventPairIsMutable(); + eventPair_.add(index, value); + onChanged(); + } else { + eventPairBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; + */ + public Builder addEventPair( + com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair.Builder builderForValue) { + if (eventPairBuilder_ == null) { + ensureEventPairIsMutable(); + eventPair_.add(builderForValue.build()); + onChanged(); + } else { + eventPairBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; + */ + public Builder addEventPair( + int index, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair.Builder builderForValue) { + if (eventPairBuilder_ == null) { + ensureEventPairIsMutable(); + eventPair_.add(index, builderForValue.build()); + onChanged(); + } else { + eventPairBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; + */ + public Builder addAllEventPair( + java.lang.Iterable values) { + if (eventPairBuilder_ == null) { + ensureEventPairIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, eventPair_); + onChanged(); + } else { + eventPairBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; + */ + public Builder clearEventPair() { + if (eventPairBuilder_ == null) { + eventPair_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + eventPairBuilder_.clear(); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; + */ + public Builder removeEventPair(int index) { + if (eventPairBuilder_ == null) { + ensureEventPairIsMutable(); + eventPair_.remove(index); + onChanged(); + } else { + eventPairBuilder_.remove(index); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; + */ + public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair.Builder getEventPairBuilder( + int index) { + return getEventPairFieldBuilder().getBuilder(index); + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; + */ + public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPairOrBuilder getEventPairOrBuilder( + int index) { + if (eventPairBuilder_ == null) { + return eventPair_.get(index); } else { + return eventPairBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; + */ + public java.util.List + getEventPairOrBuilderList() { + if (eventPairBuilder_ != null) { + return eventPairBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(eventPair_); + } + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; + */ + public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair.Builder addEventPairBuilder() { + return getEventPairFieldBuilder().addBuilder( + com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair.getDefaultInstance()); + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; + */ + public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair.Builder addEventPairBuilder( + int index) { + return getEventPairFieldBuilder().addBuilder( + index, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair.getDefaultInstance()); + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; + */ + public java.util.List + getEventPairBuilderList() { + return getEventPairFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair.Builder, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPairOrBuilder> + getEventPairFieldBuilder() { + if (eventPairBuilder_ == null) { + eventPairBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair.Builder, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPairOrBuilder>( + eventPair_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + eventPair_ = null; + } + return eventPairBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent) + } + + // @@protoc_insertion_point(class_scope:com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent) + private static final com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent(); + } + + public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PerfEvent parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PerfEvent(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/PerfEventLog.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/PerfEventLog.java new file mode 100644 index 000000000..7b579d2cf --- /dev/null +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/PerfEventLog.java @@ -0,0 +1,780 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: monitor.proto + +package com.oltpbenchmark.api.collectors.monitoring.proto; + +/** + *
+ * Encodes performance events in a log.
+ * Next id: 2
+ * 
+ * + * Protobuf type {@code com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog} + */ +public final class PerfEventLog extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog) + PerfEventLogOrBuilder { +private static final long serialVersionUID = 0L; + // Use PerfEventLog.newBuilder() to construct. + private PerfEventLog(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private PerfEventLog() { + event_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new PerfEventLog(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private PerfEventLog( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + event_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + event_.add( + input.readMessage(com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + event_ = java.util.Collections.unmodifiableList(event_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEventLog_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEventLog_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog.class, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog.Builder.class); + } + + public static final int EVENT_FIELD_NUMBER = 1; + private java.util.List event_; + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; + */ + @java.lang.Override + public java.util.List getEventList() { + return event_; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; + */ + @java.lang.Override + public java.util.List + getEventOrBuilderList() { + return event_; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; + */ + @java.lang.Override + public int getEventCount() { + return event_.size(); + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; + */ + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent getEvent(int index) { + return event_.get(index); + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; + */ + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventOrBuilder getEventOrBuilder( + int index) { + return event_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < event_.size(); i++) { + output.writeMessage(1, event_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < event_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, event_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog)) { + return super.equals(obj); + } + com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog other = (com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog) obj; + + if (!getEventList() + .equals(other.getEventList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getEventCount() > 0) { + hash = (37 * hash) + EVENT_FIELD_NUMBER; + hash = (53 * hash) + getEventList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Encodes performance events in a log.
+   * Next id: 2
+   * 
+ * + * Protobuf type {@code com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog) + com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLogOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEventLog_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEventLog_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog.class, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog.Builder.class); + } + + // Construct using com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getEventFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (eventBuilder_ == null) { + event_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + eventBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEventLog_descriptor; + } + + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog getDefaultInstanceForType() { + return com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog.getDefaultInstance(); + } + + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog build() { + com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog buildPartial() { + com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog result = new com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog(this); + int from_bitField0_ = bitField0_; + if (eventBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + event_ = java.util.Collections.unmodifiableList(event_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.event_ = event_; + } else { + result.event_ = eventBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog) { + return mergeFrom((com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog other) { + if (other == com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog.getDefaultInstance()) return this; + if (eventBuilder_ == null) { + if (!other.event_.isEmpty()) { + if (event_.isEmpty()) { + event_ = other.event_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureEventIsMutable(); + event_.addAll(other.event_); + } + onChanged(); + } + } else { + if (!other.event_.isEmpty()) { + if (eventBuilder_.isEmpty()) { + eventBuilder_.dispose(); + eventBuilder_ = null; + event_ = other.event_; + bitField0_ = (bitField0_ & ~0x00000001); + eventBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getEventFieldBuilder() : null; + } else { + eventBuilder_.addAllMessages(other.event_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List event_ = + java.util.Collections.emptyList(); + private void ensureEventIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + event_ = new java.util.ArrayList(event_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.Builder, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventOrBuilder> eventBuilder_; + + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; + */ + public java.util.List getEventList() { + if (eventBuilder_ == null) { + return java.util.Collections.unmodifiableList(event_); + } else { + return eventBuilder_.getMessageList(); + } + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; + */ + public int getEventCount() { + if (eventBuilder_ == null) { + return event_.size(); + } else { + return eventBuilder_.getCount(); + } + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; + */ + public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent getEvent(int index) { + if (eventBuilder_ == null) { + return event_.get(index); + } else { + return eventBuilder_.getMessage(index); + } + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; + */ + public Builder setEvent( + int index, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent value) { + if (eventBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventIsMutable(); + event_.set(index, value); + onChanged(); + } else { + eventBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; + */ + public Builder setEvent( + int index, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.Builder builderForValue) { + if (eventBuilder_ == null) { + ensureEventIsMutable(); + event_.set(index, builderForValue.build()); + onChanged(); + } else { + eventBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; + */ + public Builder addEvent(com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent value) { + if (eventBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventIsMutable(); + event_.add(value); + onChanged(); + } else { + eventBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; + */ + public Builder addEvent( + int index, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent value) { + if (eventBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventIsMutable(); + event_.add(index, value); + onChanged(); + } else { + eventBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; + */ + public Builder addEvent( + com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.Builder builderForValue) { + if (eventBuilder_ == null) { + ensureEventIsMutable(); + event_.add(builderForValue.build()); + onChanged(); + } else { + eventBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; + */ + public Builder addEvent( + int index, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.Builder builderForValue) { + if (eventBuilder_ == null) { + ensureEventIsMutable(); + event_.add(index, builderForValue.build()); + onChanged(); + } else { + eventBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; + */ + public Builder addAllEvent( + java.lang.Iterable values) { + if (eventBuilder_ == null) { + ensureEventIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, event_); + onChanged(); + } else { + eventBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; + */ + public Builder clearEvent() { + if (eventBuilder_ == null) { + event_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + eventBuilder_.clear(); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; + */ + public Builder removeEvent(int index) { + if (eventBuilder_ == null) { + ensureEventIsMutable(); + event_.remove(index); + onChanged(); + } else { + eventBuilder_.remove(index); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; + */ + public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.Builder getEventBuilder( + int index) { + return getEventFieldBuilder().getBuilder(index); + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; + */ + public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventOrBuilder getEventOrBuilder( + int index) { + if (eventBuilder_ == null) { + return event_.get(index); } else { + return eventBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; + */ + public java.util.List + getEventOrBuilderList() { + if (eventBuilder_ != null) { + return eventBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(event_); + } + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; + */ + public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.Builder addEventBuilder() { + return getEventFieldBuilder().addBuilder( + com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.getDefaultInstance()); + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; + */ + public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.Builder addEventBuilder( + int index) { + return getEventFieldBuilder().addBuilder( + index, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.getDefaultInstance()); + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; + */ + public java.util.List + getEventBuilderList() { + return getEventFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.Builder, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventOrBuilder> + getEventFieldBuilder() { + if (eventBuilder_ == null) { + eventBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.Builder, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventOrBuilder>( + event_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + event_ = null; + } + return eventBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog) + } + + // @@protoc_insertion_point(class_scope:com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog) + private static final com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog(); + } + + public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PerfEventLog parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PerfEventLog(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/PerfEventLogOrBuilder.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/PerfEventLogOrBuilder.java new file mode 100644 index 000000000..b47a9a925 --- /dev/null +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/PerfEventLogOrBuilder.java @@ -0,0 +1,33 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: monitor.proto + +package com.oltpbenchmark.api.collectors.monitoring.proto; + +public interface PerfEventLogOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; + */ + java.util.List + getEventList(); + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; + */ + com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent getEvent(int index); + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; + */ + int getEventCount(); + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; + */ + java.util.List + getEventOrBuilderList(); + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; + */ + com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventOrBuilder getEventOrBuilder( + int index); +} diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/PerfEventOrBuilder.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/PerfEventOrBuilder.java new file mode 100644 index 000000000..38b83cbc3 --- /dev/null +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/PerfEventOrBuilder.java @@ -0,0 +1,48 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: monitor.proto + +package com.oltpbenchmark.api.collectors.monitoring.proto; + +public interface PerfEventOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent) + com.google.protobuf.MessageOrBuilder { + + /** + * optional .google.protobuf.Timestamp timestamp = 1; + * @return Whether the timestamp field is set. + */ + boolean hasTimestamp(); + /** + * optional .google.protobuf.Timestamp timestamp = 1; + * @return The timestamp. + */ + com.google.protobuf.Timestamp getTimestamp(); + /** + * optional .google.protobuf.Timestamp timestamp = 1; + */ + com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder(); + + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; + */ + java.util.List + getEventPairList(); + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; + */ + com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair getEventPair(int index); + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; + */ + int getEventPairCount(); + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; + */ + java.util.List + getEventPairOrBuilderList(); + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; + */ + com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPairOrBuilder getEventPairOrBuilder( + int index); +} diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryEvent.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryEvent.java new file mode 100644 index 000000000..4d19c68fa --- /dev/null +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryEvent.java @@ -0,0 +1,2308 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: monitor.proto + +package com.oltpbenchmark.api.collectors.monitoring.proto; + +/** + *
+ * Proto representation for query metrics logged through BenchBase.
+ * Next id: 4
+ * 
+ * + * Protobuf type {@code com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent} + */ +public final class QueryEvent extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent) + QueryEventOrBuilder { +private static final long serialVersionUID = 0L; + // Use QueryEvent.newBuilder() to construct. + private QueryEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private QueryEvent() { + identifier_ = ""; + eventPair_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new QueryEvent(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private QueryEvent( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + identifier_ = s; + break; + } + case 18: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (((bitField0_ & 0x00000002) != 0)) { + subBuilder = timestamp_.toBuilder(); + } + timestamp_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(timestamp_); + timestamp_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000002; + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + eventPair_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + eventPair_.add( + input.readMessage(com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000004) != 0)) { + eventPair_ = java.util.Collections.unmodifiableList(eventPair_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.class, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.Builder.class); + } + + public interface EventPairOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair) + com.google.protobuf.MessageOrBuilder { + + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; + * @return Whether the stringType field is set. + */ + boolean hasStringType(); + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; + * @return The enum numeric value on the wire for stringType. + */ + int getStringTypeValue(); + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; + * @return The stringType. + */ + com.oltpbenchmark.api.collectors.monitoring.proto.StringType getStringType(); + + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; + * @return Whether the longType field is set. + */ + boolean hasLongType(); + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; + * @return The enum numeric value on the wire for longType. + */ + int getLongTypeValue(); + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; + * @return The longType. + */ + com.oltpbenchmark.api.collectors.monitoring.proto.LongType getLongType(); + + /** + * string string_value = 3; + * @return Whether the stringValue field is set. + */ + boolean hasStringValue(); + /** + * string string_value = 3; + * @return The stringValue. + */ + java.lang.String getStringValue(); + /** + * string string_value = 3; + * @return The bytes for stringValue. + */ + com.google.protobuf.ByteString + getStringValueBytes(); + + /** + * int64 long_value = 4; + * @return Whether the longValue field is set. + */ + boolean hasLongValue(); + /** + * int64 long_value = 4; + * @return The longValue. + */ + long getLongValue(); + + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair.TypeCase getTypeCase(); + + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair.ValueCase getValueCase(); + } + /** + *
+   * Encodes a pair of event type and value.
+   * Next id: 5
+   * 
+ * + * Protobuf type {@code com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair} + */ + public static final class EventPair extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair) + EventPairOrBuilder { + private static final long serialVersionUID = 0L; + // Use EventPair.newBuilder() to construct. + private EventPair(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private EventPair() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new EventPair(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private EventPair( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + int rawValue = input.readEnum(); + typeCase_ = 1; + type_ = rawValue; + break; + } + case 16: { + int rawValue = input.readEnum(); + typeCase_ = 2; + type_ = rawValue; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + valueCase_ = 3; + value_ = s; + break; + } + case 32: { + value_ = input.readInt64(); + valueCase_ = 4; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEvent_EventPair_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEvent_EventPair_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair.class, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair.Builder.class); + } + + private int typeCase_ = 0; + private java.lang.Object type_; + public enum TypeCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + STRING_TYPE(1), + LONG_TYPE(2), + TYPE_NOT_SET(0); + private final int value; + private TypeCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static TypeCase valueOf(int value) { + return forNumber(value); + } + + public static TypeCase forNumber(int value) { + switch (value) { + case 1: return STRING_TYPE; + case 2: return LONG_TYPE; + case 0: return TYPE_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public TypeCase + getTypeCase() { + return TypeCase.forNumber( + typeCase_); + } + + private int valueCase_ = 0; + private java.lang.Object value_; + public enum ValueCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + STRING_VALUE(3), + LONG_VALUE(4), + VALUE_NOT_SET(0); + private final int value; + private ValueCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ValueCase valueOf(int value) { + return forNumber(value); + } + + public static ValueCase forNumber(int value) { + switch (value) { + case 3: return STRING_VALUE; + case 4: return LONG_VALUE; + case 0: return VALUE_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public ValueCase + getValueCase() { + return ValueCase.forNumber( + valueCase_); + } + + public static final int STRING_TYPE_FIELD_NUMBER = 1; + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; + * @return Whether the stringType field is set. + */ + public boolean hasStringType() { + return typeCase_ == 1; + } + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; + * @return The enum numeric value on the wire for stringType. + */ + public int getStringTypeValue() { + if (typeCase_ == 1) { + return (java.lang.Integer) type_; + } + return 0; + } + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; + * @return The stringType. + */ + public com.oltpbenchmark.api.collectors.monitoring.proto.StringType getStringType() { + if (typeCase_ == 1) { + @SuppressWarnings("deprecation") + com.oltpbenchmark.api.collectors.monitoring.proto.StringType result = com.oltpbenchmark.api.collectors.monitoring.proto.StringType.valueOf( + (java.lang.Integer) type_); + return result == null ? com.oltpbenchmark.api.collectors.monitoring.proto.StringType.UNRECOGNIZED : result; + } + return com.oltpbenchmark.api.collectors.monitoring.proto.StringType.QUERY_TEXT; + } + + public static final int LONG_TYPE_FIELD_NUMBER = 2; + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; + * @return Whether the longType field is set. + */ + public boolean hasLongType() { + return typeCase_ == 2; + } + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; + * @return The enum numeric value on the wire for longType. + */ + public int getLongTypeValue() { + if (typeCase_ == 2) { + return (java.lang.Integer) type_; + } + return 0; + } + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; + * @return The longType. + */ + public com.oltpbenchmark.api.collectors.monitoring.proto.LongType getLongType() { + if (typeCase_ == 2) { + @SuppressWarnings("deprecation") + com.oltpbenchmark.api.collectors.monitoring.proto.LongType result = com.oltpbenchmark.api.collectors.monitoring.proto.LongType.valueOf( + (java.lang.Integer) type_); + return result == null ? com.oltpbenchmark.api.collectors.monitoring.proto.LongType.UNRECOGNIZED : result; + } + return com.oltpbenchmark.api.collectors.monitoring.proto.LongType.EXECUTION_COUNT; + } + + public static final int STRING_VALUE_FIELD_NUMBER = 3; + /** + * string string_value = 3; + * @return Whether the stringValue field is set. + */ + public boolean hasStringValue() { + return valueCase_ == 3; + } + /** + * string string_value = 3; + * @return The stringValue. + */ + public java.lang.String getStringValue() { + java.lang.Object ref = ""; + if (valueCase_ == 3) { + ref = value_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (valueCase_ == 3) { + value_ = s; + } + return s; + } + } + /** + * string string_value = 3; + * @return The bytes for stringValue. + */ + public com.google.protobuf.ByteString + getStringValueBytes() { + java.lang.Object ref = ""; + if (valueCase_ == 3) { + ref = value_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (valueCase_ == 3) { + value_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LONG_VALUE_FIELD_NUMBER = 4; + /** + * int64 long_value = 4; + * @return Whether the longValue field is set. + */ + @java.lang.Override + public boolean hasLongValue() { + return valueCase_ == 4; + } + /** + * int64 long_value = 4; + * @return The longValue. + */ + @java.lang.Override + public long getLongValue() { + if (valueCase_ == 4) { + return (java.lang.Long) value_; + } + return 0L; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (typeCase_ == 1) { + output.writeEnum(1, ((java.lang.Integer) type_)); + } + if (typeCase_ == 2) { + output.writeEnum(2, ((java.lang.Integer) type_)); + } + if (valueCase_ == 3) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, value_); + } + if (valueCase_ == 4) { + output.writeInt64( + 4, (long)((java.lang.Long) value_)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (typeCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, ((java.lang.Integer) type_)); + } + if (typeCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, ((java.lang.Integer) type_)); + } + if (valueCase_ == 3) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, value_); + } + if (valueCase_ == 4) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size( + 4, (long)((java.lang.Long) value_)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair)) { + return super.equals(obj); + } + com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair other = (com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair) obj; + + if (!getTypeCase().equals(other.getTypeCase())) return false; + switch (typeCase_) { + case 1: + if (getStringTypeValue() + != other.getStringTypeValue()) return false; + break; + case 2: + if (getLongTypeValue() + != other.getLongTypeValue()) return false; + break; + case 0: + default: + } + if (!getValueCase().equals(other.getValueCase())) return false; + switch (valueCase_) { + case 3: + if (!getStringValue() + .equals(other.getStringValue())) return false; + break; + case 4: + if (getLongValue() + != other.getLongValue()) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (typeCase_) { + case 1: + hash = (37 * hash) + STRING_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getStringTypeValue(); + break; + case 2: + hash = (37 * hash) + LONG_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getLongTypeValue(); + break; + case 0: + default: + } + switch (valueCase_) { + case 3: + hash = (37 * hash) + STRING_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getStringValue().hashCode(); + break; + case 4: + hash = (37 * hash) + LONG_VALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getLongValue()); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * Encodes a pair of event type and value.
+     * Next id: 5
+     * 
+ * + * Protobuf type {@code com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair) + com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPairOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEvent_EventPair_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEvent_EventPair_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair.class, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair.Builder.class); + } + + // Construct using com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + typeCase_ = 0; + type_ = null; + valueCase_ = 0; + value_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEvent_EventPair_descriptor; + } + + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair getDefaultInstanceForType() { + return com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair.getDefaultInstance(); + } + + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair build() { + com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair buildPartial() { + com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair result = new com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair(this); + if (typeCase_ == 1) { + result.type_ = type_; + } + if (typeCase_ == 2) { + result.type_ = type_; + } + if (valueCase_ == 3) { + result.value_ = value_; + } + if (valueCase_ == 4) { + result.value_ = value_; + } + result.typeCase_ = typeCase_; + result.valueCase_ = valueCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair) { + return mergeFrom((com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair other) { + if (other == com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair.getDefaultInstance()) return this; + switch (other.getTypeCase()) { + case STRING_TYPE: { + setStringTypeValue(other.getStringTypeValue()); + break; + } + case LONG_TYPE: { + setLongTypeValue(other.getLongTypeValue()); + break; + } + case TYPE_NOT_SET: { + break; + } + } + switch (other.getValueCase()) { + case STRING_VALUE: { + valueCase_ = 3; + value_ = other.value_; + onChanged(); + break; + } + case LONG_VALUE: { + setLongValue(other.getLongValue()); + break; + } + case VALUE_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int typeCase_ = 0; + private java.lang.Object type_; + public TypeCase + getTypeCase() { + return TypeCase.forNumber( + typeCase_); + } + + public Builder clearType() { + typeCase_ = 0; + type_ = null; + onChanged(); + return this; + } + + private int valueCase_ = 0; + private java.lang.Object value_; + public ValueCase + getValueCase() { + return ValueCase.forNumber( + valueCase_); + } + + public Builder clearValue() { + valueCase_ = 0; + value_ = null; + onChanged(); + return this; + } + + + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; + * @return Whether the stringType field is set. + */ + @java.lang.Override + public boolean hasStringType() { + return typeCase_ == 1; + } + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; + * @return The enum numeric value on the wire for stringType. + */ + @java.lang.Override + public int getStringTypeValue() { + if (typeCase_ == 1) { + return ((java.lang.Integer) type_).intValue(); + } + return 0; + } + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; + * @param value The enum numeric value on the wire for stringType to set. + * @return This builder for chaining. + */ + public Builder setStringTypeValue(int value) { + typeCase_ = 1; + type_ = value; + onChanged(); + return this; + } + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; + * @return The stringType. + */ + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.StringType getStringType() { + if (typeCase_ == 1) { + @SuppressWarnings("deprecation") + com.oltpbenchmark.api.collectors.monitoring.proto.StringType result = com.oltpbenchmark.api.collectors.monitoring.proto.StringType.valueOf( + (java.lang.Integer) type_); + return result == null ? com.oltpbenchmark.api.collectors.monitoring.proto.StringType.UNRECOGNIZED : result; + } + return com.oltpbenchmark.api.collectors.monitoring.proto.StringType.QUERY_TEXT; + } + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; + * @param value The stringType to set. + * @return This builder for chaining. + */ + public Builder setStringType(com.oltpbenchmark.api.collectors.monitoring.proto.StringType value) { + if (value == null) { + throw new NullPointerException(); + } + typeCase_ = 1; + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; + * @return This builder for chaining. + */ + public Builder clearStringType() { + if (typeCase_ == 1) { + typeCase_ = 0; + type_ = null; + onChanged(); + } + return this; + } + + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; + * @return Whether the longType field is set. + */ + @java.lang.Override + public boolean hasLongType() { + return typeCase_ == 2; + } + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; + * @return The enum numeric value on the wire for longType. + */ + @java.lang.Override + public int getLongTypeValue() { + if (typeCase_ == 2) { + return ((java.lang.Integer) type_).intValue(); + } + return 0; + } + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; + * @param value The enum numeric value on the wire for longType to set. + * @return This builder for chaining. + */ + public Builder setLongTypeValue(int value) { + typeCase_ = 2; + type_ = value; + onChanged(); + return this; + } + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; + * @return The longType. + */ + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.LongType getLongType() { + if (typeCase_ == 2) { + @SuppressWarnings("deprecation") + com.oltpbenchmark.api.collectors.monitoring.proto.LongType result = com.oltpbenchmark.api.collectors.monitoring.proto.LongType.valueOf( + (java.lang.Integer) type_); + return result == null ? com.oltpbenchmark.api.collectors.monitoring.proto.LongType.UNRECOGNIZED : result; + } + return com.oltpbenchmark.api.collectors.monitoring.proto.LongType.EXECUTION_COUNT; + } + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; + * @param value The longType to set. + * @return This builder for chaining. + */ + public Builder setLongType(com.oltpbenchmark.api.collectors.monitoring.proto.LongType value) { + if (value == null) { + throw new NullPointerException(); + } + typeCase_ = 2; + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; + * @return This builder for chaining. + */ + public Builder clearLongType() { + if (typeCase_ == 2) { + typeCase_ = 0; + type_ = null; + onChanged(); + } + return this; + } + + /** + * string string_value = 3; + * @return Whether the stringValue field is set. + */ + @java.lang.Override + public boolean hasStringValue() { + return valueCase_ == 3; + } + /** + * string string_value = 3; + * @return The stringValue. + */ + @java.lang.Override + public java.lang.String getStringValue() { + java.lang.Object ref = ""; + if (valueCase_ == 3) { + ref = value_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (valueCase_ == 3) { + value_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string string_value = 3; + * @return The bytes for stringValue. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getStringValueBytes() { + java.lang.Object ref = ""; + if (valueCase_ == 3) { + ref = value_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (valueCase_ == 3) { + value_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string string_value = 3; + * @param value The stringValue to set. + * @return This builder for chaining. + */ + public Builder setStringValue( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + valueCase_ = 3; + value_ = value; + onChanged(); + return this; + } + /** + * string string_value = 3; + * @return This builder for chaining. + */ + public Builder clearStringValue() { + if (valueCase_ == 3) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + return this; + } + /** + * string string_value = 3; + * @param value The bytes for stringValue to set. + * @return This builder for chaining. + */ + public Builder setStringValueBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + valueCase_ = 3; + value_ = value; + onChanged(); + return this; + } + + /** + * int64 long_value = 4; + * @return Whether the longValue field is set. + */ + public boolean hasLongValue() { + return valueCase_ == 4; + } + /** + * int64 long_value = 4; + * @return The longValue. + */ + public long getLongValue() { + if (valueCase_ == 4) { + return (java.lang.Long) value_; + } + return 0L; + } + /** + * int64 long_value = 4; + * @param value The longValue to set. + * @return This builder for chaining. + */ + public Builder setLongValue(long value) { + valueCase_ = 4; + value_ = value; + onChanged(); + return this; + } + /** + * int64 long_value = 4; + * @return This builder for chaining. + */ + public Builder clearLongValue() { + if (valueCase_ == 4) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair) + } + + // @@protoc_insertion_point(class_scope:com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair) + private static final com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair(); + } + + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EventPair parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EventPair(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int IDENTIFIER_FIELD_NUMBER = 1; + private volatile java.lang.Object identifier_; + /** + * optional string identifier = 1; + * @return Whether the identifier field is set. + */ + @java.lang.Override + public boolean hasIdentifier() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string identifier = 1; + * @return The identifier. + */ + @java.lang.Override + public java.lang.String getIdentifier() { + java.lang.Object ref = identifier_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + identifier_ = s; + return s; + } + } + /** + * optional string identifier = 1; + * @return The bytes for identifier. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getIdentifierBytes() { + java.lang.Object ref = identifier_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + identifier_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TIMESTAMP_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp timestamp_; + /** + * optional .google.protobuf.Timestamp timestamp = 2; + * @return Whether the timestamp field is set. + */ + @java.lang.Override + public boolean hasTimestamp() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional .google.protobuf.Timestamp timestamp = 2; + * @return The timestamp. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getTimestamp() { + return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; + } + /** + * optional .google.protobuf.Timestamp timestamp = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder() { + return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; + } + + public static final int EVENT_PAIR_FIELD_NUMBER = 3; + private java.util.List eventPair_; + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; + */ + @java.lang.Override + public java.util.List getEventPairList() { + return eventPair_; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; + */ + @java.lang.Override + public java.util.List + getEventPairOrBuilderList() { + return eventPair_; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; + */ + @java.lang.Override + public int getEventPairCount() { + return eventPair_.size(); + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; + */ + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair getEventPair(int index) { + return eventPair_.get(index); + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; + */ + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPairOrBuilder getEventPairOrBuilder( + int index) { + return eventPair_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, identifier_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getTimestamp()); + } + for (int i = 0; i < eventPair_.size(); i++) { + output.writeMessage(3, eventPair_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, identifier_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getTimestamp()); + } + for (int i = 0; i < eventPair_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, eventPair_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent)) { + return super.equals(obj); + } + com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent other = (com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent) obj; + + if (hasIdentifier() != other.hasIdentifier()) return false; + if (hasIdentifier()) { + if (!getIdentifier() + .equals(other.getIdentifier())) return false; + } + if (hasTimestamp() != other.hasTimestamp()) return false; + if (hasTimestamp()) { + if (!getTimestamp() + .equals(other.getTimestamp())) return false; + } + if (!getEventPairList() + .equals(other.getEventPairList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasIdentifier()) { + hash = (37 * hash) + IDENTIFIER_FIELD_NUMBER; + hash = (53 * hash) + getIdentifier().hashCode(); + } + if (hasTimestamp()) { + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + getTimestamp().hashCode(); + } + if (getEventPairCount() > 0) { + hash = (37 * hash) + EVENT_PAIR_FIELD_NUMBER; + hash = (53 * hash) + getEventPairList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Proto representation for query metrics logged through BenchBase.
+   * Next id: 4
+   * 
+ * + * Protobuf type {@code com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent) + com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.class, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.Builder.class); + } + + // Construct using com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getTimestampFieldBuilder(); + getEventPairFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + identifier_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + if (timestampBuilder_ == null) { + timestamp_ = null; + } else { + timestampBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + if (eventPairBuilder_ == null) { + eventPair_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + eventPairBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEvent_descriptor; + } + + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent getDefaultInstanceForType() { + return com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.getDefaultInstance(); + } + + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent build() { + com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent buildPartial() { + com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent result = new com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + to_bitField0_ |= 0x00000001; + } + result.identifier_ = identifier_; + if (((from_bitField0_ & 0x00000002) != 0)) { + if (timestampBuilder_ == null) { + result.timestamp_ = timestamp_; + } else { + result.timestamp_ = timestampBuilder_.build(); + } + to_bitField0_ |= 0x00000002; + } + if (eventPairBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + eventPair_ = java.util.Collections.unmodifiableList(eventPair_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.eventPair_ = eventPair_; + } else { + result.eventPair_ = eventPairBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent) { + return mergeFrom((com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent other) { + if (other == com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.getDefaultInstance()) return this; + if (other.hasIdentifier()) { + bitField0_ |= 0x00000001; + identifier_ = other.identifier_; + onChanged(); + } + if (other.hasTimestamp()) { + mergeTimestamp(other.getTimestamp()); + } + if (eventPairBuilder_ == null) { + if (!other.eventPair_.isEmpty()) { + if (eventPair_.isEmpty()) { + eventPair_ = other.eventPair_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureEventPairIsMutable(); + eventPair_.addAll(other.eventPair_); + } + onChanged(); + } + } else { + if (!other.eventPair_.isEmpty()) { + if (eventPairBuilder_.isEmpty()) { + eventPairBuilder_.dispose(); + eventPairBuilder_ = null; + eventPair_ = other.eventPair_; + bitField0_ = (bitField0_ & ~0x00000004); + eventPairBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getEventPairFieldBuilder() : null; + } else { + eventPairBuilder_.addAllMessages(other.eventPair_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object identifier_ = ""; + /** + * optional string identifier = 1; + * @return Whether the identifier field is set. + */ + public boolean hasIdentifier() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string identifier = 1; + * @return The identifier. + */ + public java.lang.String getIdentifier() { + java.lang.Object ref = identifier_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + identifier_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string identifier = 1; + * @return The bytes for identifier. + */ + public com.google.protobuf.ByteString + getIdentifierBytes() { + java.lang.Object ref = identifier_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + identifier_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string identifier = 1; + * @param value The identifier to set. + * @return This builder for chaining. + */ + public Builder setIdentifier( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + identifier_ = value; + onChanged(); + return this; + } + /** + * optional string identifier = 1; + * @return This builder for chaining. + */ + public Builder clearIdentifier() { + bitField0_ = (bitField0_ & ~0x00000001); + identifier_ = getDefaultInstance().getIdentifier(); + onChanged(); + return this; + } + /** + * optional string identifier = 1; + * @param value The bytes for identifier to set. + * @return This builder for chaining. + */ + public Builder setIdentifierBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + bitField0_ |= 0x00000001; + identifier_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp timestamp_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> timestampBuilder_; + /** + * optional .google.protobuf.Timestamp timestamp = 2; + * @return Whether the timestamp field is set. + */ + public boolean hasTimestamp() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional .google.protobuf.Timestamp timestamp = 2; + * @return The timestamp. + */ + public com.google.protobuf.Timestamp getTimestamp() { + if (timestampBuilder_ == null) { + return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; + } else { + return timestampBuilder_.getMessage(); + } + } + /** + * optional .google.protobuf.Timestamp timestamp = 2; + */ + public Builder setTimestamp(com.google.protobuf.Timestamp value) { + if (timestampBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + timestamp_ = value; + onChanged(); + } else { + timestampBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * optional .google.protobuf.Timestamp timestamp = 2; + */ + public Builder setTimestamp( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (timestampBuilder_ == null) { + timestamp_ = builderForValue.build(); + onChanged(); + } else { + timestampBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * optional .google.protobuf.Timestamp timestamp = 2; + */ + public Builder mergeTimestamp(com.google.protobuf.Timestamp value) { + if (timestampBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + timestamp_ != null && + timestamp_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + timestamp_ = + com.google.protobuf.Timestamp.newBuilder(timestamp_).mergeFrom(value).buildPartial(); + } else { + timestamp_ = value; + } + onChanged(); + } else { + timestampBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * optional .google.protobuf.Timestamp timestamp = 2; + */ + public Builder clearTimestamp() { + if (timestampBuilder_ == null) { + timestamp_ = null; + onChanged(); + } else { + timestampBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + /** + * optional .google.protobuf.Timestamp timestamp = 2; + */ + public com.google.protobuf.Timestamp.Builder getTimestampBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getTimestampFieldBuilder().getBuilder(); + } + /** + * optional .google.protobuf.Timestamp timestamp = 2; + */ + public com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder() { + if (timestampBuilder_ != null) { + return timestampBuilder_.getMessageOrBuilder(); + } else { + return timestamp_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; + } + } + /** + * optional .google.protobuf.Timestamp timestamp = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getTimestampFieldBuilder() { + if (timestampBuilder_ == null) { + timestampBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getTimestamp(), + getParentForChildren(), + isClean()); + timestamp_ = null; + } + return timestampBuilder_; + } + + private java.util.List eventPair_ = + java.util.Collections.emptyList(); + private void ensureEventPairIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + eventPair_ = new java.util.ArrayList(eventPair_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair.Builder, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPairOrBuilder> eventPairBuilder_; + + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; + */ + public java.util.List getEventPairList() { + if (eventPairBuilder_ == null) { + return java.util.Collections.unmodifiableList(eventPair_); + } else { + return eventPairBuilder_.getMessageList(); + } + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; + */ + public int getEventPairCount() { + if (eventPairBuilder_ == null) { + return eventPair_.size(); + } else { + return eventPairBuilder_.getCount(); + } + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; + */ + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair getEventPair(int index) { + if (eventPairBuilder_ == null) { + return eventPair_.get(index); + } else { + return eventPairBuilder_.getMessage(index); + } + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; + */ + public Builder setEventPair( + int index, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair value) { + if (eventPairBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventPairIsMutable(); + eventPair_.set(index, value); + onChanged(); + } else { + eventPairBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; + */ + public Builder setEventPair( + int index, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair.Builder builderForValue) { + if (eventPairBuilder_ == null) { + ensureEventPairIsMutable(); + eventPair_.set(index, builderForValue.build()); + onChanged(); + } else { + eventPairBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; + */ + public Builder addEventPair(com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair value) { + if (eventPairBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventPairIsMutable(); + eventPair_.add(value); + onChanged(); + } else { + eventPairBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; + */ + public Builder addEventPair( + int index, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair value) { + if (eventPairBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventPairIsMutable(); + eventPair_.add(index, value); + onChanged(); + } else { + eventPairBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; + */ + public Builder addEventPair( + com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair.Builder builderForValue) { + if (eventPairBuilder_ == null) { + ensureEventPairIsMutable(); + eventPair_.add(builderForValue.build()); + onChanged(); + } else { + eventPairBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; + */ + public Builder addEventPair( + int index, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair.Builder builderForValue) { + if (eventPairBuilder_ == null) { + ensureEventPairIsMutable(); + eventPair_.add(index, builderForValue.build()); + onChanged(); + } else { + eventPairBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; + */ + public Builder addAllEventPair( + java.lang.Iterable values) { + if (eventPairBuilder_ == null) { + ensureEventPairIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, eventPair_); + onChanged(); + } else { + eventPairBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; + */ + public Builder clearEventPair() { + if (eventPairBuilder_ == null) { + eventPair_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + eventPairBuilder_.clear(); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; + */ + public Builder removeEventPair(int index) { + if (eventPairBuilder_ == null) { + ensureEventPairIsMutable(); + eventPair_.remove(index); + onChanged(); + } else { + eventPairBuilder_.remove(index); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; + */ + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair.Builder getEventPairBuilder( + int index) { + return getEventPairFieldBuilder().getBuilder(index); + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; + */ + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPairOrBuilder getEventPairOrBuilder( + int index) { + if (eventPairBuilder_ == null) { + return eventPair_.get(index); } else { + return eventPairBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; + */ + public java.util.List + getEventPairOrBuilderList() { + if (eventPairBuilder_ != null) { + return eventPairBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(eventPair_); + } + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; + */ + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair.Builder addEventPairBuilder() { + return getEventPairFieldBuilder().addBuilder( + com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair.getDefaultInstance()); + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; + */ + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair.Builder addEventPairBuilder( + int index) { + return getEventPairFieldBuilder().addBuilder( + index, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair.getDefaultInstance()); + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; + */ + public java.util.List + getEventPairBuilderList() { + return getEventPairFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair.Builder, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPairOrBuilder> + getEventPairFieldBuilder() { + if (eventPairBuilder_ == null) { + eventPairBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair.Builder, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPairOrBuilder>( + eventPair_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + eventPair_ = null; + } + return eventPairBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent) + } + + // @@protoc_insertion_point(class_scope:com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent) + private static final com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent(); + } + + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QueryEvent parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new QueryEvent(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryEventLog.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryEventLog.java new file mode 100644 index 000000000..6c0419202 --- /dev/null +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryEventLog.java @@ -0,0 +1,780 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: monitor.proto + +package com.oltpbenchmark.api.collectors.monitoring.proto; + +/** + *
+ * Encodes query events in a log.
+ * Next id: 2
+ * 
+ * + * Protobuf type {@code com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog} + */ +public final class QueryEventLog extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog) + QueryEventLogOrBuilder { +private static final long serialVersionUID = 0L; + // Use QueryEventLog.newBuilder() to construct. + private QueryEventLog(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private QueryEventLog() { + event_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new QueryEventLog(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private QueryEventLog( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + event_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + event_.add( + input.readMessage(com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + event_ = java.util.Collections.unmodifiableList(event_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEventLog_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEventLog_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog.class, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog.Builder.class); + } + + public static final int EVENT_FIELD_NUMBER = 1; + private java.util.List event_; + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; + */ + @java.lang.Override + public java.util.List getEventList() { + return event_; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; + */ + @java.lang.Override + public java.util.List + getEventOrBuilderList() { + return event_; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; + */ + @java.lang.Override + public int getEventCount() { + return event_.size(); + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; + */ + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent getEvent(int index) { + return event_.get(index); + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; + */ + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventOrBuilder getEventOrBuilder( + int index) { + return event_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < event_.size(); i++) { + output.writeMessage(1, event_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < event_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, event_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog)) { + return super.equals(obj); + } + com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog other = (com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog) obj; + + if (!getEventList() + .equals(other.getEventList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getEventCount() > 0) { + hash = (37 * hash) + EVENT_FIELD_NUMBER; + hash = (53 * hash) + getEventList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Encodes query events in a log.
+   * Next id: 2
+   * 
+ * + * Protobuf type {@code com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog) + com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLogOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEventLog_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEventLog_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog.class, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog.Builder.class); + } + + // Construct using com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getEventFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (eventBuilder_ == null) { + event_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + eventBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEventLog_descriptor; + } + + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog getDefaultInstanceForType() { + return com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog.getDefaultInstance(); + } + + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog build() { + com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog buildPartial() { + com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog result = new com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog(this); + int from_bitField0_ = bitField0_; + if (eventBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + event_ = java.util.Collections.unmodifiableList(event_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.event_ = event_; + } else { + result.event_ = eventBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog) { + return mergeFrom((com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog other) { + if (other == com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog.getDefaultInstance()) return this; + if (eventBuilder_ == null) { + if (!other.event_.isEmpty()) { + if (event_.isEmpty()) { + event_ = other.event_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureEventIsMutable(); + event_.addAll(other.event_); + } + onChanged(); + } + } else { + if (!other.event_.isEmpty()) { + if (eventBuilder_.isEmpty()) { + eventBuilder_.dispose(); + eventBuilder_ = null; + event_ = other.event_; + bitField0_ = (bitField0_ & ~0x00000001); + eventBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getEventFieldBuilder() : null; + } else { + eventBuilder_.addAllMessages(other.event_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List event_ = + java.util.Collections.emptyList(); + private void ensureEventIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + event_ = new java.util.ArrayList(event_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.Builder, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventOrBuilder> eventBuilder_; + + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; + */ + public java.util.List getEventList() { + if (eventBuilder_ == null) { + return java.util.Collections.unmodifiableList(event_); + } else { + return eventBuilder_.getMessageList(); + } + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; + */ + public int getEventCount() { + if (eventBuilder_ == null) { + return event_.size(); + } else { + return eventBuilder_.getCount(); + } + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; + */ + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent getEvent(int index) { + if (eventBuilder_ == null) { + return event_.get(index); + } else { + return eventBuilder_.getMessage(index); + } + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; + */ + public Builder setEvent( + int index, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent value) { + if (eventBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventIsMutable(); + event_.set(index, value); + onChanged(); + } else { + eventBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; + */ + public Builder setEvent( + int index, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.Builder builderForValue) { + if (eventBuilder_ == null) { + ensureEventIsMutable(); + event_.set(index, builderForValue.build()); + onChanged(); + } else { + eventBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; + */ + public Builder addEvent(com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent value) { + if (eventBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventIsMutable(); + event_.add(value); + onChanged(); + } else { + eventBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; + */ + public Builder addEvent( + int index, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent value) { + if (eventBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventIsMutable(); + event_.add(index, value); + onChanged(); + } else { + eventBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; + */ + public Builder addEvent( + com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.Builder builderForValue) { + if (eventBuilder_ == null) { + ensureEventIsMutable(); + event_.add(builderForValue.build()); + onChanged(); + } else { + eventBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; + */ + public Builder addEvent( + int index, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.Builder builderForValue) { + if (eventBuilder_ == null) { + ensureEventIsMutable(); + event_.add(index, builderForValue.build()); + onChanged(); + } else { + eventBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; + */ + public Builder addAllEvent( + java.lang.Iterable values) { + if (eventBuilder_ == null) { + ensureEventIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, event_); + onChanged(); + } else { + eventBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; + */ + public Builder clearEvent() { + if (eventBuilder_ == null) { + event_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + eventBuilder_.clear(); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; + */ + public Builder removeEvent(int index) { + if (eventBuilder_ == null) { + ensureEventIsMutable(); + event_.remove(index); + onChanged(); + } else { + eventBuilder_.remove(index); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; + */ + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.Builder getEventBuilder( + int index) { + return getEventFieldBuilder().getBuilder(index); + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; + */ + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventOrBuilder getEventOrBuilder( + int index) { + if (eventBuilder_ == null) { + return event_.get(index); } else { + return eventBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; + */ + public java.util.List + getEventOrBuilderList() { + if (eventBuilder_ != null) { + return eventBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(event_); + } + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; + */ + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.Builder addEventBuilder() { + return getEventFieldBuilder().addBuilder( + com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.getDefaultInstance()); + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; + */ + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.Builder addEventBuilder( + int index) { + return getEventFieldBuilder().addBuilder( + index, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.getDefaultInstance()); + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; + */ + public java.util.List + getEventBuilderList() { + return getEventFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.Builder, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventOrBuilder> + getEventFieldBuilder() { + if (eventBuilder_ == null) { + eventBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.Builder, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventOrBuilder>( + event_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + event_ = null; + } + return eventBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog) + } + + // @@protoc_insertion_point(class_scope:com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog) + private static final com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog(); + } + + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QueryEventLog parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new QueryEventLog(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryEventLogOrBuilder.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryEventLogOrBuilder.java new file mode 100644 index 000000000..e37fda557 --- /dev/null +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryEventLogOrBuilder.java @@ -0,0 +1,33 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: monitor.proto + +package com.oltpbenchmark.api.collectors.monitoring.proto; + +public interface QueryEventLogOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; + */ + java.util.List + getEventList(); + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; + */ + com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent getEvent(int index); + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; + */ + int getEventCount(); + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; + */ + java.util.List + getEventOrBuilderList(); + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; + */ + com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventOrBuilder getEventOrBuilder( + int index); +} diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryEventOrBuilder.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryEventOrBuilder.java new file mode 100644 index 000000000..23b9202b5 --- /dev/null +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryEventOrBuilder.java @@ -0,0 +1,65 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: monitor.proto + +package com.oltpbenchmark.api.collectors.monitoring.proto; + +public interface QueryEventOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent) + com.google.protobuf.MessageOrBuilder { + + /** + * optional string identifier = 1; + * @return Whether the identifier field is set. + */ + boolean hasIdentifier(); + /** + * optional string identifier = 1; + * @return The identifier. + */ + java.lang.String getIdentifier(); + /** + * optional string identifier = 1; + * @return The bytes for identifier. + */ + com.google.protobuf.ByteString + getIdentifierBytes(); + + /** + * optional .google.protobuf.Timestamp timestamp = 2; + * @return Whether the timestamp field is set. + */ + boolean hasTimestamp(); + /** + * optional .google.protobuf.Timestamp timestamp = 2; + * @return The timestamp. + */ + com.google.protobuf.Timestamp getTimestamp(); + /** + * optional .google.protobuf.Timestamp timestamp = 2; + */ + com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder(); + + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; + */ + java.util.List + getEventPairList(); + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; + */ + com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair getEventPair(int index); + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; + */ + int getEventPairCount(); + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; + */ + java.util.List + getEventPairOrBuilderList(); + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; + */ + com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPairOrBuilder getEventPairOrBuilder( + int index); +} diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryInfo.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryInfo.java new file mode 100644 index 000000000..a24fca51f --- /dev/null +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryInfo.java @@ -0,0 +1,2113 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: monitor.proto + +package com.oltpbenchmark.api.collectors.monitoring.proto; + +/** + *
+ * Proto representation for one-off query metrics logged through BenchBase.
+ * 
+ * + * Protobuf type {@code com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo} + */ +public final class QueryInfo extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo) + QueryInfoOrBuilder { +private static final long serialVersionUID = 0L; + // Use QueryInfo.newBuilder() to construct. + private QueryInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private QueryInfo() { + identifier_ = ""; + infoPair_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new QueryInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private QueryInfo( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + identifier_ = s; + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + infoPair_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + infoPair_.add( + input.readMessage(com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) != 0)) { + infoPair_ = java.util.Collections.unmodifiableList(infoPair_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.class, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.Builder.class); + } + + public interface InfoPairOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair) + com.google.protobuf.MessageOrBuilder { + + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; + * @return Whether the stringType field is set. + */ + boolean hasStringType(); + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; + * @return The enum numeric value on the wire for stringType. + */ + int getStringTypeValue(); + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; + * @return The stringType. + */ + com.oltpbenchmark.api.collectors.monitoring.proto.StringType getStringType(); + + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; + * @return Whether the longType field is set. + */ + boolean hasLongType(); + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; + * @return The enum numeric value on the wire for longType. + */ + int getLongTypeValue(); + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; + * @return The longType. + */ + com.oltpbenchmark.api.collectors.monitoring.proto.LongType getLongType(); + + /** + * string string_value = 3; + * @return Whether the stringValue field is set. + */ + boolean hasStringValue(); + /** + * string string_value = 3; + * @return The stringValue. + */ + java.lang.String getStringValue(); + /** + * string string_value = 3; + * @return The bytes for stringValue. + */ + com.google.protobuf.ByteString + getStringValueBytes(); + + /** + * int64 long_value = 4; + * @return Whether the longValue field is set. + */ + boolean hasLongValue(); + /** + * int64 long_value = 4; + * @return The longValue. + */ + long getLongValue(); + + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair.TypeCase getTypeCase(); + + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair.ValueCase getValueCase(); + } + /** + *
+   * Encodes a pair of info type and value.
+   * Next id: 5
+   * 
+ * + * Protobuf type {@code com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair} + */ + public static final class InfoPair extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair) + InfoPairOrBuilder { + private static final long serialVersionUID = 0L; + // Use InfoPair.newBuilder() to construct. + private InfoPair(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private InfoPair() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new InfoPair(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private InfoPair( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + int rawValue = input.readEnum(); + typeCase_ = 1; + type_ = rawValue; + break; + } + case 16: { + int rawValue = input.readEnum(); + typeCase_ = 2; + type_ = rawValue; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + valueCase_ = 3; + value_ = s; + break; + } + case 32: { + value_ = input.readInt64(); + valueCase_ = 4; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfo_InfoPair_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfo_InfoPair_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair.class, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair.Builder.class); + } + + private int typeCase_ = 0; + private java.lang.Object type_; + public enum TypeCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + STRING_TYPE(1), + LONG_TYPE(2), + TYPE_NOT_SET(0); + private final int value; + private TypeCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static TypeCase valueOf(int value) { + return forNumber(value); + } + + public static TypeCase forNumber(int value) { + switch (value) { + case 1: return STRING_TYPE; + case 2: return LONG_TYPE; + case 0: return TYPE_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public TypeCase + getTypeCase() { + return TypeCase.forNumber( + typeCase_); + } + + private int valueCase_ = 0; + private java.lang.Object value_; + public enum ValueCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + STRING_VALUE(3), + LONG_VALUE(4), + VALUE_NOT_SET(0); + private final int value; + private ValueCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ValueCase valueOf(int value) { + return forNumber(value); + } + + public static ValueCase forNumber(int value) { + switch (value) { + case 3: return STRING_VALUE; + case 4: return LONG_VALUE; + case 0: return VALUE_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public ValueCase + getValueCase() { + return ValueCase.forNumber( + valueCase_); + } + + public static final int STRING_TYPE_FIELD_NUMBER = 1; + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; + * @return Whether the stringType field is set. + */ + public boolean hasStringType() { + return typeCase_ == 1; + } + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; + * @return The enum numeric value on the wire for stringType. + */ + public int getStringTypeValue() { + if (typeCase_ == 1) { + return (java.lang.Integer) type_; + } + return 0; + } + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; + * @return The stringType. + */ + public com.oltpbenchmark.api.collectors.monitoring.proto.StringType getStringType() { + if (typeCase_ == 1) { + @SuppressWarnings("deprecation") + com.oltpbenchmark.api.collectors.monitoring.proto.StringType result = com.oltpbenchmark.api.collectors.monitoring.proto.StringType.valueOf( + (java.lang.Integer) type_); + return result == null ? com.oltpbenchmark.api.collectors.monitoring.proto.StringType.UNRECOGNIZED : result; + } + return com.oltpbenchmark.api.collectors.monitoring.proto.StringType.QUERY_TEXT; + } + + public static final int LONG_TYPE_FIELD_NUMBER = 2; + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; + * @return Whether the longType field is set. + */ + public boolean hasLongType() { + return typeCase_ == 2; + } + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; + * @return The enum numeric value on the wire for longType. + */ + public int getLongTypeValue() { + if (typeCase_ == 2) { + return (java.lang.Integer) type_; + } + return 0; + } + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; + * @return The longType. + */ + public com.oltpbenchmark.api.collectors.monitoring.proto.LongType getLongType() { + if (typeCase_ == 2) { + @SuppressWarnings("deprecation") + com.oltpbenchmark.api.collectors.monitoring.proto.LongType result = com.oltpbenchmark.api.collectors.monitoring.proto.LongType.valueOf( + (java.lang.Integer) type_); + return result == null ? com.oltpbenchmark.api.collectors.monitoring.proto.LongType.UNRECOGNIZED : result; + } + return com.oltpbenchmark.api.collectors.monitoring.proto.LongType.EXECUTION_COUNT; + } + + public static final int STRING_VALUE_FIELD_NUMBER = 3; + /** + * string string_value = 3; + * @return Whether the stringValue field is set. + */ + public boolean hasStringValue() { + return valueCase_ == 3; + } + /** + * string string_value = 3; + * @return The stringValue. + */ + public java.lang.String getStringValue() { + java.lang.Object ref = ""; + if (valueCase_ == 3) { + ref = value_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (valueCase_ == 3) { + value_ = s; + } + return s; + } + } + /** + * string string_value = 3; + * @return The bytes for stringValue. + */ + public com.google.protobuf.ByteString + getStringValueBytes() { + java.lang.Object ref = ""; + if (valueCase_ == 3) { + ref = value_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (valueCase_ == 3) { + value_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LONG_VALUE_FIELD_NUMBER = 4; + /** + * int64 long_value = 4; + * @return Whether the longValue field is set. + */ + @java.lang.Override + public boolean hasLongValue() { + return valueCase_ == 4; + } + /** + * int64 long_value = 4; + * @return The longValue. + */ + @java.lang.Override + public long getLongValue() { + if (valueCase_ == 4) { + return (java.lang.Long) value_; + } + return 0L; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (typeCase_ == 1) { + output.writeEnum(1, ((java.lang.Integer) type_)); + } + if (typeCase_ == 2) { + output.writeEnum(2, ((java.lang.Integer) type_)); + } + if (valueCase_ == 3) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, value_); + } + if (valueCase_ == 4) { + output.writeInt64( + 4, (long)((java.lang.Long) value_)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (typeCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, ((java.lang.Integer) type_)); + } + if (typeCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, ((java.lang.Integer) type_)); + } + if (valueCase_ == 3) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, value_); + } + if (valueCase_ == 4) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size( + 4, (long)((java.lang.Long) value_)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair)) { + return super.equals(obj); + } + com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair other = (com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair) obj; + + if (!getTypeCase().equals(other.getTypeCase())) return false; + switch (typeCase_) { + case 1: + if (getStringTypeValue() + != other.getStringTypeValue()) return false; + break; + case 2: + if (getLongTypeValue() + != other.getLongTypeValue()) return false; + break; + case 0: + default: + } + if (!getValueCase().equals(other.getValueCase())) return false; + switch (valueCase_) { + case 3: + if (!getStringValue() + .equals(other.getStringValue())) return false; + break; + case 4: + if (getLongValue() + != other.getLongValue()) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (typeCase_) { + case 1: + hash = (37 * hash) + STRING_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getStringTypeValue(); + break; + case 2: + hash = (37 * hash) + LONG_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getLongTypeValue(); + break; + case 0: + default: + } + switch (valueCase_) { + case 3: + hash = (37 * hash) + STRING_VALUE_FIELD_NUMBER; + hash = (53 * hash) + getStringValue().hashCode(); + break; + case 4: + hash = (37 * hash) + LONG_VALUE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getLongValue()); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * Encodes a pair of info type and value.
+     * Next id: 5
+     * 
+ * + * Protobuf type {@code com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair) + com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPairOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfo_InfoPair_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfo_InfoPair_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair.class, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair.Builder.class); + } + + // Construct using com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + typeCase_ = 0; + type_ = null; + valueCase_ = 0; + value_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfo_InfoPair_descriptor; + } + + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair getDefaultInstanceForType() { + return com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair.getDefaultInstance(); + } + + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair build() { + com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair buildPartial() { + com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair result = new com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair(this); + if (typeCase_ == 1) { + result.type_ = type_; + } + if (typeCase_ == 2) { + result.type_ = type_; + } + if (valueCase_ == 3) { + result.value_ = value_; + } + if (valueCase_ == 4) { + result.value_ = value_; + } + result.typeCase_ = typeCase_; + result.valueCase_ = valueCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair) { + return mergeFrom((com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair other) { + if (other == com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair.getDefaultInstance()) return this; + switch (other.getTypeCase()) { + case STRING_TYPE: { + setStringTypeValue(other.getStringTypeValue()); + break; + } + case LONG_TYPE: { + setLongTypeValue(other.getLongTypeValue()); + break; + } + case TYPE_NOT_SET: { + break; + } + } + switch (other.getValueCase()) { + case STRING_VALUE: { + valueCase_ = 3; + value_ = other.value_; + onChanged(); + break; + } + case LONG_VALUE: { + setLongValue(other.getLongValue()); + break; + } + case VALUE_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int typeCase_ = 0; + private java.lang.Object type_; + public TypeCase + getTypeCase() { + return TypeCase.forNumber( + typeCase_); + } + + public Builder clearType() { + typeCase_ = 0; + type_ = null; + onChanged(); + return this; + } + + private int valueCase_ = 0; + private java.lang.Object value_; + public ValueCase + getValueCase() { + return ValueCase.forNumber( + valueCase_); + } + + public Builder clearValue() { + valueCase_ = 0; + value_ = null; + onChanged(); + return this; + } + + + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; + * @return Whether the stringType field is set. + */ + @java.lang.Override + public boolean hasStringType() { + return typeCase_ == 1; + } + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; + * @return The enum numeric value on the wire for stringType. + */ + @java.lang.Override + public int getStringTypeValue() { + if (typeCase_ == 1) { + return ((java.lang.Integer) type_).intValue(); + } + return 0; + } + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; + * @param value The enum numeric value on the wire for stringType to set. + * @return This builder for chaining. + */ + public Builder setStringTypeValue(int value) { + typeCase_ = 1; + type_ = value; + onChanged(); + return this; + } + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; + * @return The stringType. + */ + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.StringType getStringType() { + if (typeCase_ == 1) { + @SuppressWarnings("deprecation") + com.oltpbenchmark.api.collectors.monitoring.proto.StringType result = com.oltpbenchmark.api.collectors.monitoring.proto.StringType.valueOf( + (java.lang.Integer) type_); + return result == null ? com.oltpbenchmark.api.collectors.monitoring.proto.StringType.UNRECOGNIZED : result; + } + return com.oltpbenchmark.api.collectors.monitoring.proto.StringType.QUERY_TEXT; + } + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; + * @param value The stringType to set. + * @return This builder for chaining. + */ + public Builder setStringType(com.oltpbenchmark.api.collectors.monitoring.proto.StringType value) { + if (value == null) { + throw new NullPointerException(); + } + typeCase_ = 1; + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; + * @return This builder for chaining. + */ + public Builder clearStringType() { + if (typeCase_ == 1) { + typeCase_ = 0; + type_ = null; + onChanged(); + } + return this; + } + + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; + * @return Whether the longType field is set. + */ + @java.lang.Override + public boolean hasLongType() { + return typeCase_ == 2; + } + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; + * @return The enum numeric value on the wire for longType. + */ + @java.lang.Override + public int getLongTypeValue() { + if (typeCase_ == 2) { + return ((java.lang.Integer) type_).intValue(); + } + return 0; + } + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; + * @param value The enum numeric value on the wire for longType to set. + * @return This builder for chaining. + */ + public Builder setLongTypeValue(int value) { + typeCase_ = 2; + type_ = value; + onChanged(); + return this; + } + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; + * @return The longType. + */ + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.LongType getLongType() { + if (typeCase_ == 2) { + @SuppressWarnings("deprecation") + com.oltpbenchmark.api.collectors.monitoring.proto.LongType result = com.oltpbenchmark.api.collectors.monitoring.proto.LongType.valueOf( + (java.lang.Integer) type_); + return result == null ? com.oltpbenchmark.api.collectors.monitoring.proto.LongType.UNRECOGNIZED : result; + } + return com.oltpbenchmark.api.collectors.monitoring.proto.LongType.EXECUTION_COUNT; + } + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; + * @param value The longType to set. + * @return This builder for chaining. + */ + public Builder setLongType(com.oltpbenchmark.api.collectors.monitoring.proto.LongType value) { + if (value == null) { + throw new NullPointerException(); + } + typeCase_ = 2; + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; + * @return This builder for chaining. + */ + public Builder clearLongType() { + if (typeCase_ == 2) { + typeCase_ = 0; + type_ = null; + onChanged(); + } + return this; + } + + /** + * string string_value = 3; + * @return Whether the stringValue field is set. + */ + @java.lang.Override + public boolean hasStringValue() { + return valueCase_ == 3; + } + /** + * string string_value = 3; + * @return The stringValue. + */ + @java.lang.Override + public java.lang.String getStringValue() { + java.lang.Object ref = ""; + if (valueCase_ == 3) { + ref = value_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (valueCase_ == 3) { + value_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string string_value = 3; + * @return The bytes for stringValue. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getStringValueBytes() { + java.lang.Object ref = ""; + if (valueCase_ == 3) { + ref = value_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (valueCase_ == 3) { + value_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string string_value = 3; + * @param value The stringValue to set. + * @return This builder for chaining. + */ + public Builder setStringValue( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + valueCase_ = 3; + value_ = value; + onChanged(); + return this; + } + /** + * string string_value = 3; + * @return This builder for chaining. + */ + public Builder clearStringValue() { + if (valueCase_ == 3) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + return this; + } + /** + * string string_value = 3; + * @param value The bytes for stringValue to set. + * @return This builder for chaining. + */ + public Builder setStringValueBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + valueCase_ = 3; + value_ = value; + onChanged(); + return this; + } + + /** + * int64 long_value = 4; + * @return Whether the longValue field is set. + */ + public boolean hasLongValue() { + return valueCase_ == 4; + } + /** + * int64 long_value = 4; + * @return The longValue. + */ + public long getLongValue() { + if (valueCase_ == 4) { + return (java.lang.Long) value_; + } + return 0L; + } + /** + * int64 long_value = 4; + * @param value The longValue to set. + * @return This builder for chaining. + */ + public Builder setLongValue(long value) { + valueCase_ = 4; + value_ = value; + onChanged(); + return this; + } + /** + * int64 long_value = 4; + * @return This builder for chaining. + */ + public Builder clearLongValue() { + if (valueCase_ == 4) { + valueCase_ = 0; + value_ = null; + onChanged(); + } + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair) + } + + // @@protoc_insertion_point(class_scope:com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair) + private static final com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair(); + } + + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InfoPair parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new InfoPair(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int IDENTIFIER_FIELD_NUMBER = 1; + private volatile java.lang.Object identifier_; + /** + * optional string identifier = 1; + * @return Whether the identifier field is set. + */ + @java.lang.Override + public boolean hasIdentifier() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string identifier = 1; + * @return The identifier. + */ + @java.lang.Override + public java.lang.String getIdentifier() { + java.lang.Object ref = identifier_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + identifier_ = s; + return s; + } + } + /** + * optional string identifier = 1; + * @return The bytes for identifier. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getIdentifierBytes() { + java.lang.Object ref = identifier_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + identifier_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INFO_PAIR_FIELD_NUMBER = 3; + private java.util.List infoPair_; + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; + */ + @java.lang.Override + public java.util.List getInfoPairList() { + return infoPair_; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; + */ + @java.lang.Override + public java.util.List + getInfoPairOrBuilderList() { + return infoPair_; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; + */ + @java.lang.Override + public int getInfoPairCount() { + return infoPair_.size(); + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; + */ + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair getInfoPair(int index) { + return infoPair_.get(index); + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; + */ + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPairOrBuilder getInfoPairOrBuilder( + int index) { + return infoPair_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, identifier_); + } + for (int i = 0; i < infoPair_.size(); i++) { + output.writeMessage(3, infoPair_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, identifier_); + } + for (int i = 0; i < infoPair_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, infoPair_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo)) { + return super.equals(obj); + } + com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo other = (com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo) obj; + + if (hasIdentifier() != other.hasIdentifier()) return false; + if (hasIdentifier()) { + if (!getIdentifier() + .equals(other.getIdentifier())) return false; + } + if (!getInfoPairList() + .equals(other.getInfoPairList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasIdentifier()) { + hash = (37 * hash) + IDENTIFIER_FIELD_NUMBER; + hash = (53 * hash) + getIdentifier().hashCode(); + } + if (getInfoPairCount() > 0) { + hash = (37 * hash) + INFO_PAIR_FIELD_NUMBER; + hash = (53 * hash) + getInfoPairList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Proto representation for one-off query metrics logged through BenchBase.
+   * 
+ * + * Protobuf type {@code com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo) + com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.class, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.Builder.class); + } + + // Construct using com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getInfoPairFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + identifier_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + if (infoPairBuilder_ == null) { + infoPair_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + infoPairBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfo_descriptor; + } + + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo getDefaultInstanceForType() { + return com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo build() { + com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo buildPartial() { + com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo result = new com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + to_bitField0_ |= 0x00000001; + } + result.identifier_ = identifier_; + if (infoPairBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + infoPair_ = java.util.Collections.unmodifiableList(infoPair_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.infoPair_ = infoPair_; + } else { + result.infoPair_ = infoPairBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo) { + return mergeFrom((com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo other) { + if (other == com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.getDefaultInstance()) return this; + if (other.hasIdentifier()) { + bitField0_ |= 0x00000001; + identifier_ = other.identifier_; + onChanged(); + } + if (infoPairBuilder_ == null) { + if (!other.infoPair_.isEmpty()) { + if (infoPair_.isEmpty()) { + infoPair_ = other.infoPair_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureInfoPairIsMutable(); + infoPair_.addAll(other.infoPair_); + } + onChanged(); + } + } else { + if (!other.infoPair_.isEmpty()) { + if (infoPairBuilder_.isEmpty()) { + infoPairBuilder_.dispose(); + infoPairBuilder_ = null; + infoPair_ = other.infoPair_; + bitField0_ = (bitField0_ & ~0x00000002); + infoPairBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getInfoPairFieldBuilder() : null; + } else { + infoPairBuilder_.addAllMessages(other.infoPair_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object identifier_ = ""; + /** + * optional string identifier = 1; + * @return Whether the identifier field is set. + */ + public boolean hasIdentifier() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string identifier = 1; + * @return The identifier. + */ + public java.lang.String getIdentifier() { + java.lang.Object ref = identifier_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + identifier_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string identifier = 1; + * @return The bytes for identifier. + */ + public com.google.protobuf.ByteString + getIdentifierBytes() { + java.lang.Object ref = identifier_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + identifier_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string identifier = 1; + * @param value The identifier to set. + * @return This builder for chaining. + */ + public Builder setIdentifier( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + identifier_ = value; + onChanged(); + return this; + } + /** + * optional string identifier = 1; + * @return This builder for chaining. + */ + public Builder clearIdentifier() { + bitField0_ = (bitField0_ & ~0x00000001); + identifier_ = getDefaultInstance().getIdentifier(); + onChanged(); + return this; + } + /** + * optional string identifier = 1; + * @param value The bytes for identifier to set. + * @return This builder for chaining. + */ + public Builder setIdentifierBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + bitField0_ |= 0x00000001; + identifier_ = value; + onChanged(); + return this; + } + + private java.util.List infoPair_ = + java.util.Collections.emptyList(); + private void ensureInfoPairIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + infoPair_ = new java.util.ArrayList(infoPair_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair.Builder, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPairOrBuilder> infoPairBuilder_; + + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; + */ + public java.util.List getInfoPairList() { + if (infoPairBuilder_ == null) { + return java.util.Collections.unmodifiableList(infoPair_); + } else { + return infoPairBuilder_.getMessageList(); + } + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; + */ + public int getInfoPairCount() { + if (infoPairBuilder_ == null) { + return infoPair_.size(); + } else { + return infoPairBuilder_.getCount(); + } + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; + */ + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair getInfoPair(int index) { + if (infoPairBuilder_ == null) { + return infoPair_.get(index); + } else { + return infoPairBuilder_.getMessage(index); + } + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; + */ + public Builder setInfoPair( + int index, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair value) { + if (infoPairBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInfoPairIsMutable(); + infoPair_.set(index, value); + onChanged(); + } else { + infoPairBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; + */ + public Builder setInfoPair( + int index, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair.Builder builderForValue) { + if (infoPairBuilder_ == null) { + ensureInfoPairIsMutable(); + infoPair_.set(index, builderForValue.build()); + onChanged(); + } else { + infoPairBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; + */ + public Builder addInfoPair(com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair value) { + if (infoPairBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInfoPairIsMutable(); + infoPair_.add(value); + onChanged(); + } else { + infoPairBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; + */ + public Builder addInfoPair( + int index, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair value) { + if (infoPairBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInfoPairIsMutable(); + infoPair_.add(index, value); + onChanged(); + } else { + infoPairBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; + */ + public Builder addInfoPair( + com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair.Builder builderForValue) { + if (infoPairBuilder_ == null) { + ensureInfoPairIsMutable(); + infoPair_.add(builderForValue.build()); + onChanged(); + } else { + infoPairBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; + */ + public Builder addInfoPair( + int index, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair.Builder builderForValue) { + if (infoPairBuilder_ == null) { + ensureInfoPairIsMutable(); + infoPair_.add(index, builderForValue.build()); + onChanged(); + } else { + infoPairBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; + */ + public Builder addAllInfoPair( + java.lang.Iterable values) { + if (infoPairBuilder_ == null) { + ensureInfoPairIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, infoPair_); + onChanged(); + } else { + infoPairBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; + */ + public Builder clearInfoPair() { + if (infoPairBuilder_ == null) { + infoPair_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + infoPairBuilder_.clear(); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; + */ + public Builder removeInfoPair(int index) { + if (infoPairBuilder_ == null) { + ensureInfoPairIsMutable(); + infoPair_.remove(index); + onChanged(); + } else { + infoPairBuilder_.remove(index); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; + */ + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair.Builder getInfoPairBuilder( + int index) { + return getInfoPairFieldBuilder().getBuilder(index); + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; + */ + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPairOrBuilder getInfoPairOrBuilder( + int index) { + if (infoPairBuilder_ == null) { + return infoPair_.get(index); } else { + return infoPairBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; + */ + public java.util.List + getInfoPairOrBuilderList() { + if (infoPairBuilder_ != null) { + return infoPairBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(infoPair_); + } + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; + */ + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair.Builder addInfoPairBuilder() { + return getInfoPairFieldBuilder().addBuilder( + com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair.getDefaultInstance()); + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; + */ + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair.Builder addInfoPairBuilder( + int index) { + return getInfoPairFieldBuilder().addBuilder( + index, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair.getDefaultInstance()); + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; + */ + public java.util.List + getInfoPairBuilderList() { + return getInfoPairFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair.Builder, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPairOrBuilder> + getInfoPairFieldBuilder() { + if (infoPairBuilder_ == null) { + infoPairBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair.Builder, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPairOrBuilder>( + infoPair_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + infoPair_ = null; + } + return infoPairBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo) + } + + // @@protoc_insertion_point(class_scope:com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo) + private static final com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo(); + } + + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QueryInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new QueryInfo(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryInfoLog.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryInfoLog.java new file mode 100644 index 000000000..d5d51d01d --- /dev/null +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryInfoLog.java @@ -0,0 +1,780 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: monitor.proto + +package com.oltpbenchmark.api.collectors.monitoring.proto; + +/** + *
+ * Encodes one-off query info in a log.
+ * Next id: 2
+ * 
+ * + * Protobuf type {@code com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog} + */ +public final class QueryInfoLog extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog) + QueryInfoLogOrBuilder { +private static final long serialVersionUID = 0L; + // Use QueryInfoLog.newBuilder() to construct. + private QueryInfoLog(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private QueryInfoLog() { + info_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new QueryInfoLog(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private QueryInfoLog( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + info_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + info_.add( + input.readMessage(com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + info_ = java.util.Collections.unmodifiableList(info_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfoLog_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfoLog_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog.class, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog.Builder.class); + } + + public static final int INFO_FIELD_NUMBER = 1; + private java.util.List info_; + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; + */ + @java.lang.Override + public java.util.List getInfoList() { + return info_; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; + */ + @java.lang.Override + public java.util.List + getInfoOrBuilderList() { + return info_; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; + */ + @java.lang.Override + public int getInfoCount() { + return info_.size(); + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; + */ + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo getInfo(int index) { + return info_.get(index); + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; + */ + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoOrBuilder getInfoOrBuilder( + int index) { + return info_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < info_.size(); i++) { + output.writeMessage(1, info_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < info_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, info_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog)) { + return super.equals(obj); + } + com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog other = (com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog) obj; + + if (!getInfoList() + .equals(other.getInfoList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getInfoCount() > 0) { + hash = (37 * hash) + INFO_FIELD_NUMBER; + hash = (53 * hash) + getInfoList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Encodes one-off query info in a log.
+   * Next id: 2
+   * 
+ * + * Protobuf type {@code com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog) + com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLogOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfoLog_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfoLog_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog.class, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog.Builder.class); + } + + // Construct using com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getInfoFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (infoBuilder_ == null) { + info_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + infoBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfoLog_descriptor; + } + + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog getDefaultInstanceForType() { + return com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog.getDefaultInstance(); + } + + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog build() { + com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog buildPartial() { + com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog result = new com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog(this); + int from_bitField0_ = bitField0_; + if (infoBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + info_ = java.util.Collections.unmodifiableList(info_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.info_ = info_; + } else { + result.info_ = infoBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog) { + return mergeFrom((com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog other) { + if (other == com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog.getDefaultInstance()) return this; + if (infoBuilder_ == null) { + if (!other.info_.isEmpty()) { + if (info_.isEmpty()) { + info_ = other.info_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureInfoIsMutable(); + info_.addAll(other.info_); + } + onChanged(); + } + } else { + if (!other.info_.isEmpty()) { + if (infoBuilder_.isEmpty()) { + infoBuilder_.dispose(); + infoBuilder_ = null; + info_ = other.info_; + bitField0_ = (bitField0_ & ~0x00000001); + infoBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getInfoFieldBuilder() : null; + } else { + infoBuilder_.addAllMessages(other.info_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List info_ = + java.util.Collections.emptyList(); + private void ensureInfoIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + info_ = new java.util.ArrayList(info_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.Builder, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoOrBuilder> infoBuilder_; + + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; + */ + public java.util.List getInfoList() { + if (infoBuilder_ == null) { + return java.util.Collections.unmodifiableList(info_); + } else { + return infoBuilder_.getMessageList(); + } + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; + */ + public int getInfoCount() { + if (infoBuilder_ == null) { + return info_.size(); + } else { + return infoBuilder_.getCount(); + } + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; + */ + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo getInfo(int index) { + if (infoBuilder_ == null) { + return info_.get(index); + } else { + return infoBuilder_.getMessage(index); + } + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; + */ + public Builder setInfo( + int index, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo value) { + if (infoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInfoIsMutable(); + info_.set(index, value); + onChanged(); + } else { + infoBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; + */ + public Builder setInfo( + int index, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.Builder builderForValue) { + if (infoBuilder_ == null) { + ensureInfoIsMutable(); + info_.set(index, builderForValue.build()); + onChanged(); + } else { + infoBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; + */ + public Builder addInfo(com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo value) { + if (infoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInfoIsMutable(); + info_.add(value); + onChanged(); + } else { + infoBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; + */ + public Builder addInfo( + int index, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo value) { + if (infoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInfoIsMutable(); + info_.add(index, value); + onChanged(); + } else { + infoBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; + */ + public Builder addInfo( + com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.Builder builderForValue) { + if (infoBuilder_ == null) { + ensureInfoIsMutable(); + info_.add(builderForValue.build()); + onChanged(); + } else { + infoBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; + */ + public Builder addInfo( + int index, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.Builder builderForValue) { + if (infoBuilder_ == null) { + ensureInfoIsMutable(); + info_.add(index, builderForValue.build()); + onChanged(); + } else { + infoBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; + */ + public Builder addAllInfo( + java.lang.Iterable values) { + if (infoBuilder_ == null) { + ensureInfoIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, info_); + onChanged(); + } else { + infoBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; + */ + public Builder clearInfo() { + if (infoBuilder_ == null) { + info_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + infoBuilder_.clear(); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; + */ + public Builder removeInfo(int index) { + if (infoBuilder_ == null) { + ensureInfoIsMutable(); + info_.remove(index); + onChanged(); + } else { + infoBuilder_.remove(index); + } + return this; + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; + */ + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.Builder getInfoBuilder( + int index) { + return getInfoFieldBuilder().getBuilder(index); + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; + */ + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoOrBuilder getInfoOrBuilder( + int index) { + if (infoBuilder_ == null) { + return info_.get(index); } else { + return infoBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; + */ + public java.util.List + getInfoOrBuilderList() { + if (infoBuilder_ != null) { + return infoBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(info_); + } + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; + */ + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.Builder addInfoBuilder() { + return getInfoFieldBuilder().addBuilder( + com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.getDefaultInstance()); + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; + */ + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.Builder addInfoBuilder( + int index) { + return getInfoFieldBuilder().addBuilder( + index, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.getDefaultInstance()); + } + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; + */ + public java.util.List + getInfoBuilderList() { + return getInfoFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.Builder, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoOrBuilder> + getInfoFieldBuilder() { + if (infoBuilder_ == null) { + infoBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.Builder, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoOrBuilder>( + info_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + info_ = null; + } + return infoBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog) + } + + // @@protoc_insertion_point(class_scope:com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog) + private static final com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog(); + } + + public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QueryInfoLog parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new QueryInfoLog(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryInfoLogOrBuilder.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryInfoLogOrBuilder.java new file mode 100644 index 000000000..7b2edfd20 --- /dev/null +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryInfoLogOrBuilder.java @@ -0,0 +1,33 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: monitor.proto + +package com.oltpbenchmark.api.collectors.monitoring.proto; + +public interface QueryInfoLogOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; + */ + java.util.List + getInfoList(); + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; + */ + com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo getInfo(int index); + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; + */ + int getInfoCount(); + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; + */ + java.util.List + getInfoOrBuilderList(); + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; + */ + com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoOrBuilder getInfoOrBuilder( + int index); +} diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryInfoOrBuilder.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryInfoOrBuilder.java new file mode 100644 index 000000000..2e029c9c6 --- /dev/null +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryInfoOrBuilder.java @@ -0,0 +1,50 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: monitor.proto + +package com.oltpbenchmark.api.collectors.monitoring.proto; + +public interface QueryInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * optional string identifier = 1; + * @return Whether the identifier field is set. + */ + boolean hasIdentifier(); + /** + * optional string identifier = 1; + * @return The identifier. + */ + java.lang.String getIdentifier(); + /** + * optional string identifier = 1; + * @return The bytes for identifier. + */ + com.google.protobuf.ByteString + getIdentifierBytes(); + + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; + */ + java.util.List + getInfoPairList(); + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; + */ + com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair getInfoPair(int index); + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; + */ + int getInfoPairCount(); + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; + */ + java.util.List + getInfoPairOrBuilderList(); + /** + * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; + */ + com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPairOrBuilder getInfoPairOrBuilder( + int index); +} diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/StringType.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/StringType.java new file mode 100644 index 000000000..26346467d --- /dev/null +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/StringType.java @@ -0,0 +1,136 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: monitor.proto + +package com.oltpbenchmark.api.collectors.monitoring.proto; + +/** + *
+ * Enum for string values.
+ * Next id: 2
+ * 
+ * + * Protobuf enum {@code com.oltpbenchmark.api.collectors.monitoring.proto.StringType} + */ +public enum StringType + implements com.google.protobuf.ProtocolMessageEnum { + /** + * QUERY_TEXT = 0; + */ + QUERY_TEXT(0), + /** + * QUERY_PLAN = 1; + */ + QUERY_PLAN(1), + /** + * IDENTIFIER = 2; + */ + IDENTIFIER(2), + /** + * PLAN_HANDLE = 3; + */ + PLAN_HANDLE(3), + UNRECOGNIZED(-1), + ; + + /** + * QUERY_TEXT = 0; + */ + public static final int QUERY_TEXT_VALUE = 0; + /** + * QUERY_PLAN = 1; + */ + public static final int QUERY_PLAN_VALUE = 1; + /** + * IDENTIFIER = 2; + */ + public static final int IDENTIFIER_VALUE = 2; + /** + * PLAN_HANDLE = 3; + */ + public static final int PLAN_HANDLE_VALUE = 3; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static StringType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static StringType forNumber(int value) { + switch (value) { + case 0: return QUERY_TEXT; + case 1: return QUERY_PLAN; + case 2: return IDENTIFIER; + case 3: return PLAN_HANDLE; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + StringType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public StringType findValueByNumber(int number) { + return StringType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.getDescriptor().getEnumTypes().get(0); + } + + private static final StringType[] VALUES = values(); + + public static StringType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private StringType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:com.oltpbenchmark.api.collectors.monitoring.proto.StringType) +} + diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/monitor.proto b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/monitor.proto new file mode 100644 index 000000000..a7b3bb4d5 --- /dev/null +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/monitor.proto @@ -0,0 +1,132 @@ +syntax = "proto3"; +import "google/protobuf/timestamp.proto"; + +package com.oltpbenchmark.api.collectors.monitoring.proto; + +option java_multiple_files = true; + +// Enum for string values. +// Next id: 2 +enum StringType { + QUERY_TEXT = 0; + QUERY_PLAN = 1; + IDENTIFIER = 2; + PLAN_HANDLE = 3; +} + +// Enum for long values. +// Next id: 42 +enum LongType { + EXECUTION_COUNT = 0; + MIN_WORKER_TIME = 1; + MAX_WORKER_TIME = 2; + TOTAL_WORKER_TIME = 3; + MIN_PHYSICAL_READS = 4; + MAX_PHYSICAL_READS = 5; + TOTAL_PHYSICAL_READS = 6; + MIN_ELAPSED_TIME = 7; + MAX_ELAPSED_TIME = 8; + TOTAL_ELAPSED_TIME = 9; + MIN_ROWS = 10; + MAX_ROWS = 11; + TOTAL_ROWS = 12; + MIN_SPILLS = 13; + MAX_SPILLS = 14; + TOTAL_SPILLS = 15; + USED_MEMORY = 16; + TARGET_MEMORY = 17; + CPU_USAGE_PERC = 18; + CPU_EFFECTIVE_PERC = 19; + CPU_VIOLATED_PERC = 20; + TOTAL_LOGICAL_WRITES = 21; + MIN_LOGICAL_WRITES = 22; + MAX_LOGICAL_WRITES = 23; + TOTAL_LOGICAL_READS = 24; + MIN_LOGICAL_READS = 25; + MAX_LOGICAL_READS = 26; + TOTAL_USED_GRANT_KB = 27; + MIN_USED_GRANT_KB = 28; + MAX_USED_GRANT_KB = 29; + TOTAL_USED_THREADS = 30; + MIN_USED_THREADS = 31; + MAX_USED_THREADS = 32; + CPU_USAGE_PERC_BASE = 33; + CPU_EFFECTIVE_PERC_BASE = 34; + CPU_USAGE_TARGET_PERC = 35; + DISK_READ_IOPS = 36; + DISK_WRITE_IOPS = 37; + LOCKS_AVG_WAIT_TIME = 38; + LOCKS_AVG_WAIT_TIME_BASE = 39; + LOCK_REQUESTS = 40; + MS_TICKS = 41; +} + +// Proto representation for one-off query metrics logged through BenchBase. +message QueryInfo { + optional string identifier = 1; + + // Encodes a pair of info type and value. + // Next id: 5 + message InfoPair { + oneof type { + StringType string_type = 1; + LongType long_type = 2; + } + oneof value { + string string_value = 3; + int64 long_value = 4; + } + } + repeated InfoPair info_pair = 3; +} + +// Encodes one-off query info in a log. +// Next id: 2 +message QueryInfoLog { + repeated QueryInfo info = 1; +} + +// Proto representation for query metrics logged through BenchBase. +// Next id: 4 +message QueryEvent { + optional string identifier = 1; + optional google.protobuf.Timestamp timestamp = 2; + + // Encodes a pair of event type and value. + // Next id: 5 + message EventPair { + oneof type { + StringType string_type = 1; + LongType long_type = 2; + } + oneof value { + string string_value = 3; + int64 long_value = 4; + } + } + repeated EventPair event_pair = 3; +} + +// Encodes query events in a log. +// Next id: 2 +message QueryEventLog { + repeated QueryEvent event = 1; +} + +message PerfEvent { + optional google.protobuf.Timestamp timestamp = 1; + + // Encodes a pair of event type and value. + // Next id: 5 + message EventPair { + LongType long_type = 1; + int64 long_value = 2; + } + repeated EventPair event_pair = 2; +} + +// Encodes performance events in a log. +// Next id: 2 +message PerfEventLog { + repeated PerfEvent event = 1; +} diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Delivery.java b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Delivery.java index 5ff941c5f..e0203a8ea 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Delivery.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Delivery.java @@ -34,6 +34,7 @@ public class Delivery extends TPCCProcedure { private static final Logger LOG = LoggerFactory.getLogger(Delivery.class); public SQLStmt delivGetOrderIdSQL = new SQLStmt( + "/*monitor-delivGetOrderIdSQL*/ " + "SELECT NO_O_ID FROM " + TPCCConstants.TABLENAME_NEWORDER + " WHERE NO_D_ID = ? " + " AND NO_W_ID = ? " + @@ -41,18 +42,21 @@ public class Delivery extends TPCCProcedure { " LIMIT 1"); public SQLStmt delivDeleteNewOrderSQL = new SQLStmt( + "/*monitor-delivDeleteNewOrderSQL*/ " + "DELETE FROM " + TPCCConstants.TABLENAME_NEWORDER + " WHERE NO_O_ID = ? " + " AND NO_D_ID = ?" + " AND NO_W_ID = ?"); public SQLStmt delivGetCustIdSQL = new SQLStmt( + "/*monitor-delivGetCustIdSQL*/ " + "SELECT O_C_ID FROM " + TPCCConstants.TABLENAME_OPENORDER + " WHERE O_ID = ? " + " AND O_D_ID = ? " + " AND O_W_ID = ?"); public SQLStmt delivUpdateCarrierIdSQL = new SQLStmt( + "/*monitor-delivUpdateCarrierIdSQL*/ " + "UPDATE " + TPCCConstants.TABLENAME_OPENORDER + " SET O_CARRIER_ID = ? " + " WHERE O_ID = ? " + @@ -60,6 +64,7 @@ public class Delivery extends TPCCProcedure { " AND O_W_ID = ?"); public SQLStmt delivUpdateDeliveryDateSQL = new SQLStmt( + "/*monitor-delivUpdateDeliveryDateSQL*/ " + "UPDATE " + TPCCConstants.TABLENAME_ORDERLINE + " SET OL_DELIVERY_D = ? " + " WHERE OL_O_ID = ? " + @@ -67,6 +72,7 @@ public class Delivery extends TPCCProcedure { " AND OL_W_ID = ? "); public SQLStmt delivSumOrderAmountSQL = new SQLStmt( + "/*monitor-delivSumOrderAmountSQL*/ " + "SELECT SUM(OL_AMOUNT) AS OL_TOTAL " + " FROM " + TPCCConstants.TABLENAME_ORDERLINE + " WHERE OL_O_ID = ? " + @@ -74,6 +80,7 @@ public class Delivery extends TPCCProcedure { " AND OL_W_ID = ?"); public SQLStmt delivUpdateCustBalDelivCntSQL = new SQLStmt( + "/*monitor-delivUpdateCustBalDelivCntSQL*/ " + "UPDATE " + TPCCConstants.TABLENAME_CUSTOMER + " SET C_BALANCE = C_BALANCE + ?," + " C_DELIVERY_CNT = C_DELIVERY_CNT + 1 " + diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/NewOrder.java b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/NewOrder.java index 3f941969e..c83f6bb51 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/NewOrder.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/NewOrder.java @@ -34,6 +34,7 @@ public class NewOrder extends TPCCProcedure { private static final Logger LOG = LoggerFactory.getLogger(NewOrder.class); public final SQLStmt stmtGetCustSQL = new SQLStmt( + "/*monitor-stmtGetCustSQL*/" + "SELECT C_DISCOUNT, C_LAST, C_CREDIT" + " FROM " + TPCCConstants.TABLENAME_CUSTOMER + " WHERE C_W_ID = ? " + @@ -41,37 +42,44 @@ public class NewOrder extends TPCCProcedure { " AND C_ID = ?"); public final SQLStmt stmtGetWhseSQL = new SQLStmt( + "/*monitor-stmtGetWhseSQL*/" + "SELECT W_TAX " + " FROM " + TPCCConstants.TABLENAME_WAREHOUSE + " WHERE W_ID = ?"); public final SQLStmt stmtGetDistSQL = new SQLStmt( + "/*monitor-stmtGetDistSQL*/" + "SELECT D_NEXT_O_ID, D_TAX " + " FROM " + TPCCConstants.TABLENAME_DISTRICT + " WHERE D_W_ID = ? AND D_ID = ? FOR UPDATE"); public final SQLStmt stmtInsertNewOrderSQL = new SQLStmt( + "/*monitor-stmtInsertNewOrderSQL*/" + "INSERT INTO " + TPCCConstants.TABLENAME_NEWORDER + " (NO_O_ID, NO_D_ID, NO_W_ID) " + " VALUES ( ?, ?, ?)"); public final SQLStmt stmtUpdateDistSQL = new SQLStmt( + "/*monitor-stmtUpdateDistSQL*/" + "UPDATE " + TPCCConstants.TABLENAME_DISTRICT + " SET D_NEXT_O_ID = D_NEXT_O_ID + 1 " + " WHERE D_W_ID = ? " + " AND D_ID = ?"); public final SQLStmt stmtInsertOOrderSQL = new SQLStmt( + "/*monitor-stmtInsertOOrderSQL*/" + "INSERT INTO " + TPCCConstants.TABLENAME_OPENORDER + " (O_ID, O_D_ID, O_W_ID, O_C_ID, O_ENTRY_D, O_OL_CNT, O_ALL_LOCAL)" + " VALUES (?, ?, ?, ?, ?, ?, ?)"); public final SQLStmt stmtGetItemSQL = new SQLStmt( + "/*monitor-stmtGetItemSQL*/" + "SELECT I_PRICE, I_NAME , I_DATA " + " FROM " + TPCCConstants.TABLENAME_ITEM + " WHERE I_ID = ?"); public final SQLStmt stmtGetStockSQL = new SQLStmt( + "/*monitor-stmtGetStockSQL*/" + "SELECT S_QUANTITY, S_DATA, S_DIST_01, S_DIST_02, S_DIST_03, S_DIST_04, S_DIST_05, " + " S_DIST_06, S_DIST_07, S_DIST_08, S_DIST_09, S_DIST_10" + " FROM " + TPCCConstants.TABLENAME_STOCK + @@ -79,6 +87,7 @@ public class NewOrder extends TPCCProcedure { " AND S_W_ID = ? FOR UPDATE"); public final SQLStmt stmtUpdateStockSQL = new SQLStmt( + "/*monitor-stmtUpdateStockSQL*/" + "UPDATE " + TPCCConstants.TABLENAME_STOCK + " SET S_QUANTITY = ? , " + " S_YTD = S_YTD + ?, " + @@ -88,6 +97,7 @@ public class NewOrder extends TPCCProcedure { " AND S_W_ID = ?"); public final SQLStmt stmtInsertOrderLineSQL = new SQLStmt( + "/*monitor-stmtInsertOrderLineSQL*/" + "INSERT INTO " + TPCCConstants.TABLENAME_ORDERLINE + " (OL_O_ID, OL_D_ID, OL_W_ID, OL_NUMBER, OL_I_ID, OL_SUPPLY_W_ID, OL_QUANTITY, OL_AMOUNT, OL_DIST_INFO) " + " VALUES (?,?,?,?,?,?,?,?,?)"); diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/OrderStatus.java b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/OrderStatus.java index 2524c2687..79c23a526 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/OrderStatus.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/OrderStatus.java @@ -39,6 +39,7 @@ public class OrderStatus extends TPCCProcedure { private static final Logger LOG = LoggerFactory.getLogger(OrderStatus.class); public SQLStmt ordStatGetNewestOrdSQL = new SQLStmt( + "/*monitor-ordStatGetNewestOrdSQL*/" + "SELECT O_ID, O_CARRIER_ID, O_ENTRY_D " + " FROM " + TPCCConstants.TABLENAME_OPENORDER + " WHERE O_W_ID = ? " + @@ -47,6 +48,7 @@ public class OrderStatus extends TPCCProcedure { " ORDER BY O_ID DESC LIMIT 1"); public SQLStmt ordStatGetOrderLinesSQL = new SQLStmt( + "/*monitor-ordStatGetOrderLinesSQL*/" + "SELECT OL_I_ID, OL_SUPPLY_W_ID, OL_QUANTITY, OL_AMOUNT, OL_DELIVERY_D " + " FROM " + TPCCConstants.TABLENAME_ORDERLINE + " WHERE OL_O_ID = ?" + @@ -54,6 +56,7 @@ public class OrderStatus extends TPCCProcedure { " AND OL_W_ID = ?"); public SQLStmt payGetCustSQL = new SQLStmt( + "/*monitor-payGetCustSQL*/" + "SELECT C_FIRST, C_MIDDLE, C_LAST, C_STREET_1, C_STREET_2, " + " C_CITY, C_STATE, C_ZIP, C_PHONE, C_CREDIT, C_CREDIT_LIM, " + " C_DISCOUNT, C_BALANCE, C_YTD_PAYMENT, C_PAYMENT_CNT, C_SINCE " + @@ -63,6 +66,7 @@ public class OrderStatus extends TPCCProcedure { " AND C_ID = ?"); public SQLStmt customerByNameSQL = new SQLStmt( + "/*monitor-customerByNameSQL*/" + "SELECT C_FIRST, C_MIDDLE, C_ID, C_STREET_1, C_STREET_2, C_CITY, " + " C_STATE, C_ZIP, C_PHONE, C_CREDIT, C_CREDIT_LIM, C_DISCOUNT, " + " C_BALANCE, C_YTD_PAYMENT, C_PAYMENT_CNT, C_SINCE " + diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Payment.java b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Payment.java index 0a141962c..8ec7c33f5 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Payment.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Payment.java @@ -38,28 +38,33 @@ public class Payment extends TPCCProcedure { private static final Logger LOG = LoggerFactory.getLogger(Payment.class); public SQLStmt payUpdateWhseSQL = new SQLStmt( + "/*monitor-payUpdateWhseSQL*/ " + "UPDATE " + TPCCConstants.TABLENAME_WAREHOUSE + " SET W_YTD = W_YTD + ? " + " WHERE W_ID = ? "); public SQLStmt payGetWhseSQL = new SQLStmt( + "/*monitor-payGetWhseSQL*/ " + "SELECT W_STREET_1, W_STREET_2, W_CITY, W_STATE, W_ZIP, W_NAME" + " FROM " + TPCCConstants.TABLENAME_WAREHOUSE + " WHERE W_ID = ?"); public SQLStmt payUpdateDistSQL = new SQLStmt( + "/*monitor-payUpdateDistSQL*/ " + "UPDATE " + TPCCConstants.TABLENAME_DISTRICT + " SET D_YTD = D_YTD + ? " + " WHERE D_W_ID = ? " + " AND D_ID = ?"); public SQLStmt payGetDistSQL = new SQLStmt( + "/*monitor-payGetDistSQL*/ " + "SELECT D_STREET_1, D_STREET_2, D_CITY, D_STATE, D_ZIP, D_NAME" + " FROM " + TPCCConstants.TABLENAME_DISTRICT + " WHERE D_W_ID = ? " + " AND D_ID = ?"); public SQLStmt payGetCustSQL = new SQLStmt( + "/*monitor-payGetCustSQL*/ " + "SELECT C_FIRST, C_MIDDLE, C_LAST, C_STREET_1, C_STREET_2, " + " C_CITY, C_STATE, C_ZIP, C_PHONE, C_CREDIT, C_CREDIT_LIM, " + " C_DISCOUNT, C_BALANCE, C_YTD_PAYMENT, C_PAYMENT_CNT, C_SINCE " + @@ -69,6 +74,7 @@ public class Payment extends TPCCProcedure { " AND C_ID = ?"); public SQLStmt payGetCustCdataSQL = new SQLStmt( + "/*monitor-payGetCustCdataSQL*/ " + "SELECT C_DATA " + " FROM " + TPCCConstants.TABLENAME_CUSTOMER + " WHERE C_W_ID = ? " + @@ -76,6 +82,7 @@ public class Payment extends TPCCProcedure { " AND C_ID = ?"); public SQLStmt payUpdateCustBalCdataSQL = new SQLStmt( + "/*monitor-payUpdateCustBalCdataSQL*/ " + "UPDATE " + TPCCConstants.TABLENAME_CUSTOMER + " SET C_BALANCE = ?, " + " C_YTD_PAYMENT = ?, " + @@ -86,6 +93,7 @@ public class Payment extends TPCCProcedure { " AND C_ID = ?"); public SQLStmt payUpdateCustBalSQL = new SQLStmt( + "/*monitor-payUpdateCustBalSQL*/ " + "UPDATE " + TPCCConstants.TABLENAME_CUSTOMER + " SET C_BALANCE = ?, " + " C_YTD_PAYMENT = ?, " + @@ -95,11 +103,13 @@ public class Payment extends TPCCProcedure { " AND C_ID = ?"); public SQLStmt payInsertHistSQL = new SQLStmt( + "/*monitor-payInsertHistSQL*/ " + "INSERT INTO " + TPCCConstants.TABLENAME_HISTORY + " (H_C_D_ID, H_C_W_ID, H_C_ID, H_D_ID, H_W_ID, H_DATE, H_AMOUNT, H_DATA) " + " VALUES (?,?,?,?,?,?,?,?)"); public SQLStmt customerByNameSQL = new SQLStmt( + "/*monitor-customerByNameSQL*/ " + "SELECT C_FIRST, C_MIDDLE, C_ID, C_STREET_1, C_STREET_2, C_CITY, " + " C_STATE, C_ZIP, C_PHONE, C_CREDIT, C_CREDIT_LIM, C_DISCOUNT, " + " C_BALANCE, C_YTD_PAYMENT, C_PAYMENT_CNT, C_SINCE " + diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/StockLevel.java b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/StockLevel.java index 657aa8063..4b4834ba0 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/StockLevel.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/StockLevel.java @@ -35,12 +35,14 @@ public class StockLevel extends TPCCProcedure { private static final Logger LOG = LoggerFactory.getLogger(StockLevel.class); public SQLStmt stockGetDistOrderIdSQL = new SQLStmt( + "/*monitor-stockGetDistOrderIdSQL*/ " + "SELECT D_NEXT_O_ID " + " FROM " + TPCCConstants.TABLENAME_DISTRICT + " WHERE D_W_ID = ? " + " AND D_ID = ?"); public SQLStmt stockGetCountStockSQL = new SQLStmt( + "/*monitor-stockGetCountStockSQL*/ " + "SELECT COUNT(DISTINCT (S_I_ID)) AS STOCK_COUNT " + " FROM " + TPCCConstants.TABLENAME_ORDERLINE + ", " + TPCCConstants.TABLENAME_STOCK + " WHERE OL_W_ID = ?" + diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/TPCHWorker.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/TPCHWorker.java index fa26f8e32..d6a8df648 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/TPCHWorker.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/TPCHWorker.java @@ -27,7 +27,11 @@ import java.sql.Connection; import java.sql.SQLException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + public class TPCHWorker extends Worker { + private static final Logger LOG = LoggerFactory.getLogger(TPCHWorker.class); private final RandomGenerator rand; diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q1.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q1.java index d6d901576..e6cf02ba2 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q1.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q1.java @@ -27,6 +27,7 @@ public class Q1 extends GenericQuery { public final SQLStmt query_stmt = new SQLStmt(""" + /*monitor-Q01*/ SELECT l_returnflag, l_linestatus, diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q10.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q10.java index 4ecac97d8..41bed73dd 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q10.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q10.java @@ -28,6 +28,7 @@ public class Q10 extends GenericQuery { public final SQLStmt query_stmt = new SQLStmt(""" + /*monitor-Q10*/ SELECT c_custkey, c_name, diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q11.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q11.java index 131c151f7..7adba319e 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q11.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q11.java @@ -29,6 +29,7 @@ public class Q11 extends GenericQuery { public final SQLStmt query_stmt = new SQLStmt(""" + /*monitor-Q11*/ SELECT ps_partkey, SUM(ps_supplycost * ps_availqty) AS VALUE diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q12.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q12.java index b394cd2b7..87c36a783 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q12.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q12.java @@ -30,6 +30,7 @@ public class Q12 extends GenericQuery { public final SQLStmt query_stmt = new SQLStmt(""" + /*monitor-Q12*/ SELECT l_shipmode, SUM( diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q13.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q13.java index 21e228cfd..1371d2087 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q13.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q13.java @@ -28,6 +28,7 @@ public class Q13 extends GenericQuery { public final SQLStmt query_stmt = new SQLStmt(""" + /*monitor-Q13*/ SELECT c_count, COUNT(*) AS custdist diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q14.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q14.java index 9f32516ff..0fdd97491 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q14.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q14.java @@ -28,6 +28,7 @@ public class Q14 extends GenericQuery { public final SQLStmt query_stmt = new SQLStmt(""" + /*monitor-Q14*/ SELECT 100.00 * SUM( CASE diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q15.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q15.java index 5aca587c1..ef86e0b7e 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q15.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q15.java @@ -28,6 +28,7 @@ public class Q15 extends GenericQuery { public final SQLStmt createview_stmt = new SQLStmt(""" + /*monitor-Q15*/ CREATE view revenue0 (supplier_no, total_revenue) AS SELECT l_suppkey, diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q16.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q16.java index 70487115f..31a65acbd 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q16.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q16.java @@ -31,6 +31,7 @@ public class Q16 extends GenericQuery { public final SQLStmt query_stmt = new SQLStmt(""" + /*monitor-Q16*/ SELECT p_brand, p_type, diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q17.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q17.java index c72fcb4ab..0ccbe39ad 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q17.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q17.java @@ -29,6 +29,7 @@ public class Q17 extends GenericQuery { public final SQLStmt query_stmt = new SQLStmt(""" + /*monitor-Q17*/ SELECT SUM(l_extendedprice) / 7.0 AS avg_yearly FROM diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q18.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q18.java index 5ae8bc433..f654195fd 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q18.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q18.java @@ -27,6 +27,7 @@ public class Q18 extends GenericQuery { public final SQLStmt query_stmt = new SQLStmt(""" + /*monitor-Q18*/ SELECT c_name, c_custkey, diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q19.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q19.java index fbb93e04d..2ceb450ba 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q19.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q19.java @@ -28,6 +28,7 @@ public class Q19 extends GenericQuery { public final SQLStmt query_stmt = new SQLStmt(""" + /*monitor-Q19*/ SELECT SUM(l_extendedprice* (1 - l_discount)) AS revenue FROM diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q2.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q2.java index ff3b55bda..d684bcd3c 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q2.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q2.java @@ -29,6 +29,7 @@ public class Q2 extends GenericQuery { public final SQLStmt query_stmt = new SQLStmt(""" + /*monitor-Q02*/ SELECT s_acctbal, s_name, diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q20.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q20.java index 5cb274589..c8582bc5d 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q20.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q20.java @@ -30,6 +30,7 @@ public class Q20 extends GenericQuery { public final SQLStmt query_stmt = new SQLStmt(""" + /*monitor-Q20*/ SELECT s_name, s_address diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q21.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q21.java index eeacb04ac..e1ae6ff39 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q21.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q21.java @@ -29,6 +29,7 @@ public class Q21 extends GenericQuery { public final SQLStmt query_stmt = new SQLStmt(""" + /*monitor-Q21*/ SELECT s_name, COUNT(*) AS numwait diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q22.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q22.java index 6b29285df..609bc6d7f 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q22.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q22.java @@ -29,6 +29,7 @@ public class Q22 extends GenericQuery { public final SQLStmt query_stmt = new SQLStmt(""" + /*monitor-Q22*/ SELECT cntrycode, COUNT(*) AS numcust, diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q3.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q3.java index bc8fc3afc..043e3159d 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q3.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q3.java @@ -30,6 +30,7 @@ public class Q3 extends GenericQuery { public final SQLStmt query_stmt = new SQLStmt(""" + /*monitor-Q03*/ SELECT l_orderkey, SUM(l_extendedprice * (1 - l_discount)) AS revenue, diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q4.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q4.java index 46081bfb8..ee331f818 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q4.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q4.java @@ -28,6 +28,7 @@ public class Q4 extends GenericQuery { public final SQLStmt query_stmt = new SQLStmt(""" + /*monitor-Q04*/ SELECT o_orderpriority, COUNT(*) AS order_count diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q5.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q5.java index 1bd7932bf..022b3812b 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q5.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q5.java @@ -30,6 +30,7 @@ public class Q5 extends GenericQuery { public final SQLStmt query_stmt = new SQLStmt(""" + /*monitor-Q05*/ SELECT n_name, SUM(l_extendedprice * (1 - l_discount)) AS revenue diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q6.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q6.java index 40e1cd414..a9a17a40c 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q6.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q6.java @@ -28,6 +28,7 @@ public class Q6 extends GenericQuery { public final SQLStmt query_stmt = new SQLStmt(""" + /*monitor-Q06*/ SELECT SUM(l_extendedprice * l_discount) AS revenue FROM diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q7.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q7.java index c4f09e761..28a7b15e7 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q7.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q7.java @@ -29,6 +29,7 @@ public class Q7 extends GenericQuery { public final SQLStmt query_stmt = new SQLStmt(""" + /*monitor-Q07*/ SELECT supp_nation, cust_nation, diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q8.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q8.java index ae2366852..56e401a1b 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q8.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q8.java @@ -29,6 +29,7 @@ public class Q8 extends GenericQuery { public final SQLStmt query_stmt = new SQLStmt(""" + /*monitor-Q08*/ SELECT o_year, SUM( diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q9.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q9.java index 7de35a9bf..fd48939df 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q9.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q9.java @@ -29,6 +29,7 @@ public class Q9 extends GenericQuery { public final SQLStmt query_stmt = new SQLStmt(""" + /*monitor-Q09*/ SELECT nation, o_year, diff --git a/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetFollowers.java b/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetFollowers.java index 12eb175f9..5b760fa2d 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetFollowers.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetFollowers.java @@ -28,12 +28,12 @@ public class GetFollowers extends Procedure { - public final SQLStmt getFollowers = new SQLStmt("SELECT f2 FROM " + TwitterConstants.TABLENAME_FOLLOWERS + " WHERE f1 = ? LIMIT " + TwitterConstants.LIMIT_FOLLOWERS); + public final SQLStmt getFollowers = new SQLStmt("/*monitor-getFolGetFollowers*/ SELECT f2 FROM " + TwitterConstants.TABLENAME_FOLLOWERS + " WHERE f1 = ? LIMIT " + TwitterConstants.LIMIT_FOLLOWERS); /** * NOTE: The ?? is substituted into a string of repeated ?'s */ - public final SQLStmt getFollowerNames = new SQLStmt("SELECT uid, name FROM " + TwitterConstants.TABLENAME_USER + " WHERE uid IN (??)", TwitterConstants.LIMIT_FOLLOWERS); + public final SQLStmt getFollowerNames = new SQLStmt("/*monitor-getFolGetFollowerNames*/ SELECT uid, name FROM " + TwitterConstants.TABLENAME_USER + " WHERE uid IN (??)", TwitterConstants.LIMIT_FOLLOWERS); public void run(Connection conn, long uid) throws SQLException { try (PreparedStatement stmt = this.getPreparedStatement(conn, getFollowers)) { @@ -57,7 +57,7 @@ public void run(Connection conn, long uid) throws SQLException { } } } - // LOG.warn("No followers for user : "+uid); //... so what ? + // LOG.warn("No followers for user : "+uid); //... so what ? } } diff --git a/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetTweet.java b/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetTweet.java index 8c94295d8..447f2ddb3 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetTweet.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetTweet.java @@ -29,6 +29,7 @@ public class GetTweet extends Procedure { public SQLStmt getTweet = new SQLStmt( + "/*monitor-getTweet*/" + "SELECT * FROM " + TwitterConstants.TABLENAME_TWEETS + " WHERE id = ?" ); diff --git a/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetTweetsFromFollowing.java b/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetTweetsFromFollowing.java index d29492dce..59bb045ea 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetTweetsFromFollowing.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetTweetsFromFollowing.java @@ -29,12 +29,12 @@ public class GetTweetsFromFollowing extends Procedure { - public final SQLStmt getFollowing = new SQLStmt("SELECT f2 FROM " + TwitterConstants.TABLENAME_FOLLOWS + " WHERE f1 = ? LIMIT " + TwitterConstants.LIMIT_FOLLOWERS); + public final SQLStmt getFollowing = new SQLStmt("/*monitor-getTwtFolGetFollowing*/ SELECT f2 FROM " + TwitterConstants.TABLENAME_FOLLOWS + " WHERE f1 = ? LIMIT " + TwitterConstants.LIMIT_FOLLOWERS); /** * NOTE: The ?? is substituted into a string of repeated ?'s */ - public final SQLStmt getTweets = new SQLStmt("SELECT * FROM " + TwitterConstants.TABLENAME_TWEETS + " WHERE uid IN (??)", TwitterConstants.LIMIT_FOLLOWERS); + public final SQLStmt getTweets = new SQLStmt("/*monitor-getTwtFolGetTweets*/ SELECT * FROM " + TwitterConstants.TABLENAME_TWEETS + " WHERE uid IN (??)", TwitterConstants.LIMIT_FOLLOWERS); public void run(Connection conn, int uid) throws SQLException { try (PreparedStatement getFollowingStatement = this.getPreparedStatement(conn, getFollowing)) { diff --git a/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetUserTweets.java b/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetUserTweets.java index 6815f4095..cde21a06c 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetUserTweets.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetUserTweets.java @@ -28,7 +28,7 @@ public class GetUserTweets extends Procedure { - public final SQLStmt getTweets = new SQLStmt("SELECT * FROM " + TwitterConstants.TABLENAME_TWEETS + " WHERE uid = ? LIMIT " + TwitterConstants.LIMIT_TWEETS_FOR_UID); + public final SQLStmt getTweets = new SQLStmt("/*monitor-getUserTweets*/ SELECT * FROM " + TwitterConstants.TABLENAME_TWEETS + " WHERE uid = ? LIMIT " + TwitterConstants.LIMIT_TWEETS_FOR_UID); public void run(Connection conn, long uid) throws SQLException { try (PreparedStatement stmt = this.getPreparedStatement(conn, getTweets)) { diff --git a/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/InsertTweet.java b/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/InsertTweet.java index 96a1797a5..ee822fa55 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/InsertTweet.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/InsertTweet.java @@ -29,7 +29,7 @@ public class InsertTweet extends Procedure { //FIXME: Carlo is this correct? 1) added_tweets is empty initially 2) id is supposed to be not null - public final SQLStmt insertTweet = new SQLStmt("INSERT INTO " + TwitterConstants.TABLENAME_ADDED_TWEETS + " (uid,text,createdate) VALUES (?, ?, ?)"); + public final SQLStmt insertTweet = new SQLStmt("/*monitor-insertTweet*/ INSERT INTO " + TwitterConstants.TABLENAME_ADDED_TWEETS + " (uid,text,createdate) VALUES (?, ?, ?)"); public boolean run(Connection conn, long uid, String text, Time time) throws SQLException { try (PreparedStatement stmt = this.getPreparedStatement(conn, insertTweet)) { diff --git a/src/main/resources/benchmarks/tpcc/dialect-sqlserver.xml b/src/main/resources/benchmarks/tpcc/dialect-sqlserver.xml index 95228265c..4535c13e3 100644 --- a/src/main/resources/benchmarks/tpcc/dialect-sqlserver.xml +++ b/src/main/resources/benchmarks/tpcc/dialect-sqlserver.xml @@ -3,6 +3,7 @@ + /*monitor-delivGetOrderIdSQL*/ SELECT TOP 1 NO_O_ID FROM NEW_ORDER WHERE NO_D_ID = ? AND NO_W_ID = ? ORDER BY NO_O_ID ASC @@ -10,11 +11,13 @@ + /*monitor-stmtGetDistSQL*/ SELECT D_NEXT_O_ID,D_TAX FROM DISTRICT WHERE D_W_ID = ? AND D_ID = ? + /*monitor-stmtGetStockSQL*/ SELECT S_QUANTITY, S_DATA, S_DIST_01, S_DIST_02, S_DIST_03, S_DIST_04, S_DIST_05, S_DIST_06, S_DIST_07, S_DIST_08, S_DIST_09, S_DIST_10 FROM STOCK @@ -23,6 +26,7 @@ + /*monitor-ordStatGetNewestOrdSQL*/ SELECT TOP 1 O_ID, O_CARRIER_ID, O_ENTRY_D FROM OORDER WHERE O_W_ID = ? AND O_D_ID = ? AND O_C_ID = ? ORDER BY O_ID DESC diff --git a/src/main/resources/benchmarks/tpch/dialect-postgres.xml b/src/main/resources/benchmarks/tpch/dialect-postgres.xml index a5ec4da59..4ab6ae54e 100644 --- a/src/main/resources/benchmarks/tpch/dialect-postgres.xml +++ b/src/main/resources/benchmarks/tpch/dialect-postgres.xml @@ -3,65 +3,76 @@ + /*monitor-Q01*/ select l_returnflag, l_linestatus, sum(l_quantity) as sum_qty, sum(l_extendedprice) as sum_base_price, sum(l_extendedprice * (1 - l_discount)) as sum_disc_price, sum(l_extendedprice * (1 - l_discount) * (1 + l_tax)) as sum_charge, avg(l_quantity) as avg_qty, avg(l_extendedprice) as avg_price, avg(l_discount) as avg_disc, count(*) as count_order from lineitem where l_shipdate <= date '1998-12-01' - concat(?,' day')::interval group by l_returnflag, l_linestatus order by l_returnflag, l_linestatus + /*monitor-Q03*/ select l_orderkey, sum(l_extendedprice * (1 - l_discount)) as revenue, o_orderdate, o_shippriority from customer, orders, lineitem where c_mktsegment = ? and c_custkey = o_custkey and l_orderkey = o_orderkey and o_orderdate < ?::date and l_shipdate > ?::date group by l_orderkey, o_orderdate, o_shippriority order by revenue desc, o_orderdate limit 10 + /*monitor-Q04*/ select o_orderpriority, count(*) as order_count from orders where o_orderdate >= ?::date and o_orderdate < ?::date + interval '3' month and exists ( select * from lineitem where l_orderkey = o_orderkey and l_commitdate < l_receiptdate ) group by o_orderpriority order by o_orderpriority + /*monitor-Q05*/ select n_name, sum(l_extendedprice * (1 - l_discount)) as revenue from customer, orders, lineitem, supplier, nation, region where c_custkey = o_custkey and l_orderkey = o_orderkey and l_suppkey = s_suppkey and c_nationkey = s_nationkey and s_nationkey = n_nationkey and n_regionkey = r_regionkey and r_name = ? and o_orderdate >= ?::date and o_orderdate < ?::date + interval '1' year group by n_name order by revenue desc; + /*monitor-Q06*/ select sum(l_extendedprice * l_discount) as revenue from lineitem where l_shipdate >= ?::date and l_shipdate < ?::date + interval '1' year and l_discount between ?::decimal - 0.01 and ?::decimal + 0.01 and l_quantity < ? + /*monitor-Q10*/ select c_custkey, c_name, sum(l_extendedprice * (1 - l_discount)) as revenue, c_acctbal, n_name, c_address, c_phone, c_comment from customer, orders, lineitem, nation where c_custkey = o_custkey and l_orderkey = o_orderkey and o_orderdate >= ?::date and o_orderdate < ?::date + interval '3' month and l_returnflag = 'R' and c_nationkey = n_nationkey group by c_custkey, c_name, c_acctbal, c_phone, n_name, c_address, c_comment order by revenue desc limit 20 + /*monitor-Q12*/ select l_shipmode, sum(case when o_orderpriority = '1-URGENT' or o_orderpriority = '2-HIGH' then 1 else 0 end) as high_line_count, sum(case when o_orderpriority <> '1-URGENT' and o_orderpriority <> '2-HIGH' then 1 else 0 end) as low_line_count from orders, lineitem where o_orderkey = l_orderkey and l_shipmode in (?, ?) and l_commitdate < l_receiptdate and l_shipdate < l_commitdate and l_receiptdate >= ?::date and l_receiptdate < ?::date + interval '1' year group by l_shipmode order by l_shipmode + /*monitor-Q14*/ select 100.00 * sum(case when p_type like 'PROMO%' then l_extendedprice * (1 - l_discount) else 0 end) / sum(l_extendedprice * (1 - l_discount)) as promo_revenue from lineitem, part where l_partkey = p_partkey and l_shipdate >= ?::date and l_shipdate < ?::date + interval '1' month + /*monitor-Q15*/ create view revenue0 (supplier_no, total_revenue) as select l_suppkey, sum(l_extendedprice * (1 - l_discount)) from lineitem where l_shipdate >= ?::date and l_shipdate < ?::date + interval '3' month group by l_suppkey + /*monitor-Q20*/ select s_name, s_address from supplier, nation where s_suppkey in ( select ps_suppkey from partsupp where ps_partkey in ( select p_partkey from part where p_name like ? ) and ps_availqty > ( select 0.5 * sum(l_quantity) from lineitem where l_partkey = ps_partkey and l_suppkey = ps_suppkey and l_shipdate >= ?::date and l_shipdate < ?::date + interval '1' year ) ) and s_nationkey = n_nationkey and n_name = ? order by s_name + /*monitor-Q22*/ select cntrycode, count(*) as numcust, sum(c_acctbal) as totacctbal from ( select substring(c_phone from 1 for 2) as cntrycode, c_acctbal from customer where substring(c_phone from 1 for 2) in (?, ?, ?, ?, ?, ?, ?) and c_acctbal > ( select avg(c_acctbal) from customer where c_acctbal > 0.00 and substring(c_phone from 1 for 2) in (?, ?, ?, ?, ?, ?, ?) ) and not exists ( select * from orders where o_custkey = c_custkey ) ) as custsale group by cntrycode order by cntrycode diff --git a/src/main/resources/benchmarks/tpch/dialect-sqlserver.xml b/src/main/resources/benchmarks/tpch/dialect-sqlserver.xml index f788bf803..01b643720 100644 --- a/src/main/resources/benchmarks/tpch/dialect-sqlserver.xml +++ b/src/main/resources/benchmarks/tpch/dialect-sqlserver.xml @@ -3,88 +3,105 @@ + /*monitor-Q01*/ select l_returnflag, l_linestatus, sum(l_quantity) as sum_qty, sum(l_extendedprice) as sum_base_price, sum(l_extendedprice * (1 - l_discount)) as sum_disc_price, sum(l_extendedprice * (1 - l_discount) * (1 + l_tax)) as sum_charge, avg(l_quantity) as avg_qty, avg(l_extendedprice) as avg_price, avg(l_discount) as avg_disc, count(*) as count_order from lineitem where l_shipdate <= dateadd(dd, -1 * ?, cast('1998-12-01' as datetime)) group by l_returnflag, l_linestatus order by l_returnflag, l_linestatus + /*monitor-Q02*/ select top 100 s_acctbal, s_name, n_name, p_partkey, p_mfgr, s_address, s_phone, s_comment from part, supplier, partsupp, nation, region where p_partkey = ps_partkey and s_suppkey = ps_suppkey and p_size = ? and p_type like ? and s_nationkey = n_nationkey and n_regionkey = r_regionkey and r_name = ? and ps_supplycost = ( select min(ps_supplycost) from partsupp, supplier, nation, region where p_partkey = ps_partkey and s_suppkey = ps_suppkey and s_nationkey = n_nationkey and n_regionkey = r_regionkey and r_name = ? ) order by s_acctbal desc, n_name, s_name, p_partkey + /*monitor-Q03*/ select top 10 l_orderkey, sum(l_extendedprice * (1 - l_discount)) as revenue, o_orderdate, o_shippriority from customer, orders, lineitem where c_mktsegment = ? and c_custkey = o_custkey and l_orderkey = o_orderkey and o_orderdate < ? and l_shipdate > ? group by l_orderkey, o_orderdate, o_shippriority order by revenue desc, o_orderdate + /*monitor-Q04*/ select o_orderpriority, count(*) as order_count from orders where o_orderdate >= ? and o_orderdate < dateadd(mm, 3, cast(? as datetime)) and exists ( select * from lineitem where l_orderkey = o_orderkey and l_commitdate < l_receiptdate ) group by o_orderpriority order by o_orderpriority + /*monitor-Q05*/ select n_name, sum(l_extendedprice * (1 - l_discount)) as revenue from customer, orders, lineitem, supplier, nation, region where c_custkey = o_custkey and l_orderkey = o_orderkey and l_suppkey = s_suppkey and c_nationkey = s_nationkey and s_nationkey = n_nationkey and n_regionkey = r_regionkey and r_name = ? and o_orderdate >= ? and o_orderdate < dateadd(YY, 1, cast(? as datetime)) group by n_name order by revenue desc + /*monitor-Q06*/ select sum(l_extendedprice * l_discount) as revenue from lineitem where l_shipdate >= ? and l_shipdate < dateadd(yy, 1, cast(? as datetime)) and l_discount between ? - 0.01 and ? + 0.01 and l_quantity < ? + /*monitor-Q07*/ select supp_nation, cust_nation, l_year, sum(volume) as revenue from ( select n1.n_name as supp_nation, n2.n_name as cust_nation, datepart(yy, l_shipdate) as l_year, l_extendedprice * (1 - l_discount) as volume from supplier, lineitem, orders, customer, nation n1, nation n2 where s_suppkey = l_suppkey and o_orderkey = l_orderkey and c_custkey = o_custkey and s_nationkey = n1.n_nationkey and c_nationkey = n2.n_nationkey and ( (n1.n_name = ? and n2.n_name = ?) or (n1.n_name = ? and n2.n_name = ?) ) and l_shipdate between '1995-01-01' and '1996-12-31' ) as shipping group by supp_nation, cust_nation, l_year order by supp_nation, cust_nation, l_year + /*monitor-Q08*/ select o_year, sum(case when nation = ? then volume else 0 end) / sum(volume) as mkt_share from ( select datepart(yy,o_orderdate) as o_year, l_extendedprice * (1 - l_discount) as volume, n2.n_name as nation from part, supplier, lineitem, orders, customer, nation n1, nation n2, region where p_partkey = l_partkey and s_suppkey = l_suppkey and l_orderkey = o_orderkey and o_custkey = c_custkey and c_nationkey = n1.n_nationkey and n1.n_regionkey = r_regionkey and r_name = ? and s_nationkey = n2.n_nationkey and o_orderdate between '1995-01-01' and '1996-12-31' and p_type = ? ) as all_nations group by o_year order by o_year + /*monitor-Q09*/ select nation, o_year, sum(amount) as sum_profit from ( select n_name as nation, datepart(yy, o_orderdate) as o_year, l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity as amount from part, supplier, lineitem, partsupp, orders, nation where s_suppkey = l_suppkey and ps_suppkey = l_suppkey and ps_partkey = l_partkey and p_partkey = l_partkey and o_orderkey = l_orderkey and s_nationkey = n_nationkey and p_name like ? ) as profit group by nation, o_year order by nation, o_year desc + /*monitor-Q10*/ select top 20 c_custkey, c_name, sum(l_extendedprice * (1 - l_discount)) as revenue, c_acctbal, n_name, c_address, c_phone, c_comment from customer, orders, lineitem, nation where c_custkey = o_custkey and l_orderkey = o_orderkey and o_orderdate >= ? and o_orderdate < dateadd(mm, 3, cast(? as datetime)) and l_returnflag = 'R' and c_nationkey = n_nationkey group by c_custkey, c_name, c_acctbal, c_phone, n_name, c_address, c_comment order by revenue desc + /*monitor-Q12*/ select l_shipmode, sum(case when o_orderpriority = '1-URGENT' or o_orderpriority = '2-HIGH' then 1 else 0 end) as high_line_count, sum(case when o_orderpriority <> '1-URGENT' and o_orderpriority <> '2-HIGH' then 1 else 0 end) as low_line_count from orders, lineitem where o_orderkey = l_orderkey and l_shipmode in (?, ?) and l_commitdate < l_receiptdate and l_shipdate < l_commitdate and l_receiptdate >= ? and l_receiptdate < dateadd(mm, 1, cast(? as datetime)) group by l_shipmode order by l_shipmode + /*monitor-Q14*/ select 100.00 * sum(case when p_type like 'PROMO%' then l_extendedprice * (1 - l_discount) else 0 end) / sum(l_extendedprice * (1 - l_discount)) as promo_revenue from lineitem, part where l_partkey = p_partkey and l_shipdate >= ? and l_shipdate < dateadd(mm, 1, cast(? as datetime)) + /*monitor-Q15*/ create view revenue0 (supplier_no, total_revenue) as select l_suppkey, sum(l_extendedprice * (1 - l_discount)) from lineitem where l_shipdate >= ? and l_shipdate < dateadd(mm, 3, cast(? as datetime)) group by l_suppkey + /*monitor-Q18*/ select top 100 c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice, sum(l_quantity) from customer, orders, lineitem where o_orderkey in ( select l_orderkey from lineitem group by l_orderkey having sum(l_quantity) > ? ) and c_custkey = o_custkey and o_orderkey = l_orderkey group by c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice order by o_totalprice desc, o_orderdate + /*monitor-Q20*/ select s_name, s_address from supplier, nation where s_suppkey in ( select ps_suppkey from partsupp where ps_partkey in ( select p_partkey from part where p_name like ? ) and ps_availqty > ( select 0.5 * sum(l_quantity) from lineitem where l_partkey = ps_partkey and l_suppkey = ps_suppkey and l_shipdate >= ? and l_shipdate < dateadd(yy, 1, cast(? as datetime)) ) ) and s_nationkey = n_nationkey and n_name = ? order by s_name + /*monitor-Q21*/ select top 100 s_name, count(*) as numwait from supplier, lineitem l1, orders, nation where s_suppkey = l1.l_suppkey and o_orderkey = l1.l_orderkey and o_orderstatus = 'F' and l1.l_receiptdate > l1.l_commitdate and exists ( select * from lineitem l2 where l2.l_orderkey = l1.l_orderkey and l2.l_suppkey <> l1.l_suppkey ) and not exists ( select * from lineitem l3 where l3.l_orderkey = l1.l_orderkey and l3.l_suppkey <> l1.l_suppkey and l3.l_receiptdate > l3.l_commitdate ) and s_nationkey = n_nationkey and n_name = ? group by s_name order by numwait desc, s_name + /*monitor-Q22*/ select cntrycode, count(*) as numcust, sum(c_acctbal) as totacctbal from ( select substring(c_phone, 1, 2) as cntrycode, c_acctbal from customer where substring(c_phone, 1, 2) in (?, ?, ?, ?, ?, ?, ?) and c_acctbal > ( select avg(c_acctbal) from customer where c_acctbal > 0.00 and substring(c_phone, 1, 2) in (?, ?, ?, ?, ?, ?, ?) ) and not exists ( select * from orders where o_custkey = c_custkey ) ) as custsale group by cntrycode order by cntrycode - \ No newline at end of file + diff --git a/src/main/resources/benchmarks/twitter/dialect-sqlserver.xml b/src/main/resources/benchmarks/twitter/dialect-sqlserver.xml index 966e724f6..3aadb3515 100644 --- a/src/main/resources/benchmarks/twitter/dialect-sqlserver.xml +++ b/src/main/resources/benchmarks/twitter/dialect-sqlserver.xml @@ -3,29 +3,35 @@ + /*monitor-getTweet*/ SELECT * FROM "tweets" WHERE id = ? + /*monitor-getTwtFolGetFollowing*/ SELECT TOP 20 f2 FROM "follows" WHERE f1 = ? + /*monitor-getTwtFolGetTweets*/ SELECT * FROM "tweets" WHERE uid IN (??) - + + /*monitor-getFolGetFollowers*/ SELECT TOP 20 f2 FROM "followers" WHERE f1 = ? + /*monitor-getFolGetFollowerNames*/ SELECT uid, name FROM "user_profiles" WHERE uid IN (??) + /*monitor-getUserTweets*/ SELECT TOP 10 * FROM "tweets" WHERE uid = ? - + From f9327b0299566c5b7b1f53407cf6b7ad9c5254be Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Mon, 10 Apr 2023 09:18:50 +0200 Subject: [PATCH 03/67] Streamlined new code, removed superfluous protos. --- pom.xml | 7 +- .../monitoring/DatabaseMonitor.java | 247 +- .../api/collectors/monitoring/Monitor.java | 4 + .../api/collectors/monitoring/MonitorGen.java | 7 +- .../monitoring/PostgreSQLMonitor.java | 210 +- .../api/collectors/monitoring/README.md | 23 + .../monitoring/SQLServerMonitor.java | 519 +--- .../collectors/monitoring/proto/LongType.java | 478 ---- .../collectors/monitoring/proto/Monitor.java | 199 -- .../monitoring/proto/PerfEvent.java | 1572 ----------- .../monitoring/proto/PerfEventLog.java | 780 ------ .../proto/PerfEventLogOrBuilder.java | 33 - .../monitoring/proto/PerfEventOrBuilder.java | 48 - .../monitoring/proto/QueryEvent.java | 2308 ----------------- .../monitoring/proto/QueryEventLog.java | 780 ------ .../proto/QueryEventLogOrBuilder.java | 33 - .../monitoring/proto/QueryEventOrBuilder.java | 65 - .../monitoring/proto/QueryInfo.java | 2113 --------------- .../monitoring/proto/QueryInfoLog.java | 780 ------ .../proto/QueryInfoLogOrBuilder.java | 33 - .../monitoring/proto/QueryInfoOrBuilder.java | 50 - .../monitoring/proto/StringType.java | 136 - .../collectors/monitoring/proto/monitor.proto | 132 - 23 files changed, 327 insertions(+), 10230 deletions(-) create mode 100644 src/main/java/com/oltpbenchmark/api/collectors/monitoring/README.md delete mode 100644 src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/LongType.java delete mode 100644 src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/Monitor.java delete mode 100644 src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/PerfEvent.java delete mode 100644 src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/PerfEventLog.java delete mode 100644 src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/PerfEventLogOrBuilder.java delete mode 100644 src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/PerfEventOrBuilder.java delete mode 100644 src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryEvent.java delete mode 100644 src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryEventLog.java delete mode 100644 src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryEventLogOrBuilder.java delete mode 100644 src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryEventOrBuilder.java delete mode 100644 src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryInfo.java delete mode 100644 src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryInfoLog.java delete mode 100644 src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryInfoLogOrBuilder.java delete mode 100644 src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryInfoOrBuilder.java delete mode 100644 src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/StringType.java delete mode 100644 src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/monitor.proto diff --git a/pom.xml b/pom.xml index 3502b6fc3..4cdd56223 100644 --- a/pom.xml +++ b/pom.xml @@ -242,9 +242,10 @@ - com.google.protobuf - protobuf-java - 3.19.4 + org.immutables + value + 2.9.0 + provided diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/DatabaseMonitor.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/DatabaseMonitor.java index 96a9b4f4e..37a940ce6 100644 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/DatabaseMonitor.java +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/DatabaseMonitor.java @@ -1,42 +1,50 @@ package com.oltpbenchmark.api.collectors.monitoring; -import java.io.FileOutputStream; import java.io.IOException; +import java.io.PrintStream; import java.nio.file.Files; import java.nio.file.Paths; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; +import java.time.Instant; +import java.util.ArrayList; import java.util.List; +import java.util.Map; +import org.immutables.value.Value; import com.oltpbenchmark.BenchmarkState; import com.oltpbenchmark.WorkloadConfiguration; import com.oltpbenchmark.api.BenchmarkModule; import com.oltpbenchmark.api.Worker; -import com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog; -import com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog; -import com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog; import com.oltpbenchmark.util.FileUtil; -import com.oltpbenchmark.util.SQLUtil; +import com.oltpbenchmark.util.StringUtil; import org.apache.commons.lang3.StringUtils; +/** + * Generic database monitor that consolidates functionality used across DBMS. + */ public abstract class DatabaseMonitor extends Monitor { protected enum DatabaseState { READY, INVALID, TEST }; + protected final String OUTPUT_DIR = "results/monitor"; + protected final String CSV_DELIMITER = ","; + protected final String SINGLE_QUERY_EVENT_CSV = "single_query_event"; + protected final String REP_QUERY_EVENT_CSV = "repeated_query_event"; + protected final String REP_SYSTEM_EVENT_CSV = "system_query_event"; + protected final int FILE_FLUSH_COUNT = 1000; + protected DatabaseState currentState = DatabaseState.INVALID; - protected String OUTPUT_DIR = "results/monitor"; - protected String CSV_DELIMITER = ","; protected int fileCounter = 1; - protected final int fileTimeDiff; protected WorkloadConfiguration conf; protected Connection conn; - protected final QueryEventLog.Builder queryEventLogBuilder; - protected final PerfEventLog.Builder perfEventLogBuilder; - protected final QueryInfoLog.Builder queryInfoLogBuilder; + protected List singleQueryEvents; + protected List repeatedQueryEvents; + protected List repeatedSystemEvents; /** * Builds the connection to the DBMS using the same connection details as @@ -57,58 +65,6 @@ private final Connection makeConnection() throws SQLException { } } - /** - * Convenience function to try and reconnect if the connection had failed. - * - * Note: since these are read-only queries, in some clustered environments, - * its possible that we make a connection to stale primary if there's a race - * between a failover event and the connection. - * In that case, we may be reading the metrics from the wrong server. - * There isn't a great solution to this without periodically disconnecting, - * which can cause it's own overheads. - */ - protected void checkForReconnect() { - try { - if (!this.conf.getNewConnectionPerTxn() && this.conn != null) { - this.conn.close(); - this.conn = null; - } - else if (conn != null && conn.isClosed()) { - conn = null; - } - } - catch (SQLException sqlError) { - LOG.error(sqlError.getMessage(), sqlError); - conn = null; - } - - if (conn == null) { - try { - conn = makeConnection(); - } - catch (SQLException sqlError) { - LOG.error(sqlError.getMessage(), sqlError); - conn = null; - } - } - } - - protected void handleSQLConnectionException(SQLException sqlError) { - if (this.conf.getReconnectOnConnectionFailure() && SQLUtil.isConnectionErrorException(sqlError)) { - // reset the connection to null so the checkForReconnect() call can manage it - this.conn = null; - } - } - - - /** - * Constructor, set all final parameters and initialize connection. - * - * @param interval - * @param testState - * @param workers - * @param workloadConf - */ public DatabaseMonitor( int interval, BenchmarkState testState, List> workers, WorkloadConfiguration workloadConf) { @@ -124,83 +80,138 @@ public DatabaseMonitor( } FileUtil.makeDirIfNotExists(OUTPUT_DIR); - // Write to file every ~10mins as back-up. - fileTimeDiff = 600000 / this.intervalMonitor; // Init output proto builders. - this.queryEventLogBuilder = QueryEventLog.newBuilder(); - this.perfEventLogBuilder = PerfEventLog.newBuilder(); - this.queryInfoLogBuilder = QueryInfoLog.newBuilder(); + this.singleQueryEvents = new ArrayList<>(); + this.repeatedQueryEvents = new ArrayList<>(); + this.repeatedSystemEvents = new ArrayList<>(); LOG.info("Initialized DatabaseMonitor."); } - /** - * Util to write query event log to file. - */ - protected void writeQueryEventLog() { - String filePath = FileUtil.joinPath( - OUTPUT_DIR, "query_event_log_" + fileCounter + ".proto"); - + protected void writeSingleQueryEventsToCSV() { + String filePath = getFilePath(SINGLE_QUERY_EVENT_CSV, this.fileCounter); try { - if (Files.deleteIfExists(Paths.get(filePath))) { - LOG.warn("File at " + filePath + " deleted before writing query event log."); + if (this.singleQueryEvents.size() == 0) { + LOG.warn("No query events have been recorded, file not written."); + return; } - FileOutputStream out = new FileOutputStream(filePath); - queryEventLogBuilder.build().writeTo(out); + if (Files.deleteIfExists(Paths.get(filePath))) { + LOG.warn("File at " + filePath + " deleted before writing query events to file."); + } + PrintStream out = new PrintStream(filePath); + out.println("QueryId," + StringUtil.join( + ",", this.singleQueryEvents.get(0).getPropertyValues().keySet())); + for (SingleQueryEvent event : this.singleQueryEvents) { + out.println( + event.getQueryId() + "," + + StringUtil.join(",", this.singleQueryEvents.get(0).getPropertyValues().values())); + } out.close(); - LOG.info("Query event log written to " + filePath); + this.singleQueryEvents = new ArrayList<>(); + LOG.info("Query events written to " + filePath); } catch (IOException e) { - LOG.error("Error when writing query event log to file."); + LOG.error("Error when writing query events to file."); LOG.error(e.getMessage()); } } - /** - * Util to write performance event log to file. - */ - protected void writePerfEventLog() { - String filePath = FileUtil.joinPath( - OUTPUT_DIR, "perf_event_log_" + fileCounter + ".proto"); - + protected void writeRepeatedQueryEventsToCSV() { + String filePath = getFilePath(REP_QUERY_EVENT_CSV, this.fileCounter); try { - if (Files.deleteIfExists(Paths.get(filePath))) { - LOG.warn("File at " + filePath + " deleted before writing perf event log."); + if (this.repeatedQueryEvents.size() == 0) { + LOG.warn("No repeated query events have been recorded, file not written."); + return; } - FileOutputStream out = new FileOutputStream(filePath); - perfEventLogBuilder.build().writeTo(out); + if (Files.deleteIfExists(Paths.get(filePath))) { + LOG.warn("File at " + filePath + " deleted before writing repeated query events to file."); + } + PrintStream out = new PrintStream(filePath); + out.println("QueryId,Instant," + StringUtil.join( + ",", this.repeatedQueryEvents.get(0).getPropertyValues().keySet())); + for (RepeatedQueryEvent event : this.repeatedQueryEvents) { + out.println( + event.getQueryId() + "," + + event.getInstant().toString() + "," + + StringUtil.join(",", this.repeatedQueryEvents.get(0).getPropertyValues().values())); + } out.close(); - LOG.info("Perf event log written to " + filePath); + this.repeatedQueryEvents = new ArrayList<>(); + LOG.info("Repeated query events written to " + filePath); } catch (IOException e) { - LOG.error("Error when writing perf event log to file."); + LOG.error("Error when writing repeated query events to file."); LOG.error(e.getMessage()); } } - /** - * Util to write query info log to file. - */ - protected void writeQueryInfoLog() { - String filePath = FileUtil.joinPath( - OUTPUT_DIR, "query_info_log_" + fileCounter + ".proto"); - + protected void writeRepeatedSystemEventsToCSV() { + String filePath = getFilePath(REP_SYSTEM_EVENT_CSV, this.fileCounter); try { - if (Files.deleteIfExists(Paths.get(filePath))) { - LOG.warn("File at " + filePath + " deleted before writing query info log."); + if (this.repeatedSystemEvents.size() == 0) { + LOG.warn("No repeated system events have been recorded, file not written."); + return; } - FileOutputStream out = new FileOutputStream(filePath); - queryInfoLogBuilder.build().writeTo(out); + if (Files.deleteIfExists(Paths.get(filePath))) { + LOG.warn("File at " + filePath + " deleted before writing repeated system events to file."); + } + PrintStream out = new PrintStream(filePath); + out.println("Instant," + StringUtil.join( + ",", this.repeatedSystemEvents.get(0).getPropertyValues().keySet())); + for (RepeatedSystemEvent event : this.repeatedSystemEvents) { + out.println( + event.getInstant().toString() + "," + + StringUtil.join(",", this.repeatedSystemEvents.get(0).getPropertyValues().values())); + } out.close(); - LOG.info("Query info log written to " + filePath); + this.repeatedSystemEvents = new ArrayList<>(); + LOG.info("Repeated system events written to " + filePath); } catch (IOException e) { - LOG.error("Error when writing query info log to file."); + LOG.error("Error when writing repeated system events to file."); LOG.error(e.getMessage()); } } + protected String getFilePath(String filename, int fileCounter) { + return FileUtil.joinPath( + OUTPUT_DIR, filename + "_" + fileCounter + ".csv"); + } + + @Value.Immutable + public interface SingleQueryEvent { + + /** A string that identifies the query. */ + String getQueryId(); + + /** Mapping of observed properties to their corresponding values. */ + Map getPropertyValues(); + } + + @Value.Immutable + public interface RepeatedQueryEvent { + + /** A string that identifies the query. */ + String getQueryId(); + + /** The timestamp at which this event was observed. */ + Instant getInstant(); + + /** Mapping of observed properties to their corresponding values. */ + Map getPropertyValues(); + } + + @Value.Immutable + public interface RepeatedSystemEvent { + + /** The timestamp at which this event was observed. */ + Instant getInstant(); + + /** Mapping of observed properties to their corresponding values. */ + Map getPropertyValues(); + } + /** * DBMS-specific cache cleaning process. */ @@ -212,19 +223,7 @@ protected void writeQueryInfoLog() { protected abstract void runExtraction(); /** - * Write proto builders to file. - */ - protected abstract void writeLogs(); - - /** - * Consolidate protos that have been written to file and currently pending. - * Write to a common output file. - */ - protected abstract void finalizeLogs(); - - /** - * Consolidate protos that have been written to file and currently pending. - * Write to a common output file. + * Write events to csv. */ protected abstract void writeToCSV(); @@ -254,8 +253,8 @@ public void run() { if (this.conn != null) { runExtraction(); } - if (fileCounter % fileTimeDiff == 0) { - writeLogs(); + if (fileCounter % FILE_FLUSH_COUNT == 0) { + writeToCSV(); } fileCounter++; } @@ -264,7 +263,7 @@ public void run() { cleanupCache(); } - finalizeLogs(); + writeToCSV(); } /** @@ -276,7 +275,7 @@ public void tearDown() { try { conn.close(); } catch (SQLException e) { - LOG.error("Connection couldn't be closed.", e); + LOG.error("Connection could not be closed.", e); } this.conn = null; } diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/Monitor.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/Monitor.java index 810939f76..84657f7d0 100644 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/Monitor.java +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/Monitor.java @@ -9,6 +9,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +/** + * Generic monitoring class that reports the throughput of the executing workers + * while the benchmark is being executed. + */ public class Monitor extends Thread { protected static final Logger LOG = LoggerFactory.getLogger(DatabaseMonitor.class); diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/MonitorGen.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/MonitorGen.java index 153c210bc..752c35fb0 100644 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/MonitorGen.java +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/MonitorGen.java @@ -7,8 +7,13 @@ import com.oltpbenchmark.api.BenchmarkModule; import com.oltpbenchmark.api.Worker; +/** + * Monitor generator that picks the appropriate monitoring implemnetation based + * on the database type. + */ public class MonitorGen { - public static Monitor getMonitor(int interval, BenchmarkState testState, List> workers, WorkloadConfiguration conf) { + public static Monitor getMonitor(int interval, BenchmarkState testState, + List> workers, WorkloadConfiguration conf) { switch (conf.getDatabaseType()) { case SQLSERVER: return new SQLServerMonitor(interval, testState, workers, conf); diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/PostgreSQLMonitor.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/PostgreSQLMonitor.java index 806ed2267..4ee460ae4 100644 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/PostgreSQLMonitor.java +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/PostgreSQLMonitor.java @@ -1,14 +1,10 @@ package com.oltpbenchmark.api.collectors.monitoring; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Paths; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.time.Instant; +import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -16,22 +12,20 @@ import java.util.Set; import java.util.regex.Pattern; -import com.google.protobuf.Timestamp; import com.oltpbenchmark.BenchmarkState; import com.oltpbenchmark.WorkloadConfiguration; import com.oltpbenchmark.api.BenchmarkModule; import com.oltpbenchmark.api.Worker; -import com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent; -import com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog; -import com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair; -import com.oltpbenchmark.api.collectors.monitoring.proto.LongType; -import com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo; -import com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog; -import com.oltpbenchmark.api.collectors.monitoring.proto.StringType; -import com.oltpbenchmark.util.FileUtil; +/** + * Implementation of a monitor specific to PostgreSQL. Uses the + * 'pg_stat_statements' add-on to extract relevant query and system information. + */ public class PostgreSQLMonitor extends DatabaseMonitor { + private final String MONITORING_IDENTIFIER = "/*monitor-"; + private final String MONITORING_SPLIT_MARKER = "*/"; + private final String PG_STAT_STATEMENTS = "SELECT " + "query AS query_text, calls as execution_count, rows, " + "total_exec_time, min_exec_time, max_exec_time, " + @@ -39,135 +33,92 @@ public class PostgreSQLMonitor extends DatabaseMonitor { "local_blks_written, temp_blks_read, temp_blks_written " + "FROM pg_stat_statements;"; private final String CLEAN_CACHE = "SELECT pg_stat_statements_reset();"; - private final Map infoQueryTypes; - private final Map eventQueryLongTypes; - private final Map eventQueryAggLongTypes; + private final List singleQueryProperties; + private final List repeatedQueryProperties; private final Set stored_queries; - /** - * Constructor, calls super and defines local attribute to proto mapping. - * @param interval - * @param testState - * @param workers - * @param conf - */ public PostgreSQLMonitor(int interval, BenchmarkState testState, List> workers, WorkloadConfiguration conf) { super(interval, testState, workers, conf); this.stored_queries = new HashSet(); - this.infoQueryTypes = new HashMap() { + this.singleQueryProperties = new ArrayList() { { - put("query_text", StringType.QUERY_TEXT); + add("query_text"); } }; - this.eventQueryLongTypes = new HashMap() { + this.repeatedQueryProperties = new ArrayList() { { - put("execution_count", LongType.EXECUTION_COUNT); - put("min_exec_time", LongType.MIN_ELAPSED_TIME); - put("max_exec_time", LongType.MAX_ELAPSED_TIME); - put("total_exec_time", LongType.TOTAL_ELAPSED_TIME); - put("rows", LongType.TOTAL_ROWS); + add("execution_count"); + add("min_exec_time"); + add("max_exec_time"); + add("total_exec_time"); + add("rows"); + add("shared_blks_read"); + add("shared_blks_written"); + add("local_blks_read"); + add("local_blks_written"); + add("temp_blks_read"); + add("temp_blks_written"); } }; - this.eventQueryAggLongTypes = new HashMap() { - { - put(LongType.TOTAL_LOGICAL_WRITES, "written"); - put(LongType.TOTAL_LOGICAL_READS, "read"); - } - }; - } - - /** - * Util to create a string-type query info pair. - */ - private void createStringInfoPair(QueryInfo.Builder infoBuilder, String eventType, String value) { - InfoPair.Builder pair = InfoPair.newBuilder(); - pair.setStringType(this.infoQueryTypes.get(eventType)); - pair.setStringValue(value); - infoBuilder.addInfoPair(pair.build()); - } - - /** - * Util to create a long-type query event pair. - */ - private void createLongQueryEventPair(QueryEvent.Builder eventBuilder, String eventType, Long value) { - QueryEvent.EventPair.Builder pair = QueryEvent.EventPair.newBuilder(); - pair.setLongType(this.eventQueryLongTypes.get(eventType)); - pair.setLongValue(value); - eventBuilder.addEventPair(pair.build()); } /** - * Util for read and write events that are computed as sum of several - * attributes. + * Extract query events (single and repeated) using the extraction query + * and properties defined above. */ - private void createLongQueryAggEventPair(QueryEvent.Builder eventBuilder, ResultSet rs) throws SQLException { - QueryEvent.EventPair.Builder pair = QueryEvent.EventPair.newBuilder(); - for (LongType eventType : this.eventQueryAggLongTypes.keySet()) { - pair.setLongType(eventType); - pair.setLongValue(rs.getLong("shared_blks_" + this.eventQueryAggLongTypes.get(eventType)) - + rs.getLong("local_blks_" + this.eventQueryAggLongTypes.get(eventType)) + - rs.getLong("temp_blks_" + this.eventQueryAggLongTypes.get(eventType))); - } - eventBuilder.addEventPair(pair.build()); - } + private void extractQueryMetrics(Instant instant) { + ImmutableSingleQueryEvent.Builder singleQueryEventBuilder = ImmutableSingleQueryEvent.builder(); + ImmutableRepeatedQueryEvent.Builder repeatedQueryEventBuilder = ImmutableRepeatedQueryEvent.builder(); - /** - * Extract query specific metrics such as CPU worker time, elapsed time, - * etc. Also computes query info events if plan has not been observed - * previously. - * @param timestamp - */ - private void extractQueryMetrics(Timestamp timestamp) { - QueryEvent.Builder eventBuilder; - QueryInfo.Builder infoBuilder; - checkForReconnect(); try (PreparedStatement stmt = conn.prepareStatement(PG_STAT_STATEMENTS)) { ResultSet rs = stmt.executeQuery(); while (rs.next()) { // Only store those queries that have monitoring enabled via a - // comment in the PostgreSQL dialect XML. + // comment in the SQL Server dialect XML. String query_text = rs.getString("query_text"); - if (!query_text.contains("/*monitor-")) { + if (!query_text.contains(MONITORING_IDENTIFIER)) { continue; } - // Get identifier from commment in query text. - String[] split = query_text.split(Pattern.quote("/*monitor-")); - split = split[1].split(Pattern.quote("*/")); + String[] split = query_text.split(Pattern.quote(MONITORING_IDENTIFIER)); + split = split[1].split(Pattern.quote(MONITORING_SPLIT_MARKER)); String identifier = split[0]; - // Handle one-off query changes, may occur when a plan gets + // Handle one-off query info, may occur when a plan gets // executed for the first time. + Map propertyValues; if (!stored_queries.contains(identifier)) { stored_queries.add(identifier); - infoBuilder = QueryInfo.newBuilder().setIdentifier(identifier); - // Add string event types to info log. - for (String eventType : this.infoQueryTypes.keySet()) { - String value = rs.getString(eventType); + singleQueryEventBuilder.queryId(identifier); + propertyValues = new HashMap(); + // Add single events. + for (String property : this.singleQueryProperties) { + String value = rs.getString(property); if (value != null) { - createStringInfoPair(infoBuilder, eventType, value); + propertyValues.put(property, value); } } - queryInfoLogBuilder.addInfo(infoBuilder.build()); + singleQueryEventBuilder.propertyValues(propertyValues); + this.singleQueryEvents.add(singleQueryEventBuilder.build()); } // Handle repeated query events. - eventBuilder = QueryEvent.newBuilder().setIdentifier( - identifier).setTimestamp(timestamp); - // Add numeric event types. - for (String eventType : this.eventQueryLongTypes.keySet()) { - createLongQueryEventPair(eventBuilder, eventType, rs.getLong(eventType)); + repeatedQueryEventBuilder.queryId(identifier).instant(instant); + propertyValues = new HashMap(); + for (String property : this.repeatedQueryProperties) { + String value = rs.getString(property); + if (value != null) { + propertyValues.put(property, value); + } } - // Add aggregated event types. - createLongQueryAggEventPair(eventBuilder, rs); - // Add to log. - queryEventLogBuilder.addEvent(eventBuilder.build()); + repeatedQueryEventBuilder.propertyValues(propertyValues); + this.repeatedQueryEvents.add(repeatedQueryEventBuilder.build()); } } catch (SQLException sqlError) { LOG.error("Error when extracting per query metrics."); @@ -178,14 +129,12 @@ private void extractQueryMetrics(Timestamp timestamp) { @Override protected void runExtraction() { Instant time = Instant.now(); - Timestamp timestamp = Timestamp.newBuilder().setSeconds(time.getEpochSecond()).setNanos(time.getNano()).build(); - extractQueryMetrics(timestamp); + extractQueryMetrics(time); } @Override protected void cleanupCache() { - checkForReconnect(); try (PreparedStatement stmt = conn.prepareStatement(CLEAN_CACHE)) { stmt.execute(); } catch (SQLException sqlError) { @@ -194,58 +143,9 @@ protected void cleanupCache() { } } - @Override - protected void writeLogs() { - writeQueryEventLog(); - writeQueryInfoLog(); - } - - @Override - protected void finalizeLogs() { - QueryEventLog.Builder finalQueryEventLogBuilder = QueryEventLog.newBuilder(); - QueryInfoLog.Builder finalQueryInfoLogBuilder = QueryInfoLog.newBuilder(); - - try { - for (int i = fileTimeDiff; i <= fileCounter; i += fileTimeDiff) { - // Add query events and remove superfluous file. - String file = FileUtil.joinPath( - OUTPUT_DIR, "query_event_log_" + i + ".proto"); - QueryEventLog query_event_log = QueryEventLog.parseFrom( - new FileInputStream(file)); - finalQueryEventLogBuilder.addAllEvent(query_event_log.getEventList()); - Files.deleteIfExists(Paths.get(file)); - - // Add query infos. - file = FileUtil.joinPath( - OUTPUT_DIR, "query_info_log_" + i + ".proto"); - QueryInfoLog query_info_log = QueryInfoLog.parseFrom( - new FileInputStream(file)); - finalQueryInfoLogBuilder.addAllInfo(query_info_log.getInfoList()); - Files.deleteIfExists(Paths.get(file)); - } - finalQueryEventLogBuilder.addAllEvent(this.queryEventLogBuilder.getEventList()); - finalQueryInfoLogBuilder.addAllInfo(this.queryInfoLogBuilder.getInfoList()); - - // Write to file. - FileOutputStream out = new FileOutputStream(FileUtil.joinPath( - OUTPUT_DIR, "query_event_log.proto")); - finalQueryEventLogBuilder.build().writeTo(out); - out.close(); - - out = new FileOutputStream(FileUtil.joinPath( - OUTPUT_DIR, "query_info_log.proto")); - finalQueryInfoLogBuilder.build().writeTo(out); - out.close(); - - LOG.info("Successfully consolidated logs."); - } catch (IOException e) { - LOG.error("Error when consolidating log files."); - e.printStackTrace(); - } - } - @Override protected void writeToCSV() { - LOG.error("Writing to CSV is not currently supported in Postgres."); + this.writeSingleQueryEventsToCSV(); + this.writeRepeatedQueryEventsToCSV(); } } diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/README.md b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/README.md new file mode 100644 index 000000000..253cd81de --- /dev/null +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/README.md @@ -0,0 +1,23 @@ +# Monitoring in BenchBase + +Monitoring in BenchBase can be enabled using the +```text + -im,--interval-monitor Throughput Monitoring Interval in + milliseconds +``` +command line option when executing BenchBase, where the monitoring interval describes the sleeping period of the thread between recording monitoring information. +We currently support two types of monitoring: 1) Basic throughput monitoring and 2) Monitoring of query and system statistics via system tables for both SQLServer and Postgres. +The latter are automatically enabled if the DBMS that BenchBase is executed against is either SQLServer or Postgres, otherwise, monitoring will default to basic throughput monitoring. + +The output of the monitoring queries are in logs in .proto format where each element corresponds to a query resp. a monitoring event. +The proto definitions can be found at src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/monitor.proto. +Query information (such as the query plan) is logged once per executed query using the query cache that the DBMS provide to avoid unnecessary work of the DBMS. +This information is captured in the QueryEvent proto. +Performance information (such as CPU utilization, spills, or lock information) captures the system state at a specific moment in time and is logged as a PerfEvent proto. + +For monitoring to work correctly in SQLServer, the user needs to have access to the system tables. +For monitoring to work correctly in Postgres, pg_stat_statements needs to be enabled. +Note that in either case, frequent (additional) queries against the DBMS may distort the benchmarking results. +That is, a high additional query load via frequent pulling of data from the DBMS will incur system load and can potentially block the execution of the actual benchmark queries. + +The output of the monitor are logged to the same results folder as the other BenchBase telemetry, in the subfolder `monitor`. \ No newline at end of file diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java index 9c0d4034a..ea3ad8b50 100644 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java @@ -1,17 +1,10 @@ package com.oltpbenchmark.api.collectors.monitoring; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.PrintWriter; -import java.nio.file.Files; -import java.nio.file.Paths; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.time.Instant; -import java.time.ZoneId; -import java.time.format.DateTimeFormatter; +import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -19,25 +12,18 @@ import java.util.Set; import java.util.regex.Pattern; -import com.google.protobuf.Timestamp; import com.oltpbenchmark.BenchmarkState; import com.oltpbenchmark.WorkloadConfiguration; import com.oltpbenchmark.api.BenchmarkModule; import com.oltpbenchmark.api.Worker; -import com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent; -import com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog; -import com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair; -import com.oltpbenchmark.api.collectors.monitoring.proto.LongType; -import com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent; -import com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog; -import com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo; -import com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog; -import com.oltpbenchmark.api.collectors.monitoring.proto.StringType; -import com.oltpbenchmark.util.FileUtil; -import com.oltpbenchmark.util.TimeUtil; - +/** + * Implementation of a monitor specific to SQLServer. Uses SQLServer's system + * tables to extract relevant query and system information. + */ public class SQLServerMonitor extends DatabaseMonitor { + private final String MONITORING_IDENTIFIER = "/*monitor-"; + private final String MONITORING_SPLIT_MARKER = "*/"; private final String DM_EXEC_QUERY_STATS = "SELECT " + "q.text AS query_text, st.plan_handle, pl.query_plan, " + @@ -62,494 +48,213 @@ public class SQLServerMonitor extends DatabaseMonitor { "WHERE object_name LIKE '%Locks%' AND instance_name='_Total') " + "counters, (SELECT ms_ticks FROM sys.dm_os_sys_info) info"; private final String CLEAN_CACHE = "DBCC FREEPROCCACHE;"; - private final Map infoQueryTypes; - private final Map eventQueryLongTypes; - private final Map eventQueryStringTypes; - private final Map eventPerfOSTypes; - private final Map eventPerfLockTypes; + private final List singleQueryProperties; + private final List repeatedQueryProperties; + private final List repeatedSystemProperties; private final Set cached_plans; - /** - * Constructor, calls super and defines local attribute to proto mapping. - * - * @param interval - * @param testState - * @param workers - * @param conf - */ public SQLServerMonitor(int interval, BenchmarkState testState, List> workers, WorkloadConfiguration conf) { super(interval, testState, workers, conf); this.cached_plans = new HashSet(); - this.infoQueryTypes = new HashMap() { + this.singleQueryProperties = new ArrayList() { { - put("query_plan", StringType.QUERY_PLAN); - put("query_text", StringType.QUERY_TEXT); - put("plan_handle", StringType.PLAN_HANDLE); + add("query_plan"); + add("query_text"); + add("plan_handle"); } }; - this.eventQueryLongTypes = new HashMap() { - { - put("execution_count", LongType.EXECUTION_COUNT); - put("min_worker_time", LongType.MIN_WORKER_TIME); - put("max_worker_time", LongType.MAX_WORKER_TIME); - put("total_worker_time", LongType.TOTAL_WORKER_TIME); - put("min_physical_reads", LongType.MIN_PHYSICAL_READS); - put("max_physical_reads", LongType.MAX_PHYSICAL_READS); - put("total_physical_reads", LongType.TOTAL_PHYSICAL_READS); - put("min_elapsed_time", LongType.MIN_ELAPSED_TIME); - put("max_elapsed_time", LongType.MAX_ELAPSED_TIME); - put("total_elapsed_time", LongType.TOTAL_ELAPSED_TIME); - put("min_rows", LongType.MIN_ROWS); - put("max_rows", LongType.MAX_ROWS); - put("total_rows", LongType.TOTAL_ROWS); - put("min_spills", LongType.MIN_SPILLS); - put("max_spills", LongType.MAX_SPILLS); - put("total_spills", LongType.TOTAL_SPILLS); - put("min_logical_writes", LongType.MIN_LOGICAL_WRITES); - put("max_logical_writes", LongType.MAX_LOGICAL_WRITES); - put("total_logical_writes", LongType.TOTAL_LOGICAL_WRITES); - put("min_logical_reads", LongType.MIN_LOGICAL_READS); - put("max_logical_reads", LongType.MAX_LOGICAL_READS); - put("total_logical_reads", LongType.TOTAL_LOGICAL_READS); - put("min_used_grant_kb", LongType.MIN_USED_GRANT_KB); - put("max_used_grant_kb", LongType.MAX_USED_GRANT_KB); - put("total_used_grant_kb", LongType.TOTAL_USED_GRANT_KB); - put("min_used_threads", LongType.MIN_USED_THREADS); - put("max_used_threads", LongType.MAX_USED_THREADS); - put("total_used_threads", LongType.TOTAL_USED_THREADS); - } - }; - this.eventQueryStringTypes = new HashMap() { + this.repeatedQueryProperties = new ArrayList() { { - put("plan_handle", StringType.PLAN_HANDLE); + add("execution_count"); + add("min_worker_time"); + add("max_worker_time"); + add("total_worker_time"); + add("min_physical_reads"); + add("max_physical_reads"); + add("total_physical_reads"); + add("min_elapsed_time"); + add("max_elapsed_time"); + add("total_elapsed_time"); + add("min_rows"); + add("max_rows"); + add("total_rows"); + add("min_spills"); + add("max_spills"); + add("total_spills"); + add("min_logical_writes"); + add("max_logical_writes"); + add("total_logical_writes"); + add("min_logical_reads"); + add("max_logical_reads"); + add("total_logical_reads"); + add("min_used_grant_kb"); + add("max_used_grant_kb"); + add("total_used_grant_kb"); + add("min_used_threads"); + add("max_used_threads"); + add("total_used_threads"); + add("plan_handle"); } }; - this.eventPerfOSTypes = new HashMap() { + this.repeatedSystemProperties = new ArrayList() { { - put("Used memory (KB)", LongType.USED_MEMORY); - put("Target memory (KB)", LongType.TARGET_MEMORY); - put("CPU usage %", LongType.CPU_USAGE_PERC); - put("CPU effective %", LongType.CPU_EFFECTIVE_PERC); - put("CPU violated %", LongType.CPU_VIOLATED_PERC); - put("CPU usage % base", LongType.CPU_USAGE_PERC_BASE); - put("CPU effective % base", LongType.CPU_EFFECTIVE_PERC_BASE); - put("CPU usage target %", LongType.CPU_USAGE_TARGET_PERC); - put("Disk Read IO/sec", LongType.DISK_READ_IOPS); - put("Disk Write IO/sec", LongType.DISK_WRITE_IOPS); + add("Used memory (KB)"); + add("Target memory (KB)"); + add("CPU usage %"); + add("CPU effective %"); + add("CPU violated %"); + add("CPU usage % base"); + add("CPU effective % base"); + add("CPU usage target %"); + add("Disk Read IO/sec"); + add("Disk Write IO/sec"); + add("Average Wait Time (ms)"); + add("Average Wait Time Base"); + add("Lock Requests/sec"); } }; - - this.eventPerfLockTypes = new HashMap() { - { - put("Average Wait Time (ms)", LongType.LOCKS_AVG_WAIT_TIME); - put("Average Wait Time Base", LongType.LOCKS_AVG_WAIT_TIME_BASE); - put("Lock Requests/sec", LongType.LOCK_REQUESTS); - } - }; - } - - private Map getPerfCSVMapping() { - Map result = new HashMap(); - - int i = 0; - for (LongType type : this.eventPerfOSTypes.values()) { - result.put(type.toString(), i++); - } - for (LongType type : this.eventPerfLockTypes.values()) { - result.put(type.toString(), i++); - } - result.put("TIMESTAMP", i++); - result.put("MS_TICKS", i++); - return result; - } - - private void writePerfEventLogToCSV(String basePath) { - Map csvMapping = getPerfCSVMapping(); - - PerfEventLog log; - try { - log = PerfEventLog.parseFrom(new FileInputStream(FileUtil.joinPath( - OUTPUT_DIR, "perf_event_log.proto"))); - PrintWriter writer = new PrintWriter(Files.newBufferedWriter( - Paths.get(basePath + "perf_event_log.csv"))); - String[] row = new String[csvMapping.size()]; - for (String key : csvMapping.keySet()) { - row[csvMapping.get(key)] = key; - } - writer.println(String.join(CSV_DELIMITER, row)); - - for (PerfEvent event : log.getEventList()) { - DateTimeFormatter formatter = DateTimeFormatter.ofPattern( - "yyyy.MM.dd-HH:mm:ss:SS").withZone(ZoneId.systemDefault()); - row[csvMapping.get("TIMESTAMP")] = formatter.format( - Instant.ofEpochSecond(event.getTimestamp().getSeconds(), event.getTimestamp().getNanos())); - for (PerfEvent.EventPair pair : event.getEventPairList()) { - row[csvMapping.get(pair.getLongType().toString())] = "" + pair.getLongValue(); - } - writer.println(String.join(CSV_DELIMITER, row)); - } - writer.close(); - } catch (Exception e) { - LOG.error("Error when writing perf event log to csv."); - e.printStackTrace(); - } - } - - private Map getQueryCSVMapping() { - Map result = new HashMap(); - - int i = 0; - for (LongType type : this.eventQueryLongTypes.values()) { - result.put(type.toString(), i++); - } - for (StringType type : this.eventQueryStringTypes.values()) { - result.put(type.toString(), i++); - } - result.put("IDENTIFIER", i++); - result.put("TIMESTAMP", i++); - return result; - } - - private void writeQueryEventLogToCSV(String basePath) { - Map csvMapping = getQueryCSVMapping(); - - QueryEventLog log; - try { - log = QueryEventLog.parseFrom(new FileInputStream(FileUtil.joinPath( - OUTPUT_DIR, "query_event_log.proto"))); - PrintWriter writer = new PrintWriter(Files.newBufferedWriter( - Paths.get(basePath + "query_event_log.csv"))); - String[] row = new String[csvMapping.size()]; - for (String key : csvMapping.keySet()) { - row[csvMapping.get(key)] = key; - } - writer.println(String.join(CSV_DELIMITER, row)); - - for (QueryEvent info : log.getEventList()) { - DateTimeFormatter formatter = DateTimeFormatter.ofPattern( - "yyyy.MM.dd-HH:mm:ss:SS").withZone(ZoneId.systemDefault()); - row[csvMapping.get("TIMESTAMP")] = formatter.format( - Instant.ofEpochSecond(info.getTimestamp().getSeconds(), info.getTimestamp().getNanos())); - row[csvMapping.get("IDENTIFIER")] = info.getIdentifier(); - for (QueryEvent.EventPair pair : info.getEventPairList()) { - if (pair.hasLongType()) { - row[csvMapping.get(pair.getLongType().toString())] = "" + pair.getLongValue(); - } else { - row[csvMapping.get(pair.getStringType().toString())] = pair.getStringValue(); - } - } - writer.println(String.join(CSV_DELIMITER, row)); - } - writer.close(); - } catch (Exception e) { - LOG.error("Error when writing query event log to csv."); - e.printStackTrace(); - } - } - - private Map getQueryInfoCSVMapping() { - Map result = new HashMap(); - - int i = 0; - for (StringType type : this.infoQueryTypes.values()) { - result.put(type.toString(), i++); - } - result.put("IDENTIFIER", i++); - return result; - } - - private void writeQueryInfoLogToCSV(String basePath) { - Map csvMapping = getQueryInfoCSVMapping(); - - QueryInfoLog log; - try { - log = QueryInfoLog.parseFrom(new FileInputStream(FileUtil.joinPath( - OUTPUT_DIR, "query_info_log.proto"))); - PrintWriter writer = new PrintWriter(Files.newBufferedWriter( - Paths.get(basePath + "query_info_log.csv"))); - String[] row = new String[csvMapping.size()]; - for (String key : csvMapping.keySet()) { - row[csvMapping.get(key)] = key; - } - writer.println(String.join("||", row)); - - for (QueryInfo info : log.getInfoList()) { - row[csvMapping.get("IDENTIFIER")] = info.getIdentifier(); - for (QueryInfo.InfoPair pair : info.getInfoPairList()) { - row[csvMapping.get(pair.getStringType().toString())] = pair.getStringValue(); - } - writer.println(String.join("||", row)); - } - writer.close(); - } catch (Exception e) { - LOG.error("Error when writing query info log to csv."); - e.printStackTrace(); - } - } - - /** - * Util to create a string-type query info pair. - */ - private void createStringInfoPair(QueryInfo.Builder infoBuilder, String eventType, String value) { - InfoPair.Builder pair = InfoPair.newBuilder(); - pair.setStringType(this.infoQueryTypes.get(eventType)); - pair.setStringValue(value); - infoBuilder.addInfoPair(pair.build()); - } - - /** - * Util to create a long-type query event pair. - */ - private void createLongQueryEventPair(QueryEvent.Builder eventBuilder, String eventType, Long value) { - QueryEvent.EventPair.Builder pair = QueryEvent.EventPair.newBuilder(); - pair.setLongType(this.eventQueryLongTypes.get(eventType)); - pair.setLongValue(value); - eventBuilder.addEventPair(pair.build()); } /** - * Util to create a string-type query event pair. + * Extract query events (single and repeated) using the extraction query + * and properties defined above. */ - private void createStringQueryEventPair(QueryEvent.Builder eventBuilder, String eventType, String value) { - QueryEvent.EventPair.Builder pair = QueryEvent.EventPair.newBuilder(); - pair.setStringType(this.eventQueryStringTypes.get(eventType)); - pair.setStringValue(value); - eventBuilder.addEventPair(pair.build()); - } + private void extractQueryMetrics(Instant instant) { + ImmutableSingleQueryEvent.Builder singleQueryEventBuilder = ImmutableSingleQueryEvent.builder(); + ImmutableRepeatedQueryEvent.Builder repeatedQueryEventBuilder = ImmutableRepeatedQueryEvent.builder(); - /** - * Util to create a long-type performance event pair. - */ - private void createLongPerfEventPair(PerfEvent.Builder eventBuilder, LongType eventType, Long value) { - PerfEvent.EventPair.Builder pair = PerfEvent.EventPair.newBuilder(); - pair.setLongType(eventType); - pair.setLongValue(value); - eventBuilder.addEventPair(pair.build()); - } - - /** - * Extract query specific metrics such as CPU worker time, elapsed time, - * etc. Also computes query info events if plan has not been observed - * previously. - * - * @param timestamp - */ - private void extractQueryMetrics(Timestamp timestamp) { - QueryEvent.Builder eventBuilder; - QueryInfo.Builder infoBuilder; - checkForReconnect(); try (PreparedStatement stmt = conn.prepareStatement(DM_EXEC_QUERY_STATS)) { ResultSet rs = stmt.executeQuery(); while (rs.next()) { // Only store those queries that have monitoring enabled via a // comment in the SQL Server dialect XML. String query_text = rs.getString("query_text"); - if (!query_text.contains("/*monitor-")) { + if (!query_text.contains(MONITORING_IDENTIFIER)) { continue; } // Get identifier from commment in query text. - String[] split = query_text.split(Pattern.quote("/*monitor-")); - split = split[1].split(Pattern.quote("*/")); + String[] split = query_text.split(Pattern.quote(MONITORING_IDENTIFIER)); + split = split[1].split(Pattern.quote(MONITORING_SPLIT_MARKER)); String identifier = split[0]; // Get plan_handle for plan identification. String plan_handle = rs.getString("plan_handle"); - // Handle one-off query changes, may occur when a plan gets + // Handle one-off query information, may occur when a plan gets // executed for the first time. + Map propertyValues; if (!cached_plans.contains(plan_handle)) { cached_plans.add(plan_handle); - infoBuilder = QueryInfo.newBuilder().setIdentifier(identifier); - // Add string event types to info log. - for (String eventType : this.infoQueryTypes.keySet()) { - String value = rs.getString(eventType); + singleQueryEventBuilder.queryId(identifier); + propertyValues = new HashMap(); + // Add single events. + for (String property : this.singleQueryProperties) { + String value = rs.getString(property); if (value != null) { - createStringInfoPair(infoBuilder, eventType, value); + propertyValues.put(property, value); } } - queryInfoLogBuilder.addInfo(infoBuilder.build()); + singleQueryEventBuilder.propertyValues(propertyValues); + this.singleQueryEvents.add(singleQueryEventBuilder.build()); } // Handle repeated query events. - eventBuilder = QueryEvent.newBuilder().setIdentifier( - identifier).setTimestamp(timestamp); - // Add numeric event types. - for (String eventType : this.eventQueryLongTypes.keySet()) { - createLongQueryEventPair(eventBuilder, eventType, rs.getLong(eventType)); - } - // Add string event types. - for (String eventType : this.eventQueryStringTypes.keySet()) { - createStringQueryEventPair(eventBuilder, eventType, rs.getString(eventType)); + repeatedQueryEventBuilder.queryId(identifier).instant(instant); + propertyValues = new HashMap(); + for (String property : this.repeatedQueryProperties) { + String value = rs.getString(property); + if (value != null) { + propertyValues.put(property, value); + } } - queryEventLogBuilder.addEvent(eventBuilder.build()); + repeatedQueryEventBuilder.propertyValues(propertyValues); + this.repeatedQueryEvents.add(repeatedQueryEventBuilder.build()); } } catch (SQLException sqlError) { - LOG.error("Error when extracting per query metrics."); + LOG.error("Error when extracting per query measurements."); LOG.error(sqlError.getMessage()); - handleSQLConnectionException(sqlError); } } /** - * Extract performance specific metrics such as CPU and memory. - * - * @param timestamp + * Extract system events using the extraction query and properties defined + * above. */ - private void extractPerformanceMetrics(Timestamp timestamp) { - PerfEvent.Builder eventBuilder = PerfEvent.newBuilder().setTimestamp(timestamp); + private void extractPerformanceMetrics(Instant instant) { + ImmutableRepeatedSystemEvent.Builder repeatedSystemEventBuilder = ImmutableRepeatedSystemEvent.builder(); + repeatedSystemEventBuilder.instant(instant); - // Add OS counter events. - checkForReconnect(); + // Extract OS performance events. + Map propertyValues = new HashMap(); try (PreparedStatement stmt = conn.prepareStatement(DM_OS_PERFORMANCE_STATS)) { ResultSet rs = stmt.executeQuery(); while (rs.next()) { - // Add numeric event types. + // Add property values. String counter_name = rs.getString("counter_name").trim(); - if (this.eventPerfOSTypes.keySet().contains(counter_name)) { - createLongPerfEventPair( - eventBuilder, this.eventPerfOSTypes.get(counter_name), - rs.getLong("cntr_value")); + if (this.repeatedSystemProperties.contains(counter_name)) { + propertyValues.put(counter_name, rs.getString("cntr_value")); } } } catch (SQLException sqlError) { - LOG.error("Error when extracting perf OS metrics."); + LOG.error("Error when extracting OS metrics from SQL Server."); LOG.error(sqlError.getMessage()); - handleSQLConnectionException(sqlError); } - // Add lock counter events. + // Extract lock counter events. + propertyValues = new HashMap(); try (PreparedStatement stmt = conn.prepareStatement(DM_LOCK_STATS)) { ResultSet rs = stmt.executeQuery(); boolean ticks_set = false; while (rs.next()) { - // Get MS ticks values. + // Get MS ticks value. if (!ticks_set) { - createLongPerfEventPair( - eventBuilder, LongType.MS_TICKS, - rs.getLong("ms_ticks")); + propertyValues.put("ms_ticks", rs.getString("ms_ticks")); ticks_set = true; } - // Add numeric event types. + // Add property values. String counter_name = rs.getString("counter_name").trim(); - if (this.eventPerfLockTypes.keySet().contains(counter_name)) { - createLongPerfEventPair( - eventBuilder, this.eventPerfLockTypes.get(counter_name), - rs.getLong("cntr_value")); + if (this.repeatedSystemProperties.contains(counter_name)) { + propertyValues.put(counter_name, rs.getString("cntr_value")); } } } catch (SQLException sqlError) { LOG.error("Error when extracting perf OS metrics."); LOG.error(sqlError.getMessage()); - handleSQLConnectionException(sqlError); } - - perfEventLogBuilder.addEvent(eventBuilder.build()); + repeatedSystemEventBuilder.propertyValues(propertyValues); + this.repeatedSystemEvents.add(repeatedSystemEventBuilder.build()); } @Override protected void runExtraction() { Instant time = Instant.now(); - Timestamp timestamp = Timestamp.newBuilder().setSeconds(time.getEpochSecond()).setNanos(time.getNano()).build(); - extractQueryMetrics(timestamp); - extractPerformanceMetrics(timestamp); + extractQueryMetrics(time); + extractPerformanceMetrics(time); } @Override protected void cleanupCache() { - checkForReconnect(); try (PreparedStatement stmt = conn.prepareStatement(CLEAN_CACHE)) { stmt.execute(); } catch (SQLException sqlError) { LOG.error("Error when cleaning up cached plans."); LOG.error(sqlError.getMessage()); - handleSQLConnectionException(sqlError); } } - @Override - protected void writeLogs() { - writeQueryEventLog(); - writePerfEventLog(); - writeQueryInfoLog(); - } - - @Override - protected void finalizeLogs() { - QueryEventLog.Builder finalQueryEventLogBuilder = QueryEventLog.newBuilder(); - QueryInfoLog.Builder finalQueryInfoLogBuilder = QueryInfoLog.newBuilder(); - PerfEventLog.Builder finalPerfEventLogBuilder = PerfEventLog.newBuilder(); - - try { - for (int i = fileTimeDiff; i <= fileCounter; i += fileTimeDiff) { - // Add query events and remove superfluous file. - String file = FileUtil.joinPath( - OUTPUT_DIR, "query_event_log_" + i + ".proto"); - QueryEventLog query_event_log = QueryEventLog.parseFrom( - new FileInputStream(file)); - finalQueryEventLogBuilder.addAllEvent(query_event_log.getEventList()); - Files.deleteIfExists(Paths.get(file)); - - // Add query infos. - file = FileUtil.joinPath( - OUTPUT_DIR, "query_info_log_" + i + ".proto"); - QueryInfoLog query_info_log = QueryInfoLog.parseFrom( - new FileInputStream(file)); - finalQueryInfoLogBuilder.addAllInfo(query_info_log.getInfoList()); - Files.deleteIfExists(Paths.get(file)); - - // Add perf events. - file = FileUtil.joinPath( - OUTPUT_DIR, "perf_event_log_" + i + ".proto"); - PerfEventLog perf_event_log = PerfEventLog.parseFrom( - new FileInputStream(file)); - finalPerfEventLogBuilder.addAllEvent(perf_event_log.getEventList()); - Files.deleteIfExists(Paths.get(file)); - } - finalQueryEventLogBuilder.addAllEvent(this.queryEventLogBuilder.getEventList()); - finalQueryInfoLogBuilder.addAllInfo(this.queryInfoLogBuilder.getInfoList()); - finalPerfEventLogBuilder.addAllEvent(this.perfEventLogBuilder.getEventList()); - - // Write to file. - FileOutputStream out = new FileOutputStream(FileUtil.joinPath( - OUTPUT_DIR, "query_event_log.proto")); - finalQueryEventLogBuilder.build().writeTo(out); - out.close(); - - out = new FileOutputStream(FileUtil.joinPath( - OUTPUT_DIR, "query_info_log.proto")); - finalQueryInfoLogBuilder.build().writeTo(out); - out.close(); - - out = new FileOutputStream(FileUtil.joinPath( - OUTPUT_DIR, "perf_event_log.proto")); - finalPerfEventLogBuilder.build().writeTo(out); - out.close(); - - LOG.info("Successfully consolidated logs."); - } catch (IOException e) { - LOG.error("Error when consolidating log files."); - e.printStackTrace(); - } - - // Convert to human-readable CSV. - writeToCSV(); - } - @Override protected void writeToCSV() { - String basePath = FileUtil.joinPath( - OUTPUT_DIR, TimeUtil.getCurrentTimeString() + "_"); - - writePerfEventLogToCSV(basePath); - writeQueryEventLogToCSV(basePath); - writeQueryInfoLogToCSV(basePath); + this.writeSingleQueryEventsToCSV(); + this.writeRepeatedQueryEventsToCSV(); + this.writeRepeatedSystemEventsToCSV(); } + } diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/LongType.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/LongType.java deleted file mode 100644 index 54a515ae0..000000000 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/LongType.java +++ /dev/null @@ -1,478 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: monitor.proto - -package com.oltpbenchmark.api.collectors.monitoring.proto; - -/** - *
- * Enum for long values.
- * Next id: 42
- * 
- * - * Protobuf enum {@code com.oltpbenchmark.api.collectors.monitoring.proto.LongType} - */ -public enum LongType - implements com.google.protobuf.ProtocolMessageEnum { - /** - * EXECUTION_COUNT = 0; - */ - EXECUTION_COUNT(0), - /** - * MIN_WORKER_TIME = 1; - */ - MIN_WORKER_TIME(1), - /** - * MAX_WORKER_TIME = 2; - */ - MAX_WORKER_TIME(2), - /** - * TOTAL_WORKER_TIME = 3; - */ - TOTAL_WORKER_TIME(3), - /** - * MIN_PHYSICAL_READS = 4; - */ - MIN_PHYSICAL_READS(4), - /** - * MAX_PHYSICAL_READS = 5; - */ - MAX_PHYSICAL_READS(5), - /** - * TOTAL_PHYSICAL_READS = 6; - */ - TOTAL_PHYSICAL_READS(6), - /** - * MIN_ELAPSED_TIME = 7; - */ - MIN_ELAPSED_TIME(7), - /** - * MAX_ELAPSED_TIME = 8; - */ - MAX_ELAPSED_TIME(8), - /** - * TOTAL_ELAPSED_TIME = 9; - */ - TOTAL_ELAPSED_TIME(9), - /** - * MIN_ROWS = 10; - */ - MIN_ROWS(10), - /** - * MAX_ROWS = 11; - */ - MAX_ROWS(11), - /** - * TOTAL_ROWS = 12; - */ - TOTAL_ROWS(12), - /** - * MIN_SPILLS = 13; - */ - MIN_SPILLS(13), - /** - * MAX_SPILLS = 14; - */ - MAX_SPILLS(14), - /** - * TOTAL_SPILLS = 15; - */ - TOTAL_SPILLS(15), - /** - * USED_MEMORY = 16; - */ - USED_MEMORY(16), - /** - * TARGET_MEMORY = 17; - */ - TARGET_MEMORY(17), - /** - * CPU_USAGE_PERC = 18; - */ - CPU_USAGE_PERC(18), - /** - * CPU_EFFECTIVE_PERC = 19; - */ - CPU_EFFECTIVE_PERC(19), - /** - * CPU_VIOLATED_PERC = 20; - */ - CPU_VIOLATED_PERC(20), - /** - * TOTAL_LOGICAL_WRITES = 21; - */ - TOTAL_LOGICAL_WRITES(21), - /** - * MIN_LOGICAL_WRITES = 22; - */ - MIN_LOGICAL_WRITES(22), - /** - * MAX_LOGICAL_WRITES = 23; - */ - MAX_LOGICAL_WRITES(23), - /** - * TOTAL_LOGICAL_READS = 24; - */ - TOTAL_LOGICAL_READS(24), - /** - * MIN_LOGICAL_READS = 25; - */ - MIN_LOGICAL_READS(25), - /** - * MAX_LOGICAL_READS = 26; - */ - MAX_LOGICAL_READS(26), - /** - * TOTAL_USED_GRANT_KB = 27; - */ - TOTAL_USED_GRANT_KB(27), - /** - * MIN_USED_GRANT_KB = 28; - */ - MIN_USED_GRANT_KB(28), - /** - * MAX_USED_GRANT_KB = 29; - */ - MAX_USED_GRANT_KB(29), - /** - * TOTAL_USED_THREADS = 30; - */ - TOTAL_USED_THREADS(30), - /** - * MIN_USED_THREADS = 31; - */ - MIN_USED_THREADS(31), - /** - * MAX_USED_THREADS = 32; - */ - MAX_USED_THREADS(32), - /** - * CPU_USAGE_PERC_BASE = 33; - */ - CPU_USAGE_PERC_BASE(33), - /** - * CPU_EFFECTIVE_PERC_BASE = 34; - */ - CPU_EFFECTIVE_PERC_BASE(34), - /** - * CPU_USAGE_TARGET_PERC = 35; - */ - CPU_USAGE_TARGET_PERC(35), - /** - * DISK_READ_IOPS = 36; - */ - DISK_READ_IOPS(36), - /** - * DISK_WRITE_IOPS = 37; - */ - DISK_WRITE_IOPS(37), - /** - * LOCKS_AVG_WAIT_TIME = 38; - */ - LOCKS_AVG_WAIT_TIME(38), - /** - * LOCKS_AVG_WAIT_TIME_BASE = 39; - */ - LOCKS_AVG_WAIT_TIME_BASE(39), - /** - * LOCK_REQUESTS = 40; - */ - LOCK_REQUESTS(40), - /** - * MS_TICKS = 41; - */ - MS_TICKS(41), - UNRECOGNIZED(-1), - ; - - /** - * EXECUTION_COUNT = 0; - */ - public static final int EXECUTION_COUNT_VALUE = 0; - /** - * MIN_WORKER_TIME = 1; - */ - public static final int MIN_WORKER_TIME_VALUE = 1; - /** - * MAX_WORKER_TIME = 2; - */ - public static final int MAX_WORKER_TIME_VALUE = 2; - /** - * TOTAL_WORKER_TIME = 3; - */ - public static final int TOTAL_WORKER_TIME_VALUE = 3; - /** - * MIN_PHYSICAL_READS = 4; - */ - public static final int MIN_PHYSICAL_READS_VALUE = 4; - /** - * MAX_PHYSICAL_READS = 5; - */ - public static final int MAX_PHYSICAL_READS_VALUE = 5; - /** - * TOTAL_PHYSICAL_READS = 6; - */ - public static final int TOTAL_PHYSICAL_READS_VALUE = 6; - /** - * MIN_ELAPSED_TIME = 7; - */ - public static final int MIN_ELAPSED_TIME_VALUE = 7; - /** - * MAX_ELAPSED_TIME = 8; - */ - public static final int MAX_ELAPSED_TIME_VALUE = 8; - /** - * TOTAL_ELAPSED_TIME = 9; - */ - public static final int TOTAL_ELAPSED_TIME_VALUE = 9; - /** - * MIN_ROWS = 10; - */ - public static final int MIN_ROWS_VALUE = 10; - /** - * MAX_ROWS = 11; - */ - public static final int MAX_ROWS_VALUE = 11; - /** - * TOTAL_ROWS = 12; - */ - public static final int TOTAL_ROWS_VALUE = 12; - /** - * MIN_SPILLS = 13; - */ - public static final int MIN_SPILLS_VALUE = 13; - /** - * MAX_SPILLS = 14; - */ - public static final int MAX_SPILLS_VALUE = 14; - /** - * TOTAL_SPILLS = 15; - */ - public static final int TOTAL_SPILLS_VALUE = 15; - /** - * USED_MEMORY = 16; - */ - public static final int USED_MEMORY_VALUE = 16; - /** - * TARGET_MEMORY = 17; - */ - public static final int TARGET_MEMORY_VALUE = 17; - /** - * CPU_USAGE_PERC = 18; - */ - public static final int CPU_USAGE_PERC_VALUE = 18; - /** - * CPU_EFFECTIVE_PERC = 19; - */ - public static final int CPU_EFFECTIVE_PERC_VALUE = 19; - /** - * CPU_VIOLATED_PERC = 20; - */ - public static final int CPU_VIOLATED_PERC_VALUE = 20; - /** - * TOTAL_LOGICAL_WRITES = 21; - */ - public static final int TOTAL_LOGICAL_WRITES_VALUE = 21; - /** - * MIN_LOGICAL_WRITES = 22; - */ - public static final int MIN_LOGICAL_WRITES_VALUE = 22; - /** - * MAX_LOGICAL_WRITES = 23; - */ - public static final int MAX_LOGICAL_WRITES_VALUE = 23; - /** - * TOTAL_LOGICAL_READS = 24; - */ - public static final int TOTAL_LOGICAL_READS_VALUE = 24; - /** - * MIN_LOGICAL_READS = 25; - */ - public static final int MIN_LOGICAL_READS_VALUE = 25; - /** - * MAX_LOGICAL_READS = 26; - */ - public static final int MAX_LOGICAL_READS_VALUE = 26; - /** - * TOTAL_USED_GRANT_KB = 27; - */ - public static final int TOTAL_USED_GRANT_KB_VALUE = 27; - /** - * MIN_USED_GRANT_KB = 28; - */ - public static final int MIN_USED_GRANT_KB_VALUE = 28; - /** - * MAX_USED_GRANT_KB = 29; - */ - public static final int MAX_USED_GRANT_KB_VALUE = 29; - /** - * TOTAL_USED_THREADS = 30; - */ - public static final int TOTAL_USED_THREADS_VALUE = 30; - /** - * MIN_USED_THREADS = 31; - */ - public static final int MIN_USED_THREADS_VALUE = 31; - /** - * MAX_USED_THREADS = 32; - */ - public static final int MAX_USED_THREADS_VALUE = 32; - /** - * CPU_USAGE_PERC_BASE = 33; - */ - public static final int CPU_USAGE_PERC_BASE_VALUE = 33; - /** - * CPU_EFFECTIVE_PERC_BASE = 34; - */ - public static final int CPU_EFFECTIVE_PERC_BASE_VALUE = 34; - /** - * CPU_USAGE_TARGET_PERC = 35; - */ - public static final int CPU_USAGE_TARGET_PERC_VALUE = 35; - /** - * DISK_READ_IOPS = 36; - */ - public static final int DISK_READ_IOPS_VALUE = 36; - /** - * DISK_WRITE_IOPS = 37; - */ - public static final int DISK_WRITE_IOPS_VALUE = 37; - /** - * LOCKS_AVG_WAIT_TIME = 38; - */ - public static final int LOCKS_AVG_WAIT_TIME_VALUE = 38; - /** - * LOCKS_AVG_WAIT_TIME_BASE = 39; - */ - public static final int LOCKS_AVG_WAIT_TIME_BASE_VALUE = 39; - /** - * LOCK_REQUESTS = 40; - */ - public static final int LOCK_REQUESTS_VALUE = 40; - /** - * MS_TICKS = 41; - */ - public static final int MS_TICKS_VALUE = 41; - - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static LongType valueOf(int value) { - return forNumber(value); - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - */ - public static LongType forNumber(int value) { - switch (value) { - case 0: return EXECUTION_COUNT; - case 1: return MIN_WORKER_TIME; - case 2: return MAX_WORKER_TIME; - case 3: return TOTAL_WORKER_TIME; - case 4: return MIN_PHYSICAL_READS; - case 5: return MAX_PHYSICAL_READS; - case 6: return TOTAL_PHYSICAL_READS; - case 7: return MIN_ELAPSED_TIME; - case 8: return MAX_ELAPSED_TIME; - case 9: return TOTAL_ELAPSED_TIME; - case 10: return MIN_ROWS; - case 11: return MAX_ROWS; - case 12: return TOTAL_ROWS; - case 13: return MIN_SPILLS; - case 14: return MAX_SPILLS; - case 15: return TOTAL_SPILLS; - case 16: return USED_MEMORY; - case 17: return TARGET_MEMORY; - case 18: return CPU_USAGE_PERC; - case 19: return CPU_EFFECTIVE_PERC; - case 20: return CPU_VIOLATED_PERC; - case 21: return TOTAL_LOGICAL_WRITES; - case 22: return MIN_LOGICAL_WRITES; - case 23: return MAX_LOGICAL_WRITES; - case 24: return TOTAL_LOGICAL_READS; - case 25: return MIN_LOGICAL_READS; - case 26: return MAX_LOGICAL_READS; - case 27: return TOTAL_USED_GRANT_KB; - case 28: return MIN_USED_GRANT_KB; - case 29: return MAX_USED_GRANT_KB; - case 30: return TOTAL_USED_THREADS; - case 31: return MIN_USED_THREADS; - case 32: return MAX_USED_THREADS; - case 33: return CPU_USAGE_PERC_BASE; - case 34: return CPU_EFFECTIVE_PERC_BASE; - case 35: return CPU_USAGE_TARGET_PERC; - case 36: return DISK_READ_IOPS; - case 37: return DISK_WRITE_IOPS; - case 38: return LOCKS_AVG_WAIT_TIME; - case 39: return LOCKS_AVG_WAIT_TIME_BASE; - case 40: return LOCK_REQUESTS; - case 41: return MS_TICKS; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - LongType> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public LongType findValueByNumber(int number) { - return LongType.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } - return getDescriptor().getValues().get(ordinal()); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.getDescriptor().getEnumTypes().get(1); - } - - private static final LongType[] VALUES = values(); - - public static LongType valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private LongType(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:com.oltpbenchmark.api.collectors.monitoring.proto.LongType) -} - diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/Monitor.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/Monitor.java deleted file mode 100644 index 74417625a..000000000 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/Monitor.java +++ /dev/null @@ -1,199 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: monitor.proto - -package com.oltpbenchmark.api.collectors.monitoring.proto; - -public final class Monitor { - private Monitor() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - static final com.google.protobuf.Descriptors.Descriptor - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfo_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfo_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfo_InfoPair_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfo_InfoPair_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfoLog_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfoLog_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEvent_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEvent_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEvent_EventPair_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEvent_EventPair_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEventLog_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEventLog_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEvent_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEvent_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEvent_EventPair_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEvent_EventPair_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEventLog_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEventLog_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n\rmonitor.proto\0221com.oltpbenchmark.api.c" + - "ollectors.monitoring.proto\032\037google/proto" + - "buf/timestamp.proto\"\201\003\n\tQueryInfo\022\027\n\nide" + - "ntifier\030\001 \001(\tH\000\210\001\001\022X\n\tinfo_pair\030\003 \003(\0132E." + - "com.oltpbenchmark.api.collectors.monitor" + - "ing.proto.QueryInfo.InfoPair\032\361\001\n\010InfoPai" + - "r\022T\n\013string_type\030\001 \001(\0162=.com.oltpbenchma" + - "rk.api.collectors.monitoring.proto.Strin" + - "gTypeH\000\022P\n\tlong_type\030\002 \001(\0162;.com.oltpben" + - "chmark.api.collectors.monitoring.proto.L" + - "ongTypeH\000\022\026\n\014string_value\030\003 \001(\tH\001\022\024\n\nlon" + - "g_value\030\004 \001(\003H\001B\006\n\004typeB\007\n\005valueB\r\n\013_ide" + - "ntifier\"Z\n\014QueryInfoLog\022J\n\004info\030\001 \003(\0132<." + - "com.oltpbenchmark.api.collectors.monitor" + - "ing.proto.QueryInfo\"\310\003\n\nQueryEvent\022\027\n\nid" + - "entifier\030\001 \001(\tH\000\210\001\001\0222\n\ttimestamp\030\002 \001(\0132\032" + - ".google.protobuf.TimestampH\001\210\001\001\022[\n\nevent" + - "_pair\030\003 \003(\0132G.com.oltpbenchmark.api.coll" + - "ectors.monitoring.proto.QueryEvent.Event" + - "Pair\032\362\001\n\tEventPair\022T\n\013string_type\030\001 \001(\0162" + - "=.com.oltpbenchmark.api.collectors.monit" + - "oring.proto.StringTypeH\000\022P\n\tlong_type\030\002 " + - "\001(\0162;.com.oltpbenchmark.api.collectors.m" + - "onitoring.proto.LongTypeH\000\022\026\n\014string_val" + - "ue\030\003 \001(\tH\001\022\024\n\nlong_value\030\004 \001(\003H\001B\006\n\004type" + - "B\007\n\005valueB\r\n\013_identifierB\014\n\n_timestamp\"]" + - "\n\rQueryEventLog\022L\n\005event\030\001 \003(\0132=.com.olt" + - "pbenchmark.api.collectors.monitoring.pro" + - "to.QueryEvent\"\232\002\n\tPerfEvent\0222\n\ttimestamp" + - "\030\001 \001(\0132\032.google.protobuf.TimestampH\000\210\001\001\022" + - "Z\n\nevent_pair\030\002 \003(\0132F.com.oltpbenchmark." + - "api.collectors.monitoring.proto.PerfEven" + - "t.EventPair\032o\n\tEventPair\022N\n\tlong_type\030\001 " + - "\001(\0162;.com.oltpbenchmark.api.collectors.m" + - "onitoring.proto.LongType\022\022\n\nlong_value\030\002" + - " \001(\003B\014\n\n_timestamp\"[\n\014PerfEventLog\022K\n\005ev" + - "ent\030\001 \003(\0132<.com.oltpbenchmark.api.collec" + - "tors.monitoring.proto.PerfEvent*M\n\nStrin" + - "gType\022\016\n\nQUERY_TEXT\020\000\022\016\n\nQUERY_PLAN\020\001\022\016\n" + - "\nIDENTIFIER\020\002\022\017\n\013PLAN_HANDLE\020\003*\241\007\n\010LongT" + - "ype\022\023\n\017EXECUTION_COUNT\020\000\022\023\n\017MIN_WORKER_T" + - "IME\020\001\022\023\n\017MAX_WORKER_TIME\020\002\022\025\n\021TOTAL_WORK" + - "ER_TIME\020\003\022\026\n\022MIN_PHYSICAL_READS\020\004\022\026\n\022MAX" + - "_PHYSICAL_READS\020\005\022\030\n\024TOTAL_PHYSICAL_READ" + - "S\020\006\022\024\n\020MIN_ELAPSED_TIME\020\007\022\024\n\020MAX_ELAPSED" + - "_TIME\020\010\022\026\n\022TOTAL_ELAPSED_TIME\020\t\022\014\n\010MIN_R" + - "OWS\020\n\022\014\n\010MAX_ROWS\020\013\022\016\n\nTOTAL_ROWS\020\014\022\016\n\nM" + - "IN_SPILLS\020\r\022\016\n\nMAX_SPILLS\020\016\022\020\n\014TOTAL_SPI" + - "LLS\020\017\022\017\n\013USED_MEMORY\020\020\022\021\n\rTARGET_MEMORY\020" + - "\021\022\022\n\016CPU_USAGE_PERC\020\022\022\026\n\022CPU_EFFECTIVE_P" + - "ERC\020\023\022\025\n\021CPU_VIOLATED_PERC\020\024\022\030\n\024TOTAL_LO" + - "GICAL_WRITES\020\025\022\026\n\022MIN_LOGICAL_WRITES\020\026\022\026" + - "\n\022MAX_LOGICAL_WRITES\020\027\022\027\n\023TOTAL_LOGICAL_" + - "READS\020\030\022\025\n\021MIN_LOGICAL_READS\020\031\022\025\n\021MAX_LO" + - "GICAL_READS\020\032\022\027\n\023TOTAL_USED_GRANT_KB\020\033\022\025" + - "\n\021MIN_USED_GRANT_KB\020\034\022\025\n\021MAX_USED_GRANT_" + - "KB\020\035\022\026\n\022TOTAL_USED_THREADS\020\036\022\024\n\020MIN_USED" + - "_THREADS\020\037\022\024\n\020MAX_USED_THREADS\020 \022\027\n\023CPU_" + - "USAGE_PERC_BASE\020!\022\033\n\027CPU_EFFECTIVE_PERC_" + - "BASE\020\"\022\031\n\025CPU_USAGE_TARGET_PERC\020#\022\022\n\016DIS" + - "K_READ_IOPS\020$\022\023\n\017DISK_WRITE_IOPS\020%\022\027\n\023LO" + - "CKS_AVG_WAIT_TIME\020&\022\034\n\030LOCKS_AVG_WAIT_TI" + - "ME_BASE\020\'\022\021\n\rLOCK_REQUESTS\020(\022\014\n\010MS_TICKS" + - "\020)B\002P\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - com.google.protobuf.TimestampProto.getDescriptor(), - }); - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfo_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfo_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfo_descriptor, - new java.lang.String[] { "Identifier", "InfoPair", "Identifier", }); - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfo_InfoPair_descriptor = - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfo_descriptor.getNestedTypes().get(0); - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfo_InfoPair_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfo_InfoPair_descriptor, - new java.lang.String[] { "StringType", "LongType", "StringValue", "LongValue", "Type", "Value", }); - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfoLog_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfoLog_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfoLog_descriptor, - new java.lang.String[] { "Info", }); - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEvent_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEvent_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEvent_descriptor, - new java.lang.String[] { "Identifier", "Timestamp", "EventPair", "Identifier", "Timestamp", }); - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEvent_EventPair_descriptor = - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEvent_descriptor.getNestedTypes().get(0); - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEvent_EventPair_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEvent_EventPair_descriptor, - new java.lang.String[] { "StringType", "LongType", "StringValue", "LongValue", "Type", "Value", }); - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEventLog_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEventLog_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEventLog_descriptor, - new java.lang.String[] { "Event", }); - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEvent_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEvent_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEvent_descriptor, - new java.lang.String[] { "Timestamp", "EventPair", "Timestamp", }); - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEvent_EventPair_descriptor = - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEvent_descriptor.getNestedTypes().get(0); - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEvent_EventPair_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEvent_EventPair_descriptor, - new java.lang.String[] { "LongType", "LongValue", }); - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEventLog_descriptor = - getDescriptor().getMessageTypes().get(5); - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEventLog_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEventLog_descriptor, - new java.lang.String[] { "Event", }); - com.google.protobuf.TimestampProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/PerfEvent.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/PerfEvent.java deleted file mode 100644 index 3cb8c9b8b..000000000 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/PerfEvent.java +++ /dev/null @@ -1,1572 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: monitor.proto - -package com.oltpbenchmark.api.collectors.monitoring.proto; - -/** - * Protobuf type {@code com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent} - */ -public final class PerfEvent extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent) - PerfEventOrBuilder { -private static final long serialVersionUID = 0L; - // Use PerfEvent.newBuilder() to construct. - private PerfEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private PerfEvent() { - eventPair_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new PerfEvent(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private PerfEvent( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (((bitField0_ & 0x00000001) != 0)) { - subBuilder = timestamp_.toBuilder(); - } - timestamp_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(timestamp_); - timestamp_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000001; - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - eventPair_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - eventPair_.add( - input.readMessage(com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000002) != 0)) { - eventPair_ = java.util.Collections.unmodifiableList(eventPair_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEvent_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEvent_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.class, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.Builder.class); - } - - public interface EventPairOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair) - com.google.protobuf.MessageOrBuilder { - - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 1; - * @return The enum numeric value on the wire for longType. - */ - int getLongTypeValue(); - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 1; - * @return The longType. - */ - com.oltpbenchmark.api.collectors.monitoring.proto.LongType getLongType(); - - /** - * int64 long_value = 2; - * @return The longValue. - */ - long getLongValue(); - } - /** - *
-   * Encodes a pair of event type and value.
-   * Next id: 5
-   * 
- * - * Protobuf type {@code com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair} - */ - public static final class EventPair extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair) - EventPairOrBuilder { - private static final long serialVersionUID = 0L; - // Use EventPair.newBuilder() to construct. - private EventPair(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private EventPair() { - longType_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new EventPair(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private EventPair( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - int rawValue = input.readEnum(); - - longType_ = rawValue; - break; - } - case 16: { - - longValue_ = input.readInt64(); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEvent_EventPair_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEvent_EventPair_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair.class, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair.Builder.class); - } - - public static final int LONG_TYPE_FIELD_NUMBER = 1; - private int longType_; - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 1; - * @return The enum numeric value on the wire for longType. - */ - @java.lang.Override public int getLongTypeValue() { - return longType_; - } - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 1; - * @return The longType. - */ - @java.lang.Override public com.oltpbenchmark.api.collectors.monitoring.proto.LongType getLongType() { - @SuppressWarnings("deprecation") - com.oltpbenchmark.api.collectors.monitoring.proto.LongType result = com.oltpbenchmark.api.collectors.monitoring.proto.LongType.valueOf(longType_); - return result == null ? com.oltpbenchmark.api.collectors.monitoring.proto.LongType.UNRECOGNIZED : result; - } - - public static final int LONG_VALUE_FIELD_NUMBER = 2; - private long longValue_; - /** - * int64 long_value = 2; - * @return The longValue. - */ - @java.lang.Override - public long getLongValue() { - return longValue_; - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (longType_ != com.oltpbenchmark.api.collectors.monitoring.proto.LongType.EXECUTION_COUNT.getNumber()) { - output.writeEnum(1, longType_); - } - if (longValue_ != 0L) { - output.writeInt64(2, longValue_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (longType_ != com.oltpbenchmark.api.collectors.monitoring.proto.LongType.EXECUTION_COUNT.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, longType_); - } - if (longValue_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, longValue_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair)) { - return super.equals(obj); - } - com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair other = (com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair) obj; - - if (longType_ != other.longType_) return false; - if (getLongValue() - != other.getLongValue()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + LONG_TYPE_FIELD_NUMBER; - hash = (53 * hash) + longType_; - hash = (37 * hash) + LONG_VALUE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getLongValue()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-     * Encodes a pair of event type and value.
-     * Next id: 5
-     * 
- * - * Protobuf type {@code com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair) - com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPairOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEvent_EventPair_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEvent_EventPair_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair.class, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair.Builder.class); - } - - // Construct using com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - longType_ = 0; - - longValue_ = 0L; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEvent_EventPair_descriptor; - } - - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair getDefaultInstanceForType() { - return com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair.getDefaultInstance(); - } - - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair build() { - com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair buildPartial() { - com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair result = new com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair(this); - result.longType_ = longType_; - result.longValue_ = longValue_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair) { - return mergeFrom((com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair other) { - if (other == com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair.getDefaultInstance()) return this; - if (other.longType_ != 0) { - setLongTypeValue(other.getLongTypeValue()); - } - if (other.getLongValue() != 0L) { - setLongValue(other.getLongValue()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int longType_ = 0; - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 1; - * @return The enum numeric value on the wire for longType. - */ - @java.lang.Override public int getLongTypeValue() { - return longType_; - } - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 1; - * @param value The enum numeric value on the wire for longType to set. - * @return This builder for chaining. - */ - public Builder setLongTypeValue(int value) { - - longType_ = value; - onChanged(); - return this; - } - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 1; - * @return The longType. - */ - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.LongType getLongType() { - @SuppressWarnings("deprecation") - com.oltpbenchmark.api.collectors.monitoring.proto.LongType result = com.oltpbenchmark.api.collectors.monitoring.proto.LongType.valueOf(longType_); - return result == null ? com.oltpbenchmark.api.collectors.monitoring.proto.LongType.UNRECOGNIZED : result; - } - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 1; - * @param value The longType to set. - * @return This builder for chaining. - */ - public Builder setLongType(com.oltpbenchmark.api.collectors.monitoring.proto.LongType value) { - if (value == null) { - throw new NullPointerException(); - } - - longType_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 1; - * @return This builder for chaining. - */ - public Builder clearLongType() { - - longType_ = 0; - onChanged(); - return this; - } - - private long longValue_ ; - /** - * int64 long_value = 2; - * @return The longValue. - */ - @java.lang.Override - public long getLongValue() { - return longValue_; - } - /** - * int64 long_value = 2; - * @param value The longValue to set. - * @return This builder for chaining. - */ - public Builder setLongValue(long value) { - - longValue_ = value; - onChanged(); - return this; - } - /** - * int64 long_value = 2; - * @return This builder for chaining. - */ - public Builder clearLongValue() { - - longValue_ = 0L; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair) - } - - // @@protoc_insertion_point(class_scope:com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair) - private static final com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair(); - } - - public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public EventPair parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new EventPair(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - private int bitField0_; - public static final int TIMESTAMP_FIELD_NUMBER = 1; - private com.google.protobuf.Timestamp timestamp_; - /** - * optional .google.protobuf.Timestamp timestamp = 1; - * @return Whether the timestamp field is set. - */ - @java.lang.Override - public boolean hasTimestamp() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * optional .google.protobuf.Timestamp timestamp = 1; - * @return The timestamp. - */ - @java.lang.Override - public com.google.protobuf.Timestamp getTimestamp() { - return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; - } - /** - * optional .google.protobuf.Timestamp timestamp = 1; - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder() { - return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; - } - - public static final int EVENT_PAIR_FIELD_NUMBER = 2; - private java.util.List eventPair_; - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; - */ - @java.lang.Override - public java.util.List getEventPairList() { - return eventPair_; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; - */ - @java.lang.Override - public java.util.List - getEventPairOrBuilderList() { - return eventPair_; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; - */ - @java.lang.Override - public int getEventPairCount() { - return eventPair_.size(); - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; - */ - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair getEventPair(int index) { - return eventPair_.get(index); - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; - */ - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPairOrBuilder getEventPairOrBuilder( - int index) { - return eventPair_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (((bitField0_ & 0x00000001) != 0)) { - output.writeMessage(1, getTimestamp()); - } - for (int i = 0; i < eventPair_.size(); i++) { - output.writeMessage(2, eventPair_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) != 0)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getTimestamp()); - } - for (int i = 0; i < eventPair_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, eventPair_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent)) { - return super.equals(obj); - } - com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent other = (com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent) obj; - - if (hasTimestamp() != other.hasTimestamp()) return false; - if (hasTimestamp()) { - if (!getTimestamp() - .equals(other.getTimestamp())) return false; - } - if (!getEventPairList() - .equals(other.getEventPairList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasTimestamp()) { - hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; - hash = (53 * hash) + getTimestamp().hashCode(); - } - if (getEventPairCount() > 0) { - hash = (37 * hash) + EVENT_PAIR_FIELD_NUMBER; - hash = (53 * hash) + getEventPairList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent) - com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEvent_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEvent_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.class, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.Builder.class); - } - - // Construct using com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getTimestampFieldBuilder(); - getEventPairFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (timestampBuilder_ == null) { - timestamp_ = null; - } else { - timestampBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - if (eventPairBuilder_ == null) { - eventPair_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - eventPairBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEvent_descriptor; - } - - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent getDefaultInstanceForType() { - return com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.getDefaultInstance(); - } - - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent build() { - com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent buildPartial() { - com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent result = new com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) != 0)) { - if (timestampBuilder_ == null) { - result.timestamp_ = timestamp_; - } else { - result.timestamp_ = timestampBuilder_.build(); - } - to_bitField0_ |= 0x00000001; - } - if (eventPairBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - eventPair_ = java.util.Collections.unmodifiableList(eventPair_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.eventPair_ = eventPair_; - } else { - result.eventPair_ = eventPairBuilder_.build(); - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent) { - return mergeFrom((com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent other) { - if (other == com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.getDefaultInstance()) return this; - if (other.hasTimestamp()) { - mergeTimestamp(other.getTimestamp()); - } - if (eventPairBuilder_ == null) { - if (!other.eventPair_.isEmpty()) { - if (eventPair_.isEmpty()) { - eventPair_ = other.eventPair_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureEventPairIsMutable(); - eventPair_.addAll(other.eventPair_); - } - onChanged(); - } - } else { - if (!other.eventPair_.isEmpty()) { - if (eventPairBuilder_.isEmpty()) { - eventPairBuilder_.dispose(); - eventPairBuilder_ = null; - eventPair_ = other.eventPair_; - bitField0_ = (bitField0_ & ~0x00000002); - eventPairBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getEventPairFieldBuilder() : null; - } else { - eventPairBuilder_.addAllMessages(other.eventPair_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private com.google.protobuf.Timestamp timestamp_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> timestampBuilder_; - /** - * optional .google.protobuf.Timestamp timestamp = 1; - * @return Whether the timestamp field is set. - */ - public boolean hasTimestamp() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * optional .google.protobuf.Timestamp timestamp = 1; - * @return The timestamp. - */ - public com.google.protobuf.Timestamp getTimestamp() { - if (timestampBuilder_ == null) { - return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; - } else { - return timestampBuilder_.getMessage(); - } - } - /** - * optional .google.protobuf.Timestamp timestamp = 1; - */ - public Builder setTimestamp(com.google.protobuf.Timestamp value) { - if (timestampBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - timestamp_ = value; - onChanged(); - } else { - timestampBuilder_.setMessage(value); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * optional .google.protobuf.Timestamp timestamp = 1; - */ - public Builder setTimestamp( - com.google.protobuf.Timestamp.Builder builderForValue) { - if (timestampBuilder_ == null) { - timestamp_ = builderForValue.build(); - onChanged(); - } else { - timestampBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * optional .google.protobuf.Timestamp timestamp = 1; - */ - public Builder mergeTimestamp(com.google.protobuf.Timestamp value) { - if (timestampBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0) && - timestamp_ != null && - timestamp_ != com.google.protobuf.Timestamp.getDefaultInstance()) { - timestamp_ = - com.google.protobuf.Timestamp.newBuilder(timestamp_).mergeFrom(value).buildPartial(); - } else { - timestamp_ = value; - } - onChanged(); - } else { - timestampBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000001; - return this; - } - /** - * optional .google.protobuf.Timestamp timestamp = 1; - */ - public Builder clearTimestamp() { - if (timestampBuilder_ == null) { - timestamp_ = null; - onChanged(); - } else { - timestampBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - /** - * optional .google.protobuf.Timestamp timestamp = 1; - */ - public com.google.protobuf.Timestamp.Builder getTimestampBuilder() { - bitField0_ |= 0x00000001; - onChanged(); - return getTimestampFieldBuilder().getBuilder(); - } - /** - * optional .google.protobuf.Timestamp timestamp = 1; - */ - public com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder() { - if (timestampBuilder_ != null) { - return timestampBuilder_.getMessageOrBuilder(); - } else { - return timestamp_ == null ? - com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; - } - } - /** - * optional .google.protobuf.Timestamp timestamp = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getTimestampFieldBuilder() { - if (timestampBuilder_ == null) { - timestampBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( - getTimestamp(), - getParentForChildren(), - isClean()); - timestamp_ = null; - } - return timestampBuilder_; - } - - private java.util.List eventPair_ = - java.util.Collections.emptyList(); - private void ensureEventPairIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - eventPair_ = new java.util.ArrayList(eventPair_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair.Builder, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPairOrBuilder> eventPairBuilder_; - - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; - */ - public java.util.List getEventPairList() { - if (eventPairBuilder_ == null) { - return java.util.Collections.unmodifiableList(eventPair_); - } else { - return eventPairBuilder_.getMessageList(); - } - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; - */ - public int getEventPairCount() { - if (eventPairBuilder_ == null) { - return eventPair_.size(); - } else { - return eventPairBuilder_.getCount(); - } - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; - */ - public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair getEventPair(int index) { - if (eventPairBuilder_ == null) { - return eventPair_.get(index); - } else { - return eventPairBuilder_.getMessage(index); - } - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; - */ - public Builder setEventPair( - int index, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair value) { - if (eventPairBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEventPairIsMutable(); - eventPair_.set(index, value); - onChanged(); - } else { - eventPairBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; - */ - public Builder setEventPair( - int index, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair.Builder builderForValue) { - if (eventPairBuilder_ == null) { - ensureEventPairIsMutable(); - eventPair_.set(index, builderForValue.build()); - onChanged(); - } else { - eventPairBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; - */ - public Builder addEventPair(com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair value) { - if (eventPairBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEventPairIsMutable(); - eventPair_.add(value); - onChanged(); - } else { - eventPairBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; - */ - public Builder addEventPair( - int index, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair value) { - if (eventPairBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEventPairIsMutable(); - eventPair_.add(index, value); - onChanged(); - } else { - eventPairBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; - */ - public Builder addEventPair( - com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair.Builder builderForValue) { - if (eventPairBuilder_ == null) { - ensureEventPairIsMutable(); - eventPair_.add(builderForValue.build()); - onChanged(); - } else { - eventPairBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; - */ - public Builder addEventPair( - int index, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair.Builder builderForValue) { - if (eventPairBuilder_ == null) { - ensureEventPairIsMutable(); - eventPair_.add(index, builderForValue.build()); - onChanged(); - } else { - eventPairBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; - */ - public Builder addAllEventPair( - java.lang.Iterable values) { - if (eventPairBuilder_ == null) { - ensureEventPairIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, eventPair_); - onChanged(); - } else { - eventPairBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; - */ - public Builder clearEventPair() { - if (eventPairBuilder_ == null) { - eventPair_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - eventPairBuilder_.clear(); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; - */ - public Builder removeEventPair(int index) { - if (eventPairBuilder_ == null) { - ensureEventPairIsMutable(); - eventPair_.remove(index); - onChanged(); - } else { - eventPairBuilder_.remove(index); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; - */ - public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair.Builder getEventPairBuilder( - int index) { - return getEventPairFieldBuilder().getBuilder(index); - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; - */ - public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPairOrBuilder getEventPairOrBuilder( - int index) { - if (eventPairBuilder_ == null) { - return eventPair_.get(index); } else { - return eventPairBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; - */ - public java.util.List - getEventPairOrBuilderList() { - if (eventPairBuilder_ != null) { - return eventPairBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(eventPair_); - } - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; - */ - public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair.Builder addEventPairBuilder() { - return getEventPairFieldBuilder().addBuilder( - com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair.getDefaultInstance()); - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; - */ - public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair.Builder addEventPairBuilder( - int index) { - return getEventPairFieldBuilder().addBuilder( - index, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair.getDefaultInstance()); - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; - */ - public java.util.List - getEventPairBuilderList() { - return getEventPairFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair.Builder, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPairOrBuilder> - getEventPairFieldBuilder() { - if (eventPairBuilder_ == null) { - eventPairBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair.Builder, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPairOrBuilder>( - eventPair_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - eventPair_ = null; - } - return eventPairBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent) - } - - // @@protoc_insertion_point(class_scope:com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent) - private static final com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent(); - } - - public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public PerfEvent parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new PerfEvent(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/PerfEventLog.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/PerfEventLog.java deleted file mode 100644 index 7b579d2cf..000000000 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/PerfEventLog.java +++ /dev/null @@ -1,780 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: monitor.proto - -package com.oltpbenchmark.api.collectors.monitoring.proto; - -/** - *
- * Encodes performance events in a log.
- * Next id: 2
- * 
- * - * Protobuf type {@code com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog} - */ -public final class PerfEventLog extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog) - PerfEventLogOrBuilder { -private static final long serialVersionUID = 0L; - // Use PerfEventLog.newBuilder() to construct. - private PerfEventLog(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private PerfEventLog() { - event_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new PerfEventLog(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private PerfEventLog( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - event_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - event_.add( - input.readMessage(com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - event_ = java.util.Collections.unmodifiableList(event_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEventLog_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEventLog_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog.class, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog.Builder.class); - } - - public static final int EVENT_FIELD_NUMBER = 1; - private java.util.List event_; - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; - */ - @java.lang.Override - public java.util.List getEventList() { - return event_; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; - */ - @java.lang.Override - public java.util.List - getEventOrBuilderList() { - return event_; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; - */ - @java.lang.Override - public int getEventCount() { - return event_.size(); - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; - */ - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent getEvent(int index) { - return event_.get(index); - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; - */ - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventOrBuilder getEventOrBuilder( - int index) { - return event_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < event_.size(); i++) { - output.writeMessage(1, event_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < event_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, event_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog)) { - return super.equals(obj); - } - com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog other = (com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog) obj; - - if (!getEventList() - .equals(other.getEventList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getEventCount() > 0) { - hash = (37 * hash) + EVENT_FIELD_NUMBER; - hash = (53 * hash) + getEventList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Encodes performance events in a log.
-   * Next id: 2
-   * 
- * - * Protobuf type {@code com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog) - com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLogOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEventLog_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEventLog_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog.class, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog.Builder.class); - } - - // Construct using com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getEventFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (eventBuilder_ == null) { - event_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - eventBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_PerfEventLog_descriptor; - } - - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog getDefaultInstanceForType() { - return com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog.getDefaultInstance(); - } - - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog build() { - com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog buildPartial() { - com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog result = new com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog(this); - int from_bitField0_ = bitField0_; - if (eventBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - event_ = java.util.Collections.unmodifiableList(event_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.event_ = event_; - } else { - result.event_ = eventBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog) { - return mergeFrom((com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog other) { - if (other == com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog.getDefaultInstance()) return this; - if (eventBuilder_ == null) { - if (!other.event_.isEmpty()) { - if (event_.isEmpty()) { - event_ = other.event_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureEventIsMutable(); - event_.addAll(other.event_); - } - onChanged(); - } - } else { - if (!other.event_.isEmpty()) { - if (eventBuilder_.isEmpty()) { - eventBuilder_.dispose(); - eventBuilder_ = null; - event_ = other.event_; - bitField0_ = (bitField0_ & ~0x00000001); - eventBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getEventFieldBuilder() : null; - } else { - eventBuilder_.addAllMessages(other.event_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List event_ = - java.util.Collections.emptyList(); - private void ensureEventIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - event_ = new java.util.ArrayList(event_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.Builder, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventOrBuilder> eventBuilder_; - - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; - */ - public java.util.List getEventList() { - if (eventBuilder_ == null) { - return java.util.Collections.unmodifiableList(event_); - } else { - return eventBuilder_.getMessageList(); - } - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; - */ - public int getEventCount() { - if (eventBuilder_ == null) { - return event_.size(); - } else { - return eventBuilder_.getCount(); - } - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; - */ - public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent getEvent(int index) { - if (eventBuilder_ == null) { - return event_.get(index); - } else { - return eventBuilder_.getMessage(index); - } - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; - */ - public Builder setEvent( - int index, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent value) { - if (eventBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEventIsMutable(); - event_.set(index, value); - onChanged(); - } else { - eventBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; - */ - public Builder setEvent( - int index, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.Builder builderForValue) { - if (eventBuilder_ == null) { - ensureEventIsMutable(); - event_.set(index, builderForValue.build()); - onChanged(); - } else { - eventBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; - */ - public Builder addEvent(com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent value) { - if (eventBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEventIsMutable(); - event_.add(value); - onChanged(); - } else { - eventBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; - */ - public Builder addEvent( - int index, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent value) { - if (eventBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEventIsMutable(); - event_.add(index, value); - onChanged(); - } else { - eventBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; - */ - public Builder addEvent( - com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.Builder builderForValue) { - if (eventBuilder_ == null) { - ensureEventIsMutable(); - event_.add(builderForValue.build()); - onChanged(); - } else { - eventBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; - */ - public Builder addEvent( - int index, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.Builder builderForValue) { - if (eventBuilder_ == null) { - ensureEventIsMutable(); - event_.add(index, builderForValue.build()); - onChanged(); - } else { - eventBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; - */ - public Builder addAllEvent( - java.lang.Iterable values) { - if (eventBuilder_ == null) { - ensureEventIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, event_); - onChanged(); - } else { - eventBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; - */ - public Builder clearEvent() { - if (eventBuilder_ == null) { - event_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - eventBuilder_.clear(); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; - */ - public Builder removeEvent(int index) { - if (eventBuilder_ == null) { - ensureEventIsMutable(); - event_.remove(index); - onChanged(); - } else { - eventBuilder_.remove(index); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; - */ - public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.Builder getEventBuilder( - int index) { - return getEventFieldBuilder().getBuilder(index); - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; - */ - public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventOrBuilder getEventOrBuilder( - int index) { - if (eventBuilder_ == null) { - return event_.get(index); } else { - return eventBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; - */ - public java.util.List - getEventOrBuilderList() { - if (eventBuilder_ != null) { - return eventBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(event_); - } - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; - */ - public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.Builder addEventBuilder() { - return getEventFieldBuilder().addBuilder( - com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.getDefaultInstance()); - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; - */ - public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.Builder addEventBuilder( - int index) { - return getEventFieldBuilder().addBuilder( - index, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.getDefaultInstance()); - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; - */ - public java.util.List - getEventBuilderList() { - return getEventFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.Builder, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventOrBuilder> - getEventFieldBuilder() { - if (eventBuilder_ == null) { - eventBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.Builder, com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventOrBuilder>( - event_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - event_ = null; - } - return eventBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog) - } - - // @@protoc_insertion_point(class_scope:com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog) - private static final com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog(); - } - - public static com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public PerfEventLog parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new PerfEventLog(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/PerfEventLogOrBuilder.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/PerfEventLogOrBuilder.java deleted file mode 100644 index b47a9a925..000000000 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/PerfEventLogOrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: monitor.proto - -package com.oltpbenchmark.api.collectors.monitoring.proto; - -public interface PerfEventLogOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventLog) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; - */ - java.util.List - getEventList(); - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; - */ - com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent getEvent(int index); - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; - */ - int getEventCount(); - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; - */ - java.util.List - getEventOrBuilderList(); - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent event = 1; - */ - com.oltpbenchmark.api.collectors.monitoring.proto.PerfEventOrBuilder getEventOrBuilder( - int index); -} diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/PerfEventOrBuilder.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/PerfEventOrBuilder.java deleted file mode 100644 index 38b83cbc3..000000000 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/PerfEventOrBuilder.java +++ /dev/null @@ -1,48 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: monitor.proto - -package com.oltpbenchmark.api.collectors.monitoring.proto; - -public interface PerfEventOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent) - com.google.protobuf.MessageOrBuilder { - - /** - * optional .google.protobuf.Timestamp timestamp = 1; - * @return Whether the timestamp field is set. - */ - boolean hasTimestamp(); - /** - * optional .google.protobuf.Timestamp timestamp = 1; - * @return The timestamp. - */ - com.google.protobuf.Timestamp getTimestamp(); - /** - * optional .google.protobuf.Timestamp timestamp = 1; - */ - com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder(); - - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; - */ - java.util.List - getEventPairList(); - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; - */ - com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair getEventPair(int index); - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; - */ - int getEventPairCount(); - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; - */ - java.util.List - getEventPairOrBuilderList(); - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPair event_pair = 2; - */ - com.oltpbenchmark.api.collectors.monitoring.proto.PerfEvent.EventPairOrBuilder getEventPairOrBuilder( - int index); -} diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryEvent.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryEvent.java deleted file mode 100644 index 4d19c68fa..000000000 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryEvent.java +++ /dev/null @@ -1,2308 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: monitor.proto - -package com.oltpbenchmark.api.collectors.monitoring.proto; - -/** - *
- * Proto representation for query metrics logged through BenchBase.
- * Next id: 4
- * 
- * - * Protobuf type {@code com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent} - */ -public final class QueryEvent extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent) - QueryEventOrBuilder { -private static final long serialVersionUID = 0L; - // Use QueryEvent.newBuilder() to construct. - private QueryEvent(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private QueryEvent() { - identifier_ = ""; - eventPair_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new QueryEvent(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private QueryEvent( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - identifier_ = s; - break; - } - case 18: { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (((bitField0_ & 0x00000002) != 0)) { - subBuilder = timestamp_.toBuilder(); - } - timestamp_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(timestamp_); - timestamp_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000002; - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - eventPair_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; - } - eventPair_.add( - input.readMessage(com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000004) != 0)) { - eventPair_ = java.util.Collections.unmodifiableList(eventPair_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEvent_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEvent_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.class, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.Builder.class); - } - - public interface EventPairOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair) - com.google.protobuf.MessageOrBuilder { - - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; - * @return Whether the stringType field is set. - */ - boolean hasStringType(); - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; - * @return The enum numeric value on the wire for stringType. - */ - int getStringTypeValue(); - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; - * @return The stringType. - */ - com.oltpbenchmark.api.collectors.monitoring.proto.StringType getStringType(); - - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; - * @return Whether the longType field is set. - */ - boolean hasLongType(); - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; - * @return The enum numeric value on the wire for longType. - */ - int getLongTypeValue(); - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; - * @return The longType. - */ - com.oltpbenchmark.api.collectors.monitoring.proto.LongType getLongType(); - - /** - * string string_value = 3; - * @return Whether the stringValue field is set. - */ - boolean hasStringValue(); - /** - * string string_value = 3; - * @return The stringValue. - */ - java.lang.String getStringValue(); - /** - * string string_value = 3; - * @return The bytes for stringValue. - */ - com.google.protobuf.ByteString - getStringValueBytes(); - - /** - * int64 long_value = 4; - * @return Whether the longValue field is set. - */ - boolean hasLongValue(); - /** - * int64 long_value = 4; - * @return The longValue. - */ - long getLongValue(); - - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair.TypeCase getTypeCase(); - - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair.ValueCase getValueCase(); - } - /** - *
-   * Encodes a pair of event type and value.
-   * Next id: 5
-   * 
- * - * Protobuf type {@code com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair} - */ - public static final class EventPair extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair) - EventPairOrBuilder { - private static final long serialVersionUID = 0L; - // Use EventPair.newBuilder() to construct. - private EventPair(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private EventPair() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new EventPair(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private EventPair( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - int rawValue = input.readEnum(); - typeCase_ = 1; - type_ = rawValue; - break; - } - case 16: { - int rawValue = input.readEnum(); - typeCase_ = 2; - type_ = rawValue; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - valueCase_ = 3; - value_ = s; - break; - } - case 32: { - value_ = input.readInt64(); - valueCase_ = 4; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEvent_EventPair_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEvent_EventPair_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair.class, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair.Builder.class); - } - - private int typeCase_ = 0; - private java.lang.Object type_; - public enum TypeCase - implements com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - STRING_TYPE(1), - LONG_TYPE(2), - TYPE_NOT_SET(0); - private final int value; - private TypeCase(int value) { - this.value = value; - } - /** - * @param value The number of the enum to look for. - * @return The enum associated with the given number. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static TypeCase valueOf(int value) { - return forNumber(value); - } - - public static TypeCase forNumber(int value) { - switch (value) { - case 1: return STRING_TYPE; - case 2: return LONG_TYPE; - case 0: return TYPE_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public TypeCase - getTypeCase() { - return TypeCase.forNumber( - typeCase_); - } - - private int valueCase_ = 0; - private java.lang.Object value_; - public enum ValueCase - implements com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - STRING_VALUE(3), - LONG_VALUE(4), - VALUE_NOT_SET(0); - private final int value; - private ValueCase(int value) { - this.value = value; - } - /** - * @param value The number of the enum to look for. - * @return The enum associated with the given number. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static ValueCase valueOf(int value) { - return forNumber(value); - } - - public static ValueCase forNumber(int value) { - switch (value) { - case 3: return STRING_VALUE; - case 4: return LONG_VALUE; - case 0: return VALUE_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public ValueCase - getValueCase() { - return ValueCase.forNumber( - valueCase_); - } - - public static final int STRING_TYPE_FIELD_NUMBER = 1; - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; - * @return Whether the stringType field is set. - */ - public boolean hasStringType() { - return typeCase_ == 1; - } - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; - * @return The enum numeric value on the wire for stringType. - */ - public int getStringTypeValue() { - if (typeCase_ == 1) { - return (java.lang.Integer) type_; - } - return 0; - } - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; - * @return The stringType. - */ - public com.oltpbenchmark.api.collectors.monitoring.proto.StringType getStringType() { - if (typeCase_ == 1) { - @SuppressWarnings("deprecation") - com.oltpbenchmark.api.collectors.monitoring.proto.StringType result = com.oltpbenchmark.api.collectors.monitoring.proto.StringType.valueOf( - (java.lang.Integer) type_); - return result == null ? com.oltpbenchmark.api.collectors.monitoring.proto.StringType.UNRECOGNIZED : result; - } - return com.oltpbenchmark.api.collectors.monitoring.proto.StringType.QUERY_TEXT; - } - - public static final int LONG_TYPE_FIELD_NUMBER = 2; - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; - * @return Whether the longType field is set. - */ - public boolean hasLongType() { - return typeCase_ == 2; - } - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; - * @return The enum numeric value on the wire for longType. - */ - public int getLongTypeValue() { - if (typeCase_ == 2) { - return (java.lang.Integer) type_; - } - return 0; - } - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; - * @return The longType. - */ - public com.oltpbenchmark.api.collectors.monitoring.proto.LongType getLongType() { - if (typeCase_ == 2) { - @SuppressWarnings("deprecation") - com.oltpbenchmark.api.collectors.monitoring.proto.LongType result = com.oltpbenchmark.api.collectors.monitoring.proto.LongType.valueOf( - (java.lang.Integer) type_); - return result == null ? com.oltpbenchmark.api.collectors.monitoring.proto.LongType.UNRECOGNIZED : result; - } - return com.oltpbenchmark.api.collectors.monitoring.proto.LongType.EXECUTION_COUNT; - } - - public static final int STRING_VALUE_FIELD_NUMBER = 3; - /** - * string string_value = 3; - * @return Whether the stringValue field is set. - */ - public boolean hasStringValue() { - return valueCase_ == 3; - } - /** - * string string_value = 3; - * @return The stringValue. - */ - public java.lang.String getStringValue() { - java.lang.Object ref = ""; - if (valueCase_ == 3) { - ref = value_; - } - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (valueCase_ == 3) { - value_ = s; - } - return s; - } - } - /** - * string string_value = 3; - * @return The bytes for stringValue. - */ - public com.google.protobuf.ByteString - getStringValueBytes() { - java.lang.Object ref = ""; - if (valueCase_ == 3) { - ref = value_; - } - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - if (valueCase_ == 3) { - value_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int LONG_VALUE_FIELD_NUMBER = 4; - /** - * int64 long_value = 4; - * @return Whether the longValue field is set. - */ - @java.lang.Override - public boolean hasLongValue() { - return valueCase_ == 4; - } - /** - * int64 long_value = 4; - * @return The longValue. - */ - @java.lang.Override - public long getLongValue() { - if (valueCase_ == 4) { - return (java.lang.Long) value_; - } - return 0L; - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (typeCase_ == 1) { - output.writeEnum(1, ((java.lang.Integer) type_)); - } - if (typeCase_ == 2) { - output.writeEnum(2, ((java.lang.Integer) type_)); - } - if (valueCase_ == 3) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, value_); - } - if (valueCase_ == 4) { - output.writeInt64( - 4, (long)((java.lang.Long) value_)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (typeCase_ == 1) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, ((java.lang.Integer) type_)); - } - if (typeCase_ == 2) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(2, ((java.lang.Integer) type_)); - } - if (valueCase_ == 3) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, value_); - } - if (valueCase_ == 4) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size( - 4, (long)((java.lang.Long) value_)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair)) { - return super.equals(obj); - } - com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair other = (com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair) obj; - - if (!getTypeCase().equals(other.getTypeCase())) return false; - switch (typeCase_) { - case 1: - if (getStringTypeValue() - != other.getStringTypeValue()) return false; - break; - case 2: - if (getLongTypeValue() - != other.getLongTypeValue()) return false; - break; - case 0: - default: - } - if (!getValueCase().equals(other.getValueCase())) return false; - switch (valueCase_) { - case 3: - if (!getStringValue() - .equals(other.getStringValue())) return false; - break; - case 4: - if (getLongValue() - != other.getLongValue()) return false; - break; - case 0: - default: - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - switch (typeCase_) { - case 1: - hash = (37 * hash) + STRING_TYPE_FIELD_NUMBER; - hash = (53 * hash) + getStringTypeValue(); - break; - case 2: - hash = (37 * hash) + LONG_TYPE_FIELD_NUMBER; - hash = (53 * hash) + getLongTypeValue(); - break; - case 0: - default: - } - switch (valueCase_) { - case 3: - hash = (37 * hash) + STRING_VALUE_FIELD_NUMBER; - hash = (53 * hash) + getStringValue().hashCode(); - break; - case 4: - hash = (37 * hash) + LONG_VALUE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getLongValue()); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-     * Encodes a pair of event type and value.
-     * Next id: 5
-     * 
- * - * Protobuf type {@code com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair) - com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPairOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEvent_EventPair_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEvent_EventPair_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair.class, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair.Builder.class); - } - - // Construct using com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - typeCase_ = 0; - type_ = null; - valueCase_ = 0; - value_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEvent_EventPair_descriptor; - } - - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair getDefaultInstanceForType() { - return com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair.getDefaultInstance(); - } - - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair build() { - com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair buildPartial() { - com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair result = new com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair(this); - if (typeCase_ == 1) { - result.type_ = type_; - } - if (typeCase_ == 2) { - result.type_ = type_; - } - if (valueCase_ == 3) { - result.value_ = value_; - } - if (valueCase_ == 4) { - result.value_ = value_; - } - result.typeCase_ = typeCase_; - result.valueCase_ = valueCase_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair) { - return mergeFrom((com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair other) { - if (other == com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair.getDefaultInstance()) return this; - switch (other.getTypeCase()) { - case STRING_TYPE: { - setStringTypeValue(other.getStringTypeValue()); - break; - } - case LONG_TYPE: { - setLongTypeValue(other.getLongTypeValue()); - break; - } - case TYPE_NOT_SET: { - break; - } - } - switch (other.getValueCase()) { - case STRING_VALUE: { - valueCase_ = 3; - value_ = other.value_; - onChanged(); - break; - } - case LONG_VALUE: { - setLongValue(other.getLongValue()); - break; - } - case VALUE_NOT_SET: { - break; - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int typeCase_ = 0; - private java.lang.Object type_; - public TypeCase - getTypeCase() { - return TypeCase.forNumber( - typeCase_); - } - - public Builder clearType() { - typeCase_ = 0; - type_ = null; - onChanged(); - return this; - } - - private int valueCase_ = 0; - private java.lang.Object value_; - public ValueCase - getValueCase() { - return ValueCase.forNumber( - valueCase_); - } - - public Builder clearValue() { - valueCase_ = 0; - value_ = null; - onChanged(); - return this; - } - - - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; - * @return Whether the stringType field is set. - */ - @java.lang.Override - public boolean hasStringType() { - return typeCase_ == 1; - } - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; - * @return The enum numeric value on the wire for stringType. - */ - @java.lang.Override - public int getStringTypeValue() { - if (typeCase_ == 1) { - return ((java.lang.Integer) type_).intValue(); - } - return 0; - } - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; - * @param value The enum numeric value on the wire for stringType to set. - * @return This builder for chaining. - */ - public Builder setStringTypeValue(int value) { - typeCase_ = 1; - type_ = value; - onChanged(); - return this; - } - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; - * @return The stringType. - */ - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.StringType getStringType() { - if (typeCase_ == 1) { - @SuppressWarnings("deprecation") - com.oltpbenchmark.api.collectors.monitoring.proto.StringType result = com.oltpbenchmark.api.collectors.monitoring.proto.StringType.valueOf( - (java.lang.Integer) type_); - return result == null ? com.oltpbenchmark.api.collectors.monitoring.proto.StringType.UNRECOGNIZED : result; - } - return com.oltpbenchmark.api.collectors.monitoring.proto.StringType.QUERY_TEXT; - } - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; - * @param value The stringType to set. - * @return This builder for chaining. - */ - public Builder setStringType(com.oltpbenchmark.api.collectors.monitoring.proto.StringType value) { - if (value == null) { - throw new NullPointerException(); - } - typeCase_ = 1; - type_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; - * @return This builder for chaining. - */ - public Builder clearStringType() { - if (typeCase_ == 1) { - typeCase_ = 0; - type_ = null; - onChanged(); - } - return this; - } - - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; - * @return Whether the longType field is set. - */ - @java.lang.Override - public boolean hasLongType() { - return typeCase_ == 2; - } - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; - * @return The enum numeric value on the wire for longType. - */ - @java.lang.Override - public int getLongTypeValue() { - if (typeCase_ == 2) { - return ((java.lang.Integer) type_).intValue(); - } - return 0; - } - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; - * @param value The enum numeric value on the wire for longType to set. - * @return This builder for chaining. - */ - public Builder setLongTypeValue(int value) { - typeCase_ = 2; - type_ = value; - onChanged(); - return this; - } - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; - * @return The longType. - */ - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.LongType getLongType() { - if (typeCase_ == 2) { - @SuppressWarnings("deprecation") - com.oltpbenchmark.api.collectors.monitoring.proto.LongType result = com.oltpbenchmark.api.collectors.monitoring.proto.LongType.valueOf( - (java.lang.Integer) type_); - return result == null ? com.oltpbenchmark.api.collectors.monitoring.proto.LongType.UNRECOGNIZED : result; - } - return com.oltpbenchmark.api.collectors.monitoring.proto.LongType.EXECUTION_COUNT; - } - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; - * @param value The longType to set. - * @return This builder for chaining. - */ - public Builder setLongType(com.oltpbenchmark.api.collectors.monitoring.proto.LongType value) { - if (value == null) { - throw new NullPointerException(); - } - typeCase_ = 2; - type_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; - * @return This builder for chaining. - */ - public Builder clearLongType() { - if (typeCase_ == 2) { - typeCase_ = 0; - type_ = null; - onChanged(); - } - return this; - } - - /** - * string string_value = 3; - * @return Whether the stringValue field is set. - */ - @java.lang.Override - public boolean hasStringValue() { - return valueCase_ == 3; - } - /** - * string string_value = 3; - * @return The stringValue. - */ - @java.lang.Override - public java.lang.String getStringValue() { - java.lang.Object ref = ""; - if (valueCase_ == 3) { - ref = value_; - } - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (valueCase_ == 3) { - value_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string string_value = 3; - * @return The bytes for stringValue. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getStringValueBytes() { - java.lang.Object ref = ""; - if (valueCase_ == 3) { - ref = value_; - } - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - if (valueCase_ == 3) { - value_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string string_value = 3; - * @param value The stringValue to set. - * @return This builder for chaining. - */ - public Builder setStringValue( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - valueCase_ = 3; - value_ = value; - onChanged(); - return this; - } - /** - * string string_value = 3; - * @return This builder for chaining. - */ - public Builder clearStringValue() { - if (valueCase_ == 3) { - valueCase_ = 0; - value_ = null; - onChanged(); - } - return this; - } - /** - * string string_value = 3; - * @param value The bytes for stringValue to set. - * @return This builder for chaining. - */ - public Builder setStringValueBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - valueCase_ = 3; - value_ = value; - onChanged(); - return this; - } - - /** - * int64 long_value = 4; - * @return Whether the longValue field is set. - */ - public boolean hasLongValue() { - return valueCase_ == 4; - } - /** - * int64 long_value = 4; - * @return The longValue. - */ - public long getLongValue() { - if (valueCase_ == 4) { - return (java.lang.Long) value_; - } - return 0L; - } - /** - * int64 long_value = 4; - * @param value The longValue to set. - * @return This builder for chaining. - */ - public Builder setLongValue(long value) { - valueCase_ = 4; - value_ = value; - onChanged(); - return this; - } - /** - * int64 long_value = 4; - * @return This builder for chaining. - */ - public Builder clearLongValue() { - if (valueCase_ == 4) { - valueCase_ = 0; - value_ = null; - onChanged(); - } - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair) - } - - // @@protoc_insertion_point(class_scope:com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair) - private static final com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair(); - } - - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public EventPair parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new EventPair(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - private int bitField0_; - public static final int IDENTIFIER_FIELD_NUMBER = 1; - private volatile java.lang.Object identifier_; - /** - * optional string identifier = 1; - * @return Whether the identifier field is set. - */ - @java.lang.Override - public boolean hasIdentifier() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * optional string identifier = 1; - * @return The identifier. - */ - @java.lang.Override - public java.lang.String getIdentifier() { - java.lang.Object ref = identifier_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - identifier_ = s; - return s; - } - } - /** - * optional string identifier = 1; - * @return The bytes for identifier. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getIdentifierBytes() { - java.lang.Object ref = identifier_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - identifier_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TIMESTAMP_FIELD_NUMBER = 2; - private com.google.protobuf.Timestamp timestamp_; - /** - * optional .google.protobuf.Timestamp timestamp = 2; - * @return Whether the timestamp field is set. - */ - @java.lang.Override - public boolean hasTimestamp() { - return ((bitField0_ & 0x00000002) != 0); - } - /** - * optional .google.protobuf.Timestamp timestamp = 2; - * @return The timestamp. - */ - @java.lang.Override - public com.google.protobuf.Timestamp getTimestamp() { - return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; - } - /** - * optional .google.protobuf.Timestamp timestamp = 2; - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder() { - return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; - } - - public static final int EVENT_PAIR_FIELD_NUMBER = 3; - private java.util.List eventPair_; - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; - */ - @java.lang.Override - public java.util.List getEventPairList() { - return eventPair_; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; - */ - @java.lang.Override - public java.util.List - getEventPairOrBuilderList() { - return eventPair_; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; - */ - @java.lang.Override - public int getEventPairCount() { - return eventPair_.size(); - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; - */ - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair getEventPair(int index) { - return eventPair_.get(index); - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; - */ - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPairOrBuilder getEventPairOrBuilder( - int index) { - return eventPair_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (((bitField0_ & 0x00000001) != 0)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, identifier_); - } - if (((bitField0_ & 0x00000002) != 0)) { - output.writeMessage(2, getTimestamp()); - } - for (int i = 0; i < eventPair_.size(); i++) { - output.writeMessage(3, eventPair_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) != 0)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, identifier_); - } - if (((bitField0_ & 0x00000002) != 0)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getTimestamp()); - } - for (int i = 0; i < eventPair_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, eventPair_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent)) { - return super.equals(obj); - } - com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent other = (com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent) obj; - - if (hasIdentifier() != other.hasIdentifier()) return false; - if (hasIdentifier()) { - if (!getIdentifier() - .equals(other.getIdentifier())) return false; - } - if (hasTimestamp() != other.hasTimestamp()) return false; - if (hasTimestamp()) { - if (!getTimestamp() - .equals(other.getTimestamp())) return false; - } - if (!getEventPairList() - .equals(other.getEventPairList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasIdentifier()) { - hash = (37 * hash) + IDENTIFIER_FIELD_NUMBER; - hash = (53 * hash) + getIdentifier().hashCode(); - } - if (hasTimestamp()) { - hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; - hash = (53 * hash) + getTimestamp().hashCode(); - } - if (getEventPairCount() > 0) { - hash = (37 * hash) + EVENT_PAIR_FIELD_NUMBER; - hash = (53 * hash) + getEventPairList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Proto representation for query metrics logged through BenchBase.
-   * Next id: 4
-   * 
- * - * Protobuf type {@code com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent) - com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEvent_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEvent_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.class, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.Builder.class); - } - - // Construct using com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getTimestampFieldBuilder(); - getEventPairFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - identifier_ = ""; - bitField0_ = (bitField0_ & ~0x00000001); - if (timestampBuilder_ == null) { - timestamp_ = null; - } else { - timestampBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000002); - if (eventPairBuilder_ == null) { - eventPair_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - } else { - eventPairBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEvent_descriptor; - } - - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent getDefaultInstanceForType() { - return com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.getDefaultInstance(); - } - - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent build() { - com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent buildPartial() { - com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent result = new com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) != 0)) { - to_bitField0_ |= 0x00000001; - } - result.identifier_ = identifier_; - if (((from_bitField0_ & 0x00000002) != 0)) { - if (timestampBuilder_ == null) { - result.timestamp_ = timestamp_; - } else { - result.timestamp_ = timestampBuilder_.build(); - } - to_bitField0_ |= 0x00000002; - } - if (eventPairBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0)) { - eventPair_ = java.util.Collections.unmodifiableList(eventPair_); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.eventPair_ = eventPair_; - } else { - result.eventPair_ = eventPairBuilder_.build(); - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent) { - return mergeFrom((com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent other) { - if (other == com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.getDefaultInstance()) return this; - if (other.hasIdentifier()) { - bitField0_ |= 0x00000001; - identifier_ = other.identifier_; - onChanged(); - } - if (other.hasTimestamp()) { - mergeTimestamp(other.getTimestamp()); - } - if (eventPairBuilder_ == null) { - if (!other.eventPair_.isEmpty()) { - if (eventPair_.isEmpty()) { - eventPair_ = other.eventPair_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureEventPairIsMutable(); - eventPair_.addAll(other.eventPair_); - } - onChanged(); - } - } else { - if (!other.eventPair_.isEmpty()) { - if (eventPairBuilder_.isEmpty()) { - eventPairBuilder_.dispose(); - eventPairBuilder_ = null; - eventPair_ = other.eventPair_; - bitField0_ = (bitField0_ & ~0x00000004); - eventPairBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getEventPairFieldBuilder() : null; - } else { - eventPairBuilder_.addAllMessages(other.eventPair_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object identifier_ = ""; - /** - * optional string identifier = 1; - * @return Whether the identifier field is set. - */ - public boolean hasIdentifier() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * optional string identifier = 1; - * @return The identifier. - */ - public java.lang.String getIdentifier() { - java.lang.Object ref = identifier_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - identifier_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string identifier = 1; - * @return The bytes for identifier. - */ - public com.google.protobuf.ByteString - getIdentifierBytes() { - java.lang.Object ref = identifier_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - identifier_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string identifier = 1; - * @param value The identifier to set. - * @return This builder for chaining. - */ - public Builder setIdentifier( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - identifier_ = value; - onChanged(); - return this; - } - /** - * optional string identifier = 1; - * @return This builder for chaining. - */ - public Builder clearIdentifier() { - bitField0_ = (bitField0_ & ~0x00000001); - identifier_ = getDefaultInstance().getIdentifier(); - onChanged(); - return this; - } - /** - * optional string identifier = 1; - * @param value The bytes for identifier to set. - * @return This builder for chaining. - */ - public Builder setIdentifierBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - bitField0_ |= 0x00000001; - identifier_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.Timestamp timestamp_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> timestampBuilder_; - /** - * optional .google.protobuf.Timestamp timestamp = 2; - * @return Whether the timestamp field is set. - */ - public boolean hasTimestamp() { - return ((bitField0_ & 0x00000002) != 0); - } - /** - * optional .google.protobuf.Timestamp timestamp = 2; - * @return The timestamp. - */ - public com.google.protobuf.Timestamp getTimestamp() { - if (timestampBuilder_ == null) { - return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; - } else { - return timestampBuilder_.getMessage(); - } - } - /** - * optional .google.protobuf.Timestamp timestamp = 2; - */ - public Builder setTimestamp(com.google.protobuf.Timestamp value) { - if (timestampBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - timestamp_ = value; - onChanged(); - } else { - timestampBuilder_.setMessage(value); - } - bitField0_ |= 0x00000002; - return this; - } - /** - * optional .google.protobuf.Timestamp timestamp = 2; - */ - public Builder setTimestamp( - com.google.protobuf.Timestamp.Builder builderForValue) { - if (timestampBuilder_ == null) { - timestamp_ = builderForValue.build(); - onChanged(); - } else { - timestampBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000002; - return this; - } - /** - * optional .google.protobuf.Timestamp timestamp = 2; - */ - public Builder mergeTimestamp(com.google.protobuf.Timestamp value) { - if (timestampBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0) && - timestamp_ != null && - timestamp_ != com.google.protobuf.Timestamp.getDefaultInstance()) { - timestamp_ = - com.google.protobuf.Timestamp.newBuilder(timestamp_).mergeFrom(value).buildPartial(); - } else { - timestamp_ = value; - } - onChanged(); - } else { - timestampBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000002; - return this; - } - /** - * optional .google.protobuf.Timestamp timestamp = 2; - */ - public Builder clearTimestamp() { - if (timestampBuilder_ == null) { - timestamp_ = null; - onChanged(); - } else { - timestampBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - /** - * optional .google.protobuf.Timestamp timestamp = 2; - */ - public com.google.protobuf.Timestamp.Builder getTimestampBuilder() { - bitField0_ |= 0x00000002; - onChanged(); - return getTimestampFieldBuilder().getBuilder(); - } - /** - * optional .google.protobuf.Timestamp timestamp = 2; - */ - public com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder() { - if (timestampBuilder_ != null) { - return timestampBuilder_.getMessageOrBuilder(); - } else { - return timestamp_ == null ? - com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; - } - } - /** - * optional .google.protobuf.Timestamp timestamp = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getTimestampFieldBuilder() { - if (timestampBuilder_ == null) { - timestampBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( - getTimestamp(), - getParentForChildren(), - isClean()); - timestamp_ = null; - } - return timestampBuilder_; - } - - private java.util.List eventPair_ = - java.util.Collections.emptyList(); - private void ensureEventPairIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { - eventPair_ = new java.util.ArrayList(eventPair_); - bitField0_ |= 0x00000004; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair.Builder, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPairOrBuilder> eventPairBuilder_; - - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; - */ - public java.util.List getEventPairList() { - if (eventPairBuilder_ == null) { - return java.util.Collections.unmodifiableList(eventPair_); - } else { - return eventPairBuilder_.getMessageList(); - } - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; - */ - public int getEventPairCount() { - if (eventPairBuilder_ == null) { - return eventPair_.size(); - } else { - return eventPairBuilder_.getCount(); - } - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; - */ - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair getEventPair(int index) { - if (eventPairBuilder_ == null) { - return eventPair_.get(index); - } else { - return eventPairBuilder_.getMessage(index); - } - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; - */ - public Builder setEventPair( - int index, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair value) { - if (eventPairBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEventPairIsMutable(); - eventPair_.set(index, value); - onChanged(); - } else { - eventPairBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; - */ - public Builder setEventPair( - int index, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair.Builder builderForValue) { - if (eventPairBuilder_ == null) { - ensureEventPairIsMutable(); - eventPair_.set(index, builderForValue.build()); - onChanged(); - } else { - eventPairBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; - */ - public Builder addEventPair(com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair value) { - if (eventPairBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEventPairIsMutable(); - eventPair_.add(value); - onChanged(); - } else { - eventPairBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; - */ - public Builder addEventPair( - int index, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair value) { - if (eventPairBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEventPairIsMutable(); - eventPair_.add(index, value); - onChanged(); - } else { - eventPairBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; - */ - public Builder addEventPair( - com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair.Builder builderForValue) { - if (eventPairBuilder_ == null) { - ensureEventPairIsMutable(); - eventPair_.add(builderForValue.build()); - onChanged(); - } else { - eventPairBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; - */ - public Builder addEventPair( - int index, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair.Builder builderForValue) { - if (eventPairBuilder_ == null) { - ensureEventPairIsMutable(); - eventPair_.add(index, builderForValue.build()); - onChanged(); - } else { - eventPairBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; - */ - public Builder addAllEventPair( - java.lang.Iterable values) { - if (eventPairBuilder_ == null) { - ensureEventPairIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, eventPair_); - onChanged(); - } else { - eventPairBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; - */ - public Builder clearEventPair() { - if (eventPairBuilder_ == null) { - eventPair_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - } else { - eventPairBuilder_.clear(); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; - */ - public Builder removeEventPair(int index) { - if (eventPairBuilder_ == null) { - ensureEventPairIsMutable(); - eventPair_.remove(index); - onChanged(); - } else { - eventPairBuilder_.remove(index); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; - */ - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair.Builder getEventPairBuilder( - int index) { - return getEventPairFieldBuilder().getBuilder(index); - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; - */ - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPairOrBuilder getEventPairOrBuilder( - int index) { - if (eventPairBuilder_ == null) { - return eventPair_.get(index); } else { - return eventPairBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; - */ - public java.util.List - getEventPairOrBuilderList() { - if (eventPairBuilder_ != null) { - return eventPairBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(eventPair_); - } - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; - */ - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair.Builder addEventPairBuilder() { - return getEventPairFieldBuilder().addBuilder( - com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair.getDefaultInstance()); - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; - */ - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair.Builder addEventPairBuilder( - int index) { - return getEventPairFieldBuilder().addBuilder( - index, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair.getDefaultInstance()); - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; - */ - public java.util.List - getEventPairBuilderList() { - return getEventPairFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair.Builder, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPairOrBuilder> - getEventPairFieldBuilder() { - if (eventPairBuilder_ == null) { - eventPairBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair.Builder, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPairOrBuilder>( - eventPair_, - ((bitField0_ & 0x00000004) != 0), - getParentForChildren(), - isClean()); - eventPair_ = null; - } - return eventPairBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent) - } - - // @@protoc_insertion_point(class_scope:com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent) - private static final com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent(); - } - - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public QueryEvent parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new QueryEvent(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryEventLog.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryEventLog.java deleted file mode 100644 index 6c0419202..000000000 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryEventLog.java +++ /dev/null @@ -1,780 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: monitor.proto - -package com.oltpbenchmark.api.collectors.monitoring.proto; - -/** - *
- * Encodes query events in a log.
- * Next id: 2
- * 
- * - * Protobuf type {@code com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog} - */ -public final class QueryEventLog extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog) - QueryEventLogOrBuilder { -private static final long serialVersionUID = 0L; - // Use QueryEventLog.newBuilder() to construct. - private QueryEventLog(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private QueryEventLog() { - event_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new QueryEventLog(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private QueryEventLog( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - event_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - event_.add( - input.readMessage(com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - event_ = java.util.Collections.unmodifiableList(event_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEventLog_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEventLog_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog.class, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog.Builder.class); - } - - public static final int EVENT_FIELD_NUMBER = 1; - private java.util.List event_; - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; - */ - @java.lang.Override - public java.util.List getEventList() { - return event_; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; - */ - @java.lang.Override - public java.util.List - getEventOrBuilderList() { - return event_; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; - */ - @java.lang.Override - public int getEventCount() { - return event_.size(); - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; - */ - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent getEvent(int index) { - return event_.get(index); - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; - */ - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventOrBuilder getEventOrBuilder( - int index) { - return event_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < event_.size(); i++) { - output.writeMessage(1, event_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < event_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, event_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog)) { - return super.equals(obj); - } - com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog other = (com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog) obj; - - if (!getEventList() - .equals(other.getEventList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getEventCount() > 0) { - hash = (37 * hash) + EVENT_FIELD_NUMBER; - hash = (53 * hash) + getEventList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Encodes query events in a log.
-   * Next id: 2
-   * 
- * - * Protobuf type {@code com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog) - com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLogOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEventLog_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEventLog_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog.class, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog.Builder.class); - } - - // Construct using com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getEventFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (eventBuilder_ == null) { - event_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - eventBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryEventLog_descriptor; - } - - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog getDefaultInstanceForType() { - return com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog.getDefaultInstance(); - } - - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog build() { - com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog buildPartial() { - com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog result = new com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog(this); - int from_bitField0_ = bitField0_; - if (eventBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - event_ = java.util.Collections.unmodifiableList(event_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.event_ = event_; - } else { - result.event_ = eventBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog) { - return mergeFrom((com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog other) { - if (other == com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog.getDefaultInstance()) return this; - if (eventBuilder_ == null) { - if (!other.event_.isEmpty()) { - if (event_.isEmpty()) { - event_ = other.event_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureEventIsMutable(); - event_.addAll(other.event_); - } - onChanged(); - } - } else { - if (!other.event_.isEmpty()) { - if (eventBuilder_.isEmpty()) { - eventBuilder_.dispose(); - eventBuilder_ = null; - event_ = other.event_; - bitField0_ = (bitField0_ & ~0x00000001); - eventBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getEventFieldBuilder() : null; - } else { - eventBuilder_.addAllMessages(other.event_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List event_ = - java.util.Collections.emptyList(); - private void ensureEventIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - event_ = new java.util.ArrayList(event_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.Builder, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventOrBuilder> eventBuilder_; - - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; - */ - public java.util.List getEventList() { - if (eventBuilder_ == null) { - return java.util.Collections.unmodifiableList(event_); - } else { - return eventBuilder_.getMessageList(); - } - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; - */ - public int getEventCount() { - if (eventBuilder_ == null) { - return event_.size(); - } else { - return eventBuilder_.getCount(); - } - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; - */ - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent getEvent(int index) { - if (eventBuilder_ == null) { - return event_.get(index); - } else { - return eventBuilder_.getMessage(index); - } - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; - */ - public Builder setEvent( - int index, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent value) { - if (eventBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEventIsMutable(); - event_.set(index, value); - onChanged(); - } else { - eventBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; - */ - public Builder setEvent( - int index, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.Builder builderForValue) { - if (eventBuilder_ == null) { - ensureEventIsMutable(); - event_.set(index, builderForValue.build()); - onChanged(); - } else { - eventBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; - */ - public Builder addEvent(com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent value) { - if (eventBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEventIsMutable(); - event_.add(value); - onChanged(); - } else { - eventBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; - */ - public Builder addEvent( - int index, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent value) { - if (eventBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEventIsMutable(); - event_.add(index, value); - onChanged(); - } else { - eventBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; - */ - public Builder addEvent( - com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.Builder builderForValue) { - if (eventBuilder_ == null) { - ensureEventIsMutable(); - event_.add(builderForValue.build()); - onChanged(); - } else { - eventBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; - */ - public Builder addEvent( - int index, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.Builder builderForValue) { - if (eventBuilder_ == null) { - ensureEventIsMutable(); - event_.add(index, builderForValue.build()); - onChanged(); - } else { - eventBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; - */ - public Builder addAllEvent( - java.lang.Iterable values) { - if (eventBuilder_ == null) { - ensureEventIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, event_); - onChanged(); - } else { - eventBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; - */ - public Builder clearEvent() { - if (eventBuilder_ == null) { - event_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - eventBuilder_.clear(); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; - */ - public Builder removeEvent(int index) { - if (eventBuilder_ == null) { - ensureEventIsMutable(); - event_.remove(index); - onChanged(); - } else { - eventBuilder_.remove(index); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; - */ - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.Builder getEventBuilder( - int index) { - return getEventFieldBuilder().getBuilder(index); - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; - */ - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventOrBuilder getEventOrBuilder( - int index) { - if (eventBuilder_ == null) { - return event_.get(index); } else { - return eventBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; - */ - public java.util.List - getEventOrBuilderList() { - if (eventBuilder_ != null) { - return eventBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(event_); - } - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; - */ - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.Builder addEventBuilder() { - return getEventFieldBuilder().addBuilder( - com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.getDefaultInstance()); - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; - */ - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.Builder addEventBuilder( - int index) { - return getEventFieldBuilder().addBuilder( - index, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.getDefaultInstance()); - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; - */ - public java.util.List - getEventBuilderList() { - return getEventFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.Builder, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventOrBuilder> - getEventFieldBuilder() { - if (eventBuilder_ == null) { - eventBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.Builder, com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventOrBuilder>( - event_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - event_ = null; - } - return eventBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog) - } - - // @@protoc_insertion_point(class_scope:com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog) - private static final com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog(); - } - - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public QueryEventLog parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new QueryEventLog(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryEventLogOrBuilder.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryEventLogOrBuilder.java deleted file mode 100644 index e37fda557..000000000 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryEventLogOrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: monitor.proto - -package com.oltpbenchmark.api.collectors.monitoring.proto; - -public interface QueryEventLogOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventLog) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; - */ - java.util.List - getEventList(); - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; - */ - com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent getEvent(int index); - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; - */ - int getEventCount(); - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; - */ - java.util.List - getEventOrBuilderList(); - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent event = 1; - */ - com.oltpbenchmark.api.collectors.monitoring.proto.QueryEventOrBuilder getEventOrBuilder( - int index); -} diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryEventOrBuilder.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryEventOrBuilder.java deleted file mode 100644 index 23b9202b5..000000000 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryEventOrBuilder.java +++ /dev/null @@ -1,65 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: monitor.proto - -package com.oltpbenchmark.api.collectors.monitoring.proto; - -public interface QueryEventOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent) - com.google.protobuf.MessageOrBuilder { - - /** - * optional string identifier = 1; - * @return Whether the identifier field is set. - */ - boolean hasIdentifier(); - /** - * optional string identifier = 1; - * @return The identifier. - */ - java.lang.String getIdentifier(); - /** - * optional string identifier = 1; - * @return The bytes for identifier. - */ - com.google.protobuf.ByteString - getIdentifierBytes(); - - /** - * optional .google.protobuf.Timestamp timestamp = 2; - * @return Whether the timestamp field is set. - */ - boolean hasTimestamp(); - /** - * optional .google.protobuf.Timestamp timestamp = 2; - * @return The timestamp. - */ - com.google.protobuf.Timestamp getTimestamp(); - /** - * optional .google.protobuf.Timestamp timestamp = 2; - */ - com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder(); - - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; - */ - java.util.List - getEventPairList(); - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; - */ - com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair getEventPair(int index); - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; - */ - int getEventPairCount(); - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; - */ - java.util.List - getEventPairOrBuilderList(); - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPair event_pair = 3; - */ - com.oltpbenchmark.api.collectors.monitoring.proto.QueryEvent.EventPairOrBuilder getEventPairOrBuilder( - int index); -} diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryInfo.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryInfo.java deleted file mode 100644 index a24fca51f..000000000 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryInfo.java +++ /dev/null @@ -1,2113 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: monitor.proto - -package com.oltpbenchmark.api.collectors.monitoring.proto; - -/** - *
- * Proto representation for one-off query metrics logged through BenchBase.
- * 
- * - * Protobuf type {@code com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo} - */ -public final class QueryInfo extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo) - QueryInfoOrBuilder { -private static final long serialVersionUID = 0L; - // Use QueryInfo.newBuilder() to construct. - private QueryInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private QueryInfo() { - identifier_ = ""; - infoPair_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new QueryInfo(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private QueryInfo( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - bitField0_ |= 0x00000001; - identifier_ = s; - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - infoPair_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - infoPair_.add( - input.readMessage(com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000002) != 0)) { - infoPair_ = java.util.Collections.unmodifiableList(infoPair_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.class, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.Builder.class); - } - - public interface InfoPairOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair) - com.google.protobuf.MessageOrBuilder { - - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; - * @return Whether the stringType field is set. - */ - boolean hasStringType(); - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; - * @return The enum numeric value on the wire for stringType. - */ - int getStringTypeValue(); - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; - * @return The stringType. - */ - com.oltpbenchmark.api.collectors.monitoring.proto.StringType getStringType(); - - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; - * @return Whether the longType field is set. - */ - boolean hasLongType(); - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; - * @return The enum numeric value on the wire for longType. - */ - int getLongTypeValue(); - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; - * @return The longType. - */ - com.oltpbenchmark.api.collectors.monitoring.proto.LongType getLongType(); - - /** - * string string_value = 3; - * @return Whether the stringValue field is set. - */ - boolean hasStringValue(); - /** - * string string_value = 3; - * @return The stringValue. - */ - java.lang.String getStringValue(); - /** - * string string_value = 3; - * @return The bytes for stringValue. - */ - com.google.protobuf.ByteString - getStringValueBytes(); - - /** - * int64 long_value = 4; - * @return Whether the longValue field is set. - */ - boolean hasLongValue(); - /** - * int64 long_value = 4; - * @return The longValue. - */ - long getLongValue(); - - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair.TypeCase getTypeCase(); - - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair.ValueCase getValueCase(); - } - /** - *
-   * Encodes a pair of info type and value.
-   * Next id: 5
-   * 
- * - * Protobuf type {@code com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair} - */ - public static final class InfoPair extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair) - InfoPairOrBuilder { - private static final long serialVersionUID = 0L; - // Use InfoPair.newBuilder() to construct. - private InfoPair(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private InfoPair() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new InfoPair(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private InfoPair( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - int rawValue = input.readEnum(); - typeCase_ = 1; - type_ = rawValue; - break; - } - case 16: { - int rawValue = input.readEnum(); - typeCase_ = 2; - type_ = rawValue; - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - valueCase_ = 3; - value_ = s; - break; - } - case 32: { - value_ = input.readInt64(); - valueCase_ = 4; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfo_InfoPair_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfo_InfoPair_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair.class, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair.Builder.class); - } - - private int typeCase_ = 0; - private java.lang.Object type_; - public enum TypeCase - implements com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - STRING_TYPE(1), - LONG_TYPE(2), - TYPE_NOT_SET(0); - private final int value; - private TypeCase(int value) { - this.value = value; - } - /** - * @param value The number of the enum to look for. - * @return The enum associated with the given number. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static TypeCase valueOf(int value) { - return forNumber(value); - } - - public static TypeCase forNumber(int value) { - switch (value) { - case 1: return STRING_TYPE; - case 2: return LONG_TYPE; - case 0: return TYPE_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public TypeCase - getTypeCase() { - return TypeCase.forNumber( - typeCase_); - } - - private int valueCase_ = 0; - private java.lang.Object value_; - public enum ValueCase - implements com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - STRING_VALUE(3), - LONG_VALUE(4), - VALUE_NOT_SET(0); - private final int value; - private ValueCase(int value) { - this.value = value; - } - /** - * @param value The number of the enum to look for. - * @return The enum associated with the given number. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static ValueCase valueOf(int value) { - return forNumber(value); - } - - public static ValueCase forNumber(int value) { - switch (value) { - case 3: return STRING_VALUE; - case 4: return LONG_VALUE; - case 0: return VALUE_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public ValueCase - getValueCase() { - return ValueCase.forNumber( - valueCase_); - } - - public static final int STRING_TYPE_FIELD_NUMBER = 1; - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; - * @return Whether the stringType field is set. - */ - public boolean hasStringType() { - return typeCase_ == 1; - } - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; - * @return The enum numeric value on the wire for stringType. - */ - public int getStringTypeValue() { - if (typeCase_ == 1) { - return (java.lang.Integer) type_; - } - return 0; - } - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; - * @return The stringType. - */ - public com.oltpbenchmark.api.collectors.monitoring.proto.StringType getStringType() { - if (typeCase_ == 1) { - @SuppressWarnings("deprecation") - com.oltpbenchmark.api.collectors.monitoring.proto.StringType result = com.oltpbenchmark.api.collectors.monitoring.proto.StringType.valueOf( - (java.lang.Integer) type_); - return result == null ? com.oltpbenchmark.api.collectors.monitoring.proto.StringType.UNRECOGNIZED : result; - } - return com.oltpbenchmark.api.collectors.monitoring.proto.StringType.QUERY_TEXT; - } - - public static final int LONG_TYPE_FIELD_NUMBER = 2; - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; - * @return Whether the longType field is set. - */ - public boolean hasLongType() { - return typeCase_ == 2; - } - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; - * @return The enum numeric value on the wire for longType. - */ - public int getLongTypeValue() { - if (typeCase_ == 2) { - return (java.lang.Integer) type_; - } - return 0; - } - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; - * @return The longType. - */ - public com.oltpbenchmark.api.collectors.monitoring.proto.LongType getLongType() { - if (typeCase_ == 2) { - @SuppressWarnings("deprecation") - com.oltpbenchmark.api.collectors.monitoring.proto.LongType result = com.oltpbenchmark.api.collectors.monitoring.proto.LongType.valueOf( - (java.lang.Integer) type_); - return result == null ? com.oltpbenchmark.api.collectors.monitoring.proto.LongType.UNRECOGNIZED : result; - } - return com.oltpbenchmark.api.collectors.monitoring.proto.LongType.EXECUTION_COUNT; - } - - public static final int STRING_VALUE_FIELD_NUMBER = 3; - /** - * string string_value = 3; - * @return Whether the stringValue field is set. - */ - public boolean hasStringValue() { - return valueCase_ == 3; - } - /** - * string string_value = 3; - * @return The stringValue. - */ - public java.lang.String getStringValue() { - java.lang.Object ref = ""; - if (valueCase_ == 3) { - ref = value_; - } - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (valueCase_ == 3) { - value_ = s; - } - return s; - } - } - /** - * string string_value = 3; - * @return The bytes for stringValue. - */ - public com.google.protobuf.ByteString - getStringValueBytes() { - java.lang.Object ref = ""; - if (valueCase_ == 3) { - ref = value_; - } - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - if (valueCase_ == 3) { - value_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int LONG_VALUE_FIELD_NUMBER = 4; - /** - * int64 long_value = 4; - * @return Whether the longValue field is set. - */ - @java.lang.Override - public boolean hasLongValue() { - return valueCase_ == 4; - } - /** - * int64 long_value = 4; - * @return The longValue. - */ - @java.lang.Override - public long getLongValue() { - if (valueCase_ == 4) { - return (java.lang.Long) value_; - } - return 0L; - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (typeCase_ == 1) { - output.writeEnum(1, ((java.lang.Integer) type_)); - } - if (typeCase_ == 2) { - output.writeEnum(2, ((java.lang.Integer) type_)); - } - if (valueCase_ == 3) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, value_); - } - if (valueCase_ == 4) { - output.writeInt64( - 4, (long)((java.lang.Long) value_)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (typeCase_ == 1) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, ((java.lang.Integer) type_)); - } - if (typeCase_ == 2) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(2, ((java.lang.Integer) type_)); - } - if (valueCase_ == 3) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, value_); - } - if (valueCase_ == 4) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size( - 4, (long)((java.lang.Long) value_)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair)) { - return super.equals(obj); - } - com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair other = (com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair) obj; - - if (!getTypeCase().equals(other.getTypeCase())) return false; - switch (typeCase_) { - case 1: - if (getStringTypeValue() - != other.getStringTypeValue()) return false; - break; - case 2: - if (getLongTypeValue() - != other.getLongTypeValue()) return false; - break; - case 0: - default: - } - if (!getValueCase().equals(other.getValueCase())) return false; - switch (valueCase_) { - case 3: - if (!getStringValue() - .equals(other.getStringValue())) return false; - break; - case 4: - if (getLongValue() - != other.getLongValue()) return false; - break; - case 0: - default: - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - switch (typeCase_) { - case 1: - hash = (37 * hash) + STRING_TYPE_FIELD_NUMBER; - hash = (53 * hash) + getStringTypeValue(); - break; - case 2: - hash = (37 * hash) + LONG_TYPE_FIELD_NUMBER; - hash = (53 * hash) + getLongTypeValue(); - break; - case 0: - default: - } - switch (valueCase_) { - case 3: - hash = (37 * hash) + STRING_VALUE_FIELD_NUMBER; - hash = (53 * hash) + getStringValue().hashCode(); - break; - case 4: - hash = (37 * hash) + LONG_VALUE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getLongValue()); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-     * Encodes a pair of info type and value.
-     * Next id: 5
-     * 
- * - * Protobuf type {@code com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair) - com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPairOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfo_InfoPair_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfo_InfoPair_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair.class, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair.Builder.class); - } - - // Construct using com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - typeCase_ = 0; - type_ = null; - valueCase_ = 0; - value_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfo_InfoPair_descriptor; - } - - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair getDefaultInstanceForType() { - return com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair.getDefaultInstance(); - } - - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair build() { - com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair buildPartial() { - com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair result = new com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair(this); - if (typeCase_ == 1) { - result.type_ = type_; - } - if (typeCase_ == 2) { - result.type_ = type_; - } - if (valueCase_ == 3) { - result.value_ = value_; - } - if (valueCase_ == 4) { - result.value_ = value_; - } - result.typeCase_ = typeCase_; - result.valueCase_ = valueCase_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair) { - return mergeFrom((com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair other) { - if (other == com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair.getDefaultInstance()) return this; - switch (other.getTypeCase()) { - case STRING_TYPE: { - setStringTypeValue(other.getStringTypeValue()); - break; - } - case LONG_TYPE: { - setLongTypeValue(other.getLongTypeValue()); - break; - } - case TYPE_NOT_SET: { - break; - } - } - switch (other.getValueCase()) { - case STRING_VALUE: { - valueCase_ = 3; - value_ = other.value_; - onChanged(); - break; - } - case LONG_VALUE: { - setLongValue(other.getLongValue()); - break; - } - case VALUE_NOT_SET: { - break; - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int typeCase_ = 0; - private java.lang.Object type_; - public TypeCase - getTypeCase() { - return TypeCase.forNumber( - typeCase_); - } - - public Builder clearType() { - typeCase_ = 0; - type_ = null; - onChanged(); - return this; - } - - private int valueCase_ = 0; - private java.lang.Object value_; - public ValueCase - getValueCase() { - return ValueCase.forNumber( - valueCase_); - } - - public Builder clearValue() { - valueCase_ = 0; - value_ = null; - onChanged(); - return this; - } - - - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; - * @return Whether the stringType field is set. - */ - @java.lang.Override - public boolean hasStringType() { - return typeCase_ == 1; - } - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; - * @return The enum numeric value on the wire for stringType. - */ - @java.lang.Override - public int getStringTypeValue() { - if (typeCase_ == 1) { - return ((java.lang.Integer) type_).intValue(); - } - return 0; - } - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; - * @param value The enum numeric value on the wire for stringType to set. - * @return This builder for chaining. - */ - public Builder setStringTypeValue(int value) { - typeCase_ = 1; - type_ = value; - onChanged(); - return this; - } - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; - * @return The stringType. - */ - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.StringType getStringType() { - if (typeCase_ == 1) { - @SuppressWarnings("deprecation") - com.oltpbenchmark.api.collectors.monitoring.proto.StringType result = com.oltpbenchmark.api.collectors.monitoring.proto.StringType.valueOf( - (java.lang.Integer) type_); - return result == null ? com.oltpbenchmark.api.collectors.monitoring.proto.StringType.UNRECOGNIZED : result; - } - return com.oltpbenchmark.api.collectors.monitoring.proto.StringType.QUERY_TEXT; - } - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; - * @param value The stringType to set. - * @return This builder for chaining. - */ - public Builder setStringType(com.oltpbenchmark.api.collectors.monitoring.proto.StringType value) { - if (value == null) { - throw new NullPointerException(); - } - typeCase_ = 1; - type_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.StringType string_type = 1; - * @return This builder for chaining. - */ - public Builder clearStringType() { - if (typeCase_ == 1) { - typeCase_ = 0; - type_ = null; - onChanged(); - } - return this; - } - - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; - * @return Whether the longType field is set. - */ - @java.lang.Override - public boolean hasLongType() { - return typeCase_ == 2; - } - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; - * @return The enum numeric value on the wire for longType. - */ - @java.lang.Override - public int getLongTypeValue() { - if (typeCase_ == 2) { - return ((java.lang.Integer) type_).intValue(); - } - return 0; - } - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; - * @param value The enum numeric value on the wire for longType to set. - * @return This builder for chaining. - */ - public Builder setLongTypeValue(int value) { - typeCase_ = 2; - type_ = value; - onChanged(); - return this; - } - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; - * @return The longType. - */ - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.LongType getLongType() { - if (typeCase_ == 2) { - @SuppressWarnings("deprecation") - com.oltpbenchmark.api.collectors.monitoring.proto.LongType result = com.oltpbenchmark.api.collectors.monitoring.proto.LongType.valueOf( - (java.lang.Integer) type_); - return result == null ? com.oltpbenchmark.api.collectors.monitoring.proto.LongType.UNRECOGNIZED : result; - } - return com.oltpbenchmark.api.collectors.monitoring.proto.LongType.EXECUTION_COUNT; - } - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; - * @param value The longType to set. - * @return This builder for chaining. - */ - public Builder setLongType(com.oltpbenchmark.api.collectors.monitoring.proto.LongType value) { - if (value == null) { - throw new NullPointerException(); - } - typeCase_ = 2; - type_ = value.getNumber(); - onChanged(); - return this; - } - /** - * .com.oltpbenchmark.api.collectors.monitoring.proto.LongType long_type = 2; - * @return This builder for chaining. - */ - public Builder clearLongType() { - if (typeCase_ == 2) { - typeCase_ = 0; - type_ = null; - onChanged(); - } - return this; - } - - /** - * string string_value = 3; - * @return Whether the stringValue field is set. - */ - @java.lang.Override - public boolean hasStringValue() { - return valueCase_ == 3; - } - /** - * string string_value = 3; - * @return The stringValue. - */ - @java.lang.Override - public java.lang.String getStringValue() { - java.lang.Object ref = ""; - if (valueCase_ == 3) { - ref = value_; - } - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (valueCase_ == 3) { - value_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string string_value = 3; - * @return The bytes for stringValue. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getStringValueBytes() { - java.lang.Object ref = ""; - if (valueCase_ == 3) { - ref = value_; - } - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - if (valueCase_ == 3) { - value_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string string_value = 3; - * @param value The stringValue to set. - * @return This builder for chaining. - */ - public Builder setStringValue( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - valueCase_ = 3; - value_ = value; - onChanged(); - return this; - } - /** - * string string_value = 3; - * @return This builder for chaining. - */ - public Builder clearStringValue() { - if (valueCase_ == 3) { - valueCase_ = 0; - value_ = null; - onChanged(); - } - return this; - } - /** - * string string_value = 3; - * @param value The bytes for stringValue to set. - * @return This builder for chaining. - */ - public Builder setStringValueBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - valueCase_ = 3; - value_ = value; - onChanged(); - return this; - } - - /** - * int64 long_value = 4; - * @return Whether the longValue field is set. - */ - public boolean hasLongValue() { - return valueCase_ == 4; - } - /** - * int64 long_value = 4; - * @return The longValue. - */ - public long getLongValue() { - if (valueCase_ == 4) { - return (java.lang.Long) value_; - } - return 0L; - } - /** - * int64 long_value = 4; - * @param value The longValue to set. - * @return This builder for chaining. - */ - public Builder setLongValue(long value) { - valueCase_ = 4; - value_ = value; - onChanged(); - return this; - } - /** - * int64 long_value = 4; - * @return This builder for chaining. - */ - public Builder clearLongValue() { - if (valueCase_ == 4) { - valueCase_ = 0; - value_ = null; - onChanged(); - } - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair) - } - - // @@protoc_insertion_point(class_scope:com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair) - private static final com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair(); - } - - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public InfoPair parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new InfoPair(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - private int bitField0_; - public static final int IDENTIFIER_FIELD_NUMBER = 1; - private volatile java.lang.Object identifier_; - /** - * optional string identifier = 1; - * @return Whether the identifier field is set. - */ - @java.lang.Override - public boolean hasIdentifier() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * optional string identifier = 1; - * @return The identifier. - */ - @java.lang.Override - public java.lang.String getIdentifier() { - java.lang.Object ref = identifier_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - identifier_ = s; - return s; - } - } - /** - * optional string identifier = 1; - * @return The bytes for identifier. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getIdentifierBytes() { - java.lang.Object ref = identifier_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - identifier_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int INFO_PAIR_FIELD_NUMBER = 3; - private java.util.List infoPair_; - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; - */ - @java.lang.Override - public java.util.List getInfoPairList() { - return infoPair_; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; - */ - @java.lang.Override - public java.util.List - getInfoPairOrBuilderList() { - return infoPair_; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; - */ - @java.lang.Override - public int getInfoPairCount() { - return infoPair_.size(); - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; - */ - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair getInfoPair(int index) { - return infoPair_.get(index); - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; - */ - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPairOrBuilder getInfoPairOrBuilder( - int index) { - return infoPair_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (((bitField0_ & 0x00000001) != 0)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, identifier_); - } - for (int i = 0; i < infoPair_.size(); i++) { - output.writeMessage(3, infoPair_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) != 0)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, identifier_); - } - for (int i = 0; i < infoPair_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, infoPair_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo)) { - return super.equals(obj); - } - com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo other = (com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo) obj; - - if (hasIdentifier() != other.hasIdentifier()) return false; - if (hasIdentifier()) { - if (!getIdentifier() - .equals(other.getIdentifier())) return false; - } - if (!getInfoPairList() - .equals(other.getInfoPairList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasIdentifier()) { - hash = (37 * hash) + IDENTIFIER_FIELD_NUMBER; - hash = (53 * hash) + getIdentifier().hashCode(); - } - if (getInfoPairCount() > 0) { - hash = (37 * hash) + INFO_PAIR_FIELD_NUMBER; - hash = (53 * hash) + getInfoPairList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Proto representation for one-off query metrics logged through BenchBase.
-   * 
- * - * Protobuf type {@code com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo) - com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.class, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.Builder.class); - } - - // Construct using com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getInfoPairFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - identifier_ = ""; - bitField0_ = (bitField0_ & ~0x00000001); - if (infoPairBuilder_ == null) { - infoPair_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - infoPairBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfo_descriptor; - } - - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo getDefaultInstanceForType() { - return com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.getDefaultInstance(); - } - - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo build() { - com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo buildPartial() { - com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo result = new com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) != 0)) { - to_bitField0_ |= 0x00000001; - } - result.identifier_ = identifier_; - if (infoPairBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - infoPair_ = java.util.Collections.unmodifiableList(infoPair_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.infoPair_ = infoPair_; - } else { - result.infoPair_ = infoPairBuilder_.build(); - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo) { - return mergeFrom((com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo other) { - if (other == com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.getDefaultInstance()) return this; - if (other.hasIdentifier()) { - bitField0_ |= 0x00000001; - identifier_ = other.identifier_; - onChanged(); - } - if (infoPairBuilder_ == null) { - if (!other.infoPair_.isEmpty()) { - if (infoPair_.isEmpty()) { - infoPair_ = other.infoPair_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureInfoPairIsMutable(); - infoPair_.addAll(other.infoPair_); - } - onChanged(); - } - } else { - if (!other.infoPair_.isEmpty()) { - if (infoPairBuilder_.isEmpty()) { - infoPairBuilder_.dispose(); - infoPairBuilder_ = null; - infoPair_ = other.infoPair_; - bitField0_ = (bitField0_ & ~0x00000002); - infoPairBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getInfoPairFieldBuilder() : null; - } else { - infoPairBuilder_.addAllMessages(other.infoPair_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object identifier_ = ""; - /** - * optional string identifier = 1; - * @return Whether the identifier field is set. - */ - public boolean hasIdentifier() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * optional string identifier = 1; - * @return The identifier. - */ - public java.lang.String getIdentifier() { - java.lang.Object ref = identifier_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - identifier_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * optional string identifier = 1; - * @return The bytes for identifier. - */ - public com.google.protobuf.ByteString - getIdentifierBytes() { - java.lang.Object ref = identifier_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - identifier_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * optional string identifier = 1; - * @param value The identifier to set. - * @return This builder for chaining. - */ - public Builder setIdentifier( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - identifier_ = value; - onChanged(); - return this; - } - /** - * optional string identifier = 1; - * @return This builder for chaining. - */ - public Builder clearIdentifier() { - bitField0_ = (bitField0_ & ~0x00000001); - identifier_ = getDefaultInstance().getIdentifier(); - onChanged(); - return this; - } - /** - * optional string identifier = 1; - * @param value The bytes for identifier to set. - * @return This builder for chaining. - */ - public Builder setIdentifierBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - bitField0_ |= 0x00000001; - identifier_ = value; - onChanged(); - return this; - } - - private java.util.List infoPair_ = - java.util.Collections.emptyList(); - private void ensureInfoPairIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - infoPair_ = new java.util.ArrayList(infoPair_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair.Builder, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPairOrBuilder> infoPairBuilder_; - - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; - */ - public java.util.List getInfoPairList() { - if (infoPairBuilder_ == null) { - return java.util.Collections.unmodifiableList(infoPair_); - } else { - return infoPairBuilder_.getMessageList(); - } - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; - */ - public int getInfoPairCount() { - if (infoPairBuilder_ == null) { - return infoPair_.size(); - } else { - return infoPairBuilder_.getCount(); - } - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; - */ - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair getInfoPair(int index) { - if (infoPairBuilder_ == null) { - return infoPair_.get(index); - } else { - return infoPairBuilder_.getMessage(index); - } - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; - */ - public Builder setInfoPair( - int index, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair value) { - if (infoPairBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureInfoPairIsMutable(); - infoPair_.set(index, value); - onChanged(); - } else { - infoPairBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; - */ - public Builder setInfoPair( - int index, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair.Builder builderForValue) { - if (infoPairBuilder_ == null) { - ensureInfoPairIsMutable(); - infoPair_.set(index, builderForValue.build()); - onChanged(); - } else { - infoPairBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; - */ - public Builder addInfoPair(com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair value) { - if (infoPairBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureInfoPairIsMutable(); - infoPair_.add(value); - onChanged(); - } else { - infoPairBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; - */ - public Builder addInfoPair( - int index, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair value) { - if (infoPairBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureInfoPairIsMutable(); - infoPair_.add(index, value); - onChanged(); - } else { - infoPairBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; - */ - public Builder addInfoPair( - com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair.Builder builderForValue) { - if (infoPairBuilder_ == null) { - ensureInfoPairIsMutable(); - infoPair_.add(builderForValue.build()); - onChanged(); - } else { - infoPairBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; - */ - public Builder addInfoPair( - int index, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair.Builder builderForValue) { - if (infoPairBuilder_ == null) { - ensureInfoPairIsMutable(); - infoPair_.add(index, builderForValue.build()); - onChanged(); - } else { - infoPairBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; - */ - public Builder addAllInfoPair( - java.lang.Iterable values) { - if (infoPairBuilder_ == null) { - ensureInfoPairIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, infoPair_); - onChanged(); - } else { - infoPairBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; - */ - public Builder clearInfoPair() { - if (infoPairBuilder_ == null) { - infoPair_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - infoPairBuilder_.clear(); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; - */ - public Builder removeInfoPair(int index) { - if (infoPairBuilder_ == null) { - ensureInfoPairIsMutable(); - infoPair_.remove(index); - onChanged(); - } else { - infoPairBuilder_.remove(index); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; - */ - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair.Builder getInfoPairBuilder( - int index) { - return getInfoPairFieldBuilder().getBuilder(index); - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; - */ - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPairOrBuilder getInfoPairOrBuilder( - int index) { - if (infoPairBuilder_ == null) { - return infoPair_.get(index); } else { - return infoPairBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; - */ - public java.util.List - getInfoPairOrBuilderList() { - if (infoPairBuilder_ != null) { - return infoPairBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(infoPair_); - } - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; - */ - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair.Builder addInfoPairBuilder() { - return getInfoPairFieldBuilder().addBuilder( - com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair.getDefaultInstance()); - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; - */ - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair.Builder addInfoPairBuilder( - int index) { - return getInfoPairFieldBuilder().addBuilder( - index, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair.getDefaultInstance()); - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; - */ - public java.util.List - getInfoPairBuilderList() { - return getInfoPairFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair.Builder, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPairOrBuilder> - getInfoPairFieldBuilder() { - if (infoPairBuilder_ == null) { - infoPairBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair.Builder, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPairOrBuilder>( - infoPair_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - infoPair_ = null; - } - return infoPairBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo) - } - - // @@protoc_insertion_point(class_scope:com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo) - private static final com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo(); - } - - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public QueryInfo parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new QueryInfo(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryInfoLog.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryInfoLog.java deleted file mode 100644 index d5d51d01d..000000000 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryInfoLog.java +++ /dev/null @@ -1,780 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: monitor.proto - -package com.oltpbenchmark.api.collectors.monitoring.proto; - -/** - *
- * Encodes one-off query info in a log.
- * Next id: 2
- * 
- * - * Protobuf type {@code com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog} - */ -public final class QueryInfoLog extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog) - QueryInfoLogOrBuilder { -private static final long serialVersionUID = 0L; - // Use QueryInfoLog.newBuilder() to construct. - private QueryInfoLog(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private QueryInfoLog() { - info_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new QueryInfoLog(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private QueryInfoLog( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - info_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - info_.add( - input.readMessage(com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - info_ = java.util.Collections.unmodifiableList(info_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfoLog_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfoLog_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog.class, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog.Builder.class); - } - - public static final int INFO_FIELD_NUMBER = 1; - private java.util.List info_; - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; - */ - @java.lang.Override - public java.util.List getInfoList() { - return info_; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; - */ - @java.lang.Override - public java.util.List - getInfoOrBuilderList() { - return info_; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; - */ - @java.lang.Override - public int getInfoCount() { - return info_.size(); - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; - */ - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo getInfo(int index) { - return info_.get(index); - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; - */ - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoOrBuilder getInfoOrBuilder( - int index) { - return info_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < info_.size(); i++) { - output.writeMessage(1, info_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < info_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, info_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog)) { - return super.equals(obj); - } - com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog other = (com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog) obj; - - if (!getInfoList() - .equals(other.getInfoList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getInfoCount() > 0) { - hash = (37 * hash) + INFO_FIELD_NUMBER; - hash = (53 * hash) + getInfoList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Encodes one-off query info in a log.
-   * Next id: 2
-   * 
- * - * Protobuf type {@code com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog) - com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLogOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfoLog_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfoLog_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog.class, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog.Builder.class); - } - - // Construct using com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getInfoFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (infoBuilder_ == null) { - info_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - infoBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.internal_static_com_oltpbenchmark_api_collectors_monitoring_proto_QueryInfoLog_descriptor; - } - - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog getDefaultInstanceForType() { - return com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog.getDefaultInstance(); - } - - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog build() { - com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog buildPartial() { - com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog result = new com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog(this); - int from_bitField0_ = bitField0_; - if (infoBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - info_ = java.util.Collections.unmodifiableList(info_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.info_ = info_; - } else { - result.info_ = infoBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog) { - return mergeFrom((com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog other) { - if (other == com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog.getDefaultInstance()) return this; - if (infoBuilder_ == null) { - if (!other.info_.isEmpty()) { - if (info_.isEmpty()) { - info_ = other.info_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureInfoIsMutable(); - info_.addAll(other.info_); - } - onChanged(); - } - } else { - if (!other.info_.isEmpty()) { - if (infoBuilder_.isEmpty()) { - infoBuilder_.dispose(); - infoBuilder_ = null; - info_ = other.info_; - bitField0_ = (bitField0_ & ~0x00000001); - infoBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getInfoFieldBuilder() : null; - } else { - infoBuilder_.addAllMessages(other.info_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List info_ = - java.util.Collections.emptyList(); - private void ensureInfoIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - info_ = new java.util.ArrayList(info_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.Builder, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoOrBuilder> infoBuilder_; - - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; - */ - public java.util.List getInfoList() { - if (infoBuilder_ == null) { - return java.util.Collections.unmodifiableList(info_); - } else { - return infoBuilder_.getMessageList(); - } - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; - */ - public int getInfoCount() { - if (infoBuilder_ == null) { - return info_.size(); - } else { - return infoBuilder_.getCount(); - } - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; - */ - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo getInfo(int index) { - if (infoBuilder_ == null) { - return info_.get(index); - } else { - return infoBuilder_.getMessage(index); - } - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; - */ - public Builder setInfo( - int index, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo value) { - if (infoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureInfoIsMutable(); - info_.set(index, value); - onChanged(); - } else { - infoBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; - */ - public Builder setInfo( - int index, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.Builder builderForValue) { - if (infoBuilder_ == null) { - ensureInfoIsMutable(); - info_.set(index, builderForValue.build()); - onChanged(); - } else { - infoBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; - */ - public Builder addInfo(com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo value) { - if (infoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureInfoIsMutable(); - info_.add(value); - onChanged(); - } else { - infoBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; - */ - public Builder addInfo( - int index, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo value) { - if (infoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureInfoIsMutable(); - info_.add(index, value); - onChanged(); - } else { - infoBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; - */ - public Builder addInfo( - com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.Builder builderForValue) { - if (infoBuilder_ == null) { - ensureInfoIsMutable(); - info_.add(builderForValue.build()); - onChanged(); - } else { - infoBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; - */ - public Builder addInfo( - int index, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.Builder builderForValue) { - if (infoBuilder_ == null) { - ensureInfoIsMutable(); - info_.add(index, builderForValue.build()); - onChanged(); - } else { - infoBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; - */ - public Builder addAllInfo( - java.lang.Iterable values) { - if (infoBuilder_ == null) { - ensureInfoIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, info_); - onChanged(); - } else { - infoBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; - */ - public Builder clearInfo() { - if (infoBuilder_ == null) { - info_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - infoBuilder_.clear(); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; - */ - public Builder removeInfo(int index) { - if (infoBuilder_ == null) { - ensureInfoIsMutable(); - info_.remove(index); - onChanged(); - } else { - infoBuilder_.remove(index); - } - return this; - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; - */ - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.Builder getInfoBuilder( - int index) { - return getInfoFieldBuilder().getBuilder(index); - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; - */ - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoOrBuilder getInfoOrBuilder( - int index) { - if (infoBuilder_ == null) { - return info_.get(index); } else { - return infoBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; - */ - public java.util.List - getInfoOrBuilderList() { - if (infoBuilder_ != null) { - return infoBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(info_); - } - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; - */ - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.Builder addInfoBuilder() { - return getInfoFieldBuilder().addBuilder( - com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.getDefaultInstance()); - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; - */ - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.Builder addInfoBuilder( - int index) { - return getInfoFieldBuilder().addBuilder( - index, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.getDefaultInstance()); - } - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; - */ - public java.util.List - getInfoBuilderList() { - return getInfoFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.Builder, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoOrBuilder> - getInfoFieldBuilder() { - if (infoBuilder_ == null) { - infoBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.Builder, com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoOrBuilder>( - info_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - info_ = null; - } - return infoBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog) - } - - // @@protoc_insertion_point(class_scope:com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog) - private static final com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog(); - } - - public static com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public QueryInfoLog parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new QueryInfoLog(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryInfoLogOrBuilder.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryInfoLogOrBuilder.java deleted file mode 100644 index 7b2edfd20..000000000 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryInfoLogOrBuilder.java +++ /dev/null @@ -1,33 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: monitor.proto - -package com.oltpbenchmark.api.collectors.monitoring.proto; - -public interface QueryInfoLogOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoLog) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; - */ - java.util.List - getInfoList(); - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; - */ - com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo getInfo(int index); - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; - */ - int getInfoCount(); - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; - */ - java.util.List - getInfoOrBuilderList(); - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo info = 1; - */ - com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfoOrBuilder getInfoOrBuilder( - int index); -} diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryInfoOrBuilder.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryInfoOrBuilder.java deleted file mode 100644 index 2e029c9c6..000000000 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/QueryInfoOrBuilder.java +++ /dev/null @@ -1,50 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: monitor.proto - -package com.oltpbenchmark.api.collectors.monitoring.proto; - -public interface QueryInfoOrBuilder extends - // @@protoc_insertion_point(interface_extends:com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo) - com.google.protobuf.MessageOrBuilder { - - /** - * optional string identifier = 1; - * @return Whether the identifier field is set. - */ - boolean hasIdentifier(); - /** - * optional string identifier = 1; - * @return The identifier. - */ - java.lang.String getIdentifier(); - /** - * optional string identifier = 1; - * @return The bytes for identifier. - */ - com.google.protobuf.ByteString - getIdentifierBytes(); - - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; - */ - java.util.List - getInfoPairList(); - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; - */ - com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair getInfoPair(int index); - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; - */ - int getInfoPairCount(); - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; - */ - java.util.List - getInfoPairOrBuilderList(); - /** - * repeated .com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPair info_pair = 3; - */ - com.oltpbenchmark.api.collectors.monitoring.proto.QueryInfo.InfoPairOrBuilder getInfoPairOrBuilder( - int index); -} diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/StringType.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/StringType.java deleted file mode 100644 index 26346467d..000000000 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/StringType.java +++ /dev/null @@ -1,136 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: monitor.proto - -package com.oltpbenchmark.api.collectors.monitoring.proto; - -/** - *
- * Enum for string values.
- * Next id: 2
- * 
- * - * Protobuf enum {@code com.oltpbenchmark.api.collectors.monitoring.proto.StringType} - */ -public enum StringType - implements com.google.protobuf.ProtocolMessageEnum { - /** - * QUERY_TEXT = 0; - */ - QUERY_TEXT(0), - /** - * QUERY_PLAN = 1; - */ - QUERY_PLAN(1), - /** - * IDENTIFIER = 2; - */ - IDENTIFIER(2), - /** - * PLAN_HANDLE = 3; - */ - PLAN_HANDLE(3), - UNRECOGNIZED(-1), - ; - - /** - * QUERY_TEXT = 0; - */ - public static final int QUERY_TEXT_VALUE = 0; - /** - * QUERY_PLAN = 1; - */ - public static final int QUERY_PLAN_VALUE = 1; - /** - * IDENTIFIER = 2; - */ - public static final int IDENTIFIER_VALUE = 2; - /** - * PLAN_HANDLE = 3; - */ - public static final int PLAN_HANDLE_VALUE = 3; - - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static StringType valueOf(int value) { - return forNumber(value); - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - */ - public static StringType forNumber(int value) { - switch (value) { - case 0: return QUERY_TEXT; - case 1: return QUERY_PLAN; - case 2: return IDENTIFIER; - case 3: return PLAN_HANDLE; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - StringType> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public StringType findValueByNumber(int number) { - return StringType.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } - return getDescriptor().getValues().get(ordinal()); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return com.oltpbenchmark.api.collectors.monitoring.proto.Monitor.getDescriptor().getEnumTypes().get(0); - } - - private static final StringType[] VALUES = values(); - - public static StringType valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private StringType(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:com.oltpbenchmark.api.collectors.monitoring.proto.StringType) -} - diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/monitor.proto b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/monitor.proto deleted file mode 100644 index a7b3bb4d5..000000000 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/monitor.proto +++ /dev/null @@ -1,132 +0,0 @@ -syntax = "proto3"; -import "google/protobuf/timestamp.proto"; - -package com.oltpbenchmark.api.collectors.monitoring.proto; - -option java_multiple_files = true; - -// Enum for string values. -// Next id: 2 -enum StringType { - QUERY_TEXT = 0; - QUERY_PLAN = 1; - IDENTIFIER = 2; - PLAN_HANDLE = 3; -} - -// Enum for long values. -// Next id: 42 -enum LongType { - EXECUTION_COUNT = 0; - MIN_WORKER_TIME = 1; - MAX_WORKER_TIME = 2; - TOTAL_WORKER_TIME = 3; - MIN_PHYSICAL_READS = 4; - MAX_PHYSICAL_READS = 5; - TOTAL_PHYSICAL_READS = 6; - MIN_ELAPSED_TIME = 7; - MAX_ELAPSED_TIME = 8; - TOTAL_ELAPSED_TIME = 9; - MIN_ROWS = 10; - MAX_ROWS = 11; - TOTAL_ROWS = 12; - MIN_SPILLS = 13; - MAX_SPILLS = 14; - TOTAL_SPILLS = 15; - USED_MEMORY = 16; - TARGET_MEMORY = 17; - CPU_USAGE_PERC = 18; - CPU_EFFECTIVE_PERC = 19; - CPU_VIOLATED_PERC = 20; - TOTAL_LOGICAL_WRITES = 21; - MIN_LOGICAL_WRITES = 22; - MAX_LOGICAL_WRITES = 23; - TOTAL_LOGICAL_READS = 24; - MIN_LOGICAL_READS = 25; - MAX_LOGICAL_READS = 26; - TOTAL_USED_GRANT_KB = 27; - MIN_USED_GRANT_KB = 28; - MAX_USED_GRANT_KB = 29; - TOTAL_USED_THREADS = 30; - MIN_USED_THREADS = 31; - MAX_USED_THREADS = 32; - CPU_USAGE_PERC_BASE = 33; - CPU_EFFECTIVE_PERC_BASE = 34; - CPU_USAGE_TARGET_PERC = 35; - DISK_READ_IOPS = 36; - DISK_WRITE_IOPS = 37; - LOCKS_AVG_WAIT_TIME = 38; - LOCKS_AVG_WAIT_TIME_BASE = 39; - LOCK_REQUESTS = 40; - MS_TICKS = 41; -} - -// Proto representation for one-off query metrics logged through BenchBase. -message QueryInfo { - optional string identifier = 1; - - // Encodes a pair of info type and value. - // Next id: 5 - message InfoPair { - oneof type { - StringType string_type = 1; - LongType long_type = 2; - } - oneof value { - string string_value = 3; - int64 long_value = 4; - } - } - repeated InfoPair info_pair = 3; -} - -// Encodes one-off query info in a log. -// Next id: 2 -message QueryInfoLog { - repeated QueryInfo info = 1; -} - -// Proto representation for query metrics logged through BenchBase. -// Next id: 4 -message QueryEvent { - optional string identifier = 1; - optional google.protobuf.Timestamp timestamp = 2; - - // Encodes a pair of event type and value. - // Next id: 5 - message EventPair { - oneof type { - StringType string_type = 1; - LongType long_type = 2; - } - oneof value { - string string_value = 3; - int64 long_value = 4; - } - } - repeated EventPair event_pair = 3; -} - -// Encodes query events in a log. -// Next id: 2 -message QueryEventLog { - repeated QueryEvent event = 1; -} - -message PerfEvent { - optional google.protobuf.Timestamp timestamp = 1; - - // Encodes a pair of event type and value. - // Next id: 5 - message EventPair { - LongType long_type = 1; - int64 long_value = 2; - } - repeated EventPair event_pair = 2; -} - -// Encodes performance events in a log. -// Next id: 2 -message PerfEventLog { - repeated PerfEvent event = 1; -} From 8be549e19a93ddbdceb089284adbf2f40a5f1841 Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Mon, 10 Apr 2023 09:36:24 +0200 Subject: [PATCH 04/67] Fix system events extraction bug. --- .../api/collectors/monitoring/SQLServerMonitor.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java index ea3ad8b50..7d830e49c 100644 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java @@ -208,7 +208,6 @@ private void extractPerformanceMetrics(Instant instant) { } // Extract lock counter events. - propertyValues = new HashMap(); try (PreparedStatement stmt = conn.prepareStatement(DM_LOCK_STATS)) { ResultSet rs = stmt.executeQuery(); boolean ticks_set = false; From 16aa2bdd6848ea5e0c98ae25a7c9cce453437781 Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Mon, 10 Apr 2023 10:11:08 +0200 Subject: [PATCH 05/67] Change OS counters to be instance-specific. --- .../monitoring/SQLServerMonitor.java | 61 ++++++------------- 1 file changed, 19 insertions(+), 42 deletions(-) diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java index 7d830e49c..350c95973 100644 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java @@ -39,14 +39,9 @@ public class SQLServerMonitor extends DatabaseMonitor { "FROM sys.dm_exec_query_stats st " + "CROSS APPLY sys.dm_exec_sql_text(st.plan_handle) q " + "CROSS APPLY sys.dm_exec_query_plan(st.plan_handle) pl"; - private final String DM_OS_PERFORMANCE_STATS = "SELECT cntr_value, " + + private String DM_OS_PERFORMANCE_STATS = "SELECT cntr_value, " + "counter_name FROM sys.dm_os_performance_counters WHERE " + - "instance_name='default';"; - private final String DM_LOCK_STATS = "SELECT info.ms_ticks, " + - "counters.cntr_value, counters.counter_name FROM (SELECT " + - "cntr_value, counter_name FROM sys.dm_os_performance_counters " + - "WHERE object_name LIKE '%Locks%' AND instance_name='_Total') " + - "counters, (SELECT ms_ticks FROM sys.dm_os_sys_info) info"; + "instance_name='$DB_INSTANCE';"; private final String CLEAN_CACHE = "DBCC FREEPROCCACHE;"; private final List singleQueryProperties; private final List repeatedQueryProperties; @@ -54,10 +49,21 @@ public class SQLServerMonitor extends DatabaseMonitor { private final Set cached_plans; - public SQLServerMonitor(int interval, BenchmarkState testState, + public SQLServerMonitor(String db_instance, int interval, BenchmarkState testState, List> workers, WorkloadConfiguration conf) { super(interval, testState, workers, conf); + // Extract the database instance from url. + String[] params = conf.getUrl().split(";"); + for (String param : params) { + String[] values = param.split("="); + if (values[0].equals("database")) { + DM_OS_PERFORMANCE_STATS = DM_OS_PERFORMANCE_STATS.replace( + "$DB_INSTANCE", values[1]); + break; + } + } + this.cached_plans = new HashSet(); this.singleQueryProperties = new ArrayList() { @@ -104,19 +110,11 @@ public SQLServerMonitor(int interval, BenchmarkState testState, this.repeatedSystemProperties = new ArrayList() { { - add("Used memory (KB)"); - add("Target memory (KB)"); - add("CPU usage %"); - add("CPU effective %"); - add("CPU violated %"); - add("CPU usage % base"); - add("CPU effective % base"); - add("CPU usage target %"); - add("Disk Read IO/sec"); - add("Disk Write IO/sec"); - add("Average Wait Time (ms)"); - add("Average Wait Time Base"); - add("Lock Requests/sec"); + add("Data File(s) Size (KB)"); + add("Transactions/sec"); + add("Write Transactions/sec"); + add("Cache Hit Ratio"); + add("Cache Entries Count"); } }; } @@ -206,27 +204,6 @@ private void extractPerformanceMetrics(Instant instant) { LOG.error("Error when extracting OS metrics from SQL Server."); LOG.error(sqlError.getMessage()); } - - // Extract lock counter events. - try (PreparedStatement stmt = conn.prepareStatement(DM_LOCK_STATS)) { - ResultSet rs = stmt.executeQuery(); - boolean ticks_set = false; - while (rs.next()) { - // Get MS ticks value. - if (!ticks_set) { - propertyValues.put("ms_ticks", rs.getString("ms_ticks")); - ticks_set = true; - } - // Add property values. - String counter_name = rs.getString("counter_name").trim(); - if (this.repeatedSystemProperties.contains(counter_name)) { - propertyValues.put(counter_name, rs.getString("cntr_value")); - } - } - } catch (SQLException sqlError) { - LOG.error("Error when extracting perf OS metrics."); - LOG.error(sqlError.getMessage()); - } repeatedSystemEventBuilder.propertyValues(propertyValues); this.repeatedSystemEvents.add(repeatedSystemEventBuilder.build()); } From d83d434feaa916a1da102f8e200f7755146cdf89 Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Mon, 10 Apr 2023 10:14:35 +0200 Subject: [PATCH 06/67] Bugfix --- .../api/collectors/monitoring/SQLServerMonitor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java index 350c95973..a48de05f3 100644 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java @@ -49,7 +49,7 @@ public class SQLServerMonitor extends DatabaseMonitor { private final Set cached_plans; - public SQLServerMonitor(String db_instance, int interval, BenchmarkState testState, + public SQLServerMonitor(int interval, BenchmarkState testState, List> workers, WorkloadConfiguration conf) { super(interval, testState, workers, conf); From dba1c6817b9e6ea03668ff986a8ee76e9f129ef3 Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Mon, 10 Apr 2023 10:23:53 +0200 Subject: [PATCH 07/67] Variable name change. --- .../api/collectors/monitoring/DatabaseMonitor.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/DatabaseMonitor.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/DatabaseMonitor.java index 37a940ce6..36dda8bcb 100644 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/DatabaseMonitor.java +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/DatabaseMonitor.java @@ -38,7 +38,7 @@ protected enum DatabaseState { protected final int FILE_FLUSH_COUNT = 1000; protected DatabaseState currentState = DatabaseState.INVALID; - protected int fileCounter = 1; + protected int ticks = 1; protected WorkloadConfiguration conf; protected Connection conn; @@ -90,7 +90,7 @@ public DatabaseMonitor( } protected void writeSingleQueryEventsToCSV() { - String filePath = getFilePath(SINGLE_QUERY_EVENT_CSV, this.fileCounter); + String filePath = getFilePath(SINGLE_QUERY_EVENT_CSV, this.ticks); try { if (this.singleQueryEvents.size() == 0) { LOG.warn("No query events have been recorded, file not written."); @@ -118,7 +118,7 @@ protected void writeSingleQueryEventsToCSV() { } protected void writeRepeatedQueryEventsToCSV() { - String filePath = getFilePath(REP_QUERY_EVENT_CSV, this.fileCounter); + String filePath = getFilePath(REP_QUERY_EVENT_CSV, this.ticks); try { if (this.repeatedQueryEvents.size() == 0) { LOG.warn("No repeated query events have been recorded, file not written."); @@ -147,7 +147,7 @@ protected void writeRepeatedQueryEventsToCSV() { } protected void writeRepeatedSystemEventsToCSV() { - String filePath = getFilePath(REP_SYSTEM_EVENT_CSV, this.fileCounter); + String filePath = getFilePath(REP_SYSTEM_EVENT_CSV, this.ticks); try { if (this.repeatedSystemEvents.size() == 0) { LOG.warn("No repeated system events have been recorded, file not written."); @@ -253,10 +253,10 @@ public void run() { if (this.conn != null) { runExtraction(); } - if (fileCounter % FILE_FLUSH_COUNT == 0) { + if (ticks % FILE_FLUSH_COUNT == 0) { writeToCSV(); } - fileCounter++; + ticks++; } if (this.conn != null) { From 256aaf1c56ec1b8192c735a6e9b6aafb34a38d3e Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Mon, 10 Apr 2023 10:53:57 +0200 Subject: [PATCH 08/67] Add throughput vs advanced monitoring. --- .../java/com/oltpbenchmark/DBWorkload.java | 17 +++++--- .../java/com/oltpbenchmark/ThreadBench.java | 15 ++++--- .../monitoring/DatabaseMonitor.java | 10 +++-- .../api/collectors/monitoring/Monitor.java | 15 ++++--- .../api/collectors/monitoring/MonitorGen.java | 23 ++++++---- .../monitoring/PostgreSQLMonitor.java | 5 ++- .../api/collectors/monitoring/README.md | 6 +-- .../monitoring/SQLServerMonitor.java | 5 ++- .../com/oltpbenchmark/util/MonitorInfo.java | 43 +++++++++++++++++++ 9 files changed, 101 insertions(+), 38 deletions(-) create mode 100644 src/main/java/com/oltpbenchmark/util/MonitorInfo.java diff --git a/src/main/java/com/oltpbenchmark/DBWorkload.java b/src/main/java/com/oltpbenchmark/DBWorkload.java index 3a7f87aaa..f7c233270 100644 --- a/src/main/java/com/oltpbenchmark/DBWorkload.java +++ b/src/main/java/com/oltpbenchmark/DBWorkload.java @@ -81,11 +81,16 @@ public static void main(String[] args) throws Exception { } - // Seconds - int intervalMonitor = 0; + ImmutableMonitorInfo.Builder builder = ImmutableMonitorInfo.builder(); if (argsLine.hasOption("im")) { - intervalMonitor = Integer.parseInt(argsLine.getOptionValue("im")); + builder.monitoringInterval(Integer.parseInt(argsLine.getOptionValue("im"))); } + if (argsLine.hasOption("imt")) { + if (argsLine.getOptionValue("imt")=="advanced") { + builder.monitoringType(MonitorInfo.MonitoringType.ADVANCED); + } + } + MonitorInfo monitorInfo = builder.build(); // ------------------------------------------------------------------- // GET PLUGIN LIST @@ -459,7 +464,7 @@ public static void main(String[] args) throws Exception { if (isBooleanOptionSet(argsLine, "execute")) { // Bombs away! try { - Results r = runWorkload(benchList, intervalMonitor); + Results r = runWorkload(benchList, monitorInfo); writeOutputs(r, activeTXTypes, argsLine, xmlConfig); writeHistograms(r); @@ -633,7 +638,7 @@ private static void runLoader(BenchmarkModule bench) throws SQLException, Interr bench.loadDatabase(); } - private static Results runWorkload(List benchList, int intervalMonitor) throws IOException { + private static Results runWorkload(List benchList, MonitorInfo monitorInfo) throws IOException { List> workers = new ArrayList<>(); List workConfs = new ArrayList<>(); for (BenchmarkModule bench : benchList) { @@ -645,7 +650,7 @@ private static Results runWorkload(List benchList, int interval workConfs.add(bench.getWorkloadConfiguration()); } - Results r = ThreadBench.runRateLimitedBenchmark(workers, workConfs, intervalMonitor); + Results r = ThreadBench.runRateLimitedBenchmark(workers, workConfs, monitorInfo); LOG.info(SINGLE_LINE); LOG.info("Rate limited reqs/s: {}", r); return r; diff --git a/src/main/java/com/oltpbenchmark/ThreadBench.java b/src/main/java/com/oltpbenchmark/ThreadBench.java index 6847fec20..bef4bcb15 100644 --- a/src/main/java/com/oltpbenchmark/ThreadBench.java +++ b/src/main/java/com/oltpbenchmark/ThreadBench.java @@ -24,6 +24,7 @@ import com.oltpbenchmark.api.collectors.monitoring.Monitor; import com.oltpbenchmark.api.collectors.monitoring.MonitorGen; import com.oltpbenchmark.types.State; +import com.oltpbenchmark.util.MonitorInfo; import com.oltpbenchmark.util.StringUtil; import org.apache.commons.collections4.map.ListOrderedMap; import org.slf4j.Logger; @@ -39,22 +40,22 @@ public class ThreadBench implements Thread.UncaughtExceptionHandler { private final ArrayList workerThreads; private final List workConfs; private final ArrayList samples = new ArrayList<>(); - private final int intervalMonitor; + private final MonitorInfo monitorInfo; private Monitor monitor = null; private ThreadBench(List> workers, - List workConfs, int intervalMonitoring) { + List workConfs, MonitorInfo monitorInfo) { this.workers = workers; this.workConfs = workConfs; this.workerThreads = new ArrayList<>(workers.size()); - this.intervalMonitor = intervalMonitoring; + this.monitorInfo = monitorInfo; this.testState = new BenchmarkState(workers.size() + 1); } public static Results runRateLimitedBenchmark(List> workers, - List workConfs, int intervalMonitoring) { - ThreadBench bench = new ThreadBench(workers, workConfs, intervalMonitoring); + List workConfs, MonitorInfo monitorInfo) { + ThreadBench bench = new ThreadBench(workers, workConfs, monitorInfo); return bench.runRateLimitedMultiPhase(); } @@ -155,9 +156,9 @@ private Results runRateLimitedMultiPhase() { boolean lastEntry = false; // Initialize the Monitor - if (this.intervalMonitor > 0) { + if (this.monitorInfo.getMonitoringInterval() > 0) { this.monitor = MonitorGen.getMonitor( - this.intervalMonitor, this.testState, this.workers, this.workConfs.get(0)); + this.monitorInfo, this.testState, this.workers, this.workConfs.get(0)); this.monitor.start(); } diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/DatabaseMonitor.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/DatabaseMonitor.java index 36dda8bcb..c6ea46e1f 100644 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/DatabaseMonitor.java +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/DatabaseMonitor.java @@ -18,6 +18,7 @@ import com.oltpbenchmark.api.BenchmarkModule; import com.oltpbenchmark.api.Worker; import com.oltpbenchmark.util.FileUtil; +import com.oltpbenchmark.util.MonitorInfo; import com.oltpbenchmark.util.StringUtil; import org.apache.commons.lang3.StringUtils; @@ -66,9 +67,9 @@ private final Connection makeConnection() throws SQLException { } public DatabaseMonitor( - int interval, BenchmarkState testState, + MonitorInfo monitorInfo, BenchmarkState testState, List> workers, WorkloadConfiguration workloadConf) { - super(interval, testState, workers); + super(monitorInfo, testState, workers); try { this.conf = workloadConf; @@ -235,8 +236,9 @@ public interface RepeatedSystemEvent { */ @Override public void run() { - LOG.info("Starting Monitor Interval [{}ms]", this.intervalMonitor); + int interval = this.monitorInfo.getMonitoringInterval(); + LOG.info("Starting Monitor Interval [{}ms]", interval); // Make sure we record one event during setup. if (this.conn != null) { cleanupCache(); @@ -245,7 +247,7 @@ public void run() { // Periodically extract sys table stats. while (!Thread.currentThread().isInterrupted()) { try { - Thread.sleep(this.intervalMonitor); + Thread.sleep(interval); } catch (InterruptedException ex) { // Restore interrupt flag. Thread.currentThread().interrupt(); diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/Monitor.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/Monitor.java index 84657f7d0..f57c63f18 100644 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/Monitor.java +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/Monitor.java @@ -5,6 +5,7 @@ import com.oltpbenchmark.BenchmarkState; import com.oltpbenchmark.api.BenchmarkModule; import com.oltpbenchmark.api.Worker; +import com.oltpbenchmark.util.MonitorInfo; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -16,7 +17,7 @@ public class Monitor extends Thread { protected static final Logger LOG = LoggerFactory.getLogger(DatabaseMonitor.class); - protected final int intervalMonitor; + protected final MonitorInfo monitorInfo; protected final BenchmarkState testState; protected final List> workers; @@ -27,15 +28,17 @@ public class Monitor extends Thread { /** * @param interval How long to wait between polling in milliseconds */ - Monitor(int interval, BenchmarkState testState, List> workers) { - this.intervalMonitor = interval; + Monitor(MonitorInfo monitorInfo, BenchmarkState testState, List> workers) { + this.monitorInfo = monitorInfo; this.testState = testState; this.workers = workers; } @Override public void run() { - LOG.info("Starting MonitorThread Interval [{}ms]", this.intervalMonitor); + int interval = this.monitorInfo.getMonitoringInterval(); + + LOG.info("Starting MonitorThread Interval [{}ms]", interval); while (!Thread.currentThread().isInterrupted()) { // Compute the last throughput long measuredRequests = 0; @@ -44,12 +47,12 @@ public void run() { measuredRequests += w.getAndResetIntervalRequests(); } } - double seconds = this.intervalMonitor / 1000d; + double seconds = interval / 1000d; double tps = (double) measuredRequests / seconds; LOG.info("Throughput: {} txn/sec", tps); try { - Thread.sleep(this.intervalMonitor); + Thread.sleep(interval); } catch (InterruptedException ex) { // Restore interrupt flag. Thread.currentThread().interrupt(); diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/MonitorGen.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/MonitorGen.java index 752c35fb0..faaca0285 100644 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/MonitorGen.java +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/MonitorGen.java @@ -6,21 +6,28 @@ import com.oltpbenchmark.WorkloadConfiguration; import com.oltpbenchmark.api.BenchmarkModule; import com.oltpbenchmark.api.Worker; +import com.oltpbenchmark.util.MonitorInfo; /** * Monitor generator that picks the appropriate monitoring implemnetation based * on the database type. */ public class MonitorGen { - public static Monitor getMonitor(int interval, BenchmarkState testState, + public static Monitor getMonitor(MonitorInfo monitorInfo, BenchmarkState testState, List> workers, WorkloadConfiguration conf) { - switch (conf.getDatabaseType()) { - case SQLSERVER: - return new SQLServerMonitor(interval, testState, workers, conf); - case POSTGRES: - return new PostgreSQLMonitor(interval, testState, workers, conf); + switch (monitorInfo.getMonitoringType()) { + case ADVANCED: { + switch (conf.getDatabaseType()) { + case SQLSERVER: + return new SQLServerMonitor(monitorInfo, testState, workers, conf); + case POSTGRES: + return new PostgreSQLMonitor(monitorInfo, testState, workers, conf); + default: + return new Monitor(monitorInfo, testState, workers); + } + } default: - return new Monitor(interval, testState, workers); - } + return new Monitor(monitorInfo, testState, workers); + } } } \ No newline at end of file diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/PostgreSQLMonitor.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/PostgreSQLMonitor.java index 4ee460ae4..08de1f37e 100644 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/PostgreSQLMonitor.java +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/PostgreSQLMonitor.java @@ -16,6 +16,7 @@ import com.oltpbenchmark.WorkloadConfiguration; import com.oltpbenchmark.api.BenchmarkModule; import com.oltpbenchmark.api.Worker; +import com.oltpbenchmark.util.MonitorInfo; /** * Implementation of a monitor specific to PostgreSQL. Uses the @@ -38,9 +39,9 @@ public class PostgreSQLMonitor extends DatabaseMonitor { private final Set stored_queries; - public PostgreSQLMonitor(int interval, BenchmarkState testState, + public PostgreSQLMonitor(MonitorInfo monitorInfo, BenchmarkState testState, List> workers, WorkloadConfiguration conf) { - super(interval, testState, workers, conf); + super(monitorInfo, testState, workers, conf); this.stored_queries = new HashSet(); diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/README.md b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/README.md index 253cd81de..2607e080d 100644 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/README.md +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/README.md @@ -2,11 +2,11 @@ Monitoring in BenchBase can be enabled using the ```text - -im,--interval-monitor Throughput Monitoring Interval in - milliseconds + -im,--interval-monitor Monitoring (Interval in ms) + -Im,--interval-monitor Advanced Monitoring (Interval in ms) ``` command line option when executing BenchBase, where the monitoring interval describes the sleeping period of the thread between recording monitoring information. -We currently support two types of monitoring: 1) Basic throughput monitoring and 2) Monitoring of query and system statistics via system tables for both SQLServer and Postgres. +We currently support two types of monitoring: 1) Basic throughput monitoring to track the progress while executing a benchmark and 2) monitoring of query and system properties via system tables for both SQLServer and Postgres. The latter are automatically enabled if the DBMS that BenchBase is executed against is either SQLServer or Postgres, otherwise, monitoring will default to basic throughput monitoring. The output of the monitoring queries are in logs in .proto format where each element corresponds to a query resp. a monitoring event. diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java index a48de05f3..5c263d856 100644 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java @@ -16,6 +16,7 @@ import com.oltpbenchmark.WorkloadConfiguration; import com.oltpbenchmark.api.BenchmarkModule; import com.oltpbenchmark.api.Worker; +import com.oltpbenchmark.util.MonitorInfo; /** * Implementation of a monitor specific to SQLServer. Uses SQLServer's system @@ -49,9 +50,9 @@ public class SQLServerMonitor extends DatabaseMonitor { private final Set cached_plans; - public SQLServerMonitor(int interval, BenchmarkState testState, + public SQLServerMonitor(MonitorInfo monitorInfo, BenchmarkState testState, List> workers, WorkloadConfiguration conf) { - super(interval, testState, workers, conf); + super(monitorInfo, testState, workers, conf); // Extract the database instance from url. String[] params = conf.getUrl().split(";"); diff --git a/src/main/java/com/oltpbenchmark/util/MonitorInfo.java b/src/main/java/com/oltpbenchmark/util/MonitorInfo.java new file mode 100644 index 000000000..9fb5b4b63 --- /dev/null +++ b/src/main/java/com/oltpbenchmark/util/MonitorInfo.java @@ -0,0 +1,43 @@ +/* + * Copyright 2020 by OLTPBenchmark Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.oltpbenchmark.util; + +import org.immutables.value.Value; + +@Value.Immutable +public interface MonitorInfo { + + public enum MonitoringType { + ADVANCED, THROUGHPUT; + } + + /** Monitoring interval. */ + @Value.Default + default + public int getMonitoringInterval() { + return 0; + } + + /** Monitoring type. */ + @Value.Default + default + public MonitoringType getMonitoringType() { + return MonitoringType.THROUGHPUT; + } + +} From e11d8da00c15222978b5afcacbb7e77280ffa217 Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Mon, 10 Apr 2023 11:00:48 +0200 Subject: [PATCH 09/67] Fix missing option in commandline. --- src/main/java/com/oltpbenchmark/DBWorkload.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/oltpbenchmark/DBWorkload.java b/src/main/java/com/oltpbenchmark/DBWorkload.java index f7c233270..312c89526 100644 --- a/src/main/java/com/oltpbenchmark/DBWorkload.java +++ b/src/main/java/com/oltpbenchmark/DBWorkload.java @@ -494,7 +494,8 @@ private static Options buildOptions(XMLConfiguration pluginConfig) { options.addOption(null, "execute", true, "Execute the benchmark workload"); options.addOption("h", "help", false, "Print this help"); options.addOption("s", "sample", true, "Sampling window"); - options.addOption("im", "interval-monitor", true, "Throughput Monitoring Interval in milliseconds"); + options.addOption("im", "interval-monitor", true, "Monitoring Interval in milliseconds"); + options.addOption("imt", "interval-monitor-type", true, "Type of Monitoring (throughput/advanced)"); options.addOption("d", "directory", true, "Base directory for the result files, default is current directory"); options.addOption(null, "dialects-export", true, "Export benchmark SQL to a dialects file"); options.addOption("jh", "json-histograms", true, "Export histograms to JSON file"); From bdddd008cc364bdc5130a5acb0265c345d70ffec Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Mon, 10 Apr 2023 11:05:46 +0200 Subject: [PATCH 10/67] debugging --- src/main/java/com/oltpbenchmark/DBWorkload.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/oltpbenchmark/DBWorkload.java b/src/main/java/com/oltpbenchmark/DBWorkload.java index 312c89526..4df111644 100644 --- a/src/main/java/com/oltpbenchmark/DBWorkload.java +++ b/src/main/java/com/oltpbenchmark/DBWorkload.java @@ -86,7 +86,9 @@ public static void main(String[] args) throws Exception { builder.monitoringInterval(Integer.parseInt(argsLine.getOptionValue("im"))); } if (argsLine.hasOption("imt")) { + LOG.info("recognized imt"); if (argsLine.getOptionValue("imt")=="advanced") { + LOG.info("setting value to advanced"); builder.monitoringType(MonitorInfo.MonitoringType.ADVANCED); } } From 4213e87cf0414c7dbcf1ba53d9094f5b03d84010 Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Mon, 10 Apr 2023 11:09:30 +0200 Subject: [PATCH 11/67] More debugging. --- src/main/java/com/oltpbenchmark/DBWorkload.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/oltpbenchmark/DBWorkload.java b/src/main/java/com/oltpbenchmark/DBWorkload.java index 4df111644..7af84cd30 100644 --- a/src/main/java/com/oltpbenchmark/DBWorkload.java +++ b/src/main/java/com/oltpbenchmark/DBWorkload.java @@ -81,13 +81,15 @@ public static void main(String[] args) throws Exception { } + // Monitoring setup. ImmutableMonitorInfo.Builder builder = ImmutableMonitorInfo.builder(); if (argsLine.hasOption("im")) { + LOG.info("im"); builder.monitoringInterval(Integer.parseInt(argsLine.getOptionValue("im"))); } - if (argsLine.hasOption("imt")) { - LOG.info("recognized imt"); - if (argsLine.getOptionValue("imt")=="advanced") { + if (argsLine.hasOption("mt")) { + LOG.info("recognized mt"); + if (argsLine.getOptionValue("mt")=="advanced") { LOG.info("setting value to advanced"); builder.monitoringType(MonitorInfo.MonitoringType.ADVANCED); } @@ -497,7 +499,7 @@ private static Options buildOptions(XMLConfiguration pluginConfig) { options.addOption("h", "help", false, "Print this help"); options.addOption("s", "sample", true, "Sampling window"); options.addOption("im", "interval-monitor", true, "Monitoring Interval in milliseconds"); - options.addOption("imt", "interval-monitor-type", true, "Type of Monitoring (throughput/advanced)"); + options.addOption("mt", "monitor-type", true, "Type of Monitoring (throughput/advanced)"); options.addOption("d", "directory", true, "Base directory for the result files, default is current directory"); options.addOption(null, "dialects-export", true, "Export benchmark SQL to a dialects file"); options.addOption("jh", "json-histograms", true, "Export histograms to JSON file"); From 2c5da87083650d227c83845c689acfb57f755ea5 Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Mon, 10 Apr 2023 11:12:07 +0200 Subject: [PATCH 12/67] String comparison fix. --- src/main/java/com/oltpbenchmark/DBWorkload.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/oltpbenchmark/DBWorkload.java b/src/main/java/com/oltpbenchmark/DBWorkload.java index 7af84cd30..d462e7330 100644 --- a/src/main/java/com/oltpbenchmark/DBWorkload.java +++ b/src/main/java/com/oltpbenchmark/DBWorkload.java @@ -89,7 +89,7 @@ public static void main(String[] args) throws Exception { } if (argsLine.hasOption("mt")) { LOG.info("recognized mt"); - if (argsLine.getOptionValue("mt")=="advanced") { + if (argsLine.getOptionValue("mt").equals("advanced")) { LOG.info("setting value to advanced"); builder.monitoringType(MonitorInfo.MonitoringType.ADVANCED); } From b7122e9e90b8ed36ec534425ba2561bf350338c8 Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Mon, 10 Apr 2023 11:17:08 +0200 Subject: [PATCH 13/67] Remove debugging messages. --- src/main/java/com/oltpbenchmark/DBWorkload.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/main/java/com/oltpbenchmark/DBWorkload.java b/src/main/java/com/oltpbenchmark/DBWorkload.java index d462e7330..8a21205e0 100644 --- a/src/main/java/com/oltpbenchmark/DBWorkload.java +++ b/src/main/java/com/oltpbenchmark/DBWorkload.java @@ -84,13 +84,10 @@ public static void main(String[] args) throws Exception { // Monitoring setup. ImmutableMonitorInfo.Builder builder = ImmutableMonitorInfo.builder(); if (argsLine.hasOption("im")) { - LOG.info("im"); builder.monitoringInterval(Integer.parseInt(argsLine.getOptionValue("im"))); } if (argsLine.hasOption("mt")) { - LOG.info("recognized mt"); if (argsLine.getOptionValue("mt").equals("advanced")) { - LOG.info("setting value to advanced"); builder.monitoringType(MonitorInfo.MonitoringType.ADVANCED); } } From c43157f3624f0119695b4f9210d7285c32d3723c Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Mon, 10 Apr 2023 11:26:17 +0200 Subject: [PATCH 14/67] Update to README. --- .../api/collectors/monitoring/README.md | 26 ++++++++----------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/README.md b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/README.md index 2607e080d..9d7063bf1 100644 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/README.md +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/README.md @@ -2,22 +2,18 @@ Monitoring in BenchBase can be enabled using the ```text - -im,--interval-monitor Monitoring (Interval in ms) - -Im,--interval-monitor Advanced Monitoring (Interval in ms) + -im,--interval-monitor Monitoring Interval in milliseconds + -mt,--monitor-type Type of Monitoring (throughput/advanced) ``` command line option when executing BenchBase, where the monitoring interval describes the sleeping period of the thread between recording monitoring information. -We currently support two types of monitoring: 1) Basic throughput monitoring to track the progress while executing a benchmark and 2) monitoring of query and system properties via system tables for both SQLServer and Postgres. -The latter are automatically enabled if the DBMS that BenchBase is executed against is either SQLServer or Postgres, otherwise, monitoring will default to basic throughput monitoring. +We currently support two types of monitoring: 1) Basic throughput monitoring to track the progress while executing a benchmark (mt=throughput) and 2) monitoring of query and system properties via system tables for both SQLServer and Postgres (mt=advanced). +The former is the default setting unless the monitoring type is explicitly set to advanced which will trigger system monitoring if the database type is supported. -The output of the monitoring queries are in logs in .proto format where each element corresponds to a query resp. a monitoring event. -The proto definitions can be found at src/main/java/com/oltpbenchmark/api/collectors/monitoring/proto/monitor.proto. -Query information (such as the query plan) is logged once per executed query using the query cache that the DBMS provide to avoid unnecessary work of the DBMS. -This information is captured in the QueryEvent proto. -Performance information (such as CPU utilization, spills, or lock information) captures the system state at a specific moment in time and is logged as a PerfEvent proto. +Throughput monitoring logs uptdated throughput values directly to the system output, while advanced monitoring creates csv files recording their findings in folder results/monitor/. +Advanced monitoring collects data for a variety of events, such as one-off information about a query (for example query plans, query text, etc.), repeated information about a query (elapsed time per query execution, worker time, execution count etc.), and repeated system information (cache hits, number of transactions etc.). +Which events are collected depends on the database system and is customized in corresponding drivers. +The code for the drivers can be found in package src.main.java.com.oltpbenchmark.api.collectors.monitoring. -For monitoring to work correctly in SQLServer, the user needs to have access to the system tables. -For monitoring to work correctly in Postgres, pg_stat_statements needs to be enabled. -Note that in either case, frequent (additional) queries against the DBMS may distort the benchmarking results. -That is, a high additional query load via frequent pulling of data from the DBMS will incur system load and can potentially block the execution of the actual benchmark queries. - -The output of the monitor are logged to the same results folder as the other BenchBase telemetry, in the subfolder `monitor`. \ No newline at end of file +For advanced monitoring to function with SQLServer, the user needs to have access to the system tables, for Postgres, pg_stat_statements needs to be enabled. +Note that in either database system, frequent (additional) queries against the DBMS may distort the benchmarking results. +That is, a high additional query load via frequent pulling of data from the DBMS will incur system load and can potentially block the execution of the actual benchmark queries. \ No newline at end of file From d2d87936e5d048b84c55e4961906eb85b8d5e7f8 Mon Sep 17 00:00:00 2001 From: anjagruenheid <87397397+anjagruenheid@users.noreply.github.com> Date: Thu, 20 Apr 2023 18:05:17 +0200 Subject: [PATCH 15/67] Update src/main/java/com/oltpbenchmark/api/collectors/monitoring/DatabaseMonitor.java Co-authored-by: Brian Kroth --- .../api/collectors/monitoring/DatabaseMonitor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/DatabaseMonitor.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/DatabaseMonitor.java index c6ea46e1f..144145431 100644 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/DatabaseMonitor.java +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/DatabaseMonitor.java @@ -36,7 +36,7 @@ protected enum DatabaseState { protected final String SINGLE_QUERY_EVENT_CSV = "single_query_event"; protected final String REP_QUERY_EVENT_CSV = "repeated_query_event"; protected final String REP_SYSTEM_EVENT_CSV = "system_query_event"; - protected final int FILE_FLUSH_COUNT = 1000; + protected final int FILE_FLUSH_COUNT = 1000; // flush writes to the metrics files every 1000 ms protected DatabaseState currentState = DatabaseState.INVALID; protected int ticks = 1; From 794d4d7e02088473e1809aea624a28dd2942f5da Mon Sep 17 00:00:00 2001 From: anjagruenheid <87397397+anjagruenheid@users.noreply.github.com> Date: Thu, 20 Apr 2023 18:05:51 +0200 Subject: [PATCH 16/67] Update src/main/java/com/oltpbenchmark/api/collectors/monitoring/README.md Co-authored-by: Brian Kroth --- .../java/com/oltpbenchmark/api/collectors/monitoring/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/README.md b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/README.md index 9d7063bf1..3c9277f65 100644 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/README.md +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/README.md @@ -14,6 +14,6 @@ Advanced monitoring collects data for a variety of events, such as one-off infor Which events are collected depends on the database system and is customized in corresponding drivers. The code for the drivers can be found in package src.main.java.com.oltpbenchmark.api.collectors.monitoring. -For advanced monitoring to function with SQLServer, the user needs to have access to the system tables, for Postgres, pg_stat_statements needs to be enabled. +For advanced monitoring to function with SQLServer, the user needs to have access to the system tables, for Postgres, `pg_stat_statements` needs to be enabled. Note that in either database system, frequent (additional) queries against the DBMS may distort the benchmarking results. That is, a high additional query load via frequent pulling of data from the DBMS will incur system load and can potentially block the execution of the actual benchmark queries. \ No newline at end of file From 7ec4e0e07da4f4867eff6cd24d295a10391354cc Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Fri, 21 Apr 2023 16:36:27 +0200 Subject: [PATCH 17/67] Address some of the comments from Brian's review. --- .../java/com/oltpbenchmark/ThreadBench.java | 5 ++- .../monitoring/DatabaseMonitor.java | 2 +- .../monitoring/PostgreSQLMonitor.java | 13 ++++--- .../monitoring/SQLServerMonitor.java | 37 ++++++++++--------- 4 files changed, 32 insertions(+), 25 deletions(-) diff --git a/src/main/java/com/oltpbenchmark/ThreadBench.java b/src/main/java/com/oltpbenchmark/ThreadBench.java index bef4bcb15..0da689ac5 100644 --- a/src/main/java/com/oltpbenchmark/ThreadBench.java +++ b/src/main/java/com/oltpbenchmark/ThreadBench.java @@ -34,6 +34,9 @@ public class ThreadBench implements Thread.UncaughtExceptionHandler { private static final Logger LOG = LoggerFactory.getLogger(ThreadBench.class); + // Determines how long (in ms) to wait until monitoring thread rejoins the + // main thread. + private static final int MONITOR_REJOIN_TIME = 60000; private final BenchmarkState testState; private final List> workers; @@ -307,7 +310,7 @@ private Results runRateLimitedMultiPhase() { try { if (this.monitor != null) { this.monitor.interrupt(); - this.monitor.join(60000); // wait for 60second for monitor thread to rejoin + this.monitor.join(MONITOR_REJOIN_TIME); this.monitor.tearDown(); } } diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/DatabaseMonitor.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/DatabaseMonitor.java index c6ea46e1f..faf785c12 100644 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/DatabaseMonitor.java +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/DatabaseMonitor.java @@ -82,7 +82,7 @@ public DatabaseMonitor( FileUtil.makeDirIfNotExists(OUTPUT_DIR); - // Init output proto builders. + // Initialize event lists. this.singleQueryEvents = new ArrayList<>(); this.repeatedQueryEvents = new ArrayList<>(); this.repeatedSystemEvents = new ArrayList<>(); diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/PostgreSQLMonitor.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/PostgreSQLMonitor.java index 08de1f37e..fb0c1d2a8 100644 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/PostgreSQLMonitor.java +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/PostgreSQLMonitor.java @@ -27,12 +27,13 @@ public class PostgreSQLMonitor extends DatabaseMonitor { private final String MONITORING_IDENTIFIER = "/*monitor-"; private final String MONITORING_SPLIT_MARKER = "*/"; - private final String PG_STAT_STATEMENTS = "SELECT " + - "query AS query_text, calls as execution_count, rows, " + - "total_exec_time, min_exec_time, max_exec_time, " + - "shared_blks_read, shared_blks_written, local_blks_read, " + - "local_blks_written, temp_blks_read, temp_blks_written " + - "FROM pg_stat_statements;"; + private final String PG_STAT_STATEMENTS = """ + SELECT query AS query_text, calls as execution_count, rows, + total_exec_time, min_exec_time, max_exec_time, + shared_blks_read, shared_blks_written, local_blks_read, + local_blks_written, temp_blks_read, temp_blks_written + FROM pg_stat_statements; + """; private final String CLEAN_CACHE = "SELECT pg_stat_statements_reset();"; private final List singleQueryProperties; private final List repeatedQueryProperties; diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java index 5c263d856..7c84641d2 100644 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java @@ -26,23 +26,26 @@ public class SQLServerMonitor extends DatabaseMonitor { private final String MONITORING_IDENTIFIER = "/*monitor-"; private final String MONITORING_SPLIT_MARKER = "*/"; - private final String DM_EXEC_QUERY_STATS = "SELECT " + - "q.text AS query_text, st.plan_handle, pl.query_plan, " + - "st.execution_count, st.min_worker_time, st.max_worker_time, " + - "st.total_worker_time, st.min_physical_reads, st.max_physical_reads, " + - "st.total_physical_reads, st.min_elapsed_time, st.max_elapsed_time, " + - "st.total_elapsed_time, st.total_rows, st.min_rows, st.max_rows, " + - "st.min_spills, st.max_spills, st.total_spills, " + - "st.min_logical_writes, st.max_logical_writes, st.total_logical_writes, " + - "st.min_logical_reads, st.max_logical_reads, st.total_logical_reads, " + - "st.min_used_grant_kb, st.max_used_grant_kb, st.total_used_grant_kb, " + - "st.min_used_threads, st.max_used_threads, st.total_used_threads " + - "FROM sys.dm_exec_query_stats st " + - "CROSS APPLY sys.dm_exec_sql_text(st.plan_handle) q " + - "CROSS APPLY sys.dm_exec_query_plan(st.plan_handle) pl"; - private String DM_OS_PERFORMANCE_STATS = "SELECT cntr_value, " + - "counter_name FROM sys.dm_os_performance_counters WHERE " + - "instance_name='$DB_INSTANCE';"; + private final String DM_EXEC_QUERY_STATS = """ + SELECT q.text AS query_text, st.plan_handle, pl.query_plan, + q.text AS query_text, st.plan_handle, pl.query_plan, + st.execution_count, st.min_worker_time, st.max_worker_time, + st.total_worker_time, st.min_physical_reads, st.max_physical_reads, + st.total_physical_reads, st.min_elapsed_time, st.max_elapsed_time, + st.total_elapsed_time, st.total_rows, st.min_rows, st.max_rows, + st.min_spills, st.max_spills, st.total_spills, + st.min_logical_writes, st.max_logical_writes, st.total_logical_writes, + st.min_logical_reads, st.max_logical_reads, st.total_logical_reads, + st.min_used_grant_kb, st.max_used_grant_kb, st.total_used_grant_kb, + st.min_used_threads, st.max_used_threads, st.total_used_threads + FROM sys.dm_exec_query_stats st + CROSS APPLY sys.dm_exec_sql_text(st.plan_handle) q + CROSS APPLY sys.dm_exec_query_plan(st.plan_handle) pl + """; + private String DM_OS_PERFORMANCE_STATS = """ + SELECT cntr_value, counter_name FROM sys.dm_os_performance_counters + WHERE instance_name='$DB_INSTANCE'; + """; private final String CLEAN_CACHE = "DBCC FREEPROCCACHE;"; private final List singleQueryProperties; private final List repeatedQueryProperties; From 7a9bc29918837ac46a859cc82185dfd030b1d443 Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Wed, 26 Apr 2023 13:18:18 +0200 Subject: [PATCH 18/67] First draft for generic monitoring prefix (incl TPCC). --- .../java/com/oltpbenchmark/DBWorkload.java | 7 + .../oltpbenchmark/WorkloadConfiguration.java | 9 + .../java/com/oltpbenchmark/api/Procedure.java | 31 +++ .../java/com/oltpbenchmark/api/SQLStmt.java | 12 ++ .../java/com/oltpbenchmark/api/Worker.java | 1 + .../benchmarks/tpcc/procedures/Delivery.java | 131 ++++++------ .../benchmarks/tpcc/procedures/NewOrder.java | 167 ++++++++------- .../tpcc/procedures/OrderStatus.java | 87 ++++---- .../benchmarks/tpcc/procedures/Payment.java | 193 +++++++++--------- .../tpcc/procedures/StockLevel.java | 43 ++-- .../com/oltpbenchmark/types/DatabaseType.java | 27 ++- .../oltpbenchmark/util/MonitoringUtil.java | 54 +++++ 12 files changed, 461 insertions(+), 301 deletions(-) create mode 100644 src/main/java/com/oltpbenchmark/util/MonitoringUtil.java diff --git a/src/main/java/com/oltpbenchmark/DBWorkload.java b/src/main/java/com/oltpbenchmark/DBWorkload.java index 8a21205e0..01cd8cece 100644 --- a/src/main/java/com/oltpbenchmark/DBWorkload.java +++ b/src/main/java/com/oltpbenchmark/DBWorkload.java @@ -24,6 +24,8 @@ import com.oltpbenchmark.api.Worker; import com.oltpbenchmark.types.DatabaseType; import com.oltpbenchmark.util.*; +import com.oltpbenchmark.util.MonitorInfo.MonitoringType; + import org.apache.commons.cli.*; import org.apache.commons.collections4.map.ListOrderedMap; import org.apache.commons.configuration2.HierarchicalConfiguration; @@ -156,6 +158,11 @@ public static void main(String[] args) throws Exception { // Nothing to do here ! } + // Set monitoring enabled, if all requirements are met. + if (monitorInfo.getMonitoringInterval()>0 && monitorInfo.getMonitoringType()==MonitoringType.THROUGHPUT) { + wrkld.setMonitoringEnabled(true); + } + // ---------------------------------------------------------------- // CREATE BENCHMARK MODULE // ---------------------------------------------------------------- diff --git a/src/main/java/com/oltpbenchmark/WorkloadConfiguration.java b/src/main/java/com/oltpbenchmark/WorkloadConfiguration.java index fb76076f0..d31500916 100644 --- a/src/main/java/com/oltpbenchmark/WorkloadConfiguration.java +++ b/src/main/java/com/oltpbenchmark/WorkloadConfiguration.java @@ -49,6 +49,7 @@ public class WorkloadConfiguration { private int isolationMode = Connection.TRANSACTION_SERIALIZABLE; private String dataDir = null; private String ddlPath = null; + private boolean monitoringEnabled = false; /** * If true, establish a new connection for each transaction, otherwise use one persistent connection per client @@ -124,6 +125,14 @@ public void setMaxRetries(int maxRetries) { this.maxRetries = maxRetries; } + public void setMonitoringEnabled(boolean monitoringEnabled) { + this.monitoringEnabled = true; + } + + public boolean getMonitoringEnabled() { + return this.monitoringEnabled; + } + /** * @return @see newConnectionPerTxn member docs for behavior. */ diff --git a/src/main/java/com/oltpbenchmark/api/Procedure.java b/src/main/java/com/oltpbenchmark/api/Procedure.java index 35357e95f..a388b9efe 100644 --- a/src/main/java/com/oltpbenchmark/api/Procedure.java +++ b/src/main/java/com/oltpbenchmark/api/Procedure.java @@ -19,6 +19,8 @@ import com.oltpbenchmark.jdbc.AutoIncrementPreparedStatement; import com.oltpbenchmark.types.DatabaseType; +import com.oltpbenchmark.util.MonitoringUtil; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -38,12 +40,14 @@ public abstract class Procedure { private final String procName; private DatabaseType dbType; private Map name_stmt_xref; + private boolean monitoringEnabled; /** * Constructor */ protected Procedure() { this.procName = this.getClass().getSimpleName(); + monitoringEnabled = false; } /** @@ -72,6 +76,33 @@ protected final String getProcedureName() { return (this.procName); } + /** + * Create a SQLStmt from a query statement. If monitoring is enabled, + * add monitoring prefix. + */ + protected SQLStmt createSqlStatement(String query, String queryId) { + String finalQuery = ""; + if (this.getMonitoringEnabled()) { + finalQuery = MonitoringUtil.getMonitoringPrefix().replace("$queryId", queryId); + } + finalQuery += query; + return new SQLStmt(finalQuery); + } + + /** + * Enable monitoring for this procedure. + */ + public void setMonitoringEnabled(boolean monitoringEnabled) { + this.monitoringEnabled = monitoringEnabled; + } + + /** + * Check whether monitoring is enabled for this procedure. + */ + public boolean getMonitoringEnabled() { + return this.monitoringEnabled; + } + /** * Return a PreparedStatement for the given SQLStmt handle * The underlying Procedure API will make sure that the proper SQL diff --git a/src/main/java/com/oltpbenchmark/api/SQLStmt.java b/src/main/java/com/oltpbenchmark/api/SQLStmt.java index f363d4e64..95bfdb05f 100644 --- a/src/main/java/com/oltpbenchmark/api/SQLStmt.java +++ b/src/main/java/com/oltpbenchmark/api/SQLStmt.java @@ -54,6 +54,18 @@ public SQLStmt(String sql, int... substitutions) { this.setSQL(sql); } + /** + * Constructor with monitoring prefix. + * + * @param sql + * @param monitoringPrefix + * @param substitutions + */ + public SQLStmt(String sql, String monitoringPrefix, int... substitutions) { + this.substitutions = substitutions; + this.setSQL(monitoringPrefix + sql); + } + /** * Magic SQL setter! * Each occurrence of the pattern "??" will be replaced by a string diff --git a/src/main/java/com/oltpbenchmark/api/Worker.java b/src/main/java/com/oltpbenchmark/api/Worker.java index f1cdf68ee..1857b5113 100644 --- a/src/main/java/com/oltpbenchmark/api/Worker.java +++ b/src/main/java/com/oltpbenchmark/api/Worker.java @@ -88,6 +88,7 @@ public Worker(T benchmark, int id) { this.procedures.putAll(this.benchmark.getProcedures()); for (Entry e : this.procedures.entrySet()) { Procedure proc = e.getValue(); + proc.setMonitoringEnabled(configuration.getMonitoringEnabled()); this.name_procedures.put(e.getKey().getName(), proc); this.class_procedures.put(proc.getClass(), proc); } diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Delivery.java b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Delivery.java index e0203a8ea..784176fa2 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Delivery.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Delivery.java @@ -17,7 +17,6 @@ package com.oltpbenchmark.benchmarks.tpcc.procedures; -import com.oltpbenchmark.api.SQLStmt; import com.oltpbenchmark.benchmarks.tpcc.TPCCConfig; import com.oltpbenchmark.benchmarks.tpcc.TPCCConstants; import com.oltpbenchmark.benchmarks.tpcc.TPCCUtil; @@ -33,61 +32,67 @@ public class Delivery extends TPCCProcedure { private static final Logger LOG = LoggerFactory.getLogger(Delivery.class); - public SQLStmt delivGetOrderIdSQL = new SQLStmt( - "/*monitor-delivGetOrderIdSQL*/ " + - "SELECT NO_O_ID FROM " + TPCCConstants.TABLENAME_NEWORDER + - " WHERE NO_D_ID = ? " + - " AND NO_W_ID = ? " + - " ORDER BY NO_O_ID ASC " + - " LIMIT 1"); - - public SQLStmt delivDeleteNewOrderSQL = new SQLStmt( - "/*monitor-delivDeleteNewOrderSQL*/ " + - "DELETE FROM " + TPCCConstants.TABLENAME_NEWORDER + - " WHERE NO_O_ID = ? " + - " AND NO_D_ID = ?" + - " AND NO_W_ID = ?"); - - public SQLStmt delivGetCustIdSQL = new SQLStmt( - "/*monitor-delivGetCustIdSQL*/ " + - "SELECT O_C_ID FROM " + TPCCConstants.TABLENAME_OPENORDER + - " WHERE O_ID = ? " + - " AND O_D_ID = ? " + - " AND O_W_ID = ?"); - - public SQLStmt delivUpdateCarrierIdSQL = new SQLStmt( - "/*monitor-delivUpdateCarrierIdSQL*/ " + - "UPDATE " + TPCCConstants.TABLENAME_OPENORDER + - " SET O_CARRIER_ID = ? " + - " WHERE O_ID = ? " + - " AND O_D_ID = ?" + - " AND O_W_ID = ?"); - - public SQLStmt delivUpdateDeliveryDateSQL = new SQLStmt( - "/*monitor-delivUpdateDeliveryDateSQL*/ " + - "UPDATE " + TPCCConstants.TABLENAME_ORDERLINE + - " SET OL_DELIVERY_D = ? " + - " WHERE OL_O_ID = ? " + - " AND OL_D_ID = ? " + - " AND OL_W_ID = ? "); - - public SQLStmt delivSumOrderAmountSQL = new SQLStmt( - "/*monitor-delivSumOrderAmountSQL*/ " + - "SELECT SUM(OL_AMOUNT) AS OL_TOTAL " + - " FROM " + TPCCConstants.TABLENAME_ORDERLINE + - " WHERE OL_O_ID = ? " + - " AND OL_D_ID = ? " + - " AND OL_W_ID = ?"); - - public SQLStmt delivUpdateCustBalDelivCntSQL = new SQLStmt( - "/*monitor-delivUpdateCustBalDelivCntSQL*/ " + - "UPDATE " + TPCCConstants.TABLENAME_CUSTOMER + - " SET C_BALANCE = C_BALANCE + ?," + - " C_DELIVERY_CNT = C_DELIVERY_CNT + 1 " + - " WHERE C_W_ID = ? " + - " AND C_D_ID = ? " + - " AND C_ID = ? "); - + public String delivGetOrderIdSQL = + """ + SELECT NO_O_ID FROM %s + WHERE NO_D_ID = ? + AND NO_W_ID = ? + ORDER BY NO_O_ID ASC + LIMIT 1) + """.formatted(TPCCConstants.TABLENAME_NEWORDER); + + public String delivDeleteNewOrderSQL = + """ + DELETE FROM %s + WHERE NO_O_ID = ? + AND NO_D_ID = ? + AND NO_W_ID = ? + """.formatted(TPCCConstants.TABLENAME_NEWORDER); + + public String delivGetCustIdSQL = + """ + SELECT O_C_ID FROM %s + WHERE O_ID = ? + AND O_D_ID = ? + AND O_W_ID = ? + """.formatted(TPCCConstants.TABLENAME_OPENORDER); + + public String delivUpdateCarrierIdSQL = + """ + UPDATE %s + SET O_CARRIER_ID = ? + WHERE O_ID = ? + AND O_D_ID = ? + AND O_W_ID = ? + """.formatted(TPCCConstants.TABLENAME_OPENORDER); + + public String delivUpdateDeliveryDateSQL = + """ + UPDATE %s + SET OL_DELIVERY_D = ? + WHERE OL_O_ID = ? + AND OL_D_ID = ? + AND OL_W_ID = ? + """.formatted(TPCCConstants.TABLENAME_ORDERLINE); + + public String delivSumOrderAmountSQL = + """ + SELECT SUM(OL_AMOUNT) AS OL_TOTAL + FROM %s + WHERE OL_O_ID = ? + AND OL_D_ID = ? + AND OL_W_ID = ? + """.formatted(TPCCConstants.TABLENAME_ORDERLINE); + + public String delivUpdateCustBalDelivCntSQL = + """ + UPDATE %s + SET C_BALANCE = C_BALANCE + ?, + C_DELIVERY_CNT = C_DELIVERY_CNT + 1 + WHERE C_W_ID = ? + AND C_D_ID = ? + AND C_ID = ? + """.formatted(TPCCConstants.TABLENAME_CUSTOMER); public void run(Connection conn, Random gen, int w_id, int numWarehouses, int terminalDistrictLowerID, int terminalDistrictUpperID, TPCCWorker w) throws SQLException { @@ -147,7 +152,7 @@ public void run(Connection conn, Random gen, int w_id, int numWarehouses, int te private Integer getOrderId(Connection conn, int w_id, int d_id) throws SQLException { - try (PreparedStatement delivGetOrderId = this.getPreparedStatement(conn, delivGetOrderIdSQL)) { + try (PreparedStatement delivGetOrderId = this.getPreparedStatement(conn, this.createSqlStatement(delivGetOrderIdSQL, "delivGetOrderIdSQL"))) { delivGetOrderId.setInt(1, d_id); delivGetOrderId.setInt(2, w_id); @@ -168,7 +173,7 @@ private Integer getOrderId(Connection conn, int w_id, int d_id) throws SQLExcept } private void deleteOrder(Connection conn, int w_id, int d_id, int no_o_id) throws SQLException { - try (PreparedStatement delivDeleteNewOrder = this.getPreparedStatement(conn, delivDeleteNewOrderSQL)) { + try (PreparedStatement delivDeleteNewOrder = this.getPreparedStatement(conn, this.createSqlStatement(delivDeleteNewOrderSQL, "delivDeleteNewOrderSQL"))) { delivDeleteNewOrder.setInt(1, no_o_id); delivDeleteNewOrder.setInt(2, d_id); delivDeleteNewOrder.setInt(3, w_id); @@ -189,7 +194,7 @@ private void deleteOrder(Connection conn, int w_id, int d_id, int no_o_id) throw private int getCustomerId(Connection conn, int w_id, int d_id, int no_o_id) throws SQLException { - try (PreparedStatement delivGetCustId = this.getPreparedStatement(conn, delivGetCustIdSQL)) { + try (PreparedStatement delivGetCustId = this.getPreparedStatement(conn, this.createSqlStatement(delivGetCustIdSQL, "delivGetCustIdSQL"))) { delivGetCustId.setInt(1, no_o_id); delivGetCustId.setInt(2, d_id); delivGetCustId.setInt(3, w_id); @@ -207,7 +212,7 @@ private int getCustomerId(Connection conn, int w_id, int d_id, int no_o_id) thro } private void updateCarrierId(Connection conn, int w_id, int o_carrier_id, int d_id, int no_o_id) throws SQLException { - try (PreparedStatement delivUpdateCarrierId = this.getPreparedStatement(conn, delivUpdateCarrierIdSQL)) { + try (PreparedStatement delivUpdateCarrierId = this.getPreparedStatement(conn, this.createSqlStatement(delivUpdateCarrierIdSQL, "delivUpdateCarrierIdSQL"))) { delivUpdateCarrierId.setInt(1, o_carrier_id); delivUpdateCarrierId.setInt(2, no_o_id); delivUpdateCarrierId.setInt(3, d_id); @@ -225,7 +230,7 @@ private void updateCarrierId(Connection conn, int w_id, int o_carrier_id, int d_ private void updateDeliveryDate(Connection conn, int w_id, int d_id, int no_o_id) throws SQLException { Timestamp timestamp = new Timestamp(System.currentTimeMillis()); - try (PreparedStatement delivUpdateDeliveryDate = this.getPreparedStatement(conn, delivUpdateDeliveryDateSQL)) { + try (PreparedStatement delivUpdateDeliveryDate = this.getPreparedStatement(conn, this.createSqlStatement(delivUpdateDeliveryDateSQL, "delivUpdateDeliveryDateSQL"))) { delivUpdateDeliveryDate.setTimestamp(1, timestamp); delivUpdateDeliveryDate.setInt(2, no_o_id); delivUpdateDeliveryDate.setInt(3, d_id); @@ -241,7 +246,7 @@ private void updateDeliveryDate(Connection conn, int w_id, int d_id, int no_o_id } private float getOrderLineTotal(Connection conn, int w_id, int d_id, int no_o_id) throws SQLException { - try (PreparedStatement delivSumOrderAmount = this.getPreparedStatement(conn, delivSumOrderAmountSQL)) { + try (PreparedStatement delivSumOrderAmount = this.getPreparedStatement(conn, this.createSqlStatement(delivSumOrderAmountSQL, "delivSumOrderAmountSQL"))) { delivSumOrderAmount.setInt(1, no_o_id); delivSumOrderAmount.setInt(2, d_id); delivSumOrderAmount.setInt(3, w_id); @@ -259,7 +264,7 @@ private float getOrderLineTotal(Connection conn, int w_id, int d_id, int no_o_id private void updateBalanceAndDelivery(Connection conn, int w_id, int d_id, int c_id, float orderLineTotal) throws SQLException { - try (PreparedStatement delivUpdateCustBalDelivCnt = this.getPreparedStatement(conn, delivUpdateCustBalDelivCntSQL)) { + try (PreparedStatement delivUpdateCustBalDelivCnt = this.getPreparedStatement(conn, this.createSqlStatement(delivUpdateCustBalDelivCntSQL, "delivUpdateCustBalDelivCntSQL"))) { delivUpdateCustBalDelivCnt.setBigDecimal(1, BigDecimal.valueOf(orderLineTotal)); delivUpdateCustBalDelivCnt.setInt(2, w_id); delivUpdateCustBalDelivCnt.setInt(3, d_id); diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/NewOrder.java b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/NewOrder.java index c83f6bb51..7a59a80c4 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/NewOrder.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/NewOrder.java @@ -17,7 +17,6 @@ package com.oltpbenchmark.benchmarks.tpcc.procedures; -import com.oltpbenchmark.api.SQLStmt; import com.oltpbenchmark.benchmarks.tpcc.TPCCConfig; import com.oltpbenchmark.benchmarks.tpcc.TPCCConstants; import com.oltpbenchmark.benchmarks.tpcc.TPCCUtil; @@ -33,74 +32,84 @@ public class NewOrder extends TPCCProcedure { private static final Logger LOG = LoggerFactory.getLogger(NewOrder.class); - public final SQLStmt stmtGetCustSQL = new SQLStmt( - "/*monitor-stmtGetCustSQL*/" + - "SELECT C_DISCOUNT, C_LAST, C_CREDIT" + - " FROM " + TPCCConstants.TABLENAME_CUSTOMER + - " WHERE C_W_ID = ? " + - " AND C_D_ID = ? " + - " AND C_ID = ?"); - - public final SQLStmt stmtGetWhseSQL = new SQLStmt( - "/*monitor-stmtGetWhseSQL*/" + - "SELECT W_TAX " + - " FROM " + TPCCConstants.TABLENAME_WAREHOUSE + - " WHERE W_ID = ?"); - - public final SQLStmt stmtGetDistSQL = new SQLStmt( - "/*monitor-stmtGetDistSQL*/" + - "SELECT D_NEXT_O_ID, D_TAX " + - " FROM " + TPCCConstants.TABLENAME_DISTRICT + - " WHERE D_W_ID = ? AND D_ID = ? FOR UPDATE"); - - public final SQLStmt stmtInsertNewOrderSQL = new SQLStmt( - "/*monitor-stmtInsertNewOrderSQL*/" + - "INSERT INTO " + TPCCConstants.TABLENAME_NEWORDER + - " (NO_O_ID, NO_D_ID, NO_W_ID) " + - " VALUES ( ?, ?, ?)"); - - public final SQLStmt stmtUpdateDistSQL = new SQLStmt( - "/*monitor-stmtUpdateDistSQL*/" + - "UPDATE " + TPCCConstants.TABLENAME_DISTRICT + - " SET D_NEXT_O_ID = D_NEXT_O_ID + 1 " + - " WHERE D_W_ID = ? " + - " AND D_ID = ?"); - - public final SQLStmt stmtInsertOOrderSQL = new SQLStmt( - "/*monitor-stmtInsertOOrderSQL*/" + - "INSERT INTO " + TPCCConstants.TABLENAME_OPENORDER + - " (O_ID, O_D_ID, O_W_ID, O_C_ID, O_ENTRY_D, O_OL_CNT, O_ALL_LOCAL)" + - " VALUES (?, ?, ?, ?, ?, ?, ?)"); - - public final SQLStmt stmtGetItemSQL = new SQLStmt( - "/*monitor-stmtGetItemSQL*/" + - "SELECT I_PRICE, I_NAME , I_DATA " + - " FROM " + TPCCConstants.TABLENAME_ITEM + - " WHERE I_ID = ?"); - - public final SQLStmt stmtGetStockSQL = new SQLStmt( - "/*monitor-stmtGetStockSQL*/" + - "SELECT S_QUANTITY, S_DATA, S_DIST_01, S_DIST_02, S_DIST_03, S_DIST_04, S_DIST_05, " + - " S_DIST_06, S_DIST_07, S_DIST_08, S_DIST_09, S_DIST_10" + - " FROM " + TPCCConstants.TABLENAME_STOCK + - " WHERE S_I_ID = ? " + - " AND S_W_ID = ? FOR UPDATE"); - - public final SQLStmt stmtUpdateStockSQL = new SQLStmt( - "/*monitor-stmtUpdateStockSQL*/" + - "UPDATE " + TPCCConstants.TABLENAME_STOCK + - " SET S_QUANTITY = ? , " + - " S_YTD = S_YTD + ?, " + - " S_ORDER_CNT = S_ORDER_CNT + 1, " + - " S_REMOTE_CNT = S_REMOTE_CNT + ? " + - " WHERE S_I_ID = ? " + - " AND S_W_ID = ?"); - - public final SQLStmt stmtInsertOrderLineSQL = new SQLStmt( - "/*monitor-stmtInsertOrderLineSQL*/" + - "INSERT INTO " + TPCCConstants.TABLENAME_ORDERLINE + - " (OL_O_ID, OL_D_ID, OL_W_ID, OL_NUMBER, OL_I_ID, OL_SUPPLY_W_ID, OL_QUANTITY, OL_AMOUNT, OL_DIST_INFO) " + - " VALUES (?,?,?,?,?,?,?,?,?)"); + public final String stmtGetCustSQL = + """ + SELECT C_DISCOUNT, C_LAST, C_CREDIT + FROM %s + WHERE C_W_ID = ? + AND C_D_ID = ? + AND C_ID = ? + """.formatted(TPCCConstants.TABLENAME_CUSTOMER); + + public final String stmtGetWhseSQL = + """ + SELECT W_TAX + FROM %s + WHERE W_ID = ? + """.formatted(TPCCConstants.TABLENAME_WAREHOUSE); + + public final String stmtGetDistSQL = + """ + SELECT D_NEXT_O_ID, D_TAX + FROM %s + WHERE D_W_ID = ? AND D_ID = ? FOR UPDATE + """.formatted(TPCCConstants.TABLENAME_DISTRICT); + + public final String stmtInsertNewOrderSQL = + """ + INSERT INTO %s + + (NO_O_ID, NO_D_ID, NO_W_ID) + VALUES ( ?, ?, ?) + """.formatted(TPCCConstants.TABLENAME_NEWORDER); + + public final String stmtUpdateDistSQL = + """ + UPDATE %s + + SET D_NEXT_O_ID = D_NEXT_O_ID + 1 + WHERE D_W_ID = ? + AND D_ID = ? + """.formatted(TPCCConstants.TABLENAME_DISTRICT); + + public final String stmtInsertOOrderSQL = + """ + INSERT INTO %s + + (O_ID, O_D_ID, O_W_ID, O_C_ID, O_ENTRY_D, O_OL_CNT, O_ALL_LOCAL) + VALUES (?, ?, ?, ?, ?, ?, ?) + """.formatted(TPCCConstants.TABLENAME_OPENORDER); + + public final String stmtGetItemSQL = + """ + SELECT I_PRICE, I_NAME , I_DATA + FROM %s + + WHERE I_ID = ? + """.formatted(TPCCConstants.TABLENAME_ITEM); + + public final String stmtGetStockSQL = + """ + SELECT S_QUANTITY, S_DATA, S_DIST_01, S_DIST_02, S_DIST_03, S_DIST_04, S_DIST_05, + S_DIST_06, S_DIST_07, S_DIST_08, S_DIST_09, S_DIST_10 + FROM %s + + WHERE S_I_ID = ? + AND S_W_ID = ? FOR UPDATE + """.formatted(TPCCConstants.TABLENAME_STOCK); + + public final String stmtUpdateStockSQL = + """ + UPDATE %s + + SET S_QUANTITY = ? , + S_YTD = S_YTD + ?, + S_ORDER_CNT = S_ORDER_CNT + 1, + S_REMOTE_CNT = S_REMOTE_CNT + ? + WHERE S_I_ID = ? + AND S_W_ID = ? + """.formatted(TPCCConstants.TABLENAME_STOCK); + + public final String stmtInsertOrderLineSQL = + """ + INSERT INTO %s + + (OL_O_ID, OL_D_ID, OL_W_ID, OL_NUMBER, OL_I_ID, OL_SUPPLY_W_ID, OL_QUANTITY, OL_AMOUNT, OL_DIST_INFO) + VALUES (?,?,?,?,?,?,?,?,?) + """.formatted(TPCCConstants.TABLENAME_ORDERLINE); public void run(Connection conn, Random gen, int terminalWarehouseID, int numWarehouses, int terminalDistrictLowerID, int terminalDistrictUpperID, TPCCWorker w) throws SQLException { @@ -155,8 +164,8 @@ private void newOrderTransaction(int w_id, int d_id, int c_id, insertNewOrder(conn, w_id, d_id, d_next_o_id); - try (PreparedStatement stmtUpdateStock = this.getPreparedStatement(conn, stmtUpdateStockSQL); - PreparedStatement stmtInsertOrderLine = this.getPreparedStatement(conn, stmtInsertOrderLineSQL)) { + try (PreparedStatement stmtUpdateStock = this.getPreparedStatement(conn, this.createSqlStatement(stmtUpdateStockSQL,"stmtUpdateStockSQL")); + PreparedStatement stmtInsertOrderLine = this.getPreparedStatement(conn, this.createSqlStatement(stmtInsertOrderLineSQL,"stmtInsertOrderLineSQL"))) { for (int ol_number = 1; ol_number <= o_ol_cnt; ol_number++) { int ol_supply_w_id = supplierWarehouseIDs[ol_number - 1]; @@ -227,7 +236,7 @@ private String getDistInfo(int d_id, Stock s) { } private Stock getStock(Connection conn, int ol_supply_w_id, int ol_i_id, int ol_quantity) throws SQLException { - try (PreparedStatement stmtGetStock = this.getPreparedStatement(conn, stmtGetStockSQL)) { + try (PreparedStatement stmtGetStock = this.getPreparedStatement(conn, this.createSqlStatement(stmtGetStockSQL,"stmtGetStockSQL"))) { stmtGetStock.setInt(1, ol_i_id); stmtGetStock.setInt(2, ol_supply_w_id); try (ResultSet rs = stmtGetStock.executeQuery()) { @@ -259,7 +268,7 @@ private Stock getStock(Connection conn, int ol_supply_w_id, int ol_i_id, int ol_ } private float getItemPrice(Connection conn, int ol_i_id) throws SQLException { - try (PreparedStatement stmtGetItem = this.getPreparedStatement(conn, stmtGetItemSQL)) { + try (PreparedStatement stmtGetItem = this.getPreparedStatement(conn, this.createSqlStatement(stmtGetItemSQL,"stmtGetItemSQL"))) { stmtGetItem.setInt(1, ol_i_id); try (ResultSet rs = stmtGetItem.executeQuery()) { if (!rs.next()) { @@ -273,7 +282,7 @@ private float getItemPrice(Connection conn, int ol_i_id) throws SQLException { } private void insertNewOrder(Connection conn, int w_id, int d_id, int o_id) throws SQLException { - try (PreparedStatement stmtInsertNewOrder = this.getPreparedStatement(conn, stmtInsertNewOrderSQL);) { + try (PreparedStatement stmtInsertNewOrder = this.getPreparedStatement(conn, this.createSqlStatement(stmtInsertNewOrderSQL,"stmtInsertNewOrderSQL"));) { stmtInsertNewOrder.setInt(1, o_id); stmtInsertNewOrder.setInt(2, d_id); stmtInsertNewOrder.setInt(3, w_id); @@ -286,7 +295,7 @@ private void insertNewOrder(Connection conn, int w_id, int d_id, int o_id) throw } private void insertOpenOrder(Connection conn, int w_id, int d_id, int c_id, int o_ol_cnt, int o_all_local, int o_id) throws SQLException { - try (PreparedStatement stmtInsertOOrder = this.getPreparedStatement(conn, stmtInsertOOrderSQL);) { + try (PreparedStatement stmtInsertOOrder = this.getPreparedStatement(conn, this.createSqlStatement(stmtInsertOOrderSQL,"stmtInsertOOrderSQL"));) { stmtInsertOOrder.setInt(1, o_id); stmtInsertOOrder.setInt(2, d_id); stmtInsertOOrder.setInt(3, w_id); @@ -304,7 +313,7 @@ private void insertOpenOrder(Connection conn, int w_id, int d_id, int c_id, int } private void updateDistrict(Connection conn, int w_id, int d_id) throws SQLException { - try (PreparedStatement stmtUpdateDist = this.getPreparedStatement(conn, stmtUpdateDistSQL)) { + try (PreparedStatement stmtUpdateDist = this.getPreparedStatement(conn, this.createSqlStatement(stmtUpdateDistSQL,"stmtUpdateDistSQL"))) { stmtUpdateDist.setInt(1, w_id); stmtUpdateDist.setInt(2, d_id); int result = stmtUpdateDist.executeUpdate(); @@ -315,7 +324,7 @@ private void updateDistrict(Connection conn, int w_id, int d_id) throws SQLExcep } private int getDistrict(Connection conn, int w_id, int d_id) throws SQLException { - try (PreparedStatement stmtGetDist = this.getPreparedStatement(conn, stmtGetDistSQL)) { + try (PreparedStatement stmtGetDist = this.getPreparedStatement(conn, this.createSqlStatement(stmtGetDistSQL,"stmtGetDistSQL"))) { stmtGetDist.setInt(1, w_id); stmtGetDist.setInt(2, d_id); try (ResultSet rs = stmtGetDist.executeQuery()) { @@ -328,7 +337,7 @@ private int getDistrict(Connection conn, int w_id, int d_id) throws SQLException } private void getWarehouse(Connection conn, int w_id) throws SQLException { - try (PreparedStatement stmtGetWhse = this.getPreparedStatement(conn, stmtGetWhseSQL)) { + try (PreparedStatement stmtGetWhse = this.getPreparedStatement(conn, this.createSqlStatement(stmtGetWhseSQL,"stmtGetWhseSQL"))) { stmtGetWhse.setInt(1, w_id); try (ResultSet rs = stmtGetWhse.executeQuery()) { if (!rs.next()) { @@ -339,7 +348,7 @@ private void getWarehouse(Connection conn, int w_id) throws SQLException { } private void getCustomer(Connection conn, int w_id, int d_id, int c_id) throws SQLException { - try (PreparedStatement stmtGetCust = this.getPreparedStatement(conn, stmtGetCustSQL)) { + try (PreparedStatement stmtGetCust = this.getPreparedStatement(conn, this.createSqlStatement(stmtGetCustSQL,"stmtGetCustSQL"))) { stmtGetCust.setInt(1, w_id); stmtGetCust.setInt(2, d_id); stmtGetCust.setInt(3, c_id); diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/OrderStatus.java b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/OrderStatus.java index 79c23a526..36173b0be 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/OrderStatus.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/OrderStatus.java @@ -17,7 +17,6 @@ package com.oltpbenchmark.benchmarks.tpcc.procedures; -import com.oltpbenchmark.api.SQLStmt; import com.oltpbenchmark.benchmarks.tpcc.TPCCConstants; import com.oltpbenchmark.benchmarks.tpcc.TPCCUtil; import com.oltpbenchmark.benchmarks.tpcc.TPCCWorker; @@ -38,43 +37,47 @@ public class OrderStatus extends TPCCProcedure { private static final Logger LOG = LoggerFactory.getLogger(OrderStatus.class); - public SQLStmt ordStatGetNewestOrdSQL = new SQLStmt( - "/*monitor-ordStatGetNewestOrdSQL*/" + - "SELECT O_ID, O_CARRIER_ID, O_ENTRY_D " + - " FROM " + TPCCConstants.TABLENAME_OPENORDER + - " WHERE O_W_ID = ? " + - " AND O_D_ID = ? " + - " AND O_C_ID = ? " + - " ORDER BY O_ID DESC LIMIT 1"); - - public SQLStmt ordStatGetOrderLinesSQL = new SQLStmt( - "/*monitor-ordStatGetOrderLinesSQL*/" + - "SELECT OL_I_ID, OL_SUPPLY_W_ID, OL_QUANTITY, OL_AMOUNT, OL_DELIVERY_D " + - " FROM " + TPCCConstants.TABLENAME_ORDERLINE + - " WHERE OL_O_ID = ?" + - " AND OL_D_ID = ?" + - " AND OL_W_ID = ?"); - - public SQLStmt payGetCustSQL = new SQLStmt( - "/*monitor-payGetCustSQL*/" + - "SELECT C_FIRST, C_MIDDLE, C_LAST, C_STREET_1, C_STREET_2, " + - " C_CITY, C_STATE, C_ZIP, C_PHONE, C_CREDIT, C_CREDIT_LIM, " + - " C_DISCOUNT, C_BALANCE, C_YTD_PAYMENT, C_PAYMENT_CNT, C_SINCE " + - " FROM " + TPCCConstants.TABLENAME_CUSTOMER + - " WHERE C_W_ID = ? " + - " AND C_D_ID = ? " + - " AND C_ID = ?"); - - public SQLStmt customerByNameSQL = new SQLStmt( - "/*monitor-customerByNameSQL*/" + - "SELECT C_FIRST, C_MIDDLE, C_ID, C_STREET_1, C_STREET_2, C_CITY, " + - " C_STATE, C_ZIP, C_PHONE, C_CREDIT, C_CREDIT_LIM, C_DISCOUNT, " + - " C_BALANCE, C_YTD_PAYMENT, C_PAYMENT_CNT, C_SINCE " + - " FROM " + TPCCConstants.TABLENAME_CUSTOMER + - " WHERE C_W_ID = ? " + - " AND C_D_ID = ? " + - " AND C_LAST = ? " + - " ORDER BY C_FIRST"); + public String ordStatGetNewestOrdSQL = + """ + SELECT O_ID, O_CARRIER_ID, O_ENTRY_D + FROM %s + WHERE O_W_ID = ? + AND O_D_ID = ? + AND O_C_ID = ? + ORDER BY O_ID DESC LIMIT 1 + """.formatted(TPCCConstants.TABLENAME_OPENORDER); + + public String ordStatGetOrderLinesSQL = + """ + SELECT OL_I_ID, OL_SUPPLY_W_ID, OL_QUANTITY, OL_AMOUNT, OL_DELIVERY_D + FROM %s + WHERE OL_O_ID = ? + AND OL_D_ID = ? + AND OL_W_ID = ? + """.formatted(TPCCConstants.TABLENAME_ORDERLINE); + + public String payGetCustSQL = + """ + SELECT C_FIRST, C_MIDDLE, C_LAST, C_STREET_1, C_STREET_2, + C_CITY, C_STATE, C_ZIP, C_PHONE, C_CREDIT, C_CREDIT_LIM, + C_DISCOUNT, C_BALANCE, C_YTD_PAYMENT, C_PAYMENT_CNT, C_SINCE + FROM %s + WHERE C_W_ID = ? + AND C_D_ID = ? + AND C_ID = ? + """.formatted(TPCCConstants.TABLENAME_CUSTOMER); + + public String customerByNameSQL = + """ + SELECT C_FIRST, C_MIDDLE, C_ID, C_STREET_1, C_STREET_2, C_CITY, + C_STATE, C_ZIP, C_PHONE, C_CREDIT, C_CREDIT_LIM, C_DISCOUNT, + C_BALANCE, C_YTD_PAYMENT, C_PAYMENT_CNT, C_SINCE + FROM %s + WHERE C_W_ID = ? + AND C_D_ID = ? + AND C_LAST = ? + ORDER BY C_FIRST + """.formatted(TPCCConstants.TABLENAME_CUSTOMER); public void run(Connection conn, Random gen, int w_id, int numWarehouses, int terminalDistrictLowerID, int terminalDistrictUpperID, TPCCWorker w) throws SQLException { @@ -158,7 +161,7 @@ public void run(Connection conn, Random gen, int w_id, int numWarehouses, int te } private Oorder getOrderDetails(Connection conn, int w_id, int d_id, Customer c) throws SQLException { - try (PreparedStatement ordStatGetNewestOrd = this.getPreparedStatement(conn, ordStatGetNewestOrdSQL)) { + try (PreparedStatement ordStatGetNewestOrd = this.getPreparedStatement(conn, this.createSqlStatement(ordStatGetNewestOrdSQL,"ordStatGetNewestOrdSQL"))) { // find the newest order for the customer @@ -187,7 +190,7 @@ private Oorder getOrderDetails(Connection conn, int w_id, int d_id, Customer c) private List getOrderLines(Connection conn, int w_id, int d_id, int o_id, Customer c) throws SQLException { List orderLines = new ArrayList<>(); - try (PreparedStatement ordStatGetOrderLines = this.getPreparedStatement(conn, ordStatGetOrderLinesSQL)) { + try (PreparedStatement ordStatGetOrderLines = this.getPreparedStatement(conn, this.createSqlStatement(ordStatGetOrderLinesSQL,"ordStatGetOrderLinesSQL"))) { ordStatGetOrderLines.setInt(1, o_id); ordStatGetOrderLines.setInt(2, d_id); ordStatGetOrderLines.setInt(3, w_id); @@ -229,7 +232,7 @@ private List getOrderLines(Connection conn, int w_id, int d_id, int o_id // prepared statements public Customer getCustomerById(int c_w_id, int c_d_id, int c_id, Connection conn) throws SQLException { - try (PreparedStatement payGetCust = this.getPreparedStatement(conn, payGetCustSQL)) { + try (PreparedStatement payGetCust = this.getPreparedStatement(conn, this.createSqlStatement(payGetCustSQL,"payGetCustSQL"))) { payGetCust.setInt(1, c_w_id); payGetCust.setInt(2, c_d_id); @@ -256,7 +259,7 @@ public Customer getCustomerById(int c_w_id, int c_d_id, int c_id, Connection con public Customer getCustomerByName(int c_w_id, int c_d_id, String c_last, Connection conn) throws SQLException { ArrayList customers = new ArrayList<>(); - try (PreparedStatement customerByName = this.getPreparedStatement(conn, customerByNameSQL)) { + try (PreparedStatement customerByName = this.getPreparedStatement(conn, this.createSqlStatement(customerByNameSQL,"customerByNameSQL"))) { customerByName.setInt(1, c_w_id); customerByName.setInt(2, c_d_id); diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Payment.java b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Payment.java index 8ec7c33f5..36ed87ab2 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Payment.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Payment.java @@ -17,7 +17,6 @@ package com.oltpbenchmark.benchmarks.tpcc.procedures; -import com.oltpbenchmark.api.SQLStmt; import com.oltpbenchmark.benchmarks.tpcc.TPCCConfig; import com.oltpbenchmark.benchmarks.tpcc.TPCCConstants; import com.oltpbenchmark.benchmarks.tpcc.TPCCUtil; @@ -37,87 +36,97 @@ public class Payment extends TPCCProcedure { private static final Logger LOG = LoggerFactory.getLogger(Payment.class); - public SQLStmt payUpdateWhseSQL = new SQLStmt( - "/*monitor-payUpdateWhseSQL*/ " + - "UPDATE " + TPCCConstants.TABLENAME_WAREHOUSE + - " SET W_YTD = W_YTD + ? " + - " WHERE W_ID = ? "); - - public SQLStmt payGetWhseSQL = new SQLStmt( - "/*monitor-payGetWhseSQL*/ " + - "SELECT W_STREET_1, W_STREET_2, W_CITY, W_STATE, W_ZIP, W_NAME" + - " FROM " + TPCCConstants.TABLENAME_WAREHOUSE + - " WHERE W_ID = ?"); - - public SQLStmt payUpdateDistSQL = new SQLStmt( - "/*monitor-payUpdateDistSQL*/ " + - "UPDATE " + TPCCConstants.TABLENAME_DISTRICT + - " SET D_YTD = D_YTD + ? " + - " WHERE D_W_ID = ? " + - " AND D_ID = ?"); - - public SQLStmt payGetDistSQL = new SQLStmt( - "/*monitor-payGetDistSQL*/ " + - "SELECT D_STREET_1, D_STREET_2, D_CITY, D_STATE, D_ZIP, D_NAME" + - " FROM " + TPCCConstants.TABLENAME_DISTRICT + - " WHERE D_W_ID = ? " + - " AND D_ID = ?"); - - public SQLStmt payGetCustSQL = new SQLStmt( - "/*monitor-payGetCustSQL*/ " + - "SELECT C_FIRST, C_MIDDLE, C_LAST, C_STREET_1, C_STREET_2, " + - " C_CITY, C_STATE, C_ZIP, C_PHONE, C_CREDIT, C_CREDIT_LIM, " + - " C_DISCOUNT, C_BALANCE, C_YTD_PAYMENT, C_PAYMENT_CNT, C_SINCE " + - " FROM " + TPCCConstants.TABLENAME_CUSTOMER + - " WHERE C_W_ID = ? " + - " AND C_D_ID = ? " + - " AND C_ID = ?"); - - public SQLStmt payGetCustCdataSQL = new SQLStmt( - "/*monitor-payGetCustCdataSQL*/ " + - "SELECT C_DATA " + - " FROM " + TPCCConstants.TABLENAME_CUSTOMER + - " WHERE C_W_ID = ? " + - " AND C_D_ID = ? " + - " AND C_ID = ?"); - - public SQLStmt payUpdateCustBalCdataSQL = new SQLStmt( - "/*monitor-payUpdateCustBalCdataSQL*/ " + - "UPDATE " + TPCCConstants.TABLENAME_CUSTOMER + - " SET C_BALANCE = ?, " + - " C_YTD_PAYMENT = ?, " + - " C_PAYMENT_CNT = ?, " + - " C_DATA = ? " + - " WHERE C_W_ID = ? " + - " AND C_D_ID = ? " + - " AND C_ID = ?"); - - public SQLStmt payUpdateCustBalSQL = new SQLStmt( - "/*monitor-payUpdateCustBalSQL*/ " + - "UPDATE " + TPCCConstants.TABLENAME_CUSTOMER + - " SET C_BALANCE = ?, " + - " C_YTD_PAYMENT = ?, " + - " C_PAYMENT_CNT = ? " + - " WHERE C_W_ID = ? " + - " AND C_D_ID = ? " + - " AND C_ID = ?"); - - public SQLStmt payInsertHistSQL = new SQLStmt( - "/*monitor-payInsertHistSQL*/ " + - "INSERT INTO " + TPCCConstants.TABLENAME_HISTORY + - " (H_C_D_ID, H_C_W_ID, H_C_ID, H_D_ID, H_W_ID, H_DATE, H_AMOUNT, H_DATA) " + - " VALUES (?,?,?,?,?,?,?,?)"); - - public SQLStmt customerByNameSQL = new SQLStmt( - "/*monitor-customerByNameSQL*/ " + - "SELECT C_FIRST, C_MIDDLE, C_ID, C_STREET_1, C_STREET_2, C_CITY, " + - " C_STATE, C_ZIP, C_PHONE, C_CREDIT, C_CREDIT_LIM, C_DISCOUNT, " + - " C_BALANCE, C_YTD_PAYMENT, C_PAYMENT_CNT, C_SINCE " + - " FROM " + TPCCConstants.TABLENAME_CUSTOMER + - " WHERE C_W_ID = ? " + - " AND C_D_ID = ? " + - " AND C_LAST = ? " + - " ORDER BY C_FIRST"); + public String payUpdateWhseSQL = + """ + UPDATE %s + SET W_YTD = W_YTD + ? + WHERE W_ID = ? + """.formatted(TPCCConstants.TABLENAME_WAREHOUSE); + + public String payGetWhseSQL = + """ + SELECT W_STREET_1, W_STREET_2, W_CITY, W_STATE, W_ZIP, W_NAME + FROM %s + WHERE W_ID = ? + """.formatted(TPCCConstants.TABLENAME_WAREHOUSE); + + public String payUpdateDistSQL = + """ + UPDATE %s + SET D_YTD = D_YTD + ? + WHERE D_W_ID = ? + AND D_ID = ? + """.formatted(TPCCConstants.TABLENAME_DISTRICT); + + public String payGetDistSQL = + """ + SELECT D_STREET_1, D_STREET_2, D_CITY, D_STATE, D_ZIP, D_NAME + FROM %s + WHERE D_W_ID = ? + AND D_ID = ? + """.formatted(TPCCConstants.TABLENAME_DISTRICT); + + public String payGetCustSQL = + """ + SELECT C_FIRST, C_MIDDLE, C_LAST, C_STREET_1, C_STREET_2, + C_CITY, C_STATE, C_ZIP, C_PHONE, C_CREDIT, C_CREDIT_LIM, + C_DISCOUNT, C_BALANCE, C_YTD_PAYMENT, C_PAYMENT_CNT, C_SINCE + FROM %s + WHERE C_W_ID = ? + AND C_D_ID = ? + AND C_ID = ? + """.formatted(TPCCConstants.TABLENAME_CUSTOMER); + + public String payGetCustCdataSQL = + """ + SELECT C_DATA + FROM %s + WHERE C_W_ID = ? + AND C_D_ID = ? + AND C_ID = ? + """.formatted(TPCCConstants.TABLENAME_CUSTOMER); + + public String payUpdateCustBalCdataSQL = + """ + UPDATE %s + SET C_BALANCE = ?, + C_YTD_PAYMENT = ?, + C_PAYMENT_CNT = ?, + C_DATA = ? + WHERE C_W_ID = ? + AND C_D_ID = ? + AND C_ID = ? + """.formatted(TPCCConstants.TABLENAME_CUSTOMER); + + public String payUpdateCustBalSQL = + """ + UPDATE %s + SET C_BALANCE = ?, + C_YTD_PAYMENT = ?, + C_PAYMENT_CNT = ? + WHERE C_W_ID = ? + AND C_D_ID = ? + AND C_ID = ? + """.formatted(TPCCConstants.TABLENAME_CUSTOMER); + + public String payInsertHistSQL = + """ + INSERT INTO %s + + (H_C_D_ID, H_C_W_ID, H_C_ID, H_D_ID, H_W_ID, H_DATE, H_AMOUNT, H_DATA) + VALUES (?,?,?,?,?,?,?,?) + """.formatted(TPCCConstants.TABLENAME_HISTORY); + + public String customerByNameSQL = + """ + SELECT C_FIRST, C_MIDDLE, C_ID, C_STREET_1, C_STREET_2, C_CITY, + C_STATE, C_ZIP, C_PHONE, C_CREDIT, C_CREDIT_LIM, C_DISCOUNT, + C_BALANCE, C_YTD_PAYMENT, C_PAYMENT_CNT, C_SINCE + FROM %s + WHERE C_W_ID = ? + AND C_D_ID = ? + AND C_LAST = ? + ORDER BY C_FIRST + """.formatted(TPCCConstants.TABLENAME_CUSTOMER); public void run(Connection conn, Random gen, int w_id, int numWarehouses, int terminalDistrictLowerID, int terminalDistrictUpperID, TPCCWorker worker) throws SQLException { @@ -262,7 +271,7 @@ private int getCustomerDistrictId(Random gen, int districtID, int x) { } private void updateWarehouse(Connection conn, int w_id, float paymentAmount) throws SQLException { - try (PreparedStatement payUpdateWhse = this.getPreparedStatement(conn, payUpdateWhseSQL)) { + try (PreparedStatement payUpdateWhse = this.getPreparedStatement(conn, this.createSqlStatement(payUpdateWhseSQL,"payUpdateWhseSQL"))) { payUpdateWhse.setBigDecimal(1, BigDecimal.valueOf(paymentAmount)); payUpdateWhse.setInt(2, w_id); // MySQL reports deadlocks due to lock upgrades: @@ -275,7 +284,7 @@ private void updateWarehouse(Connection conn, int w_id, float paymentAmount) thr } private Warehouse getWarehouse(Connection conn, int w_id) throws SQLException { - try (PreparedStatement payGetWhse = this.getPreparedStatement(conn, payGetWhseSQL)) { + try (PreparedStatement payGetWhse = this.getPreparedStatement(conn, this.createSqlStatement(payGetWhseSQL,"payGetWhseSQL"))) { payGetWhse.setInt(1, w_id); try (ResultSet rs = payGetWhse.executeQuery()) { @@ -317,7 +326,7 @@ private Customer getCustomer(Connection conn, Random gen, int customerDistrictID } private void updateDistrict(Connection conn, int w_id, int districtID, float paymentAmount) throws SQLException { - try (PreparedStatement payUpdateDist = this.getPreparedStatement(conn, payUpdateDistSQL)) { + try (PreparedStatement payUpdateDist = this.getPreparedStatement(conn, this.createSqlStatement(payUpdateDistSQL,"payUpdateDistSQL"))) { payUpdateDist.setBigDecimal(1, BigDecimal.valueOf(paymentAmount)); payUpdateDist.setInt(2, w_id); payUpdateDist.setInt(3, districtID); @@ -331,7 +340,7 @@ private void updateDistrict(Connection conn, int w_id, int districtID, float pay } private District getDistrict(Connection conn, int w_id, int districtID) throws SQLException { - try (PreparedStatement payGetDist = this.getPreparedStatement(conn, payGetDistSQL)) { + try (PreparedStatement payGetDist = this.getPreparedStatement(conn, this.createSqlStatement(payGetDistSQL,"payGetDistSQL"))) { payGetDist.setInt(1, w_id); payGetDist.setInt(2, districtID); @@ -355,7 +364,7 @@ private District getDistrict(Connection conn, int w_id, int districtID) throws S private String getCData(Connection conn, int w_id, int districtID, int customerDistrictID, int customerWarehouseID, float paymentAmount, Customer c) throws SQLException { - try (PreparedStatement payGetCustCdata = this.getPreparedStatement(conn, payGetCustCdataSQL)) { + try (PreparedStatement payGetCustCdata = this.getPreparedStatement(conn, this.createSqlStatement(payGetCustCdataSQL,"payGetCustCdataSQL"))) { String c_data; payGetCustCdata.setInt(1, customerWarehouseID); payGetCustCdata.setInt(2, customerDistrictID); @@ -378,7 +387,7 @@ private String getCData(Connection conn, int w_id, int districtID, int customerD } private void updateBalanceCData(Connection conn, int customerDistrictID, int customerWarehouseID, Customer c) throws SQLException { - try (PreparedStatement payUpdateCustBalCdata = this.getPreparedStatement(conn, payUpdateCustBalCdataSQL)) { + try (PreparedStatement payUpdateCustBalCdata = this.getPreparedStatement(conn, this.createSqlStatement(payUpdateCustBalCdataSQL,"payUpdateCustBalCdataSQL"))) { payUpdateCustBalCdata.setDouble(1, c.c_balance); payUpdateCustBalCdata.setDouble(2, c.c_ytd_payment); payUpdateCustBalCdata.setInt(3, c.c_payment_cnt); @@ -397,7 +406,7 @@ private void updateBalanceCData(Connection conn, int customerDistrictID, int cus private void updateBalance(Connection conn, int customerDistrictID, int customerWarehouseID, Customer c) throws SQLException { - try (PreparedStatement payUpdateCustBal = this.getPreparedStatement(conn, payUpdateCustBalSQL)) { + try (PreparedStatement payUpdateCustBal = this.getPreparedStatement(conn, this.createSqlStatement(payUpdateCustBalSQL,"payUpdateCustBalSQL"))) { payUpdateCustBal.setDouble(1, c.c_balance); payUpdateCustBal.setDouble(2, c.c_ytd_payment); payUpdateCustBal.setInt(3, c.c_payment_cnt); @@ -422,7 +431,7 @@ private void insertHistory(Connection conn, int w_id, int districtID, int custom } String h_data = w_name + " " + d_name; - try (PreparedStatement payInsertHist = this.getPreparedStatement(conn, payInsertHistSQL)) { + try (PreparedStatement payInsertHist = this.getPreparedStatement(conn, this.createSqlStatement(payInsertHistSQL,"payInsertHistSQL"))) { payInsertHist.setInt(1, customerDistrictID); payInsertHist.setInt(2, customerWarehouseID); payInsertHist.setInt(3, c.c_id); @@ -439,7 +448,7 @@ private void insertHistory(Connection conn, int w_id, int districtID, int custom // prepared statements public Customer getCustomerById(int c_w_id, int c_d_id, int c_id, Connection conn) throws SQLException { - try (PreparedStatement payGetCust = this.getPreparedStatement(conn, payGetCustSQL)) { + try (PreparedStatement payGetCust = this.getPreparedStatement(conn, this.createSqlStatement(payGetCustSQL,"payGetCustSQL"))) { payGetCust.setInt(1, c_w_id); payGetCust.setInt(2, c_d_id); @@ -463,7 +472,7 @@ public Customer getCustomerById(int c_w_id, int c_d_id, int c_id, Connection con public Customer getCustomerByName(int c_w_id, int c_d_id, String customerLastName, Connection conn) throws SQLException { ArrayList customers = new ArrayList<>(); - try (PreparedStatement customerByName = this.getPreparedStatement(conn, customerByNameSQL)) { + try (PreparedStatement customerByName = this.getPreparedStatement(conn, this.createSqlStatement(customerByNameSQL,"customerByNameSQL"))) { customerByName.setInt(1, c_w_id); customerByName.setInt(2, c_d_id); diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/StockLevel.java b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/StockLevel.java index 4b4834ba0..d08b810b4 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/StockLevel.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/StockLevel.java @@ -17,7 +17,6 @@ package com.oltpbenchmark.benchmarks.tpcc.procedures; -import com.oltpbenchmark.api.SQLStmt; import com.oltpbenchmark.benchmarks.tpcc.TPCCConstants; import com.oltpbenchmark.benchmarks.tpcc.TPCCUtil; import com.oltpbenchmark.benchmarks.tpcc.TPCCWorker; @@ -34,24 +33,26 @@ public class StockLevel extends TPCCProcedure { private static final Logger LOG = LoggerFactory.getLogger(StockLevel.class); - public SQLStmt stockGetDistOrderIdSQL = new SQLStmt( - "/*monitor-stockGetDistOrderIdSQL*/ " + - "SELECT D_NEXT_O_ID " + - " FROM " + TPCCConstants.TABLENAME_DISTRICT + - " WHERE D_W_ID = ? " + - " AND D_ID = ?"); - - public SQLStmt stockGetCountStockSQL = new SQLStmt( - "/*monitor-stockGetCountStockSQL*/ " + - "SELECT COUNT(DISTINCT (S_I_ID)) AS STOCK_COUNT " + - " FROM " + TPCCConstants.TABLENAME_ORDERLINE + ", " + TPCCConstants.TABLENAME_STOCK + - " WHERE OL_W_ID = ?" + - " AND OL_D_ID = ?" + - " AND OL_O_ID < ?" + - " AND OL_O_ID >= ?" + - " AND S_W_ID = ?" + - " AND S_I_ID = OL_I_ID" + - " AND S_QUANTITY < ?"); + public String stockGetDistOrderIdSQL = + """ + SELECT D_NEXT_O_ID + FROM %s + WHERE D_W_ID = ? + AND D_ID = ? + """.formatted(TPCCConstants.TABLENAME_DISTRICT); + + public String stockGetCountStockSQL = + """ + SELECT COUNT(DISTINCT (S_I_ID)) AS STOCK_COUNT + FROM %s, %s + WHERE OL_W_ID = ? + AND OL_D_ID = ? + AND OL_O_ID < ? + AND OL_O_ID >= ? + AND S_W_ID = ? + AND S_I_ID = OL_I_ID + AND S_QUANTITY < ? + """.formatted(TPCCConstants.TABLENAME_ORDERLINE, TPCCConstants.TABLENAME_STOCK); public void run(Connection conn, Random gen, int w_id, int numWarehouses, int terminalDistrictLowerID, int terminalDistrictUpperID, TPCCWorker w) throws SQLException { @@ -80,7 +81,7 @@ public void run(Connection conn, Random gen, int w_id, int numWarehouses, int te } private int getOrderId(Connection conn, int w_id, int d_id) throws SQLException { - try (PreparedStatement stockGetDistOrderId = this.getPreparedStatement(conn, stockGetDistOrderIdSQL)) { + try (PreparedStatement stockGetDistOrderId = this.getPreparedStatement(conn, this.createSqlStatement(stockGetDistOrderIdSQL,"stockGetDistOrderIdSQL"))) { stockGetDistOrderId.setInt(1, w_id); stockGetDistOrderId.setInt(2, d_id); @@ -96,7 +97,7 @@ private int getOrderId(Connection conn, int w_id, int d_id) throws SQLException } private int getStockCount(Connection conn, int w_id, int threshold, int d_id, int o_id) throws SQLException { - try (PreparedStatement stockGetCountStock = this.getPreparedStatement(conn, stockGetCountStockSQL)) { + try (PreparedStatement stockGetCountStock = this.getPreparedStatement(conn, this.createSqlStatement(stockGetCountStockSQL,"stockGetCountStockSQL"))) { stockGetCountStock.setInt(1, w_id); stockGetCountStock.setInt(2, d_id); stockGetCountStock.setInt(3, o_id); diff --git a/src/main/java/com/oltpbenchmark/types/DatabaseType.java b/src/main/java/com/oltpbenchmark/types/DatabaseType.java index 00e3d2b74..1e4515127 100644 --- a/src/main/java/com/oltpbenchmark/types/DatabaseType.java +++ b/src/main/java/com/oltpbenchmark/types/DatabaseType.java @@ -35,7 +35,7 @@ public enum DatabaseType { DB2(true, false), H2(true, false), HSQLDB(false, false), - POSTGRES(false, false, true), + POSTGRES(false, false, true, true), MARIADB(true, false), MONETDB(false, false), MYROCKS(true, false), @@ -47,19 +47,24 @@ public enum DatabaseType { SPANNER(false, true), SQLAZURE(true, true, true), SQLITE(true, false), - SQLSERVER(true, true, true), + SQLSERVER(true, true, true, true), TIMESTEN(true, false), PHOENIX(true, true); - DatabaseType(boolean escapeNames, boolean includeColNames, boolean loadNeedsUpdateColumnSequence) { + DatabaseType(boolean escapeNames, boolean includeColNames, boolean loadNeedsUpdateColumnSequence, boolean needsMonitoringPrefix) { this.escapeNames = escapeNames; this.includeColNames = includeColNames; this.loadNeedsUpdateColumnSequence = loadNeedsUpdateColumnSequence; + this.needsMonitoringPrefix = needsMonitoringPrefix; + } + + DatabaseType(boolean escapeNames, boolean includeColNames, boolean loadNeedsUpdateColumnSequence) { + this(escapeNames, includeColNames, loadNeedsUpdateColumnSequence, false); } DatabaseType(boolean escapeNames, boolean includeColNames) { - this(escapeNames, includeColNames, false); + this(escapeNames, includeColNames, false, false); } /** @@ -80,6 +85,12 @@ public enum DatabaseType { */ private final boolean loadNeedsUpdateColumnSequence; + /** + * If this flag is set to true, the framework will add a monitoring prefix + * to each query. + */ + private final boolean needsMonitoringPrefix; + // --------------------------------------------------------------- // ACCESSORS @@ -109,6 +120,14 @@ public boolean shouldUpdateColumnSequenceAfterLoad() { return (this.loadNeedsUpdateColumnSequence); } + /** + * @return True if the framework should add a monitoring prefix to each + * query. + */ + public boolean shouldCreateMonitoringPrefix() { + return (this.needsMonitoringPrefix); + } + // ---------------------------------------------------------------- // STATIC METHODS + MEMBERS // ---------------------------------------------------------------- diff --git a/src/main/java/com/oltpbenchmark/util/MonitoringUtil.java b/src/main/java/com/oltpbenchmark/util/MonitoringUtil.java new file mode 100644 index 000000000..999d497ec --- /dev/null +++ b/src/main/java/com/oltpbenchmark/util/MonitoringUtil.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 by OLTPBenchmark Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.oltpbenchmark.util; + +public abstract class MonitoringUtil { + + private final static String MONITORING_PREFIX = "/* MONITOR-$queryId */"; + private final static String MONITORING_QUERYID = "$queryId"; + private final static String MONITORING_SPLIT_PREFIX = "/* "; + private final static String MONITORING_SPLIT_SUFFIX = " */"; + + /** + * Universal monitoring prefix. + */ + public static String getMonitoringPrefix() { + return MonitoringUtil.MONITORING_PREFIX; + } + + /** + * Query identifier in monitoring prefix. + */ + public static String getMonitoringQueryId() { + return MonitoringUtil.MONITORING_QUERYID; + } + + /** + * Comment split prefix. + */ + public static String getMonitoringSplitPrefix() { + return MonitoringUtil.MONITORING_SPLIT_PREFIX; + } + + /** + * Comment split suffix. + */ + public static String getMonitoringSplitSuffix() { + return MonitoringUtil.MONITORING_SPLIT_SUFFIX; + } +} From 442a2aa680b994f079672af01e9d396f18011f7c Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Wed, 26 Apr 2023 13:21:32 +0200 Subject: [PATCH 19/67] Bugfix for wrong monitoring type. --- src/main/java/com/oltpbenchmark/DBWorkload.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/oltpbenchmark/DBWorkload.java b/src/main/java/com/oltpbenchmark/DBWorkload.java index 01cd8cece..fb97bea22 100644 --- a/src/main/java/com/oltpbenchmark/DBWorkload.java +++ b/src/main/java/com/oltpbenchmark/DBWorkload.java @@ -159,7 +159,7 @@ public static void main(String[] args) throws Exception { } // Set monitoring enabled, if all requirements are met. - if (monitorInfo.getMonitoringInterval()>0 && monitorInfo.getMonitoringType()==MonitoringType.THROUGHPUT) { + if (monitorInfo.getMonitoringInterval()>0 && monitorInfo.getMonitoringType()==MonitoringType.ADVANCED) { wrkld.setMonitoringEnabled(true); } From 778db5cb13644627c52c2aa4b73479db8be4cd15 Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Wed, 26 Apr 2023 13:41:38 +0200 Subject: [PATCH 20/67] Adjust SqlStmt usage to be dialect-compliant. --- .../java/com/oltpbenchmark/api/Procedure.java | 13 ++-- .../java/com/oltpbenchmark/api/SQLStmt.java | 20 +++--- .../benchmarks/tpcc/procedures/Delivery.java | 43 ++++++------- .../benchmarks/tpcc/procedures/NewOrder.java | 61 ++++++++++--------- .../tpcc/procedures/OrderStatus.java | 25 ++++---- .../benchmarks/tpcc/procedures/Payment.java | 61 ++++++++++--------- .../tpcc/procedures/StockLevel.java | 13 ++-- .../benchmarks/tpcc/dialect-sqlserver.xml | 4 -- 8 files changed, 118 insertions(+), 122 deletions(-) diff --git a/src/main/java/com/oltpbenchmark/api/Procedure.java b/src/main/java/com/oltpbenchmark/api/Procedure.java index a388b9efe..099150cf2 100644 --- a/src/main/java/com/oltpbenchmark/api/Procedure.java +++ b/src/main/java/com/oltpbenchmark/api/Procedure.java @@ -77,16 +77,15 @@ protected final String getProcedureName() { } /** - * Create a SQLStmt from a query statement. If monitoring is enabled, - * add monitoring prefix. + * Finalizes a query statement. If monitoring is enabled, this method will + * add a monitoring prefix. */ - protected SQLStmt createSqlStatement(String query, String queryId) { - String finalQuery = ""; + protected SQLStmt finalizeSqlStatement(SQLStmt stmt, String queryId) { + SQLStmt finalStmt = stmt; if (this.getMonitoringEnabled()) { - finalQuery = MonitoringUtil.getMonitoringPrefix().replace("$queryId", queryId); + finalStmt.addPrefix(MonitoringUtil.getMonitoringPrefix().replace("$queryId", queryId)); } - finalQuery += query; - return new SQLStmt(finalQuery); + return finalStmt; } /** diff --git a/src/main/java/com/oltpbenchmark/api/SQLStmt.java b/src/main/java/com/oltpbenchmark/api/SQLStmt.java index 95bfdb05f..8498ece52 100644 --- a/src/main/java/com/oltpbenchmark/api/SQLStmt.java +++ b/src/main/java/com/oltpbenchmark/api/SQLStmt.java @@ -54,18 +54,6 @@ public SQLStmt(String sql, int... substitutions) { this.setSQL(sql); } - /** - * Constructor with monitoring prefix. - * - * @param sql - * @param monitoringPrefix - * @param substitutions - */ - public SQLStmt(String sql, String monitoringPrefix, int... substitutions) { - this.substitutions = substitutions; - this.setSQL(monitoringPrefix + sql); - } - /** * Magic SQL setter! * Each occurrence of the pattern "??" will be replaced by a string @@ -90,6 +78,14 @@ public final void setSQL(String sql) { } } + /** + * Adds a prefix to the query string. + * @param prefix + */ + public final void addPrefix(String prefix) { + this.setSQL(prefix + sql); + } + public final String getSQL() { return (this.sql); } diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Delivery.java b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Delivery.java index 784176fa2..ce65e5888 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Delivery.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Delivery.java @@ -17,6 +17,7 @@ package com.oltpbenchmark.benchmarks.tpcc.procedures; +import com.oltpbenchmark.api.SQLStmt; import com.oltpbenchmark.benchmarks.tpcc.TPCCConfig; import com.oltpbenchmark.benchmarks.tpcc.TPCCConstants; import com.oltpbenchmark.benchmarks.tpcc.TPCCUtil; @@ -32,59 +33,59 @@ public class Delivery extends TPCCProcedure { private static final Logger LOG = LoggerFactory.getLogger(Delivery.class); - public String delivGetOrderIdSQL = + public SQLStmt delivGetOrderIdSQL = new SQLStmt( """ SELECT NO_O_ID FROM %s WHERE NO_D_ID = ? AND NO_W_ID = ? ORDER BY NO_O_ID ASC LIMIT 1) - """.formatted(TPCCConstants.TABLENAME_NEWORDER); + """.formatted(TPCCConstants.TABLENAME_NEWORDER)); - public String delivDeleteNewOrderSQL = + public SQLStmt delivDeleteNewOrderSQL = new SQLStmt( """ DELETE FROM %s WHERE NO_O_ID = ? AND NO_D_ID = ? AND NO_W_ID = ? - """.formatted(TPCCConstants.TABLENAME_NEWORDER); + """.formatted(TPCCConstants.TABLENAME_NEWORDER)); - public String delivGetCustIdSQL = + public SQLStmt delivGetCustIdSQL = new SQLStmt( """ SELECT O_C_ID FROM %s WHERE O_ID = ? AND O_D_ID = ? AND O_W_ID = ? - """.formatted(TPCCConstants.TABLENAME_OPENORDER); + """.formatted(TPCCConstants.TABLENAME_OPENORDER)); - public String delivUpdateCarrierIdSQL = + public SQLStmt delivUpdateCarrierIdSQL = new SQLStmt( """ UPDATE %s SET O_CARRIER_ID = ? WHERE O_ID = ? AND O_D_ID = ? AND O_W_ID = ? - """.formatted(TPCCConstants.TABLENAME_OPENORDER); + """.formatted(TPCCConstants.TABLENAME_OPENORDER)); - public String delivUpdateDeliveryDateSQL = + public SQLStmt delivUpdateDeliveryDateSQL = new SQLStmt( """ UPDATE %s SET OL_DELIVERY_D = ? WHERE OL_O_ID = ? AND OL_D_ID = ? AND OL_W_ID = ? - """.formatted(TPCCConstants.TABLENAME_ORDERLINE); + """.formatted(TPCCConstants.TABLENAME_ORDERLINE)); - public String delivSumOrderAmountSQL = + public SQLStmt delivSumOrderAmountSQL = new SQLStmt( """ SELECT SUM(OL_AMOUNT) AS OL_TOTAL FROM %s WHERE OL_O_ID = ? AND OL_D_ID = ? AND OL_W_ID = ? - """.formatted(TPCCConstants.TABLENAME_ORDERLINE); + """.formatted(TPCCConstants.TABLENAME_ORDERLINE)); - public String delivUpdateCustBalDelivCntSQL = + public SQLStmt delivUpdateCustBalDelivCntSQL = new SQLStmt( """ UPDATE %s SET C_BALANCE = C_BALANCE + ?, @@ -92,7 +93,7 @@ SELECT SUM(OL_AMOUNT) AS OL_TOTAL WHERE C_W_ID = ? AND C_D_ID = ? AND C_ID = ? - """.formatted(TPCCConstants.TABLENAME_CUSTOMER); + """.formatted(TPCCConstants.TABLENAME_CUSTOMER)); public void run(Connection conn, Random gen, int w_id, int numWarehouses, int terminalDistrictLowerID, int terminalDistrictUpperID, TPCCWorker w) throws SQLException { @@ -152,7 +153,7 @@ public void run(Connection conn, Random gen, int w_id, int numWarehouses, int te private Integer getOrderId(Connection conn, int w_id, int d_id) throws SQLException { - try (PreparedStatement delivGetOrderId = this.getPreparedStatement(conn, this.createSqlStatement(delivGetOrderIdSQL, "delivGetOrderIdSQL"))) { + try (PreparedStatement delivGetOrderId = this.getPreparedStatement(conn, this.finalizeSqlStatement(delivGetOrderIdSQL, "delivGetOrderIdSQL"))) { delivGetOrderId.setInt(1, d_id); delivGetOrderId.setInt(2, w_id); @@ -173,7 +174,7 @@ private Integer getOrderId(Connection conn, int w_id, int d_id) throws SQLExcept } private void deleteOrder(Connection conn, int w_id, int d_id, int no_o_id) throws SQLException { - try (PreparedStatement delivDeleteNewOrder = this.getPreparedStatement(conn, this.createSqlStatement(delivDeleteNewOrderSQL, "delivDeleteNewOrderSQL"))) { + try (PreparedStatement delivDeleteNewOrder = this.getPreparedStatement(conn, this.finalizeSqlStatement(delivDeleteNewOrderSQL, "delivDeleteNewOrderSQL"))) { delivDeleteNewOrder.setInt(1, no_o_id); delivDeleteNewOrder.setInt(2, d_id); delivDeleteNewOrder.setInt(3, w_id); @@ -194,7 +195,7 @@ private void deleteOrder(Connection conn, int w_id, int d_id, int no_o_id) throw private int getCustomerId(Connection conn, int w_id, int d_id, int no_o_id) throws SQLException { - try (PreparedStatement delivGetCustId = this.getPreparedStatement(conn, this.createSqlStatement(delivGetCustIdSQL, "delivGetCustIdSQL"))) { + try (PreparedStatement delivGetCustId = this.getPreparedStatement(conn, this.finalizeSqlStatement(delivGetCustIdSQL, "delivGetCustIdSQL"))) { delivGetCustId.setInt(1, no_o_id); delivGetCustId.setInt(2, d_id); delivGetCustId.setInt(3, w_id); @@ -212,7 +213,7 @@ private int getCustomerId(Connection conn, int w_id, int d_id, int no_o_id) thro } private void updateCarrierId(Connection conn, int w_id, int o_carrier_id, int d_id, int no_o_id) throws SQLException { - try (PreparedStatement delivUpdateCarrierId = this.getPreparedStatement(conn, this.createSqlStatement(delivUpdateCarrierIdSQL, "delivUpdateCarrierIdSQL"))) { + try (PreparedStatement delivUpdateCarrierId = this.getPreparedStatement(conn, this.finalizeSqlStatement(delivUpdateCarrierIdSQL, "delivUpdateCarrierIdSQL"))) { delivUpdateCarrierId.setInt(1, o_carrier_id); delivUpdateCarrierId.setInt(2, no_o_id); delivUpdateCarrierId.setInt(3, d_id); @@ -230,7 +231,7 @@ private void updateCarrierId(Connection conn, int w_id, int o_carrier_id, int d_ private void updateDeliveryDate(Connection conn, int w_id, int d_id, int no_o_id) throws SQLException { Timestamp timestamp = new Timestamp(System.currentTimeMillis()); - try (PreparedStatement delivUpdateDeliveryDate = this.getPreparedStatement(conn, this.createSqlStatement(delivUpdateDeliveryDateSQL, "delivUpdateDeliveryDateSQL"))) { + try (PreparedStatement delivUpdateDeliveryDate = this.getPreparedStatement(conn, this.finalizeSqlStatement(delivUpdateDeliveryDateSQL, "delivUpdateDeliveryDateSQL"))) { delivUpdateDeliveryDate.setTimestamp(1, timestamp); delivUpdateDeliveryDate.setInt(2, no_o_id); delivUpdateDeliveryDate.setInt(3, d_id); @@ -246,7 +247,7 @@ private void updateDeliveryDate(Connection conn, int w_id, int d_id, int no_o_id } private float getOrderLineTotal(Connection conn, int w_id, int d_id, int no_o_id) throws SQLException { - try (PreparedStatement delivSumOrderAmount = this.getPreparedStatement(conn, this.createSqlStatement(delivSumOrderAmountSQL, "delivSumOrderAmountSQL"))) { + try (PreparedStatement delivSumOrderAmount = this.getPreparedStatement(conn, this.finalizeSqlStatement(delivSumOrderAmountSQL, "delivSumOrderAmountSQL"))) { delivSumOrderAmount.setInt(1, no_o_id); delivSumOrderAmount.setInt(2, d_id); delivSumOrderAmount.setInt(3, w_id); @@ -264,7 +265,7 @@ private float getOrderLineTotal(Connection conn, int w_id, int d_id, int no_o_id private void updateBalanceAndDelivery(Connection conn, int w_id, int d_id, int c_id, float orderLineTotal) throws SQLException { - try (PreparedStatement delivUpdateCustBalDelivCnt = this.getPreparedStatement(conn, this.createSqlStatement(delivUpdateCustBalDelivCntSQL, "delivUpdateCustBalDelivCntSQL"))) { + try (PreparedStatement delivUpdateCustBalDelivCnt = this.getPreparedStatement(conn, this.finalizeSqlStatement(delivUpdateCustBalDelivCntSQL, "delivUpdateCustBalDelivCntSQL"))) { delivUpdateCustBalDelivCnt.setBigDecimal(1, BigDecimal.valueOf(orderLineTotal)); delivUpdateCustBalDelivCnt.setInt(2, w_id); delivUpdateCustBalDelivCnt.setInt(3, d_id); diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/NewOrder.java b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/NewOrder.java index 7a59a80c4..a960e93f3 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/NewOrder.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/NewOrder.java @@ -17,6 +17,7 @@ package com.oltpbenchmark.benchmarks.tpcc.procedures; +import com.oltpbenchmark.api.SQLStmt; import com.oltpbenchmark.benchmarks.tpcc.TPCCConfig; import com.oltpbenchmark.benchmarks.tpcc.TPCCConstants; import com.oltpbenchmark.benchmarks.tpcc.TPCCUtil; @@ -32,68 +33,68 @@ public class NewOrder extends TPCCProcedure { private static final Logger LOG = LoggerFactory.getLogger(NewOrder.class); - public final String stmtGetCustSQL = + public final SQLStmt stmtGetCustSQL = new SQLStmt( """ SELECT C_DISCOUNT, C_LAST, C_CREDIT FROM %s WHERE C_W_ID = ? AND C_D_ID = ? AND C_ID = ? - """.formatted(TPCCConstants.TABLENAME_CUSTOMER); + """.formatted(TPCCConstants.TABLENAME_CUSTOMER)); - public final String stmtGetWhseSQL = + public final SQLStmt stmtGetWhseSQL = new SQLStmt( """ SELECT W_TAX FROM %s WHERE W_ID = ? - """.formatted(TPCCConstants.TABLENAME_WAREHOUSE); + """.formatted(TPCCConstants.TABLENAME_WAREHOUSE)); - public final String stmtGetDistSQL = + public final SQLStmt stmtGetDistSQL = new SQLStmt( """ SELECT D_NEXT_O_ID, D_TAX FROM %s WHERE D_W_ID = ? AND D_ID = ? FOR UPDATE - """.formatted(TPCCConstants.TABLENAME_DISTRICT); + """.formatted(TPCCConstants.TABLENAME_DISTRICT)); - public final String stmtInsertNewOrderSQL = + public final SQLStmt stmtInsertNewOrderSQL = new SQLStmt( """ INSERT INTO %s + (NO_O_ID, NO_D_ID, NO_W_ID) VALUES ( ?, ?, ?) - """.formatted(TPCCConstants.TABLENAME_NEWORDER); + """.formatted(TPCCConstants.TABLENAME_NEWORDER)); - public final String stmtUpdateDistSQL = + public final SQLStmt stmtUpdateDistSQL = new SQLStmt( """ UPDATE %s + SET D_NEXT_O_ID = D_NEXT_O_ID + 1 WHERE D_W_ID = ? AND D_ID = ? - """.formatted(TPCCConstants.TABLENAME_DISTRICT); + """.formatted(TPCCConstants.TABLENAME_DISTRICT)); - public final String stmtInsertOOrderSQL = + public final SQLStmt stmtInsertOOrderSQL = new SQLStmt( """ INSERT INTO %s + (O_ID, O_D_ID, O_W_ID, O_C_ID, O_ENTRY_D, O_OL_CNT, O_ALL_LOCAL) VALUES (?, ?, ?, ?, ?, ?, ?) - """.formatted(TPCCConstants.TABLENAME_OPENORDER); + """.formatted(TPCCConstants.TABLENAME_OPENORDER)); - public final String stmtGetItemSQL = + public final SQLStmt stmtGetItemSQL = new SQLStmt( """ SELECT I_PRICE, I_NAME , I_DATA FROM %s + WHERE I_ID = ? - """.formatted(TPCCConstants.TABLENAME_ITEM); + """.formatted(TPCCConstants.TABLENAME_ITEM)); - public final String stmtGetStockSQL = + public final SQLStmt stmtGetStockSQL = new SQLStmt( """ SELECT S_QUANTITY, S_DATA, S_DIST_01, S_DIST_02, S_DIST_03, S_DIST_04, S_DIST_05, S_DIST_06, S_DIST_07, S_DIST_08, S_DIST_09, S_DIST_10 FROM %s + WHERE S_I_ID = ? AND S_W_ID = ? FOR UPDATE - """.formatted(TPCCConstants.TABLENAME_STOCK); + """.formatted(TPCCConstants.TABLENAME_STOCK)); - public final String stmtUpdateStockSQL = + public final SQLStmt stmtUpdateStockSQL = new SQLStmt( """ UPDATE %s + SET S_QUANTITY = ? , @@ -102,14 +103,14 @@ public class NewOrder extends TPCCProcedure { S_REMOTE_CNT = S_REMOTE_CNT + ? WHERE S_I_ID = ? AND S_W_ID = ? - """.formatted(TPCCConstants.TABLENAME_STOCK); + """.formatted(TPCCConstants.TABLENAME_STOCK)); - public final String stmtInsertOrderLineSQL = + public final SQLStmt stmtInsertOrderLineSQL = new SQLStmt( """ INSERT INTO %s + (OL_O_ID, OL_D_ID, OL_W_ID, OL_NUMBER, OL_I_ID, OL_SUPPLY_W_ID, OL_QUANTITY, OL_AMOUNT, OL_DIST_INFO) VALUES (?,?,?,?,?,?,?,?,?) - """.formatted(TPCCConstants.TABLENAME_ORDERLINE); + """.formatted(TPCCConstants.TABLENAME_ORDERLINE)); public void run(Connection conn, Random gen, int terminalWarehouseID, int numWarehouses, int terminalDistrictLowerID, int terminalDistrictUpperID, TPCCWorker w) throws SQLException { @@ -164,8 +165,8 @@ private void newOrderTransaction(int w_id, int d_id, int c_id, insertNewOrder(conn, w_id, d_id, d_next_o_id); - try (PreparedStatement stmtUpdateStock = this.getPreparedStatement(conn, this.createSqlStatement(stmtUpdateStockSQL,"stmtUpdateStockSQL")); - PreparedStatement stmtInsertOrderLine = this.getPreparedStatement(conn, this.createSqlStatement(stmtInsertOrderLineSQL,"stmtInsertOrderLineSQL"))) { + try (PreparedStatement stmtUpdateStock = this.getPreparedStatement(conn, this.finalizeSqlStatement(stmtUpdateStockSQL,"stmtUpdateStockSQL")); + PreparedStatement stmtInsertOrderLine = this.getPreparedStatement(conn, this.finalizeSqlStatement(stmtInsertOrderLineSQL,"stmtInsertOrderLineSQL"))) { for (int ol_number = 1; ol_number <= o_ol_cnt; ol_number++) { int ol_supply_w_id = supplierWarehouseIDs[ol_number - 1]; @@ -236,7 +237,7 @@ private String getDistInfo(int d_id, Stock s) { } private Stock getStock(Connection conn, int ol_supply_w_id, int ol_i_id, int ol_quantity) throws SQLException { - try (PreparedStatement stmtGetStock = this.getPreparedStatement(conn, this.createSqlStatement(stmtGetStockSQL,"stmtGetStockSQL"))) { + try (PreparedStatement stmtGetStock = this.getPreparedStatement(conn, this.finalizeSqlStatement(stmtGetStockSQL,"stmtGetStockSQL"))) { stmtGetStock.setInt(1, ol_i_id); stmtGetStock.setInt(2, ol_supply_w_id); try (ResultSet rs = stmtGetStock.executeQuery()) { @@ -268,7 +269,7 @@ private Stock getStock(Connection conn, int ol_supply_w_id, int ol_i_id, int ol_ } private float getItemPrice(Connection conn, int ol_i_id) throws SQLException { - try (PreparedStatement stmtGetItem = this.getPreparedStatement(conn, this.createSqlStatement(stmtGetItemSQL,"stmtGetItemSQL"))) { + try (PreparedStatement stmtGetItem = this.getPreparedStatement(conn, this.finalizeSqlStatement(stmtGetItemSQL,"stmtGetItemSQL"))) { stmtGetItem.setInt(1, ol_i_id); try (ResultSet rs = stmtGetItem.executeQuery()) { if (!rs.next()) { @@ -282,7 +283,7 @@ private float getItemPrice(Connection conn, int ol_i_id) throws SQLException { } private void insertNewOrder(Connection conn, int w_id, int d_id, int o_id) throws SQLException { - try (PreparedStatement stmtInsertNewOrder = this.getPreparedStatement(conn, this.createSqlStatement(stmtInsertNewOrderSQL,"stmtInsertNewOrderSQL"));) { + try (PreparedStatement stmtInsertNewOrder = this.getPreparedStatement(conn, this.finalizeSqlStatement(stmtInsertNewOrderSQL,"stmtInsertNewOrderSQL"));) { stmtInsertNewOrder.setInt(1, o_id); stmtInsertNewOrder.setInt(2, d_id); stmtInsertNewOrder.setInt(3, w_id); @@ -295,7 +296,7 @@ private void insertNewOrder(Connection conn, int w_id, int d_id, int o_id) throw } private void insertOpenOrder(Connection conn, int w_id, int d_id, int c_id, int o_ol_cnt, int o_all_local, int o_id) throws SQLException { - try (PreparedStatement stmtInsertOOrder = this.getPreparedStatement(conn, this.createSqlStatement(stmtInsertOOrderSQL,"stmtInsertOOrderSQL"));) { + try (PreparedStatement stmtInsertOOrder = this.getPreparedStatement(conn, this.finalizeSqlStatement(stmtInsertOOrderSQL,"stmtInsertOOrderSQL"));) { stmtInsertOOrder.setInt(1, o_id); stmtInsertOOrder.setInt(2, d_id); stmtInsertOOrder.setInt(3, w_id); @@ -313,7 +314,7 @@ private void insertOpenOrder(Connection conn, int w_id, int d_id, int c_id, int } private void updateDistrict(Connection conn, int w_id, int d_id) throws SQLException { - try (PreparedStatement stmtUpdateDist = this.getPreparedStatement(conn, this.createSqlStatement(stmtUpdateDistSQL,"stmtUpdateDistSQL"))) { + try (PreparedStatement stmtUpdateDist = this.getPreparedStatement(conn, this.finalizeSqlStatement(stmtUpdateDistSQL,"stmtUpdateDistSQL"))) { stmtUpdateDist.setInt(1, w_id); stmtUpdateDist.setInt(2, d_id); int result = stmtUpdateDist.executeUpdate(); @@ -324,7 +325,7 @@ private void updateDistrict(Connection conn, int w_id, int d_id) throws SQLExcep } private int getDistrict(Connection conn, int w_id, int d_id) throws SQLException { - try (PreparedStatement stmtGetDist = this.getPreparedStatement(conn, this.createSqlStatement(stmtGetDistSQL,"stmtGetDistSQL"))) { + try (PreparedStatement stmtGetDist = this.getPreparedStatement(conn, this.finalizeSqlStatement(stmtGetDistSQL,"stmtGetDistSQL"))) { stmtGetDist.setInt(1, w_id); stmtGetDist.setInt(2, d_id); try (ResultSet rs = stmtGetDist.executeQuery()) { @@ -337,7 +338,7 @@ private int getDistrict(Connection conn, int w_id, int d_id) throws SQLException } private void getWarehouse(Connection conn, int w_id) throws SQLException { - try (PreparedStatement stmtGetWhse = this.getPreparedStatement(conn, this.createSqlStatement(stmtGetWhseSQL,"stmtGetWhseSQL"))) { + try (PreparedStatement stmtGetWhse = this.getPreparedStatement(conn, this.finalizeSqlStatement(stmtGetWhseSQL,"stmtGetWhseSQL"))) { stmtGetWhse.setInt(1, w_id); try (ResultSet rs = stmtGetWhse.executeQuery()) { if (!rs.next()) { @@ -348,7 +349,7 @@ private void getWarehouse(Connection conn, int w_id) throws SQLException { } private void getCustomer(Connection conn, int w_id, int d_id, int c_id) throws SQLException { - try (PreparedStatement stmtGetCust = this.getPreparedStatement(conn, this.createSqlStatement(stmtGetCustSQL,"stmtGetCustSQL"))) { + try (PreparedStatement stmtGetCust = this.getPreparedStatement(conn, this.finalizeSqlStatement(stmtGetCustSQL,"stmtGetCustSQL"))) { stmtGetCust.setInt(1, w_id); stmtGetCust.setInt(2, d_id); stmtGetCust.setInt(3, c_id); diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/OrderStatus.java b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/OrderStatus.java index 36173b0be..7d66e9b87 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/OrderStatus.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/OrderStatus.java @@ -17,6 +17,7 @@ package com.oltpbenchmark.benchmarks.tpcc.procedures; +import com.oltpbenchmark.api.SQLStmt; import com.oltpbenchmark.benchmarks.tpcc.TPCCConstants; import com.oltpbenchmark.benchmarks.tpcc.TPCCUtil; import com.oltpbenchmark.benchmarks.tpcc.TPCCWorker; @@ -37,7 +38,7 @@ public class OrderStatus extends TPCCProcedure { private static final Logger LOG = LoggerFactory.getLogger(OrderStatus.class); - public String ordStatGetNewestOrdSQL = + public SQLStmt ordStatGetNewestOrdSQL = new SQLStmt( """ SELECT O_ID, O_CARRIER_ID, O_ENTRY_D FROM %s @@ -45,18 +46,18 @@ public class OrderStatus extends TPCCProcedure { AND O_D_ID = ? AND O_C_ID = ? ORDER BY O_ID DESC LIMIT 1 - """.formatted(TPCCConstants.TABLENAME_OPENORDER); + """.formatted(TPCCConstants.TABLENAME_OPENORDER)); - public String ordStatGetOrderLinesSQL = + public SQLStmt ordStatGetOrderLinesSQL = new SQLStmt( """ SELECT OL_I_ID, OL_SUPPLY_W_ID, OL_QUANTITY, OL_AMOUNT, OL_DELIVERY_D FROM %s WHERE OL_O_ID = ? AND OL_D_ID = ? AND OL_W_ID = ? - """.formatted(TPCCConstants.TABLENAME_ORDERLINE); + """.formatted(TPCCConstants.TABLENAME_ORDERLINE)); - public String payGetCustSQL = + public SQLStmt payGetCustSQL = new SQLStmt( """ SELECT C_FIRST, C_MIDDLE, C_LAST, C_STREET_1, C_STREET_2, C_CITY, C_STATE, C_ZIP, C_PHONE, C_CREDIT, C_CREDIT_LIM, @@ -65,9 +66,9 @@ public class OrderStatus extends TPCCProcedure { WHERE C_W_ID = ? AND C_D_ID = ? AND C_ID = ? - """.formatted(TPCCConstants.TABLENAME_CUSTOMER); + """.formatted(TPCCConstants.TABLENAME_CUSTOMER)); - public String customerByNameSQL = + public SQLStmt customerByNameSQL = new SQLStmt( """ SELECT C_FIRST, C_MIDDLE, C_ID, C_STREET_1, C_STREET_2, C_CITY, C_STATE, C_ZIP, C_PHONE, C_CREDIT, C_CREDIT_LIM, C_DISCOUNT, @@ -77,7 +78,7 @@ public class OrderStatus extends TPCCProcedure { AND C_D_ID = ? AND C_LAST = ? ORDER BY C_FIRST - """.formatted(TPCCConstants.TABLENAME_CUSTOMER); + """.formatted(TPCCConstants.TABLENAME_CUSTOMER)); public void run(Connection conn, Random gen, int w_id, int numWarehouses, int terminalDistrictLowerID, int terminalDistrictUpperID, TPCCWorker w) throws SQLException { @@ -161,7 +162,7 @@ public void run(Connection conn, Random gen, int w_id, int numWarehouses, int te } private Oorder getOrderDetails(Connection conn, int w_id, int d_id, Customer c) throws SQLException { - try (PreparedStatement ordStatGetNewestOrd = this.getPreparedStatement(conn, this.createSqlStatement(ordStatGetNewestOrdSQL,"ordStatGetNewestOrdSQL"))) { + try (PreparedStatement ordStatGetNewestOrd = this.getPreparedStatement(conn, this.finalizeSqlStatement(ordStatGetNewestOrdSQL,"ordStatGetNewestOrdSQL"))) { // find the newest order for the customer @@ -190,7 +191,7 @@ private Oorder getOrderDetails(Connection conn, int w_id, int d_id, Customer c) private List getOrderLines(Connection conn, int w_id, int d_id, int o_id, Customer c) throws SQLException { List orderLines = new ArrayList<>(); - try (PreparedStatement ordStatGetOrderLines = this.getPreparedStatement(conn, this.createSqlStatement(ordStatGetOrderLinesSQL,"ordStatGetOrderLinesSQL"))) { + try (PreparedStatement ordStatGetOrderLines = this.getPreparedStatement(conn, this.finalizeSqlStatement(ordStatGetOrderLinesSQL,"ordStatGetOrderLinesSQL"))) { ordStatGetOrderLines.setInt(1, o_id); ordStatGetOrderLines.setInt(2, d_id); ordStatGetOrderLines.setInt(3, w_id); @@ -232,7 +233,7 @@ private List getOrderLines(Connection conn, int w_id, int d_id, int o_id // prepared statements public Customer getCustomerById(int c_w_id, int c_d_id, int c_id, Connection conn) throws SQLException { - try (PreparedStatement payGetCust = this.getPreparedStatement(conn, this.createSqlStatement(payGetCustSQL,"payGetCustSQL"))) { + try (PreparedStatement payGetCust = this.getPreparedStatement(conn, this.finalizeSqlStatement(payGetCustSQL,"payGetCustSQL"))) { payGetCust.setInt(1, c_w_id); payGetCust.setInt(2, c_d_id); @@ -259,7 +260,7 @@ public Customer getCustomerById(int c_w_id, int c_d_id, int c_id, Connection con public Customer getCustomerByName(int c_w_id, int c_d_id, String c_last, Connection conn) throws SQLException { ArrayList customers = new ArrayList<>(); - try (PreparedStatement customerByName = this.getPreparedStatement(conn, this.createSqlStatement(customerByNameSQL,"customerByNameSQL"))) { + try (PreparedStatement customerByName = this.getPreparedStatement(conn, this.finalizeSqlStatement(customerByNameSQL,"customerByNameSQL"))) { customerByName.setInt(1, c_w_id); customerByName.setInt(2, c_d_id); diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Payment.java b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Payment.java index 36ed87ab2..bdf76980d 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Payment.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Payment.java @@ -17,6 +17,7 @@ package com.oltpbenchmark.benchmarks.tpcc.procedures; +import com.oltpbenchmark.api.SQLStmt; import com.oltpbenchmark.benchmarks.tpcc.TPCCConfig; import com.oltpbenchmark.benchmarks.tpcc.TPCCConstants; import com.oltpbenchmark.benchmarks.tpcc.TPCCUtil; @@ -36,37 +37,37 @@ public class Payment extends TPCCProcedure { private static final Logger LOG = LoggerFactory.getLogger(Payment.class); - public String payUpdateWhseSQL = + public SQLStmt payUpdateWhseSQL = new SQLStmt( """ UPDATE %s SET W_YTD = W_YTD + ? WHERE W_ID = ? - """.formatted(TPCCConstants.TABLENAME_WAREHOUSE); + """.formatted(TPCCConstants.TABLENAME_WAREHOUSE)); - public String payGetWhseSQL = + public SQLStmt payGetWhseSQL = new SQLStmt( """ SELECT W_STREET_1, W_STREET_2, W_CITY, W_STATE, W_ZIP, W_NAME FROM %s WHERE W_ID = ? - """.formatted(TPCCConstants.TABLENAME_WAREHOUSE); + """.formatted(TPCCConstants.TABLENAME_WAREHOUSE)); - public String payUpdateDistSQL = + public SQLStmt payUpdateDistSQL = new SQLStmt( """ UPDATE %s SET D_YTD = D_YTD + ? WHERE D_W_ID = ? AND D_ID = ? - """.formatted(TPCCConstants.TABLENAME_DISTRICT); + """.formatted(TPCCConstants.TABLENAME_DISTRICT)); - public String payGetDistSQL = + public SQLStmt payGetDistSQL = new SQLStmt( """ SELECT D_STREET_1, D_STREET_2, D_CITY, D_STATE, D_ZIP, D_NAME FROM %s WHERE D_W_ID = ? AND D_ID = ? - """.formatted(TPCCConstants.TABLENAME_DISTRICT); + """.formatted(TPCCConstants.TABLENAME_DISTRICT)); - public String payGetCustSQL = + public SQLStmt payGetCustSQL = new SQLStmt( """ SELECT C_FIRST, C_MIDDLE, C_LAST, C_STREET_1, C_STREET_2, C_CITY, C_STATE, C_ZIP, C_PHONE, C_CREDIT, C_CREDIT_LIM, @@ -75,18 +76,18 @@ public class Payment extends TPCCProcedure { WHERE C_W_ID = ? AND C_D_ID = ? AND C_ID = ? - """.formatted(TPCCConstants.TABLENAME_CUSTOMER); + """.formatted(TPCCConstants.TABLENAME_CUSTOMER)); - public String payGetCustCdataSQL = + public SQLStmt payGetCustCdataSQL = new SQLStmt( """ SELECT C_DATA FROM %s WHERE C_W_ID = ? AND C_D_ID = ? AND C_ID = ? - """.formatted(TPCCConstants.TABLENAME_CUSTOMER); + """.formatted(TPCCConstants.TABLENAME_CUSTOMER)); - public String payUpdateCustBalCdataSQL = + public SQLStmt payUpdateCustBalCdataSQL = new SQLStmt( """ UPDATE %s SET C_BALANCE = ?, @@ -96,9 +97,9 @@ public class Payment extends TPCCProcedure { WHERE C_W_ID = ? AND C_D_ID = ? AND C_ID = ? - """.formatted(TPCCConstants.TABLENAME_CUSTOMER); + """.formatted(TPCCConstants.TABLENAME_CUSTOMER)); - public String payUpdateCustBalSQL = + public SQLStmt payUpdateCustBalSQL = new SQLStmt( """ UPDATE %s SET C_BALANCE = ?, @@ -107,16 +108,16 @@ public class Payment extends TPCCProcedure { WHERE C_W_ID = ? AND C_D_ID = ? AND C_ID = ? - """.formatted(TPCCConstants.TABLENAME_CUSTOMER); + """.formatted(TPCCConstants.TABLENAME_CUSTOMER)); - public String payInsertHistSQL = + public SQLStmt payInsertHistSQL = new SQLStmt( """ INSERT INTO %s + (H_C_D_ID, H_C_W_ID, H_C_ID, H_D_ID, H_W_ID, H_DATE, H_AMOUNT, H_DATA) VALUES (?,?,?,?,?,?,?,?) - """.formatted(TPCCConstants.TABLENAME_HISTORY); + """.formatted(TPCCConstants.TABLENAME_HISTORY)); - public String customerByNameSQL = + public SQLStmt customerByNameSQL = new SQLStmt( """ SELECT C_FIRST, C_MIDDLE, C_ID, C_STREET_1, C_STREET_2, C_CITY, C_STATE, C_ZIP, C_PHONE, C_CREDIT, C_CREDIT_LIM, C_DISCOUNT, @@ -126,7 +127,7 @@ public class Payment extends TPCCProcedure { AND C_D_ID = ? AND C_LAST = ? ORDER BY C_FIRST - """.formatted(TPCCConstants.TABLENAME_CUSTOMER); + """.formatted(TPCCConstants.TABLENAME_CUSTOMER)); public void run(Connection conn, Random gen, int w_id, int numWarehouses, int terminalDistrictLowerID, int terminalDistrictUpperID, TPCCWorker worker) throws SQLException { @@ -271,7 +272,7 @@ private int getCustomerDistrictId(Random gen, int districtID, int x) { } private void updateWarehouse(Connection conn, int w_id, float paymentAmount) throws SQLException { - try (PreparedStatement payUpdateWhse = this.getPreparedStatement(conn, this.createSqlStatement(payUpdateWhseSQL,"payUpdateWhseSQL"))) { + try (PreparedStatement payUpdateWhse = this.getPreparedStatement(conn, this.finalizeSqlStatement(payUpdateWhseSQL,"payUpdateWhseSQL"))) { payUpdateWhse.setBigDecimal(1, BigDecimal.valueOf(paymentAmount)); payUpdateWhse.setInt(2, w_id); // MySQL reports deadlocks due to lock upgrades: @@ -284,7 +285,7 @@ private void updateWarehouse(Connection conn, int w_id, float paymentAmount) thr } private Warehouse getWarehouse(Connection conn, int w_id) throws SQLException { - try (PreparedStatement payGetWhse = this.getPreparedStatement(conn, this.createSqlStatement(payGetWhseSQL,"payGetWhseSQL"))) { + try (PreparedStatement payGetWhse = this.getPreparedStatement(conn, this.finalizeSqlStatement(payGetWhseSQL,"payGetWhseSQL"))) { payGetWhse.setInt(1, w_id); try (ResultSet rs = payGetWhse.executeQuery()) { @@ -326,7 +327,7 @@ private Customer getCustomer(Connection conn, Random gen, int customerDistrictID } private void updateDistrict(Connection conn, int w_id, int districtID, float paymentAmount) throws SQLException { - try (PreparedStatement payUpdateDist = this.getPreparedStatement(conn, this.createSqlStatement(payUpdateDistSQL,"payUpdateDistSQL"))) { + try (PreparedStatement payUpdateDist = this.getPreparedStatement(conn, this.finalizeSqlStatement(payUpdateDistSQL,"payUpdateDistSQL"))) { payUpdateDist.setBigDecimal(1, BigDecimal.valueOf(paymentAmount)); payUpdateDist.setInt(2, w_id); payUpdateDist.setInt(3, districtID); @@ -340,7 +341,7 @@ private void updateDistrict(Connection conn, int w_id, int districtID, float pay } private District getDistrict(Connection conn, int w_id, int districtID) throws SQLException { - try (PreparedStatement payGetDist = this.getPreparedStatement(conn, this.createSqlStatement(payGetDistSQL,"payGetDistSQL"))) { + try (PreparedStatement payGetDist = this.getPreparedStatement(conn, this.finalizeSqlStatement(payGetDistSQL,"payGetDistSQL"))) { payGetDist.setInt(1, w_id); payGetDist.setInt(2, districtID); @@ -364,7 +365,7 @@ private District getDistrict(Connection conn, int w_id, int districtID) throws S private String getCData(Connection conn, int w_id, int districtID, int customerDistrictID, int customerWarehouseID, float paymentAmount, Customer c) throws SQLException { - try (PreparedStatement payGetCustCdata = this.getPreparedStatement(conn, this.createSqlStatement(payGetCustCdataSQL,"payGetCustCdataSQL"))) { + try (PreparedStatement payGetCustCdata = this.getPreparedStatement(conn, this.finalizeSqlStatement(payGetCustCdataSQL,"payGetCustCdataSQL"))) { String c_data; payGetCustCdata.setInt(1, customerWarehouseID); payGetCustCdata.setInt(2, customerDistrictID); @@ -387,7 +388,7 @@ private String getCData(Connection conn, int w_id, int districtID, int customerD } private void updateBalanceCData(Connection conn, int customerDistrictID, int customerWarehouseID, Customer c) throws SQLException { - try (PreparedStatement payUpdateCustBalCdata = this.getPreparedStatement(conn, this.createSqlStatement(payUpdateCustBalCdataSQL,"payUpdateCustBalCdataSQL"))) { + try (PreparedStatement payUpdateCustBalCdata = this.getPreparedStatement(conn, this.finalizeSqlStatement(payUpdateCustBalCdataSQL,"payUpdateCustBalCdataSQL"))) { payUpdateCustBalCdata.setDouble(1, c.c_balance); payUpdateCustBalCdata.setDouble(2, c.c_ytd_payment); payUpdateCustBalCdata.setInt(3, c.c_payment_cnt); @@ -406,7 +407,7 @@ private void updateBalanceCData(Connection conn, int customerDistrictID, int cus private void updateBalance(Connection conn, int customerDistrictID, int customerWarehouseID, Customer c) throws SQLException { - try (PreparedStatement payUpdateCustBal = this.getPreparedStatement(conn, this.createSqlStatement(payUpdateCustBalSQL,"payUpdateCustBalSQL"))) { + try (PreparedStatement payUpdateCustBal = this.getPreparedStatement(conn, this.finalizeSqlStatement(payUpdateCustBalSQL,"payUpdateCustBalSQL"))) { payUpdateCustBal.setDouble(1, c.c_balance); payUpdateCustBal.setDouble(2, c.c_ytd_payment); payUpdateCustBal.setInt(3, c.c_payment_cnt); @@ -431,7 +432,7 @@ private void insertHistory(Connection conn, int w_id, int districtID, int custom } String h_data = w_name + " " + d_name; - try (PreparedStatement payInsertHist = this.getPreparedStatement(conn, this.createSqlStatement(payInsertHistSQL,"payInsertHistSQL"))) { + try (PreparedStatement payInsertHist = this.getPreparedStatement(conn, this.finalizeSqlStatement(payInsertHistSQL,"payInsertHistSQL"))) { payInsertHist.setInt(1, customerDistrictID); payInsertHist.setInt(2, customerWarehouseID); payInsertHist.setInt(3, c.c_id); @@ -448,7 +449,7 @@ private void insertHistory(Connection conn, int w_id, int districtID, int custom // prepared statements public Customer getCustomerById(int c_w_id, int c_d_id, int c_id, Connection conn) throws SQLException { - try (PreparedStatement payGetCust = this.getPreparedStatement(conn, this.createSqlStatement(payGetCustSQL,"payGetCustSQL"))) { + try (PreparedStatement payGetCust = this.getPreparedStatement(conn, this.finalizeSqlStatement(payGetCustSQL,"payGetCustSQL"))) { payGetCust.setInt(1, c_w_id); payGetCust.setInt(2, c_d_id); @@ -472,7 +473,7 @@ public Customer getCustomerById(int c_w_id, int c_d_id, int c_id, Connection con public Customer getCustomerByName(int c_w_id, int c_d_id, String customerLastName, Connection conn) throws SQLException { ArrayList customers = new ArrayList<>(); - try (PreparedStatement customerByName = this.getPreparedStatement(conn, this.createSqlStatement(customerByNameSQL,"customerByNameSQL"))) { + try (PreparedStatement customerByName = this.getPreparedStatement(conn, this.finalizeSqlStatement(customerByNameSQL,"customerByNameSQL"))) { customerByName.setInt(1, c_w_id); customerByName.setInt(2, c_d_id); diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/StockLevel.java b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/StockLevel.java index d08b810b4..ad428b82d 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/StockLevel.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/StockLevel.java @@ -17,6 +17,7 @@ package com.oltpbenchmark.benchmarks.tpcc.procedures; +import com.oltpbenchmark.api.SQLStmt; import com.oltpbenchmark.benchmarks.tpcc.TPCCConstants; import com.oltpbenchmark.benchmarks.tpcc.TPCCUtil; import com.oltpbenchmark.benchmarks.tpcc.TPCCWorker; @@ -33,15 +34,15 @@ public class StockLevel extends TPCCProcedure { private static final Logger LOG = LoggerFactory.getLogger(StockLevel.class); - public String stockGetDistOrderIdSQL = + public SQLStmt stockGetDistOrderIdSQL = new SQLStmt( """ SELECT D_NEXT_O_ID FROM %s WHERE D_W_ID = ? AND D_ID = ? - """.formatted(TPCCConstants.TABLENAME_DISTRICT); + """.formatted(TPCCConstants.TABLENAME_DISTRICT)); - public String stockGetCountStockSQL = + public SQLStmt stockGetCountStockSQL = new SQLStmt( """ SELECT COUNT(DISTINCT (S_I_ID)) AS STOCK_COUNT FROM %s, %s @@ -52,7 +53,7 @@ SELECT COUNT(DISTINCT (S_I_ID)) AS STOCK_COUNT AND S_W_ID = ? AND S_I_ID = OL_I_ID AND S_QUANTITY < ? - """.formatted(TPCCConstants.TABLENAME_ORDERLINE, TPCCConstants.TABLENAME_STOCK); + """.formatted(TPCCConstants.TABLENAME_ORDERLINE, TPCCConstants.TABLENAME_STOCK)); public void run(Connection conn, Random gen, int w_id, int numWarehouses, int terminalDistrictLowerID, int terminalDistrictUpperID, TPCCWorker w) throws SQLException { @@ -81,7 +82,7 @@ public void run(Connection conn, Random gen, int w_id, int numWarehouses, int te } private int getOrderId(Connection conn, int w_id, int d_id) throws SQLException { - try (PreparedStatement stockGetDistOrderId = this.getPreparedStatement(conn, this.createSqlStatement(stockGetDistOrderIdSQL,"stockGetDistOrderIdSQL"))) { + try (PreparedStatement stockGetDistOrderId = this.getPreparedStatement(conn, this.finalizeSqlStatement(stockGetDistOrderIdSQL,"stockGetDistOrderIdSQL"))) { stockGetDistOrderId.setInt(1, w_id); stockGetDistOrderId.setInt(2, d_id); @@ -97,7 +98,7 @@ private int getOrderId(Connection conn, int w_id, int d_id) throws SQLException } private int getStockCount(Connection conn, int w_id, int threshold, int d_id, int o_id) throws SQLException { - try (PreparedStatement stockGetCountStock = this.getPreparedStatement(conn, this.createSqlStatement(stockGetCountStockSQL,"stockGetCountStockSQL"))) { + try (PreparedStatement stockGetCountStock = this.getPreparedStatement(conn, this.finalizeSqlStatement(stockGetCountStockSQL,"stockGetCountStockSQL"))) { stockGetCountStock.setInt(1, w_id); stockGetCountStock.setInt(2, d_id); stockGetCountStock.setInt(3, o_id); diff --git a/src/main/resources/benchmarks/tpcc/dialect-sqlserver.xml b/src/main/resources/benchmarks/tpcc/dialect-sqlserver.xml index 4535c13e3..95228265c 100644 --- a/src/main/resources/benchmarks/tpcc/dialect-sqlserver.xml +++ b/src/main/resources/benchmarks/tpcc/dialect-sqlserver.xml @@ -3,7 +3,6 @@ - /*monitor-delivGetOrderIdSQL*/ SELECT TOP 1 NO_O_ID FROM NEW_ORDER WHERE NO_D_ID = ? AND NO_W_ID = ? ORDER BY NO_O_ID ASC @@ -11,13 +10,11 @@ - /*monitor-stmtGetDistSQL*/ SELECT D_NEXT_O_ID,D_TAX FROM DISTRICT WHERE D_W_ID = ? AND D_ID = ? - /*monitor-stmtGetStockSQL*/ SELECT S_QUANTITY, S_DATA, S_DIST_01, S_DIST_02, S_DIST_03, S_DIST_04, S_DIST_05, S_DIST_06, S_DIST_07, S_DIST_08, S_DIST_09, S_DIST_10 FROM STOCK @@ -26,7 +23,6 @@ - /*monitor-ordStatGetNewestOrdSQL*/ SELECT TOP 1 O_ID, O_CARRIER_ID, O_ENTRY_D FROM OORDER WHERE O_W_ID = ? AND O_D_ID = ? AND O_C_ID = ? ORDER BY O_ID DESC From e49679b292151d254cd740bb17e8471b8bb6ae9c Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Wed, 26 Apr 2023 13:46:31 +0200 Subject: [PATCH 21/67] Bugfixes for query strings. --- .../benchmarks/tpcc/procedures/NewOrder.java | 14 +++++++------- .../benchmarks/tpcc/procedures/Payment.java | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/NewOrder.java b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/NewOrder.java index a960e93f3..900317af3 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/NewOrder.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/NewOrder.java @@ -58,14 +58,14 @@ public class NewOrder extends TPCCProcedure { public final SQLStmt stmtInsertNewOrderSQL = new SQLStmt( """ - INSERT INTO %s + + INSERT INTO %s (NO_O_ID, NO_D_ID, NO_W_ID) VALUES ( ?, ?, ?) """.formatted(TPCCConstants.TABLENAME_NEWORDER)); public final SQLStmt stmtUpdateDistSQL = new SQLStmt( """ - UPDATE %s + + UPDATE %s SET D_NEXT_O_ID = D_NEXT_O_ID + 1 WHERE D_W_ID = ? AND D_ID = ? @@ -73,7 +73,7 @@ public class NewOrder extends TPCCProcedure { public final SQLStmt stmtInsertOOrderSQL = new SQLStmt( """ - INSERT INTO %s + + INSERT INTO %s (O_ID, O_D_ID, O_W_ID, O_C_ID, O_ENTRY_D, O_OL_CNT, O_ALL_LOCAL) VALUES (?, ?, ?, ?, ?, ?, ?) """.formatted(TPCCConstants.TABLENAME_OPENORDER)); @@ -81,7 +81,7 @@ public class NewOrder extends TPCCProcedure { public final SQLStmt stmtGetItemSQL = new SQLStmt( """ SELECT I_PRICE, I_NAME , I_DATA - FROM %s + + FROM %s WHERE I_ID = ? """.formatted(TPCCConstants.TABLENAME_ITEM)); @@ -89,14 +89,14 @@ public class NewOrder extends TPCCProcedure { """ SELECT S_QUANTITY, S_DATA, S_DIST_01, S_DIST_02, S_DIST_03, S_DIST_04, S_DIST_05, S_DIST_06, S_DIST_07, S_DIST_08, S_DIST_09, S_DIST_10 - FROM %s + + FROM %s WHERE S_I_ID = ? AND S_W_ID = ? FOR UPDATE """.formatted(TPCCConstants.TABLENAME_STOCK)); public final SQLStmt stmtUpdateStockSQL = new SQLStmt( """ - UPDATE %s + + UPDATE %s SET S_QUANTITY = ? , S_YTD = S_YTD + ?, S_ORDER_CNT = S_ORDER_CNT + 1, @@ -107,7 +107,7 @@ public class NewOrder extends TPCCProcedure { public final SQLStmt stmtInsertOrderLineSQL = new SQLStmt( """ - INSERT INTO %s + + INSERT INTO %s (OL_O_ID, OL_D_ID, OL_W_ID, OL_NUMBER, OL_I_ID, OL_SUPPLY_W_ID, OL_QUANTITY, OL_AMOUNT, OL_DIST_INFO) VALUES (?,?,?,?,?,?,?,?,?) """.formatted(TPCCConstants.TABLENAME_ORDERLINE)); diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Payment.java b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Payment.java index bdf76980d..d78bade1a 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Payment.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Payment.java @@ -112,7 +112,7 @@ public class Payment extends TPCCProcedure { public SQLStmt payInsertHistSQL = new SQLStmt( """ - INSERT INTO %s + + INSERT INTO %s (H_C_D_ID, H_C_W_ID, H_C_ID, H_D_ID, H_W_ID, H_DATE, H_AMOUNT, H_DATA) VALUES (?,?,?,?,?,?,?,?) """.formatted(TPCCConstants.TABLENAME_HISTORY)); From 6a54235ecb1c49b3f397f75a55c34a906db4721e Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Wed, 26 Apr 2023 13:55:52 +0200 Subject: [PATCH 22/67] Debugging --- src/main/java/com/oltpbenchmark/DBWorkload.java | 1 + src/main/java/com/oltpbenchmark/api/Procedure.java | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/main/java/com/oltpbenchmark/DBWorkload.java b/src/main/java/com/oltpbenchmark/DBWorkload.java index fb97bea22..5487b7ff2 100644 --- a/src/main/java/com/oltpbenchmark/DBWorkload.java +++ b/src/main/java/com/oltpbenchmark/DBWorkload.java @@ -160,6 +160,7 @@ public static void main(String[] args) throws Exception { // Set monitoring enabled, if all requirements are met. if (monitorInfo.getMonitoringInterval()>0 && monitorInfo.getMonitoringType()==MonitoringType.ADVANCED) { + LOG.info("Advanced monitoring enabled, prefix will be added to queries."); wrkld.setMonitoringEnabled(true); } diff --git a/src/main/java/com/oltpbenchmark/api/Procedure.java b/src/main/java/com/oltpbenchmark/api/Procedure.java index 099150cf2..4b7980ee4 100644 --- a/src/main/java/com/oltpbenchmark/api/Procedure.java +++ b/src/main/java/com/oltpbenchmark/api/Procedure.java @@ -82,7 +82,9 @@ protected final String getProcedureName() { */ protected SQLStmt finalizeSqlStatement(SQLStmt stmt, String queryId) { SQLStmt finalStmt = stmt; + LOG.info("Finalizing statement " + queryId); if (this.getMonitoringEnabled()) { + LOG.info("Monitoring prefix: " + MonitoringUtil.getMonitoringPrefix().replace("$queryId", queryId)); finalStmt.addPrefix(MonitoringUtil.getMonitoringPrefix().replace("$queryId", queryId)); } return finalStmt; From 4693a0521e5a71d8a54f04d0eebe6a5cc468735f Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Wed, 26 Apr 2023 14:06:06 +0200 Subject: [PATCH 23/67] Enable new monitoring in SQLServer & Postgres monitors. --- .../java/com/oltpbenchmark/api/Procedure.java | 4 +-- .../monitoring/PostgreSQLMonitor.java | 10 +++---- .../monitoring/SQLServerMonitor.java | 9 +++---- .../oltpbenchmark/util/MonitoringUtil.java | 26 +++++++++---------- 4 files changed, 22 insertions(+), 27 deletions(-) diff --git a/src/main/java/com/oltpbenchmark/api/Procedure.java b/src/main/java/com/oltpbenchmark/api/Procedure.java index 4b7980ee4..a1e60aaab 100644 --- a/src/main/java/com/oltpbenchmark/api/Procedure.java +++ b/src/main/java/com/oltpbenchmark/api/Procedure.java @@ -82,10 +82,8 @@ protected final String getProcedureName() { */ protected SQLStmt finalizeSqlStatement(SQLStmt stmt, String queryId) { SQLStmt finalStmt = stmt; - LOG.info("Finalizing statement " + queryId); if (this.getMonitoringEnabled()) { - LOG.info("Monitoring prefix: " + MonitoringUtil.getMonitoringPrefix().replace("$queryId", queryId)); - finalStmt.addPrefix(MonitoringUtil.getMonitoringPrefix().replace("$queryId", queryId)); + finalStmt.addPrefix(MonitoringUtil.getMonitoringMarker().replace(MonitoringUtil.getMonitoringQueryId(), queryId)); } return finalStmt; } diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/PostgreSQLMonitor.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/PostgreSQLMonitor.java index fb0c1d2a8..c9e895253 100644 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/PostgreSQLMonitor.java +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/PostgreSQLMonitor.java @@ -17,6 +17,7 @@ import com.oltpbenchmark.api.BenchmarkModule; import com.oltpbenchmark.api.Worker; import com.oltpbenchmark.util.MonitorInfo; +import com.oltpbenchmark.util.MonitoringUtil; /** * Implementation of a monitor specific to PostgreSQL. Uses the @@ -24,9 +25,6 @@ */ public class PostgreSQLMonitor extends DatabaseMonitor { - private final String MONITORING_IDENTIFIER = "/*monitor-"; - private final String MONITORING_SPLIT_MARKER = "*/"; - private final String PG_STAT_STATEMENTS = """ SELECT query AS query_text, calls as execution_count, rows, total_exec_time, min_exec_time, max_exec_time, @@ -83,12 +81,12 @@ private void extractQueryMetrics(Instant instant) { // Only store those queries that have monitoring enabled via a // comment in the SQL Server dialect XML. String query_text = rs.getString("query_text"); - if (!query_text.contains(MONITORING_IDENTIFIER)) { + if (!query_text.contains(MonitoringUtil.getMonitoringPrefix())) { continue; } // Get identifier from commment in query text. - String[] split = query_text.split(Pattern.quote(MONITORING_IDENTIFIER)); - split = split[1].split(Pattern.quote(MONITORING_SPLIT_MARKER)); + String[] split = query_text.split(Pattern.quote(MonitoringUtil.getMonitoringPrefix())); + split = split[1].split(Pattern.quote(MonitoringUtil.getMonitoringSuffix())); String identifier = split[0]; // Handle one-off query info, may occur when a plan gets diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java index 7c84641d2..a8448d822 100644 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java @@ -17,14 +17,13 @@ import com.oltpbenchmark.api.BenchmarkModule; import com.oltpbenchmark.api.Worker; import com.oltpbenchmark.util.MonitorInfo; +import com.oltpbenchmark.util.MonitoringUtil; /** * Implementation of a monitor specific to SQLServer. Uses SQLServer's system * tables to extract relevant query and system information. */ public class SQLServerMonitor extends DatabaseMonitor { - private final String MONITORING_IDENTIFIER = "/*monitor-"; - private final String MONITORING_SPLIT_MARKER = "*/"; private final String DM_EXEC_QUERY_STATS = """ SELECT q.text AS query_text, st.plan_handle, pl.query_plan, @@ -137,13 +136,13 @@ private void extractQueryMetrics(Instant instant) { // Only store those queries that have monitoring enabled via a // comment in the SQL Server dialect XML. String query_text = rs.getString("query_text"); - if (!query_text.contains(MONITORING_IDENTIFIER)) { + if (!query_text.contains(MonitoringUtil.getMonitoringPrefix())) { continue; } // Get identifier from commment in query text. - String[] split = query_text.split(Pattern.quote(MONITORING_IDENTIFIER)); - split = split[1].split(Pattern.quote(MONITORING_SPLIT_MARKER)); + String[] split = query_text.split(Pattern.quote(MonitoringUtil.getMonitoringPrefix())); + split = split[1].split(Pattern.quote(MonitoringUtil.getMonitoringSuffix())); String identifier = split[0]; // Get plan_handle for plan identification. String plan_handle = rs.getString("plan_handle"); diff --git a/src/main/java/com/oltpbenchmark/util/MonitoringUtil.java b/src/main/java/com/oltpbenchmark/util/MonitoringUtil.java index 999d497ec..d3e96426b 100644 --- a/src/main/java/com/oltpbenchmark/util/MonitoringUtil.java +++ b/src/main/java/com/oltpbenchmark/util/MonitoringUtil.java @@ -19,14 +19,21 @@ public abstract class MonitoringUtil { - private final static String MONITORING_PREFIX = "/* MONITOR-$queryId */"; + private final static String MONITORING_MARKER = "/* MONITOR-$queryId */"; + private final static String MONITORING_PREFIX = "/* MONITOR"; private final static String MONITORING_QUERYID = "$queryId"; - private final static String MONITORING_SPLIT_PREFIX = "/* "; - private final static String MONITORING_SPLIT_SUFFIX = " */"; + private final static String MONITORING_SUFFIX = " */"; /** * Universal monitoring prefix. */ + public static String getMonitoringMarker() { + return MonitoringUtil.MONITORING_MARKER; + } + + /** + * Get monitoring identifier. + */ public static String getMonitoringPrefix() { return MonitoringUtil.MONITORING_PREFIX; } @@ -39,16 +46,9 @@ public static String getMonitoringQueryId() { } /** - * Comment split prefix. - */ - public static String getMonitoringSplitPrefix() { - return MonitoringUtil.MONITORING_SPLIT_PREFIX; - } - - /** - * Comment split suffix. + * Comment suffix. */ - public static String getMonitoringSplitSuffix() { - return MonitoringUtil.MONITORING_SPLIT_SUFFIX; + public static String getMonitoringSuffix() { + return MonitoringUtil.MONITORING_SUFFIX; } } From f768e4b0a8fec04c0d65eb6bebba3673e92cef93 Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Wed, 26 Apr 2023 14:33:00 +0200 Subject: [PATCH 24/67] Remove superfluous monitoring references and shift prefix addition to procedure name map. --- .../java/com/oltpbenchmark/DBWorkload.java | 5 ++-- .../oltpbenchmark/WorkloadConfiguration.java | 8 +++--- .../java/com/oltpbenchmark/api/Procedure.java | 28 ++++--------------- .../java/com/oltpbenchmark/api/Worker.java | 4 ++- .../benchmarks/tpcc/procedures/Delivery.java | 14 +++++----- .../benchmarks/tpcc/procedures/NewOrder.java | 20 ++++++------- .../tpcc/procedures/OrderStatus.java | 8 +++--- .../benchmarks/tpcc/procedures/Payment.java | 20 ++++++------- .../tpcc/procedures/StockLevel.java | 4 +-- .../benchmarks/tpch/procedures/Q1.java | 1 - .../benchmarks/tpch/procedures/Q10.java | 1 - .../benchmarks/tpch/procedures/Q11.java | 1 - .../benchmarks/tpch/procedures/Q12.java | 1 - .../benchmarks/tpch/procedures/Q13.java | 1 - .../benchmarks/tpch/procedures/Q14.java | 1 - .../benchmarks/tpch/procedures/Q15.java | 1 - .../benchmarks/tpch/procedures/Q16.java | 1 - .../benchmarks/tpch/procedures/Q17.java | 1 - .../benchmarks/tpch/procedures/Q18.java | 1 - .../benchmarks/tpch/procedures/Q19.java | 1 - .../benchmarks/tpch/procedures/Q2.java | 1 - .../benchmarks/tpch/procedures/Q20.java | 1 - .../benchmarks/tpch/procedures/Q21.java | 1 - .../benchmarks/tpch/procedures/Q22.java | 1 - .../benchmarks/tpch/procedures/Q3.java | 1 - .../benchmarks/tpch/procedures/Q4.java | 1 - .../benchmarks/tpch/procedures/Q5.java | 1 - .../benchmarks/tpch/procedures/Q6.java | 1 - .../benchmarks/tpch/procedures/Q7.java | 1 - .../benchmarks/tpch/procedures/Q8.java | 1 - .../benchmarks/tpch/procedures/Q9.java | 1 - .../twitter/procedures/GetFollowers.java | 6 ++-- .../twitter/procedures/GetTweet.java | 3 +- .../procedures/GetTweetsFromFollowing.java | 8 +++--- .../twitter/procedures/GetUserTweets.java | 4 +-- .../twitter/procedures/InsertTweet.java | 4 +-- .../oltpbenchmark/util/MonitoringUtil.java | 2 +- .../benchmarks/tpch/dialect-postgres.xml | 11 -------- .../benchmarks/tpch/dialect-sqlserver.xml | 17 ----------- .../benchmarks/twitter/dialect-sqlserver.xml | 6 ---- 40 files changed, 61 insertions(+), 133 deletions(-) diff --git a/src/main/java/com/oltpbenchmark/DBWorkload.java b/src/main/java/com/oltpbenchmark/DBWorkload.java index 5487b7ff2..ba21d0cba 100644 --- a/src/main/java/com/oltpbenchmark/DBWorkload.java +++ b/src/main/java/com/oltpbenchmark/DBWorkload.java @@ -159,9 +159,10 @@ public static void main(String[] args) throws Exception { } // Set monitoring enabled, if all requirements are met. - if (monitorInfo.getMonitoringInterval()>0 && monitorInfo.getMonitoringType()==MonitoringType.ADVANCED) { + if (monitorInfo.getMonitoringInterval()>0 && monitorInfo.getMonitoringType()==MonitoringType.ADVANCED + && DatabaseType.get(xmlConfig.getString("type")).shouldCreateMonitoringPrefix()) { LOG.info("Advanced monitoring enabled, prefix will be added to queries."); - wrkld.setMonitoringEnabled(true); + wrkld.setAdvancedMonitoringEnabled(true); } // ---------------------------------------------------------------- diff --git a/src/main/java/com/oltpbenchmark/WorkloadConfiguration.java b/src/main/java/com/oltpbenchmark/WorkloadConfiguration.java index d31500916..15b448b51 100644 --- a/src/main/java/com/oltpbenchmark/WorkloadConfiguration.java +++ b/src/main/java/com/oltpbenchmark/WorkloadConfiguration.java @@ -49,7 +49,7 @@ public class WorkloadConfiguration { private int isolationMode = Connection.TRANSACTION_SERIALIZABLE; private String dataDir = null; private String ddlPath = null; - private boolean monitoringEnabled = false; + private boolean advancedMonitoringEnabled = false; /** * If true, establish a new connection for each transaction, otherwise use one persistent connection per client @@ -125,12 +125,12 @@ public void setMaxRetries(int maxRetries) { this.maxRetries = maxRetries; } - public void setMonitoringEnabled(boolean monitoringEnabled) { - this.monitoringEnabled = true; + public void setAdvancedMonitoringEnabled(boolean advancedMonitoringEnabled) { + this.advancedMonitoringEnabled = true; } public boolean getMonitoringEnabled() { - return this.monitoringEnabled; + return this.advancedMonitoringEnabled; } /** diff --git a/src/main/java/com/oltpbenchmark/api/Procedure.java b/src/main/java/com/oltpbenchmark/api/Procedure.java index a1e60aaab..6027c17b2 100644 --- a/src/main/java/com/oltpbenchmark/api/Procedure.java +++ b/src/main/java/com/oltpbenchmark/api/Procedure.java @@ -33,6 +33,7 @@ import java.util.Collections; import java.util.HashMap; import java.util.Map; +import java.util.Map.Entry; public abstract class Procedure { private static final Logger LOG = LoggerFactory.getLogger(Procedure.class); @@ -40,14 +41,12 @@ public abstract class Procedure { private final String procName; private DatabaseType dbType; private Map name_stmt_xref; - private boolean monitoringEnabled; /** * Constructor */ protected Procedure() { this.procName = this.getClass().getSimpleName(); - monitoringEnabled = false; } /** @@ -77,29 +76,12 @@ protected final String getProcedureName() { } /** - * Finalizes a query statement. If monitoring is enabled, this method will - * add a monitoring prefix. + * Enable monitoring for this procedure by adding a monitoring prefix. */ - protected SQLStmt finalizeSqlStatement(SQLStmt stmt, String queryId) { - SQLStmt finalStmt = stmt; - if (this.getMonitoringEnabled()) { - finalStmt.addPrefix(MonitoringUtil.getMonitoringMarker().replace(MonitoringUtil.getMonitoringQueryId(), queryId)); + public void enabledAdvancedMonitoring() { + for (Entry entry : name_stmt_xref.entrySet()) { + entry.getValue().addPrefix(entry.getKey()); } - return finalStmt; - } - - /** - * Enable monitoring for this procedure. - */ - public void setMonitoringEnabled(boolean monitoringEnabled) { - this.monitoringEnabled = monitoringEnabled; - } - - /** - * Check whether monitoring is enabled for this procedure. - */ - public boolean getMonitoringEnabled() { - return this.monitoringEnabled; } /** diff --git a/src/main/java/com/oltpbenchmark/api/Worker.java b/src/main/java/com/oltpbenchmark/api/Worker.java index 1857b5113..653fa46c1 100644 --- a/src/main/java/com/oltpbenchmark/api/Worker.java +++ b/src/main/java/com/oltpbenchmark/api/Worker.java @@ -88,7 +88,9 @@ public Worker(T benchmark, int id) { this.procedures.putAll(this.benchmark.getProcedures()); for (Entry e : this.procedures.entrySet()) { Procedure proc = e.getValue(); - proc.setMonitoringEnabled(configuration.getMonitoringEnabled()); + if (configuration.getMonitoringEnabled()) { + proc.enabledAdvancedMonitoring(); + } this.name_procedures.put(e.getKey().getName(), proc); this.class_procedures.put(proc.getClass(), proc); } diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Delivery.java b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Delivery.java index ce65e5888..02e3564dc 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Delivery.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Delivery.java @@ -153,7 +153,7 @@ public void run(Connection conn, Random gen, int w_id, int numWarehouses, int te private Integer getOrderId(Connection conn, int w_id, int d_id) throws SQLException { - try (PreparedStatement delivGetOrderId = this.getPreparedStatement(conn, this.finalizeSqlStatement(delivGetOrderIdSQL, "delivGetOrderIdSQL"))) { + try (PreparedStatement delivGetOrderId = this.getPreparedStatement(conn, delivGetOrderIdSQL)) { delivGetOrderId.setInt(1, d_id); delivGetOrderId.setInt(2, w_id); @@ -174,7 +174,7 @@ private Integer getOrderId(Connection conn, int w_id, int d_id) throws SQLExcept } private void deleteOrder(Connection conn, int w_id, int d_id, int no_o_id) throws SQLException { - try (PreparedStatement delivDeleteNewOrder = this.getPreparedStatement(conn, this.finalizeSqlStatement(delivDeleteNewOrderSQL, "delivDeleteNewOrderSQL"))) { + try (PreparedStatement delivDeleteNewOrder = this.getPreparedStatement(conn, delivDeleteNewOrderSQL)) { delivDeleteNewOrder.setInt(1, no_o_id); delivDeleteNewOrder.setInt(2, d_id); delivDeleteNewOrder.setInt(3, w_id); @@ -195,7 +195,7 @@ private void deleteOrder(Connection conn, int w_id, int d_id, int no_o_id) throw private int getCustomerId(Connection conn, int w_id, int d_id, int no_o_id) throws SQLException { - try (PreparedStatement delivGetCustId = this.getPreparedStatement(conn, this.finalizeSqlStatement(delivGetCustIdSQL, "delivGetCustIdSQL"))) { + try (PreparedStatement delivGetCustId = this.getPreparedStatement(conn, delivGetCustIdSQL)) { delivGetCustId.setInt(1, no_o_id); delivGetCustId.setInt(2, d_id); delivGetCustId.setInt(3, w_id); @@ -213,7 +213,7 @@ private int getCustomerId(Connection conn, int w_id, int d_id, int no_o_id) thro } private void updateCarrierId(Connection conn, int w_id, int o_carrier_id, int d_id, int no_o_id) throws SQLException { - try (PreparedStatement delivUpdateCarrierId = this.getPreparedStatement(conn, this.finalizeSqlStatement(delivUpdateCarrierIdSQL, "delivUpdateCarrierIdSQL"))) { + try (PreparedStatement delivUpdateCarrierId = this.getPreparedStatement(conn, delivUpdateCarrierIdSQL)) { delivUpdateCarrierId.setInt(1, o_carrier_id); delivUpdateCarrierId.setInt(2, no_o_id); delivUpdateCarrierId.setInt(3, d_id); @@ -231,7 +231,7 @@ private void updateCarrierId(Connection conn, int w_id, int o_carrier_id, int d_ private void updateDeliveryDate(Connection conn, int w_id, int d_id, int no_o_id) throws SQLException { Timestamp timestamp = new Timestamp(System.currentTimeMillis()); - try (PreparedStatement delivUpdateDeliveryDate = this.getPreparedStatement(conn, this.finalizeSqlStatement(delivUpdateDeliveryDateSQL, "delivUpdateDeliveryDateSQL"))) { + try (PreparedStatement delivUpdateDeliveryDate = this.getPreparedStatement(conn, delivUpdateDeliveryDateSQL)) { delivUpdateDeliveryDate.setTimestamp(1, timestamp); delivUpdateDeliveryDate.setInt(2, no_o_id); delivUpdateDeliveryDate.setInt(3, d_id); @@ -247,7 +247,7 @@ private void updateDeliveryDate(Connection conn, int w_id, int d_id, int no_o_id } private float getOrderLineTotal(Connection conn, int w_id, int d_id, int no_o_id) throws SQLException { - try (PreparedStatement delivSumOrderAmount = this.getPreparedStatement(conn, this.finalizeSqlStatement(delivSumOrderAmountSQL, "delivSumOrderAmountSQL"))) { + try (PreparedStatement delivSumOrderAmount = this.getPreparedStatement(conn, delivSumOrderAmountSQL)) { delivSumOrderAmount.setInt(1, no_o_id); delivSumOrderAmount.setInt(2, d_id); delivSumOrderAmount.setInt(3, w_id); @@ -265,7 +265,7 @@ private float getOrderLineTotal(Connection conn, int w_id, int d_id, int no_o_id private void updateBalanceAndDelivery(Connection conn, int w_id, int d_id, int c_id, float orderLineTotal) throws SQLException { - try (PreparedStatement delivUpdateCustBalDelivCnt = this.getPreparedStatement(conn, this.finalizeSqlStatement(delivUpdateCustBalDelivCntSQL, "delivUpdateCustBalDelivCntSQL"))) { + try (PreparedStatement delivUpdateCustBalDelivCnt = this.getPreparedStatement(conn, delivUpdateCustBalDelivCntSQL)) { delivUpdateCustBalDelivCnt.setBigDecimal(1, BigDecimal.valueOf(orderLineTotal)); delivUpdateCustBalDelivCnt.setInt(2, w_id); delivUpdateCustBalDelivCnt.setInt(3, d_id); diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/NewOrder.java b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/NewOrder.java index 900317af3..99d0a4267 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/NewOrder.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/NewOrder.java @@ -165,8 +165,8 @@ private void newOrderTransaction(int w_id, int d_id, int c_id, insertNewOrder(conn, w_id, d_id, d_next_o_id); - try (PreparedStatement stmtUpdateStock = this.getPreparedStatement(conn, this.finalizeSqlStatement(stmtUpdateStockSQL,"stmtUpdateStockSQL")); - PreparedStatement stmtInsertOrderLine = this.getPreparedStatement(conn, this.finalizeSqlStatement(stmtInsertOrderLineSQL,"stmtInsertOrderLineSQL"))) { + try (PreparedStatement stmtUpdateStock = this.getPreparedStatement(conn, stmtUpdateStockSQL); + PreparedStatement stmtInsertOrderLine = this.getPreparedStatement(conn, stmtInsertOrderLineSQL)) { for (int ol_number = 1; ol_number <= o_ol_cnt; ol_number++) { int ol_supply_w_id = supplierWarehouseIDs[ol_number - 1]; @@ -237,7 +237,7 @@ private String getDistInfo(int d_id, Stock s) { } private Stock getStock(Connection conn, int ol_supply_w_id, int ol_i_id, int ol_quantity) throws SQLException { - try (PreparedStatement stmtGetStock = this.getPreparedStatement(conn, this.finalizeSqlStatement(stmtGetStockSQL,"stmtGetStockSQL"))) { + try (PreparedStatement stmtGetStock = this.getPreparedStatement(conn, stmtGetStockSQL)) { stmtGetStock.setInt(1, ol_i_id); stmtGetStock.setInt(2, ol_supply_w_id); try (ResultSet rs = stmtGetStock.executeQuery()) { @@ -269,7 +269,7 @@ private Stock getStock(Connection conn, int ol_supply_w_id, int ol_i_id, int ol_ } private float getItemPrice(Connection conn, int ol_i_id) throws SQLException { - try (PreparedStatement stmtGetItem = this.getPreparedStatement(conn, this.finalizeSqlStatement(stmtGetItemSQL,"stmtGetItemSQL"))) { + try (PreparedStatement stmtGetItem = this.getPreparedStatement(conn, stmtGetItemSQL)) { stmtGetItem.setInt(1, ol_i_id); try (ResultSet rs = stmtGetItem.executeQuery()) { if (!rs.next()) { @@ -283,7 +283,7 @@ private float getItemPrice(Connection conn, int ol_i_id) throws SQLException { } private void insertNewOrder(Connection conn, int w_id, int d_id, int o_id) throws SQLException { - try (PreparedStatement stmtInsertNewOrder = this.getPreparedStatement(conn, this.finalizeSqlStatement(stmtInsertNewOrderSQL,"stmtInsertNewOrderSQL"));) { + try (PreparedStatement stmtInsertNewOrder = this.getPreparedStatement(conn, stmtInsertNewOrderSQL);) { stmtInsertNewOrder.setInt(1, o_id); stmtInsertNewOrder.setInt(2, d_id); stmtInsertNewOrder.setInt(3, w_id); @@ -296,7 +296,7 @@ private void insertNewOrder(Connection conn, int w_id, int d_id, int o_id) throw } private void insertOpenOrder(Connection conn, int w_id, int d_id, int c_id, int o_ol_cnt, int o_all_local, int o_id) throws SQLException { - try (PreparedStatement stmtInsertOOrder = this.getPreparedStatement(conn, this.finalizeSqlStatement(stmtInsertOOrderSQL,"stmtInsertOOrderSQL"));) { + try (PreparedStatement stmtInsertOOrder = this.getPreparedStatement(conn, stmtInsertOOrderSQL);) { stmtInsertOOrder.setInt(1, o_id); stmtInsertOOrder.setInt(2, d_id); stmtInsertOOrder.setInt(3, w_id); @@ -314,7 +314,7 @@ private void insertOpenOrder(Connection conn, int w_id, int d_id, int c_id, int } private void updateDistrict(Connection conn, int w_id, int d_id) throws SQLException { - try (PreparedStatement stmtUpdateDist = this.getPreparedStatement(conn, this.finalizeSqlStatement(stmtUpdateDistSQL,"stmtUpdateDistSQL"))) { + try (PreparedStatement stmtUpdateDist = this.getPreparedStatement(conn, stmtUpdateDistSQL)) { stmtUpdateDist.setInt(1, w_id); stmtUpdateDist.setInt(2, d_id); int result = stmtUpdateDist.executeUpdate(); @@ -325,7 +325,7 @@ private void updateDistrict(Connection conn, int w_id, int d_id) throws SQLExcep } private int getDistrict(Connection conn, int w_id, int d_id) throws SQLException { - try (PreparedStatement stmtGetDist = this.getPreparedStatement(conn, this.finalizeSqlStatement(stmtGetDistSQL,"stmtGetDistSQL"))) { + try (PreparedStatement stmtGetDist = this.getPreparedStatement(conn, stmtGetDistSQL)) { stmtGetDist.setInt(1, w_id); stmtGetDist.setInt(2, d_id); try (ResultSet rs = stmtGetDist.executeQuery()) { @@ -338,7 +338,7 @@ private int getDistrict(Connection conn, int w_id, int d_id) throws SQLException } private void getWarehouse(Connection conn, int w_id) throws SQLException { - try (PreparedStatement stmtGetWhse = this.getPreparedStatement(conn, this.finalizeSqlStatement(stmtGetWhseSQL,"stmtGetWhseSQL"))) { + try (PreparedStatement stmtGetWhse = this.getPreparedStatement(conn, stmtGetWhseSQL)) { stmtGetWhse.setInt(1, w_id); try (ResultSet rs = stmtGetWhse.executeQuery()) { if (!rs.next()) { @@ -349,7 +349,7 @@ private void getWarehouse(Connection conn, int w_id) throws SQLException { } private void getCustomer(Connection conn, int w_id, int d_id, int c_id) throws SQLException { - try (PreparedStatement stmtGetCust = this.getPreparedStatement(conn, this.finalizeSqlStatement(stmtGetCustSQL,"stmtGetCustSQL"))) { + try (PreparedStatement stmtGetCust = this.getPreparedStatement(conn, stmtGetCustSQL)) { stmtGetCust.setInt(1, w_id); stmtGetCust.setInt(2, d_id); stmtGetCust.setInt(3, c_id); diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/OrderStatus.java b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/OrderStatus.java index 7d66e9b87..0dc158b69 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/OrderStatus.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/OrderStatus.java @@ -162,7 +162,7 @@ public void run(Connection conn, Random gen, int w_id, int numWarehouses, int te } private Oorder getOrderDetails(Connection conn, int w_id, int d_id, Customer c) throws SQLException { - try (PreparedStatement ordStatGetNewestOrd = this.getPreparedStatement(conn, this.finalizeSqlStatement(ordStatGetNewestOrdSQL,"ordStatGetNewestOrdSQL"))) { + try (PreparedStatement ordStatGetNewestOrd = this.getPreparedStatement(conn, ordStatGetNewestOrdSQL)) { // find the newest order for the customer @@ -191,7 +191,7 @@ private Oorder getOrderDetails(Connection conn, int w_id, int d_id, Customer c) private List getOrderLines(Connection conn, int w_id, int d_id, int o_id, Customer c) throws SQLException { List orderLines = new ArrayList<>(); - try (PreparedStatement ordStatGetOrderLines = this.getPreparedStatement(conn, this.finalizeSqlStatement(ordStatGetOrderLinesSQL,"ordStatGetOrderLinesSQL"))) { + try (PreparedStatement ordStatGetOrderLines = this.getPreparedStatement(conn, ordStatGetOrderLinesSQL)) { ordStatGetOrderLines.setInt(1, o_id); ordStatGetOrderLines.setInt(2, d_id); ordStatGetOrderLines.setInt(3, w_id); @@ -233,7 +233,7 @@ private List getOrderLines(Connection conn, int w_id, int d_id, int o_id // prepared statements public Customer getCustomerById(int c_w_id, int c_d_id, int c_id, Connection conn) throws SQLException { - try (PreparedStatement payGetCust = this.getPreparedStatement(conn, this.finalizeSqlStatement(payGetCustSQL,"payGetCustSQL"))) { + try (PreparedStatement payGetCust = this.getPreparedStatement(conn, payGetCustSQL)) { payGetCust.setInt(1, c_w_id); payGetCust.setInt(2, c_d_id); @@ -260,7 +260,7 @@ public Customer getCustomerById(int c_w_id, int c_d_id, int c_id, Connection con public Customer getCustomerByName(int c_w_id, int c_d_id, String c_last, Connection conn) throws SQLException { ArrayList customers = new ArrayList<>(); - try (PreparedStatement customerByName = this.getPreparedStatement(conn, this.finalizeSqlStatement(customerByNameSQL,"customerByNameSQL"))) { + try (PreparedStatement customerByName = this.getPreparedStatement(conn, customerByNameSQL)) { customerByName.setInt(1, c_w_id); customerByName.setInt(2, c_d_id); diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Payment.java b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Payment.java index d78bade1a..2a55c6d5c 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Payment.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Payment.java @@ -272,7 +272,7 @@ private int getCustomerDistrictId(Random gen, int districtID, int x) { } private void updateWarehouse(Connection conn, int w_id, float paymentAmount) throws SQLException { - try (PreparedStatement payUpdateWhse = this.getPreparedStatement(conn, this.finalizeSqlStatement(payUpdateWhseSQL,"payUpdateWhseSQL"))) { + try (PreparedStatement payUpdateWhse = this.getPreparedStatement(conn, payUpdateWhseSQL)) { payUpdateWhse.setBigDecimal(1, BigDecimal.valueOf(paymentAmount)); payUpdateWhse.setInt(2, w_id); // MySQL reports deadlocks due to lock upgrades: @@ -285,7 +285,7 @@ private void updateWarehouse(Connection conn, int w_id, float paymentAmount) thr } private Warehouse getWarehouse(Connection conn, int w_id) throws SQLException { - try (PreparedStatement payGetWhse = this.getPreparedStatement(conn, this.finalizeSqlStatement(payGetWhseSQL,"payGetWhseSQL"))) { + try (PreparedStatement payGetWhse = this.getPreparedStatement(conn, payGetWhseSQL)) { payGetWhse.setInt(1, w_id); try (ResultSet rs = payGetWhse.executeQuery()) { @@ -327,7 +327,7 @@ private Customer getCustomer(Connection conn, Random gen, int customerDistrictID } private void updateDistrict(Connection conn, int w_id, int districtID, float paymentAmount) throws SQLException { - try (PreparedStatement payUpdateDist = this.getPreparedStatement(conn, this.finalizeSqlStatement(payUpdateDistSQL,"payUpdateDistSQL"))) { + try (PreparedStatement payUpdateDist = this.getPreparedStatement(conn, payUpdateDistSQL)) { payUpdateDist.setBigDecimal(1, BigDecimal.valueOf(paymentAmount)); payUpdateDist.setInt(2, w_id); payUpdateDist.setInt(3, districtID); @@ -341,7 +341,7 @@ private void updateDistrict(Connection conn, int w_id, int districtID, float pay } private District getDistrict(Connection conn, int w_id, int districtID) throws SQLException { - try (PreparedStatement payGetDist = this.getPreparedStatement(conn, this.finalizeSqlStatement(payGetDistSQL,"payGetDistSQL"))) { + try (PreparedStatement payGetDist = this.getPreparedStatement(conn, payGetDistSQL)) { payGetDist.setInt(1, w_id); payGetDist.setInt(2, districtID); @@ -365,7 +365,7 @@ private District getDistrict(Connection conn, int w_id, int districtID) throws S private String getCData(Connection conn, int w_id, int districtID, int customerDistrictID, int customerWarehouseID, float paymentAmount, Customer c) throws SQLException { - try (PreparedStatement payGetCustCdata = this.getPreparedStatement(conn, this.finalizeSqlStatement(payGetCustCdataSQL,"payGetCustCdataSQL"))) { + try (PreparedStatement payGetCustCdata = this.getPreparedStatement(conn, payGetCustCdataSQL)) { String c_data; payGetCustCdata.setInt(1, customerWarehouseID); payGetCustCdata.setInt(2, customerDistrictID); @@ -388,7 +388,7 @@ private String getCData(Connection conn, int w_id, int districtID, int customerD } private void updateBalanceCData(Connection conn, int customerDistrictID, int customerWarehouseID, Customer c) throws SQLException { - try (PreparedStatement payUpdateCustBalCdata = this.getPreparedStatement(conn, this.finalizeSqlStatement(payUpdateCustBalCdataSQL,"payUpdateCustBalCdataSQL"))) { + try (PreparedStatement payUpdateCustBalCdata = this.getPreparedStatement(conn, payUpdateCustBalCdataSQL)) { payUpdateCustBalCdata.setDouble(1, c.c_balance); payUpdateCustBalCdata.setDouble(2, c.c_ytd_payment); payUpdateCustBalCdata.setInt(3, c.c_payment_cnt); @@ -407,7 +407,7 @@ private void updateBalanceCData(Connection conn, int customerDistrictID, int cus private void updateBalance(Connection conn, int customerDistrictID, int customerWarehouseID, Customer c) throws SQLException { - try (PreparedStatement payUpdateCustBal = this.getPreparedStatement(conn, this.finalizeSqlStatement(payUpdateCustBalSQL,"payUpdateCustBalSQL"))) { + try (PreparedStatement payUpdateCustBal = this.getPreparedStatement(conn, payUpdateCustBalSQL)) { payUpdateCustBal.setDouble(1, c.c_balance); payUpdateCustBal.setDouble(2, c.c_ytd_payment); payUpdateCustBal.setInt(3, c.c_payment_cnt); @@ -432,7 +432,7 @@ private void insertHistory(Connection conn, int w_id, int districtID, int custom } String h_data = w_name + " " + d_name; - try (PreparedStatement payInsertHist = this.getPreparedStatement(conn, this.finalizeSqlStatement(payInsertHistSQL,"payInsertHistSQL"))) { + try (PreparedStatement payInsertHist = this.getPreparedStatement(conn, payInsertHistSQL)) { payInsertHist.setInt(1, customerDistrictID); payInsertHist.setInt(2, customerWarehouseID); payInsertHist.setInt(3, c.c_id); @@ -449,7 +449,7 @@ private void insertHistory(Connection conn, int w_id, int districtID, int custom // prepared statements public Customer getCustomerById(int c_w_id, int c_d_id, int c_id, Connection conn) throws SQLException { - try (PreparedStatement payGetCust = this.getPreparedStatement(conn, this.finalizeSqlStatement(payGetCustSQL,"payGetCustSQL"))) { + try (PreparedStatement payGetCust = this.getPreparedStatement(conn, payGetCustSQL)) { payGetCust.setInt(1, c_w_id); payGetCust.setInt(2, c_d_id); @@ -473,7 +473,7 @@ public Customer getCustomerById(int c_w_id, int c_d_id, int c_id, Connection con public Customer getCustomerByName(int c_w_id, int c_d_id, String customerLastName, Connection conn) throws SQLException { ArrayList customers = new ArrayList<>(); - try (PreparedStatement customerByName = this.getPreparedStatement(conn, this.finalizeSqlStatement(customerByNameSQL,"customerByNameSQL"))) { + try (PreparedStatement customerByName = this.getPreparedStatement(conn, customerByNameSQL)) { customerByName.setInt(1, c_w_id); customerByName.setInt(2, c_d_id); diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/StockLevel.java b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/StockLevel.java index ad428b82d..ca5f836b4 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/StockLevel.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/StockLevel.java @@ -82,7 +82,7 @@ public void run(Connection conn, Random gen, int w_id, int numWarehouses, int te } private int getOrderId(Connection conn, int w_id, int d_id) throws SQLException { - try (PreparedStatement stockGetDistOrderId = this.getPreparedStatement(conn, this.finalizeSqlStatement(stockGetDistOrderIdSQL,"stockGetDistOrderIdSQL"))) { + try (PreparedStatement stockGetDistOrderId = this.getPreparedStatement(conn, stockGetDistOrderIdSQL)) { stockGetDistOrderId.setInt(1, w_id); stockGetDistOrderId.setInt(2, d_id); @@ -98,7 +98,7 @@ private int getOrderId(Connection conn, int w_id, int d_id) throws SQLException } private int getStockCount(Connection conn, int w_id, int threshold, int d_id, int o_id) throws SQLException { - try (PreparedStatement stockGetCountStock = this.getPreparedStatement(conn, this.finalizeSqlStatement(stockGetCountStockSQL,"stockGetCountStockSQL"))) { + try (PreparedStatement stockGetCountStock = this.getPreparedStatement(conn, stockGetCountStockSQL)) { stockGetCountStock.setInt(1, w_id); stockGetCountStock.setInt(2, d_id); stockGetCountStock.setInt(3, o_id); diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q1.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q1.java index e6cf02ba2..d6d901576 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q1.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q1.java @@ -27,7 +27,6 @@ public class Q1 extends GenericQuery { public final SQLStmt query_stmt = new SQLStmt(""" - /*monitor-Q01*/ SELECT l_returnflag, l_linestatus, diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q10.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q10.java index 41bed73dd..4ecac97d8 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q10.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q10.java @@ -28,7 +28,6 @@ public class Q10 extends GenericQuery { public final SQLStmt query_stmt = new SQLStmt(""" - /*monitor-Q10*/ SELECT c_custkey, c_name, diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q11.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q11.java index 7adba319e..131c151f7 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q11.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q11.java @@ -29,7 +29,6 @@ public class Q11 extends GenericQuery { public final SQLStmt query_stmt = new SQLStmt(""" - /*monitor-Q11*/ SELECT ps_partkey, SUM(ps_supplycost * ps_availqty) AS VALUE diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q12.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q12.java index 87c36a783..b394cd2b7 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q12.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q12.java @@ -30,7 +30,6 @@ public class Q12 extends GenericQuery { public final SQLStmt query_stmt = new SQLStmt(""" - /*monitor-Q12*/ SELECT l_shipmode, SUM( diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q13.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q13.java index 1371d2087..21e228cfd 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q13.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q13.java @@ -28,7 +28,6 @@ public class Q13 extends GenericQuery { public final SQLStmt query_stmt = new SQLStmt(""" - /*monitor-Q13*/ SELECT c_count, COUNT(*) AS custdist diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q14.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q14.java index 0fdd97491..9f32516ff 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q14.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q14.java @@ -28,7 +28,6 @@ public class Q14 extends GenericQuery { public final SQLStmt query_stmt = new SQLStmt(""" - /*monitor-Q14*/ SELECT 100.00 * SUM( CASE diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q15.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q15.java index ef86e0b7e..5aca587c1 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q15.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q15.java @@ -28,7 +28,6 @@ public class Q15 extends GenericQuery { public final SQLStmt createview_stmt = new SQLStmt(""" - /*monitor-Q15*/ CREATE view revenue0 (supplier_no, total_revenue) AS SELECT l_suppkey, diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q16.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q16.java index 31a65acbd..70487115f 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q16.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q16.java @@ -31,7 +31,6 @@ public class Q16 extends GenericQuery { public final SQLStmt query_stmt = new SQLStmt(""" - /*monitor-Q16*/ SELECT p_brand, p_type, diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q17.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q17.java index 0ccbe39ad..c72fcb4ab 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q17.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q17.java @@ -29,7 +29,6 @@ public class Q17 extends GenericQuery { public final SQLStmt query_stmt = new SQLStmt(""" - /*monitor-Q17*/ SELECT SUM(l_extendedprice) / 7.0 AS avg_yearly FROM diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q18.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q18.java index f654195fd..5ae8bc433 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q18.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q18.java @@ -27,7 +27,6 @@ public class Q18 extends GenericQuery { public final SQLStmt query_stmt = new SQLStmt(""" - /*monitor-Q18*/ SELECT c_name, c_custkey, diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q19.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q19.java index 2ceb450ba..fbb93e04d 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q19.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q19.java @@ -28,7 +28,6 @@ public class Q19 extends GenericQuery { public final SQLStmt query_stmt = new SQLStmt(""" - /*monitor-Q19*/ SELECT SUM(l_extendedprice* (1 - l_discount)) AS revenue FROM diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q2.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q2.java index d684bcd3c..ff3b55bda 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q2.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q2.java @@ -29,7 +29,6 @@ public class Q2 extends GenericQuery { public final SQLStmt query_stmt = new SQLStmt(""" - /*monitor-Q02*/ SELECT s_acctbal, s_name, diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q20.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q20.java index c8582bc5d..5cb274589 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q20.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q20.java @@ -30,7 +30,6 @@ public class Q20 extends GenericQuery { public final SQLStmt query_stmt = new SQLStmt(""" - /*monitor-Q20*/ SELECT s_name, s_address diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q21.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q21.java index e1ae6ff39..eeacb04ac 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q21.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q21.java @@ -29,7 +29,6 @@ public class Q21 extends GenericQuery { public final SQLStmt query_stmt = new SQLStmt(""" - /*monitor-Q21*/ SELECT s_name, COUNT(*) AS numwait diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q22.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q22.java index 609bc6d7f..6b29285df 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q22.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q22.java @@ -29,7 +29,6 @@ public class Q22 extends GenericQuery { public final SQLStmt query_stmt = new SQLStmt(""" - /*monitor-Q22*/ SELECT cntrycode, COUNT(*) AS numcust, diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q3.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q3.java index 043e3159d..bc8fc3afc 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q3.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q3.java @@ -30,7 +30,6 @@ public class Q3 extends GenericQuery { public final SQLStmt query_stmt = new SQLStmt(""" - /*monitor-Q03*/ SELECT l_orderkey, SUM(l_extendedprice * (1 - l_discount)) AS revenue, diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q4.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q4.java index ee331f818..46081bfb8 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q4.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q4.java @@ -28,7 +28,6 @@ public class Q4 extends GenericQuery { public final SQLStmt query_stmt = new SQLStmt(""" - /*monitor-Q04*/ SELECT o_orderpriority, COUNT(*) AS order_count diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q5.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q5.java index 022b3812b..1bd7932bf 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q5.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q5.java @@ -30,7 +30,6 @@ public class Q5 extends GenericQuery { public final SQLStmt query_stmt = new SQLStmt(""" - /*monitor-Q05*/ SELECT n_name, SUM(l_extendedprice * (1 - l_discount)) AS revenue diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q6.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q6.java index a9a17a40c..40e1cd414 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q6.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q6.java @@ -28,7 +28,6 @@ public class Q6 extends GenericQuery { public final SQLStmt query_stmt = new SQLStmt(""" - /*monitor-Q06*/ SELECT SUM(l_extendedprice * l_discount) AS revenue FROM diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q7.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q7.java index 28a7b15e7..c4f09e761 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q7.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q7.java @@ -29,7 +29,6 @@ public class Q7 extends GenericQuery { public final SQLStmt query_stmt = new SQLStmt(""" - /*monitor-Q07*/ SELECT supp_nation, cust_nation, diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q8.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q8.java index 56e401a1b..ae2366852 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q8.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q8.java @@ -29,7 +29,6 @@ public class Q8 extends GenericQuery { public final SQLStmt query_stmt = new SQLStmt(""" - /*monitor-Q08*/ SELECT o_year, SUM( diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q9.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q9.java index fd48939df..7de35a9bf 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q9.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q9.java @@ -29,7 +29,6 @@ public class Q9 extends GenericQuery { public final SQLStmt query_stmt = new SQLStmt(""" - /*monitor-Q09*/ SELECT nation, o_year, diff --git a/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetFollowers.java b/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetFollowers.java index 5b760fa2d..cbc3c1053 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetFollowers.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetFollowers.java @@ -28,15 +28,15 @@ public class GetFollowers extends Procedure { - public final SQLStmt getFollowers = new SQLStmt("/*monitor-getFolGetFollowers*/ SELECT f2 FROM " + TwitterConstants.TABLENAME_FOLLOWERS + " WHERE f1 = ? LIMIT " + TwitterConstants.LIMIT_FOLLOWERS); + public final SQLStmt getFollowers = new SQLStmt("SELECT f2 FROM " + TwitterConstants.TABLENAME_FOLLOWERS + " WHERE f1 = ? LIMIT " + TwitterConstants.LIMIT_FOLLOWERS); /** * NOTE: The ?? is substituted into a string of repeated ?'s */ - public final SQLStmt getFollowerNames = new SQLStmt("/*monitor-getFolGetFollowerNames*/ SELECT uid, name FROM " + TwitterConstants.TABLENAME_USER + " WHERE uid IN (??)", TwitterConstants.LIMIT_FOLLOWERS); + public final SQLStmt getFollowerNames = new SQLStmt("SELECT uid, name FROM " + TwitterConstants.TABLENAME_USER + " WHERE uid IN (??)", TwitterConstants.LIMIT_FOLLOWERS); public void run(Connection conn, long uid) throws SQLException { - try (PreparedStatement stmt = this.getPreparedStatement(conn, getFollowers)) { + try (PreparedStatement stmt = this.getPreparedStatement(conn, getFollowerNames)) { stmt.setLong(1, uid); try (ResultSet rs = stmt.executeQuery()) { diff --git a/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetTweet.java b/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetTweet.java index 447f2ddb3..f5c26e8a3 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetTweet.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetTweet.java @@ -29,12 +29,11 @@ public class GetTweet extends Procedure { public SQLStmt getTweet = new SQLStmt( - "/*monitor-getTweet*/" + "SELECT * FROM " + TwitterConstants.TABLENAME_TWEETS + " WHERE id = ?" ); public void run(Connection conn, long tweet_id) throws SQLException { - try (PreparedStatement stmt = this.getPreparedStatement(conn, getTweet)) { + try (PreparedStatement stmt = this.getPreparedStatement(conn, getTweet,"getTweet")) { stmt.setLong(1, tweet_id); try (ResultSet rs = stmt.executeQuery()) { } diff --git a/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetTweetsFromFollowing.java b/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetTweetsFromFollowing.java index 59bb045ea..de378f53b 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetTweetsFromFollowing.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetTweetsFromFollowing.java @@ -29,19 +29,19 @@ public class GetTweetsFromFollowing extends Procedure { - public final SQLStmt getFollowing = new SQLStmt("/*monitor-getTwtFolGetFollowing*/ SELECT f2 FROM " + TwitterConstants.TABLENAME_FOLLOWS + " WHERE f1 = ? LIMIT " + TwitterConstants.LIMIT_FOLLOWERS); + public final SQLStmt getFollowing = new SQLStmt("SELECT f2 FROM " + TwitterConstants.TABLENAME_FOLLOWS + " WHERE f1 = ? LIMIT " + TwitterConstants.LIMIT_FOLLOWERS); /** * NOTE: The ?? is substituted into a string of repeated ?'s */ - public final SQLStmt getTweets = new SQLStmt("/*monitor-getTwtFolGetTweets*/ SELECT * FROM " + TwitterConstants.TABLENAME_TWEETS + " WHERE uid IN (??)", TwitterConstants.LIMIT_FOLLOWERS); + public final SQLStmt getTweets = new SQLStmt("SELECT * FROM " + TwitterConstants.TABLENAME_TWEETS + " WHERE uid IN (??)", TwitterConstants.LIMIT_FOLLOWERS); public void run(Connection conn, int uid) throws SQLException { - try (PreparedStatement getFollowingStatement = this.getPreparedStatement(conn, getFollowing)) { + try (PreparedStatement getFollowingStatement = this.getPreparedStatement(conn, getFollowing,"getFollowing")) { getFollowingStatement.setLong(1, uid); try (ResultSet followingResult = getFollowingStatement.executeQuery()) { - try (PreparedStatement stmt = this.getPreparedStatement(conn, getTweets)) { + try (PreparedStatement stmt = this.getPreparedStatement(conn, getTweets,"getTweets")) { int ctr = 0; long last = -1; while (followingResult.next() && ctr++ < TwitterConstants.LIMIT_FOLLOWERS) { diff --git a/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetUserTweets.java b/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetUserTweets.java index cde21a06c..da992a4f8 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetUserTweets.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetUserTweets.java @@ -28,10 +28,10 @@ public class GetUserTweets extends Procedure { - public final SQLStmt getTweets = new SQLStmt("/*monitor-getUserTweets*/ SELECT * FROM " + TwitterConstants.TABLENAME_TWEETS + " WHERE uid = ? LIMIT " + TwitterConstants.LIMIT_TWEETS_FOR_UID); + public final SQLStmt getTweets = new SQLStmt("SELECT * FROM " + TwitterConstants.TABLENAME_TWEETS + " WHERE uid = ? LIMIT " + TwitterConstants.LIMIT_TWEETS_FOR_UID); public void run(Connection conn, long uid) throws SQLException { - try (PreparedStatement stmt = this.getPreparedStatement(conn, getTweets)) { + try (PreparedStatement stmt = this.getPreparedStatement(conn, getTweets,"getTweets")) { stmt.setLong(1, uid); try (ResultSet rs = stmt.executeQuery()) { } diff --git a/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/InsertTweet.java b/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/InsertTweet.java index ee822fa55..252c9267d 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/InsertTweet.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/InsertTweet.java @@ -29,10 +29,10 @@ public class InsertTweet extends Procedure { //FIXME: Carlo is this correct? 1) added_tweets is empty initially 2) id is supposed to be not null - public final SQLStmt insertTweet = new SQLStmt("/*monitor-insertTweet*/ INSERT INTO " + TwitterConstants.TABLENAME_ADDED_TWEETS + " (uid,text,createdate) VALUES (?, ?, ?)"); + public final SQLStmt insertTweet = new SQLStmt("INSERT INTO " + TwitterConstants.TABLENAME_ADDED_TWEETS + " (uid,text,createdate) VALUES (?, ?, ?)"); public boolean run(Connection conn, long uid, String text, Time time) throws SQLException { - try (PreparedStatement stmt = this.getPreparedStatement(conn, insertTweet)) { + try (PreparedStatement stmt = this.getPreparedStatement(conn, insertTweet,"insertTweet")) { stmt.setLong(1, uid); stmt.setString(2, text); stmt.setDate(3, new java.sql.Date(System.currentTimeMillis())); diff --git a/src/main/java/com/oltpbenchmark/util/MonitoringUtil.java b/src/main/java/com/oltpbenchmark/util/MonitoringUtil.java index d3e96426b..914fe5eb7 100644 --- a/src/main/java/com/oltpbenchmark/util/MonitoringUtil.java +++ b/src/main/java/com/oltpbenchmark/util/MonitoringUtil.java @@ -20,7 +20,7 @@ public abstract class MonitoringUtil { private final static String MONITORING_MARKER = "/* MONITOR-$queryId */"; - private final static String MONITORING_PREFIX = "/* MONITOR"; + private final static String MONITORING_PREFIX = "/* MONITOR-"; private final static String MONITORING_QUERYID = "$queryId"; private final static String MONITORING_SUFFIX = " */"; diff --git a/src/main/resources/benchmarks/tpch/dialect-postgres.xml b/src/main/resources/benchmarks/tpch/dialect-postgres.xml index 4ab6ae54e..a5ec4da59 100644 --- a/src/main/resources/benchmarks/tpch/dialect-postgres.xml +++ b/src/main/resources/benchmarks/tpch/dialect-postgres.xml @@ -3,76 +3,65 @@ - /*monitor-Q01*/ select l_returnflag, l_linestatus, sum(l_quantity) as sum_qty, sum(l_extendedprice) as sum_base_price, sum(l_extendedprice * (1 - l_discount)) as sum_disc_price, sum(l_extendedprice * (1 - l_discount) * (1 + l_tax)) as sum_charge, avg(l_quantity) as avg_qty, avg(l_extendedprice) as avg_price, avg(l_discount) as avg_disc, count(*) as count_order from lineitem where l_shipdate <= date '1998-12-01' - concat(?,' day')::interval group by l_returnflag, l_linestatus order by l_returnflag, l_linestatus - /*monitor-Q03*/ select l_orderkey, sum(l_extendedprice * (1 - l_discount)) as revenue, o_orderdate, o_shippriority from customer, orders, lineitem where c_mktsegment = ? and c_custkey = o_custkey and l_orderkey = o_orderkey and o_orderdate < ?::date and l_shipdate > ?::date group by l_orderkey, o_orderdate, o_shippriority order by revenue desc, o_orderdate limit 10 - /*monitor-Q04*/ select o_orderpriority, count(*) as order_count from orders where o_orderdate >= ?::date and o_orderdate < ?::date + interval '3' month and exists ( select * from lineitem where l_orderkey = o_orderkey and l_commitdate < l_receiptdate ) group by o_orderpriority order by o_orderpriority - /*monitor-Q05*/ select n_name, sum(l_extendedprice * (1 - l_discount)) as revenue from customer, orders, lineitem, supplier, nation, region where c_custkey = o_custkey and l_orderkey = o_orderkey and l_suppkey = s_suppkey and c_nationkey = s_nationkey and s_nationkey = n_nationkey and n_regionkey = r_regionkey and r_name = ? and o_orderdate >= ?::date and o_orderdate < ?::date + interval '1' year group by n_name order by revenue desc; - /*monitor-Q06*/ select sum(l_extendedprice * l_discount) as revenue from lineitem where l_shipdate >= ?::date and l_shipdate < ?::date + interval '1' year and l_discount between ?::decimal - 0.01 and ?::decimal + 0.01 and l_quantity < ? - /*monitor-Q10*/ select c_custkey, c_name, sum(l_extendedprice * (1 - l_discount)) as revenue, c_acctbal, n_name, c_address, c_phone, c_comment from customer, orders, lineitem, nation where c_custkey = o_custkey and l_orderkey = o_orderkey and o_orderdate >= ?::date and o_orderdate < ?::date + interval '3' month and l_returnflag = 'R' and c_nationkey = n_nationkey group by c_custkey, c_name, c_acctbal, c_phone, n_name, c_address, c_comment order by revenue desc limit 20 - /*monitor-Q12*/ select l_shipmode, sum(case when o_orderpriority = '1-URGENT' or o_orderpriority = '2-HIGH' then 1 else 0 end) as high_line_count, sum(case when o_orderpriority <> '1-URGENT' and o_orderpriority <> '2-HIGH' then 1 else 0 end) as low_line_count from orders, lineitem where o_orderkey = l_orderkey and l_shipmode in (?, ?) and l_commitdate < l_receiptdate and l_shipdate < l_commitdate and l_receiptdate >= ?::date and l_receiptdate < ?::date + interval '1' year group by l_shipmode order by l_shipmode - /*monitor-Q14*/ select 100.00 * sum(case when p_type like 'PROMO%' then l_extendedprice * (1 - l_discount) else 0 end) / sum(l_extendedprice * (1 - l_discount)) as promo_revenue from lineitem, part where l_partkey = p_partkey and l_shipdate >= ?::date and l_shipdate < ?::date + interval '1' month - /*monitor-Q15*/ create view revenue0 (supplier_no, total_revenue) as select l_suppkey, sum(l_extendedprice * (1 - l_discount)) from lineitem where l_shipdate >= ?::date and l_shipdate < ?::date + interval '3' month group by l_suppkey - /*monitor-Q20*/ select s_name, s_address from supplier, nation where s_suppkey in ( select ps_suppkey from partsupp where ps_partkey in ( select p_partkey from part where p_name like ? ) and ps_availqty > ( select 0.5 * sum(l_quantity) from lineitem where l_partkey = ps_partkey and l_suppkey = ps_suppkey and l_shipdate >= ?::date and l_shipdate < ?::date + interval '1' year ) ) and s_nationkey = n_nationkey and n_name = ? order by s_name - /*monitor-Q22*/ select cntrycode, count(*) as numcust, sum(c_acctbal) as totacctbal from ( select substring(c_phone from 1 for 2) as cntrycode, c_acctbal from customer where substring(c_phone from 1 for 2) in (?, ?, ?, ?, ?, ?, ?) and c_acctbal > ( select avg(c_acctbal) from customer where c_acctbal > 0.00 and substring(c_phone from 1 for 2) in (?, ?, ?, ?, ?, ?, ?) ) and not exists ( select * from orders where o_custkey = c_custkey ) ) as custsale group by cntrycode order by cntrycode diff --git a/src/main/resources/benchmarks/tpch/dialect-sqlserver.xml b/src/main/resources/benchmarks/tpch/dialect-sqlserver.xml index 01b643720..cd849d91d 100644 --- a/src/main/resources/benchmarks/tpch/dialect-sqlserver.xml +++ b/src/main/resources/benchmarks/tpch/dialect-sqlserver.xml @@ -3,103 +3,86 @@ - /*monitor-Q01*/ select l_returnflag, l_linestatus, sum(l_quantity) as sum_qty, sum(l_extendedprice) as sum_base_price, sum(l_extendedprice * (1 - l_discount)) as sum_disc_price, sum(l_extendedprice * (1 - l_discount) * (1 + l_tax)) as sum_charge, avg(l_quantity) as avg_qty, avg(l_extendedprice) as avg_price, avg(l_discount) as avg_disc, count(*) as count_order from lineitem where l_shipdate <= dateadd(dd, -1 * ?, cast('1998-12-01' as datetime)) group by l_returnflag, l_linestatus order by l_returnflag, l_linestatus - /*monitor-Q02*/ select top 100 s_acctbal, s_name, n_name, p_partkey, p_mfgr, s_address, s_phone, s_comment from part, supplier, partsupp, nation, region where p_partkey = ps_partkey and s_suppkey = ps_suppkey and p_size = ? and p_type like ? and s_nationkey = n_nationkey and n_regionkey = r_regionkey and r_name = ? and ps_supplycost = ( select min(ps_supplycost) from partsupp, supplier, nation, region where p_partkey = ps_partkey and s_suppkey = ps_suppkey and s_nationkey = n_nationkey and n_regionkey = r_regionkey and r_name = ? ) order by s_acctbal desc, n_name, s_name, p_partkey - /*monitor-Q03*/ select top 10 l_orderkey, sum(l_extendedprice * (1 - l_discount)) as revenue, o_orderdate, o_shippriority from customer, orders, lineitem where c_mktsegment = ? and c_custkey = o_custkey and l_orderkey = o_orderkey and o_orderdate < ? and l_shipdate > ? group by l_orderkey, o_orderdate, o_shippriority order by revenue desc, o_orderdate - /*monitor-Q04*/ select o_orderpriority, count(*) as order_count from orders where o_orderdate >= ? and o_orderdate < dateadd(mm, 3, cast(? as datetime)) and exists ( select * from lineitem where l_orderkey = o_orderkey and l_commitdate < l_receiptdate ) group by o_orderpriority order by o_orderpriority - /*monitor-Q05*/ select n_name, sum(l_extendedprice * (1 - l_discount)) as revenue from customer, orders, lineitem, supplier, nation, region where c_custkey = o_custkey and l_orderkey = o_orderkey and l_suppkey = s_suppkey and c_nationkey = s_nationkey and s_nationkey = n_nationkey and n_regionkey = r_regionkey and r_name = ? and o_orderdate >= ? and o_orderdate < dateadd(YY, 1, cast(? as datetime)) group by n_name order by revenue desc - /*monitor-Q06*/ select sum(l_extendedprice * l_discount) as revenue from lineitem where l_shipdate >= ? and l_shipdate < dateadd(yy, 1, cast(? as datetime)) and l_discount between ? - 0.01 and ? + 0.01 and l_quantity < ? - /*monitor-Q07*/ select supp_nation, cust_nation, l_year, sum(volume) as revenue from ( select n1.n_name as supp_nation, n2.n_name as cust_nation, datepart(yy, l_shipdate) as l_year, l_extendedprice * (1 - l_discount) as volume from supplier, lineitem, orders, customer, nation n1, nation n2 where s_suppkey = l_suppkey and o_orderkey = l_orderkey and c_custkey = o_custkey and s_nationkey = n1.n_nationkey and c_nationkey = n2.n_nationkey and ( (n1.n_name = ? and n2.n_name = ?) or (n1.n_name = ? and n2.n_name = ?) ) and l_shipdate between '1995-01-01' and '1996-12-31' ) as shipping group by supp_nation, cust_nation, l_year order by supp_nation, cust_nation, l_year - /*monitor-Q08*/ select o_year, sum(case when nation = ? then volume else 0 end) / sum(volume) as mkt_share from ( select datepart(yy,o_orderdate) as o_year, l_extendedprice * (1 - l_discount) as volume, n2.n_name as nation from part, supplier, lineitem, orders, customer, nation n1, nation n2, region where p_partkey = l_partkey and s_suppkey = l_suppkey and l_orderkey = o_orderkey and o_custkey = c_custkey and c_nationkey = n1.n_nationkey and n1.n_regionkey = r_regionkey and r_name = ? and s_nationkey = n2.n_nationkey and o_orderdate between '1995-01-01' and '1996-12-31' and p_type = ? ) as all_nations group by o_year order by o_year - /*monitor-Q09*/ select nation, o_year, sum(amount) as sum_profit from ( select n_name as nation, datepart(yy, o_orderdate) as o_year, l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity as amount from part, supplier, lineitem, partsupp, orders, nation where s_suppkey = l_suppkey and ps_suppkey = l_suppkey and ps_partkey = l_partkey and p_partkey = l_partkey and o_orderkey = l_orderkey and s_nationkey = n_nationkey and p_name like ? ) as profit group by nation, o_year order by nation, o_year desc - /*monitor-Q10*/ select top 20 c_custkey, c_name, sum(l_extendedprice * (1 - l_discount)) as revenue, c_acctbal, n_name, c_address, c_phone, c_comment from customer, orders, lineitem, nation where c_custkey = o_custkey and l_orderkey = o_orderkey and o_orderdate >= ? and o_orderdate < dateadd(mm, 3, cast(? as datetime)) and l_returnflag = 'R' and c_nationkey = n_nationkey group by c_custkey, c_name, c_acctbal, c_phone, n_name, c_address, c_comment order by revenue desc - /*monitor-Q12*/ select l_shipmode, sum(case when o_orderpriority = '1-URGENT' or o_orderpriority = '2-HIGH' then 1 else 0 end) as high_line_count, sum(case when o_orderpriority <> '1-URGENT' and o_orderpriority <> '2-HIGH' then 1 else 0 end) as low_line_count from orders, lineitem where o_orderkey = l_orderkey and l_shipmode in (?, ?) and l_commitdate < l_receiptdate and l_shipdate < l_commitdate and l_receiptdate >= ? and l_receiptdate < dateadd(mm, 1, cast(? as datetime)) group by l_shipmode order by l_shipmode - /*monitor-Q14*/ select 100.00 * sum(case when p_type like 'PROMO%' then l_extendedprice * (1 - l_discount) else 0 end) / sum(l_extendedprice * (1 - l_discount)) as promo_revenue from lineitem, part where l_partkey = p_partkey and l_shipdate >= ? and l_shipdate < dateadd(mm, 1, cast(? as datetime)) - /*monitor-Q15*/ create view revenue0 (supplier_no, total_revenue) as select l_suppkey, sum(l_extendedprice * (1 - l_discount)) from lineitem where l_shipdate >= ? and l_shipdate < dateadd(mm, 3, cast(? as datetime)) group by l_suppkey - /*monitor-Q18*/ select top 100 c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice, sum(l_quantity) from customer, orders, lineitem where o_orderkey in ( select l_orderkey from lineitem group by l_orderkey having sum(l_quantity) > ? ) and c_custkey = o_custkey and o_orderkey = l_orderkey group by c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice order by o_totalprice desc, o_orderdate - /*monitor-Q20*/ select s_name, s_address from supplier, nation where s_suppkey in ( select ps_suppkey from partsupp where ps_partkey in ( select p_partkey from part where p_name like ? ) and ps_availqty > ( select 0.5 * sum(l_quantity) from lineitem where l_partkey = ps_partkey and l_suppkey = ps_suppkey and l_shipdate >= ? and l_shipdate < dateadd(yy, 1, cast(? as datetime)) ) ) and s_nationkey = n_nationkey and n_name = ? order by s_name - /*monitor-Q21*/ select top 100 s_name, count(*) as numwait from supplier, lineitem l1, orders, nation where s_suppkey = l1.l_suppkey and o_orderkey = l1.l_orderkey and o_orderstatus = 'F' and l1.l_receiptdate > l1.l_commitdate and exists ( select * from lineitem l2 where l2.l_orderkey = l1.l_orderkey and l2.l_suppkey <> l1.l_suppkey ) and not exists ( select * from lineitem l3 where l3.l_orderkey = l1.l_orderkey and l3.l_suppkey <> l1.l_suppkey and l3.l_receiptdate > l3.l_commitdate ) and s_nationkey = n_nationkey and n_name = ? group by s_name order by numwait desc, s_name - /*monitor-Q22*/ select cntrycode, count(*) as numcust, sum(c_acctbal) as totacctbal from ( select substring(c_phone, 1, 2) as cntrycode, c_acctbal from customer where substring(c_phone, 1, 2) in (?, ?, ?, ?, ?, ?, ?) and c_acctbal > ( select avg(c_acctbal) from customer where c_acctbal > 0.00 and substring(c_phone, 1, 2) in (?, ?, ?, ?, ?, ?, ?) ) and not exists ( select * from orders where o_custkey = c_custkey ) ) as custsale group by cntrycode order by cntrycode diff --git a/src/main/resources/benchmarks/twitter/dialect-sqlserver.xml b/src/main/resources/benchmarks/twitter/dialect-sqlserver.xml index 3aadb3515..282d9e92f 100644 --- a/src/main/resources/benchmarks/twitter/dialect-sqlserver.xml +++ b/src/main/resources/benchmarks/twitter/dialect-sqlserver.xml @@ -3,33 +3,27 @@ - /*monitor-getTweet*/ SELECT * FROM "tweets" WHERE id = ? - /*monitor-getTwtFolGetFollowing*/ SELECT TOP 20 f2 FROM "follows" WHERE f1 = ? - /*monitor-getTwtFolGetTweets*/ SELECT * FROM "tweets" WHERE uid IN (??) - /*monitor-getFolGetFollowers*/ SELECT TOP 20 f2 FROM "followers" WHERE f1 = ? - /*monitor-getFolGetFollowerNames*/ SELECT uid, name FROM "user_profiles" WHERE uid IN (??) - /*monitor-getUserTweets*/ SELECT TOP 10 * FROM "tweets" WHERE uid = ? From b9f0c310311eb823a7879ec9b85f378427bbed71 Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Wed, 26 Apr 2023 14:43:10 +0200 Subject: [PATCH 25/67] Expand advanced monitoring to bugfix issues. --- src/main/java/com/oltpbenchmark/api/Procedure.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/oltpbenchmark/api/Procedure.java b/src/main/java/com/oltpbenchmark/api/Procedure.java index 6027c17b2..90ffb0774 100644 --- a/src/main/java/com/oltpbenchmark/api/Procedure.java +++ b/src/main/java/com/oltpbenchmark/api/Procedure.java @@ -19,7 +19,6 @@ import com.oltpbenchmark.jdbc.AutoIncrementPreparedStatement; import com.oltpbenchmark.types.DatabaseType; -import com.oltpbenchmark.util.MonitoringUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -79,9 +78,14 @@ protected final String getProcedureName() { * Enable monitoring for this procedure by adding a monitoring prefix. */ public void enabledAdvancedMonitoring() { - for (Entry entry : name_stmt_xref.entrySet()) { - entry.getValue().addPrefix(entry.getKey()); + Map modified_name_stmt_xref = new HashMap<>(); + for (Entry entry : this.getStatements().entrySet()) { + SQLStmt stmt = entry.getValue(); + stmt.addPrefix(entry.getKey()); + modified_name_stmt_xref.put(entry.getKey(), stmt); + LOG.info("Enabling advanced monitoring for: " + entry.getKey()); } + this.name_stmt_xref = modified_name_stmt_xref; } /** From a44b518f57d722aeaa685fcd4986f066498728a1 Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Wed, 26 Apr 2023 15:06:47 +0200 Subject: [PATCH 26/67] Make advanced monitoring analogous to loading dialects. --- .../oltpbenchmark/api/BenchmarkModule.java | 3 +++ .../java/com/oltpbenchmark/api/Procedure.java | 26 ++++++++----------- .../java/com/oltpbenchmark/api/Worker.java | 3 --- .../twitter/procedures/GetTweet.java | 2 +- 4 files changed, 15 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/oltpbenchmark/api/BenchmarkModule.java b/src/main/java/com/oltpbenchmark/api/BenchmarkModule.java index ddd0a6cc0..377a518c8 100644 --- a/src/main/java/com/oltpbenchmark/api/BenchmarkModule.java +++ b/src/main/java/com/oltpbenchmark/api/BenchmarkModule.java @@ -363,6 +363,9 @@ public Map getProcedures() { proc.initialize(this.workConf.getDatabaseType()); proc_xref.put(txn, proc); proc.loadSQLDialect(this.dialects); + if (this.workConf.getMonitoringEnabled()) { + proc.enabledAdvancedMonitoring(); + } } } if (proc_xref.isEmpty()) { diff --git a/src/main/java/com/oltpbenchmark/api/Procedure.java b/src/main/java/com/oltpbenchmark/api/Procedure.java index 90ffb0774..c78d7ec89 100644 --- a/src/main/java/com/oltpbenchmark/api/Procedure.java +++ b/src/main/java/com/oltpbenchmark/api/Procedure.java @@ -32,7 +32,6 @@ import java.util.Collections; import java.util.HashMap; import java.util.Map; -import java.util.Map.Entry; public abstract class Procedure { private static final Logger LOG = LoggerFactory.getLogger(Procedure.class); @@ -74,20 +73,6 @@ protected final String getProcedureName() { return (this.procName); } - /** - * Enable monitoring for this procedure by adding a monitoring prefix. - */ - public void enabledAdvancedMonitoring() { - Map modified_name_stmt_xref = new HashMap<>(); - for (Entry entry : this.getStatements().entrySet()) { - SQLStmt stmt = entry.getValue(); - stmt.addPrefix(entry.getKey()); - modified_name_stmt_xref.put(entry.getKey(), stmt); - LOG.info("Enabling advanced monitoring for: " + entry.getKey()); - } - this.name_stmt_xref = modified_name_stmt_xref; - } - /** * Return a PreparedStatement for the given SQLStmt handle * The underlying Procedure API will make sure that the proper SQL @@ -172,6 +157,17 @@ protected final void loadSQLDialect(StatementDialects dialects) { } } + /** + * Enable monitoring for this procedure by adding a monitoring prefixes. + */ + protected final void enabledAdvancedMonitoring() { + for (String stmtName : this.getStatements().keySet()) { + SQLStmt stmt = this.name_stmt_xref.get(stmtName); + stmt.addPrefix(stmtName); + LOG.info("Enabling advanced monitoring for: " + stmtName); + } + } + /** * Hook for testing * diff --git a/src/main/java/com/oltpbenchmark/api/Worker.java b/src/main/java/com/oltpbenchmark/api/Worker.java index 653fa46c1..f1cdf68ee 100644 --- a/src/main/java/com/oltpbenchmark/api/Worker.java +++ b/src/main/java/com/oltpbenchmark/api/Worker.java @@ -88,9 +88,6 @@ public Worker(T benchmark, int id) { this.procedures.putAll(this.benchmark.getProcedures()); for (Entry e : this.procedures.entrySet()) { Procedure proc = e.getValue(); - if (configuration.getMonitoringEnabled()) { - proc.enabledAdvancedMonitoring(); - } this.name_procedures.put(e.getKey().getName(), proc); this.class_procedures.put(proc.getClass(), proc); } diff --git a/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetTweet.java b/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetTweet.java index f5c26e8a3..8c94295d8 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetTweet.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetTweet.java @@ -33,7 +33,7 @@ public class GetTweet extends Procedure { ); public void run(Connection conn, long tweet_id) throws SQLException { - try (PreparedStatement stmt = this.getPreparedStatement(conn, getTweet,"getTweet")) { + try (PreparedStatement stmt = this.getPreparedStatement(conn, getTweet)) { stmt.setLong(1, tweet_id); try (ResultSet rs = stmt.executeQuery()) { } From 888bdf622b4868a4beea86300fe7bb1d433f98fe Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Wed, 26 Apr 2023 15:08:09 +0200 Subject: [PATCH 27/67] Remove superfluous strings. --- .../benchmarks/twitter/procedures/GetTweetsFromFollowing.java | 4 ++-- .../benchmarks/twitter/procedures/GetUserTweets.java | 2 +- .../benchmarks/twitter/procedures/InsertTweet.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetTweetsFromFollowing.java b/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetTweetsFromFollowing.java index de378f53b..d29492dce 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetTweetsFromFollowing.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetTweetsFromFollowing.java @@ -37,11 +37,11 @@ public class GetTweetsFromFollowing extends Procedure { public final SQLStmt getTweets = new SQLStmt("SELECT * FROM " + TwitterConstants.TABLENAME_TWEETS + " WHERE uid IN (??)", TwitterConstants.LIMIT_FOLLOWERS); public void run(Connection conn, int uid) throws SQLException { - try (PreparedStatement getFollowingStatement = this.getPreparedStatement(conn, getFollowing,"getFollowing")) { + try (PreparedStatement getFollowingStatement = this.getPreparedStatement(conn, getFollowing)) { getFollowingStatement.setLong(1, uid); try (ResultSet followingResult = getFollowingStatement.executeQuery()) { - try (PreparedStatement stmt = this.getPreparedStatement(conn, getTweets,"getTweets")) { + try (PreparedStatement stmt = this.getPreparedStatement(conn, getTweets)) { int ctr = 0; long last = -1; while (followingResult.next() && ctr++ < TwitterConstants.LIMIT_FOLLOWERS) { diff --git a/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetUserTweets.java b/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetUserTweets.java index da992a4f8..6815f4095 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetUserTweets.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetUserTweets.java @@ -31,7 +31,7 @@ public class GetUserTweets extends Procedure { public final SQLStmt getTweets = new SQLStmt("SELECT * FROM " + TwitterConstants.TABLENAME_TWEETS + " WHERE uid = ? LIMIT " + TwitterConstants.LIMIT_TWEETS_FOR_UID); public void run(Connection conn, long uid) throws SQLException { - try (PreparedStatement stmt = this.getPreparedStatement(conn, getTweets,"getTweets")) { + try (PreparedStatement stmt = this.getPreparedStatement(conn, getTweets)) { stmt.setLong(1, uid); try (ResultSet rs = stmt.executeQuery()) { } diff --git a/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/InsertTweet.java b/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/InsertTweet.java index 252c9267d..96a1797a5 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/InsertTweet.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/InsertTweet.java @@ -32,7 +32,7 @@ public class InsertTweet extends Procedure { public final SQLStmt insertTweet = new SQLStmt("INSERT INTO " + TwitterConstants.TABLENAME_ADDED_TWEETS + " (uid,text,createdate) VALUES (?, ?, ?)"); public boolean run(Connection conn, long uid, String text, Time time) throws SQLException { - try (PreparedStatement stmt = this.getPreparedStatement(conn, insertTweet,"insertTweet")) { + try (PreparedStatement stmt = this.getPreparedStatement(conn, insertTweet)) { stmt.setLong(1, uid); stmt.setString(2, text); stmt.setDate(3, new java.sql.Date(System.currentTimeMillis())); From 6f22cf5582bc46bce9c817a9752901b0ebb27308 Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Wed, 26 Apr 2023 15:14:23 +0200 Subject: [PATCH 28/67] debugging --- .../com/oltpbenchmark/benchmarks/tpcc/procedures/NewOrder.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/NewOrder.java b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/NewOrder.java index 99d0a4267..d535baa13 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/NewOrder.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/NewOrder.java @@ -350,6 +350,7 @@ private void getWarehouse(Connection conn, int w_id) throws SQLException { private void getCustomer(Connection conn, int w_id, int d_id, int c_id) throws SQLException { try (PreparedStatement stmtGetCust = this.getPreparedStatement(conn, stmtGetCustSQL)) { + LOG.info("query: " + stmtGetCustSQL.getSQL()); stmtGetCust.setInt(1, w_id); stmtGetCust.setInt(2, d_id); stmtGetCust.setInt(3, c_id); From fda6d319ce29a17968da8926561770958323a714 Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Wed, 26 Apr 2023 15:19:40 +0200 Subject: [PATCH 29/67] remove logging --- .../com/oltpbenchmark/benchmarks/tpcc/procedures/NewOrder.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/NewOrder.java b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/NewOrder.java index d535baa13..99d0a4267 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/NewOrder.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/NewOrder.java @@ -350,7 +350,6 @@ private void getWarehouse(Connection conn, int w_id) throws SQLException { private void getCustomer(Connection conn, int w_id, int d_id, int c_id) throws SQLException { try (PreparedStatement stmtGetCust = this.getPreparedStatement(conn, stmtGetCustSQL)) { - LOG.info("query: " + stmtGetCustSQL.getSQL()); stmtGetCust.setInt(1, w_id); stmtGetCust.setInt(2, d_id); stmtGetCust.setInt(3, c_id); From af03f99638d87b56411d8dffc2b3f472865f8c37 Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Wed, 26 Apr 2023 15:25:39 +0200 Subject: [PATCH 30/67] Same structure as dialects. --- src/main/java/com/oltpbenchmark/api/Procedure.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/oltpbenchmark/api/Procedure.java b/src/main/java/com/oltpbenchmark/api/Procedure.java index c78d7ec89..3980f1331 100644 --- a/src/main/java/com/oltpbenchmark/api/Procedure.java +++ b/src/main/java/com/oltpbenchmark/api/Procedure.java @@ -163,8 +163,11 @@ protected final void loadSQLDialect(StatementDialects dialects) { protected final void enabledAdvancedMonitoring() { for (String stmtName : this.getStatements().keySet()) { SQLStmt stmt = this.name_stmt_xref.get(stmtName); + if (LOG.isDebugEnabled()) { + LOG.debug(String.format("Enabling advanced monitoring for query %s", + stmtName)); + } stmt.addPrefix(stmtName); - LOG.info("Enabling advanced monitoring for: " + stmtName); } } From 80f0cc3954c33b04dbfe419f11f5d1f9e2a9a32f Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Wed, 26 Apr 2023 16:13:52 +0200 Subject: [PATCH 31/67] bugfix --- .../com/oltpbenchmark/benchmarks/tpcc/procedures/Delivery.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Delivery.java b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Delivery.java index 02e3564dc..111334d70 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Delivery.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Delivery.java @@ -39,7 +39,7 @@ public class Delivery extends TPCCProcedure { WHERE NO_D_ID = ? AND NO_W_ID = ? ORDER BY NO_O_ID ASC - LIMIT 1) + LIMIT 1 """.formatted(TPCCConstants.TABLENAME_NEWORDER)); public SQLStmt delivDeleteNewOrderSQL = new SQLStmt( From 725645f754b19cf124ff19be9df9747019b64a5c Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Thu, 27 Apr 2023 07:41:31 +0200 Subject: [PATCH 32/67] Reverse changes to Twitter/TPC-H. --- .../java/com/oltpbenchmark/benchmarks/tpch/TPCHWorker.java | 5 +---- .../benchmarks/twitter/procedures/GetFollowers.java | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/TPCHWorker.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/TPCHWorker.java index d6a8df648..fe90df3bf 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/TPCHWorker.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/TPCHWorker.java @@ -27,12 +27,9 @@ import java.sql.Connection; import java.sql.SQLException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; public class TPCHWorker extends Worker { - private static final Logger LOG = LoggerFactory.getLogger(TPCHWorker.class); - + private final RandomGenerator rand; public TPCHWorker(TPCHBenchmark benchmarkModule, int id) { diff --git a/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetFollowers.java b/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetFollowers.java index cbc3c1053..9f62bb5ba 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetFollowers.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetFollowers.java @@ -40,7 +40,7 @@ public void run(Connection conn, long uid) throws SQLException { stmt.setLong(1, uid); try (ResultSet rs = stmt.executeQuery()) { - try (PreparedStatement getFollowerNamesstmt = this.getPreparedStatement(conn, getFollowerNames)) { + try (PreparedStatement getFollowerNamesstmt = this.getPreparedStatement(conn, getFollowers)) { int ctr = 0; long last = -1; while (rs.next() && ctr++ < TwitterConstants.LIMIT_FOLLOWERS) { From 4e80e5027a47b9aa52a6957091112d1b88db5c94 Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Thu, 27 Apr 2023 07:50:25 +0200 Subject: [PATCH 33/67] Debugging advanced monitoring. --- src/main/java/com/oltpbenchmark/api/Procedure.java | 9 ++++++++- src/main/java/com/oltpbenchmark/api/SQLStmt.java | 8 -------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/oltpbenchmark/api/Procedure.java b/src/main/java/com/oltpbenchmark/api/Procedure.java index 3980f1331..0080aadd3 100644 --- a/src/main/java/com/oltpbenchmark/api/Procedure.java +++ b/src/main/java/com/oltpbenchmark/api/Procedure.java @@ -19,6 +19,7 @@ import com.oltpbenchmark.jdbc.AutoIncrementPreparedStatement; import com.oltpbenchmark.types.DatabaseType; +import com.oltpbenchmark.util.MonitoringUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -167,7 +168,13 @@ protected final void enabledAdvancedMonitoring() { LOG.debug(String.format("Enabling advanced monitoring for query %s", stmtName)); } - stmt.addPrefix(stmtName); + // Create monitoring prefix. + String prefix = MonitoringUtil.getMonitoringMarker(); + prefix = prefix.replace(MonitoringUtil.getMonitoringQueryId(), stmtName); + // Update SQL string. + stmt.setSQL(prefix + stmt.getSQL()); + + LOG.info("Setting SQL for key " + stmtName + " to " + stmt.getSQL()); } } diff --git a/src/main/java/com/oltpbenchmark/api/SQLStmt.java b/src/main/java/com/oltpbenchmark/api/SQLStmt.java index 8498ece52..f363d4e64 100644 --- a/src/main/java/com/oltpbenchmark/api/SQLStmt.java +++ b/src/main/java/com/oltpbenchmark/api/SQLStmt.java @@ -78,14 +78,6 @@ public final void setSQL(String sql) { } } - /** - * Adds a prefix to the query string. - * @param prefix - */ - public final void addPrefix(String prefix) { - this.setSQL(prefix + sql); - } - public final String getSQL() { return (this.sql); } From c29dbe0902b2e457770ef2f056642b1ee810fbc5 Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Thu, 27 Apr 2023 07:56:07 +0200 Subject: [PATCH 34/67] Remove debugging message. --- src/main/java/com/oltpbenchmark/api/Procedure.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/com/oltpbenchmark/api/Procedure.java b/src/main/java/com/oltpbenchmark/api/Procedure.java index 0080aadd3..2700b5d53 100644 --- a/src/main/java/com/oltpbenchmark/api/Procedure.java +++ b/src/main/java/com/oltpbenchmark/api/Procedure.java @@ -173,8 +173,6 @@ protected final void enabledAdvancedMonitoring() { prefix = prefix.replace(MonitoringUtil.getMonitoringQueryId(), stmtName); // Update SQL string. stmt.setSQL(prefix + stmt.getSQL()); - - LOG.info("Setting SQL for key " + stmtName + " to " + stmt.getSQL()); } } From a2932a2f0cd5b2f494ce6851363d80824f70dfa7 Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Thu, 27 Apr 2023 08:00:34 +0200 Subject: [PATCH 35/67] Reset phase (not part of this PR). --- src/main/java/com/oltpbenchmark/Phase.java | 424 ++++++++++----------- 1 file changed, 212 insertions(+), 212 deletions(-) diff --git a/src/main/java/com/oltpbenchmark/Phase.java b/src/main/java/com/oltpbenchmark/Phase.java index 951658382..c9b42127e 100644 --- a/src/main/java/com/oltpbenchmark/Phase.java +++ b/src/main/java/com/oltpbenchmark/Phase.java @@ -15,215 +15,215 @@ * */ -package com.oltpbenchmark; - -import com.oltpbenchmark.util.StringUtil; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -public class Phase { - private static final Logger LOG = LoggerFactory.getLogger(Phase.class); - - public enum Arrival { - REGULAR, POISSON, - } - - private final Random gen = new Random(); - private final String benchmarkName; - private final int id; - private final int time; - private final int warmupTime; - private final int rate; - private final Arrival arrival; - - - private final boolean rateLimited; - private final boolean disabled; - private final boolean serial; - private final boolean timed; - private final List weights; - private final int weightCount; - private final int activeTerminals; - private int nextSerial; - - - Phase(String benchmarkName, int id, int t, int wt, int r, List weights, boolean rateLimited, boolean disabled, boolean serial, boolean timed, int activeTerminals, Arrival a) { - this.benchmarkName = benchmarkName; - this.id = id; - this.time = t; - this.warmupTime = wt; - this.rate = r; - this.weights = weights; - this.weightCount = this.weights.size(); - this.rateLimited = rateLimited; - this.disabled = disabled; - this.serial = serial; - this.timed = timed; - this.nextSerial = 1; - this.activeTerminals = activeTerminals; - this.arrival = a; - } - - - - public boolean isRateLimited() { - return rateLimited; - } - - public boolean isDisabled() { - return disabled; - } - - public boolean isSerial() { - return serial; - } - - public boolean isTimed() { - return timed; - } - - public boolean isLatencyRun() { - return !timed && serial; - } - - public boolean isThroughputRun() { - return !isLatencyRun(); - } - - public void resetSerial() { - this.nextSerial = 1; - } - - public int getActiveTerminals() { - return activeTerminals; - } - - public int getWeightCount() { - return (this.weightCount); - } - - public int getId() { - return id; - } - - public int getTime() { - return time; - } - - public int getWarmupTime() { - return warmupTime; - } - - public int getRate() { - return rate; - } - - public Arrival getArrival() { - return arrival; - } - - public List getWeights() { - return (this.weights); - } - - /** - * Computes the sum of weights. Usually needs to add up to 100% - * - * @return The total weight - */ - public double totalWeight() { - double total = 0.0; - for (Double d : weights) { - total += d; - } - return total; - } - - /** - * This simply computes the next transaction by randomly selecting one based - * on the weights of this phase. - * - * @return - */ - public int chooseTransaction() { - return chooseTransaction(false); - } - - public int chooseTransaction(boolean isColdQuery) { - if (isDisabled()) { - return -1; - } - - if (isSerial()) { - int ret; - synchronized (this) { - ret = this.nextSerial; - - // Serial runs should not execute queries with non-positive - // weights. - while (ret <= this.weightCount && weights.get(ret - 1) <= 0.0) { - ret = ++this.nextSerial; - } - - // If it's a cold execution, then we don't want to advance yet, - // since the hot run needs to execute the same query. - if (!isColdQuery) { - - // throughput) run, so we loop through the list multiple - // times. Note that we do the modulus before the increment - // so that we end up in the range [1,num_weights] - if (isTimed()) { - - this.nextSerial %= this.weightCount; - } - - ++this.nextSerial; - } - } - return ret; - } else { - int randomPercentage = gen.nextInt((int) totalWeight()) + 1; - double weight = 0.0; - for (int i = 0; i < this.weightCount; i++) { - weight += weights.get(i); - if (randomPercentage <= weight) { - return i + 1; - } - } - } - - return -1; - } - - /** - * Returns a string for logging purposes when entering the phase - */ - public String currentPhaseString() { - List inner = new ArrayList<>(); - inner.add("[Workload=" + benchmarkName.toUpperCase() + "]"); - if (isDisabled()) { - inner.add("[Disabled=true]"); - } else { - if (isLatencyRun()) { - inner.add("[Serial=true]"); - inner.add("[Time=n/a]"); - } else { - inner.add("[Serial=" + isSerial() + "]"); - inner.add("[Time=" + time + "]"); - } - inner.add("[WarmupTime=" + warmupTime + "]"); - inner.add("[Rate=" + (isRateLimited() ? rate : "unlimited") + "]"); - inner.add("[Arrival=" + arrival + "]"); - inner.add("[Ratios=" + getWeights() + "]"); - inner.add("[ActiveWorkers=" + getActiveTerminals() + "]"); - } - - return StringUtil.bold("PHASE START") + " :: " + StringUtil.join(" ", inner); - } - -} + package com.oltpbenchmark; + + import com.oltpbenchmark.util.StringUtil; + + import org.slf4j.Logger; + import org.slf4j.LoggerFactory; + + import java.util.ArrayList; + import java.util.List; + import java.util.Random; + + public class Phase { + private static final Logger LOG = LoggerFactory.getLogger(Phase.class); + + public enum Arrival { + REGULAR, POISSON, + } + + private final Random gen = new Random(); + private final String benchmarkName; + private final int id; + private final int time; + private final int warmupTime; + private final int rate; + private final Arrival arrival; + + + private final boolean rateLimited; + private final boolean disabled; + private final boolean serial; + private final boolean timed; + private final List weights; + private final int weightCount; + private final int activeTerminals; + private int nextSerial; + + + Phase(String benchmarkName, int id, int t, int wt, int r, List weights, boolean rateLimited, boolean disabled, boolean serial, boolean timed, int activeTerminals, Arrival a) { + this.benchmarkName = benchmarkName; + this.id = id; + this.time = t; + this.warmupTime = wt; + this.rate = r; + this.weights = weights; + this.weightCount = this.weights.size(); + this.rateLimited = rateLimited; + this.disabled = disabled; + this.serial = serial; + this.timed = timed; + this.nextSerial = 1; + this.activeTerminals = activeTerminals; + this.arrival = a; + } + + + + public boolean isRateLimited() { + return rateLimited; + } + + public boolean isDisabled() { + return disabled; + } + + public boolean isSerial() { + return serial; + } + + public boolean isTimed() { + return timed; + } + + public boolean isLatencyRun() { + return !timed && serial; + } + + public boolean isThroughputRun() { + return !isLatencyRun(); + } + + public void resetSerial() { + this.nextSerial = 1; + } + + public int getActiveTerminals() { + return activeTerminals; + } + + public int getWeightCount() { + return (this.weightCount); + } + + public int getId() { + return id; + } + + public int getTime() { + return time; + } + + public int getWarmupTime() { + return warmupTime; + } + + public int getRate() { + return rate; + } + + public Arrival getArrival() { + return arrival; + } + + public List getWeights() { + return (this.weights); + } + + /** + * Computes the sum of weights. Usually needs to add up to 100% + * + * @return The total weight + */ + public double totalWeight() { + double total = 0.0; + for (Double d : weights) { + total += d; + } + return total; + } + + /** + * This simply computes the next transaction by randomly selecting one based + * on the weights of this phase. + * + * @return + */ + public int chooseTransaction() { + return chooseTransaction(false); + } + + public int chooseTransaction(boolean isColdQuery) { + if (isDisabled()) { + return -1; + } + + if (isSerial()) { + int ret; + synchronized (this) { + ret = this.nextSerial; + + // Serial runs should not execute queries with non-positive + // weights. + while (ret <= this.weightCount && weights.get(ret - 1) <= 0.0) { + ret = ++this.nextSerial; + } + + // If it's a cold execution, then we don't want to advance yet, + // since the hot run needs to execute the same query. + if (!isColdQuery) { + + // throughput) run, so we loop through the list multiple + // times. Note that we do the modulus before the increment + // so that we end up in the range [1,num_weights] + if (isTimed()) { + + this.nextSerial %= this.weightCount; + } + + ++this.nextSerial; + } + } + return ret; + } else { + int randomPercentage = gen.nextInt((int) totalWeight()) + 1; + double weight = 0.0; + for (int i = 0; i < this.weightCount; i++) { + weight += weights.get(i); + if (randomPercentage <= weight) { + return i + 1; + } + } + } + + return -1; + } + + /** + * Returns a string for logging purposes when entering the phase + */ + public String currentPhaseString() { + List inner = new ArrayList<>(); + inner.add("[Workload=" + benchmarkName.toUpperCase() + "]"); + if (isDisabled()) { + inner.add("[Disabled=true]"); + } else { + if (isLatencyRun()) { + inner.add("[Serial=true]"); + inner.add("[Time=n/a]"); + } else { + inner.add("[Serial=" + isSerial() + "]"); + inner.add("[Time=" + time + "]"); + } + inner.add("[WarmupTime=" + warmupTime + "]"); + inner.add("[Rate=" + (isRateLimited() ? rate : "unlimited") + "]"); + inner.add("[Arrival=" + arrival + "]"); + inner.add("[Ratios=" + getWeights() + "]"); + inner.add("[ActiveWorkers=" + getActiveTerminals() + "]"); + } + + return StringUtil.bold("PHASE START") + " :: " + StringUtil.join(" ", inner); + } + + } \ No newline at end of file From 31187f7f48547cfe4e6d48809bb41e8cff1695c3 Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Thu, 27 Apr 2023 08:01:23 +0200 Subject: [PATCH 36/67] reset phase #2 --- src/main/java/com/oltpbenchmark/Phase.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/oltpbenchmark/Phase.java b/src/main/java/com/oltpbenchmark/Phase.java index c9b42127e..85a2157fc 100644 --- a/src/main/java/com/oltpbenchmark/Phase.java +++ b/src/main/java/com/oltpbenchmark/Phase.java @@ -19,16 +19,11 @@ import com.oltpbenchmark.util.StringUtil; - import org.slf4j.Logger; - import org.slf4j.LoggerFactory; - import java.util.ArrayList; import java.util.List; import java.util.Random; public class Phase { - private static final Logger LOG = LoggerFactory.getLogger(Phase.class); - public enum Arrival { REGULAR, POISSON, } @@ -226,4 +221,5 @@ public String currentPhaseString() { return StringUtil.bold("PHASE START") + " :: " + StringUtil.join(" ", inner); } - } \ No newline at end of file + } + \ No newline at end of file From f2dc2bc7bfd1176f0d679f76d35207a08695b4ad Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Thu, 27 Apr 2023 08:03:23 +0200 Subject: [PATCH 37/67] reset --- src/main/java/com/oltpbenchmark/Phase.java | 415 ++++++++++----------- 1 file changed, 207 insertions(+), 208 deletions(-) diff --git a/src/main/java/com/oltpbenchmark/Phase.java b/src/main/java/com/oltpbenchmark/Phase.java index 85a2157fc..d4da78bba 100644 --- a/src/main/java/com/oltpbenchmark/Phase.java +++ b/src/main/java/com/oltpbenchmark/Phase.java @@ -15,211 +15,210 @@ * */ - package com.oltpbenchmark; - - import com.oltpbenchmark.util.StringUtil; - - import java.util.ArrayList; - import java.util.List; - import java.util.Random; - - public class Phase { - public enum Arrival { - REGULAR, POISSON, - } - - private final Random gen = new Random(); - private final String benchmarkName; - private final int id; - private final int time; - private final int warmupTime; - private final int rate; - private final Arrival arrival; - - - private final boolean rateLimited; - private final boolean disabled; - private final boolean serial; - private final boolean timed; - private final List weights; - private final int weightCount; - private final int activeTerminals; - private int nextSerial; - - - Phase(String benchmarkName, int id, int t, int wt, int r, List weights, boolean rateLimited, boolean disabled, boolean serial, boolean timed, int activeTerminals, Arrival a) { - this.benchmarkName = benchmarkName; - this.id = id; - this.time = t; - this.warmupTime = wt; - this.rate = r; - this.weights = weights; - this.weightCount = this.weights.size(); - this.rateLimited = rateLimited; - this.disabled = disabled; - this.serial = serial; - this.timed = timed; - this.nextSerial = 1; - this.activeTerminals = activeTerminals; - this.arrival = a; - } - - - - public boolean isRateLimited() { - return rateLimited; - } - - public boolean isDisabled() { - return disabled; - } - - public boolean isSerial() { - return serial; - } - - public boolean isTimed() { - return timed; - } - - public boolean isLatencyRun() { - return !timed && serial; - } - - public boolean isThroughputRun() { - return !isLatencyRun(); - } - - public void resetSerial() { - this.nextSerial = 1; - } - - public int getActiveTerminals() { - return activeTerminals; - } - - public int getWeightCount() { - return (this.weightCount); - } - - public int getId() { - return id; - } - - public int getTime() { - return time; - } - - public int getWarmupTime() { - return warmupTime; - } - - public int getRate() { - return rate; - } - - public Arrival getArrival() { - return arrival; - } - - public List getWeights() { - return (this.weights); - } - - /** - * Computes the sum of weights. Usually needs to add up to 100% - * - * @return The total weight - */ - public double totalWeight() { - double total = 0.0; - for (Double d : weights) { - total += d; - } - return total; - } - - /** - * This simply computes the next transaction by randomly selecting one based - * on the weights of this phase. - * - * @return - */ - public int chooseTransaction() { - return chooseTransaction(false); - } - - public int chooseTransaction(boolean isColdQuery) { - if (isDisabled()) { - return -1; - } - - if (isSerial()) { - int ret; - synchronized (this) { - ret = this.nextSerial; - - // Serial runs should not execute queries with non-positive - // weights. - while (ret <= this.weightCount && weights.get(ret - 1) <= 0.0) { - ret = ++this.nextSerial; - } - - // If it's a cold execution, then we don't want to advance yet, - // since the hot run needs to execute the same query. - if (!isColdQuery) { - - // throughput) run, so we loop through the list multiple - // times. Note that we do the modulus before the increment - // so that we end up in the range [1,num_weights] - if (isTimed()) { - - this.nextSerial %= this.weightCount; - } - - ++this.nextSerial; - } - } - return ret; - } else { - int randomPercentage = gen.nextInt((int) totalWeight()) + 1; - double weight = 0.0; - for (int i = 0; i < this.weightCount; i++) { - weight += weights.get(i); - if (randomPercentage <= weight) { - return i + 1; - } - } - } - - return -1; - } - - /** - * Returns a string for logging purposes when entering the phase - */ - public String currentPhaseString() { - List inner = new ArrayList<>(); - inner.add("[Workload=" + benchmarkName.toUpperCase() + "]"); - if (isDisabled()) { - inner.add("[Disabled=true]"); - } else { - if (isLatencyRun()) { - inner.add("[Serial=true]"); - inner.add("[Time=n/a]"); - } else { - inner.add("[Serial=" + isSerial() + "]"); - inner.add("[Time=" + time + "]"); - } - inner.add("[WarmupTime=" + warmupTime + "]"); - inner.add("[Rate=" + (isRateLimited() ? rate : "unlimited") + "]"); - inner.add("[Arrival=" + arrival + "]"); - inner.add("[Ratios=" + getWeights() + "]"); - inner.add("[ActiveWorkers=" + getActiveTerminals() + "]"); - } - - return StringUtil.bold("PHASE START") + " :: " + StringUtil.join(" ", inner); - } - - } - \ No newline at end of file +package com.oltpbenchmark; + +import com.oltpbenchmark.util.StringUtil; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +public class Phase { + public enum Arrival { + REGULAR, POISSON, + } + + private final Random gen = new Random(); + private final String benchmarkName; + private final int id; + private final int time; + private final int warmupTime; + private final int rate; + private final Arrival arrival; + + + private final boolean rateLimited; + private final boolean disabled; + private final boolean serial; + private final boolean timed; + private final List weights; + private final int weightCount; + private final int activeTerminals; + private int nextSerial; + + + Phase(String benchmarkName, int id, int t, int wt, int r, List weights, boolean rateLimited, boolean disabled, boolean serial, boolean timed, int activeTerminals, Arrival a) { + this.benchmarkName = benchmarkName; + this.id = id; + this.time = t; + this.warmupTime = wt; + this.rate = r; + this.weights = weights; + this.weightCount = this.weights.size(); + this.rateLimited = rateLimited; + this.disabled = disabled; + this.serial = serial; + this.timed = timed; + this.nextSerial = 1; + this.activeTerminals = activeTerminals; + this.arrival = a; + } + + + + public boolean isRateLimited() { + return rateLimited; + } + + public boolean isDisabled() { + return disabled; + } + + public boolean isSerial() { + return serial; + } + + public boolean isTimed() { + return timed; + } + + public boolean isLatencyRun() { + return !timed && serial; + } + + public boolean isThroughputRun() { + return !isLatencyRun(); + } + + public void resetSerial() { + this.nextSerial = 1; + } + + public int getActiveTerminals() { + return activeTerminals; + } + + public int getWeightCount() { + return (this.weightCount); + } + + public int getId() { + return id; + } + + public int getTime() { + return time; + } + + public int getWarmupTime() { + return warmupTime; + } + + public int getRate() { + return rate; + } + + public Arrival getArrival() { + return arrival; + } + + public List getWeights() { + return (this.weights); + } + + /** + * Computes the sum of weights. Usually needs to add up to 100% + * + * @return The total weight + */ + public double totalWeight() { + double total = 0.0; + for (Double d : weights) { + total += d; + } + return total; + } + + /** + * This simply computes the next transaction by randomly selecting one based + * on the weights of this phase. + * + * @return + */ + public int chooseTransaction() { + return chooseTransaction(false); + } + + public int chooseTransaction(boolean isColdQuery) { + if (isDisabled()) { + return -1; + } + + if (isSerial()) { + int ret; + synchronized (this) { + ret = this.nextSerial; + + // Serial runs should not execute queries with non-positive + // weights. + while (ret <= this.weightCount && weights.get(ret - 1) <= 0.0) { + ret = ++this.nextSerial; + } + + // If it's a cold execution, then we don't want to advance yet, + // since the hot run needs to execute the same query. + if (!isColdQuery) { + + // throughput) run, so we loop through the list multiple + // times. Note that we do the modulus before the increment + // so that we end up in the range [1,num_weights] + if (isTimed()) { + + this.nextSerial %= this.weightCount; + } + + ++this.nextSerial; + } + } + return ret; + } else { + int randomPercentage = gen.nextInt((int) totalWeight()) + 1; + double weight = 0.0; + for (int i = 0; i < this.weightCount; i++) { + weight += weights.get(i); + if (randomPercentage <= weight) { + return i + 1; + } + } + } + + return -1; + } + + /** + * Returns a string for logging purposes when entering the phase + */ + public String currentPhaseString() { + List inner = new ArrayList<>(); + inner.add("[Workload=" + benchmarkName.toUpperCase() + "]"); + if (isDisabled()) { + inner.add("[Disabled=true]"); + } else { + if (isLatencyRun()) { + inner.add("[Serial=true]"); + inner.add("[Time=n/a]"); + } else { + inner.add("[Serial=" + isSerial() + "]"); + inner.add("[Time=" + time + "]"); + } + inner.add("[WarmupTime=" + warmupTime + "]"); + inner.add("[Rate=" + (isRateLimited() ? rate : "unlimited") + "]"); + inner.add("[Arrival=" + arrival + "]"); + inner.add("[Ratios=" + getWeights() + "]"); + inner.add("[ActiveWorkers=" + getActiveTerminals() + "]"); + } + + return StringUtil.bold("PHASE START") + " :: " + StringUtil.join(" ", inner); + } + +} \ No newline at end of file From b75e74bc069af307a9e3a148de9ac023190ce91a Mon Sep 17 00:00:00 2001 From: anjagruenheid <87397397+anjagruenheid@users.noreply.github.com> Date: Thu, 27 Apr 2023 08:04:48 +0200 Subject: [PATCH 38/67] Update src/main/java/com/oltpbenchmark/api/collectors/monitoring/README.md Co-authored-by: Brian Kroth --- .../com/oltpbenchmark/api/collectors/monitoring/README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/README.md b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/README.md index 3c9277f65..9547779da 100644 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/README.md +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/README.md @@ -6,7 +6,12 @@ Monitoring in BenchBase can be enabled using the -mt,--monitor-type Type of Monitoring (throughput/advanced) ``` command line option when executing BenchBase, where the monitoring interval describes the sleeping period of the thread between recording monitoring information. -We currently support two types of monitoring: 1) Basic throughput monitoring to track the progress while executing a benchmark (mt=throughput) and 2) monitoring of query and system properties via system tables for both SQLServer and Postgres (mt=advanced). +We currently support two types of monitoring: + +1. Basic throughput monitoring to track the progress while executing a benchmark (`-mt=throughput`), and +2. monitoring of query and system properties via system tables for both SQLServer and Postgres (`-mt=advanced`). + Support for other engines can also be added. + The former is the default setting unless the monitoring type is explicitly set to advanced which will trigger system monitoring if the database type is supported. Throughput monitoring logs uptdated throughput values directly to the system output, while advanced monitoring creates csv files recording their findings in folder results/monitor/. From 002be6325c3e1f2890a04f7618e5cd9d1ac9f356 Mon Sep 17 00:00:00 2001 From: anjagruenheid <87397397+anjagruenheid@users.noreply.github.com> Date: Thu, 27 Apr 2023 08:04:59 +0200 Subject: [PATCH 39/67] Update src/main/java/com/oltpbenchmark/api/collectors/monitoring/README.md Co-authored-by: Brian Kroth --- .../java/com/oltpbenchmark/api/collectors/monitoring/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/README.md b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/README.md index 9547779da..512625545 100644 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/README.md +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/README.md @@ -14,7 +14,7 @@ We currently support two types of monitoring: The former is the default setting unless the monitoring type is explicitly set to advanced which will trigger system monitoring if the database type is supported. -Throughput monitoring logs uptdated throughput values directly to the system output, while advanced monitoring creates csv files recording their findings in folder results/monitor/. +Throughput monitoring logs updated throughput values directly to the system output, while advanced monitoring creates csv files recording their findings in folder `results/monitor/`. Advanced monitoring collects data for a variety of events, such as one-off information about a query (for example query plans, query text, etc.), repeated information about a query (elapsed time per query execution, worker time, execution count etc.), and repeated system information (cache hits, number of transactions etc.). Which events are collected depends on the database system and is customized in corresponding drivers. The code for the drivers can be found in package src.main.java.com.oltpbenchmark.api.collectors.monitoring. From a93605ad21fbefd395ad1ad7a6290f375e0c2cd3 Mon Sep 17 00:00:00 2001 From: anjagruenheid <87397397+anjagruenheid@users.noreply.github.com> Date: Thu, 27 Apr 2023 08:05:11 +0200 Subject: [PATCH 40/67] Update src/main/java/com/oltpbenchmark/api/collectors/monitoring/README.md Co-authored-by: Brian Kroth --- .../java/com/oltpbenchmark/api/collectors/monitoring/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/README.md b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/README.md index 512625545..e1a3b44c2 100644 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/README.md +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/README.md @@ -17,7 +17,7 @@ The former is the default setting unless the monitoring type is explicitly set t Throughput monitoring logs updated throughput values directly to the system output, while advanced monitoring creates csv files recording their findings in folder `results/monitor/`. Advanced monitoring collects data for a variety of events, such as one-off information about a query (for example query plans, query text, etc.), repeated information about a query (elapsed time per query execution, worker time, execution count etc.), and repeated system information (cache hits, number of transactions etc.). Which events are collected depends on the database system and is customized in corresponding drivers. -The code for the drivers can be found in package src.main.java.com.oltpbenchmark.api.collectors.monitoring. +The code for the drivers can be found in package [`src.main.java.com.oltpbenchmark.api.collectors.monitoring`](./../monitoring/). For advanced monitoring to function with SQLServer, the user needs to have access to the system tables, for Postgres, `pg_stat_statements` needs to be enabled. Note that in either database system, frequent (additional) queries against the DBMS may distort the benchmarking results. From 431a64e94ca63df7fb1ededff753c6bcd355c57c Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Thu, 27 Apr 2023 08:32:45 +0200 Subject: [PATCH 41/67] Revert untouched files. --- .../benchmarks/twitter/procedures/GetFollowers.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetFollowers.java b/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetFollowers.java index 9f62bb5ba..ec8cb4d73 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetFollowers.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetFollowers.java @@ -36,11 +36,11 @@ public class GetFollowers extends Procedure { public final SQLStmt getFollowerNames = new SQLStmt("SELECT uid, name FROM " + TwitterConstants.TABLENAME_USER + " WHERE uid IN (??)", TwitterConstants.LIMIT_FOLLOWERS); public void run(Connection conn, long uid) throws SQLException { - try (PreparedStatement stmt = this.getPreparedStatement(conn, getFollowerNames)) { + try (PreparedStatement stmt = this.getPreparedStatement(conn, getFollowers)) { stmt.setLong(1, uid); try (ResultSet rs = stmt.executeQuery()) { - try (PreparedStatement getFollowerNamesstmt = this.getPreparedStatement(conn, getFollowers)) { + try (PreparedStatement getFollowerNamesstmt = this.getPreparedStatement(conn, getFollowerNames)) { int ctr = 0; long last = -1; while (rs.next() && ctr++ < TwitterConstants.LIMIT_FOLLOWERS) { @@ -57,7 +57,7 @@ public void run(Connection conn, long uid) throws SQLException { } } } - // LOG.warn("No followers for user : "+uid); //... so what ? + // LOG.warn("No followers for user : "+uid); //... so what ? } } From 8a299ec19a91b132440980c474caafb96ffa9121 Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Thu, 27 Apr 2023 08:33:00 +0200 Subject: [PATCH 42/67] revert --- src/main/java/com/oltpbenchmark/benchmarks/tpch/TPCHWorker.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/TPCHWorker.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/TPCHWorker.java index fe90df3bf..98f559306 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/TPCHWorker.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/TPCHWorker.java @@ -29,7 +29,6 @@ public class TPCHWorker extends Worker { - private final RandomGenerator rand; public TPCHWorker(TPCHBenchmark benchmarkModule, int id) { From ce4e60e5d19629b4225ad5afde4ca1c723731434 Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Thu, 27 Apr 2023 08:36:09 +0200 Subject: [PATCH 43/67] Proper revert! --- src/main/java/com/oltpbenchmark/benchmarks/tpch/TPCHWorker.java | 2 +- .../benchmarks/twitter/procedures/GetFollowers.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/TPCHWorker.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/TPCHWorker.java index 98f559306..fa26f8e32 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/TPCHWorker.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/TPCHWorker.java @@ -27,8 +27,8 @@ import java.sql.Connection; import java.sql.SQLException; - public class TPCHWorker extends Worker { + private final RandomGenerator rand; public TPCHWorker(TPCHBenchmark benchmarkModule, int id) { diff --git a/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetFollowers.java b/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetFollowers.java index ec8cb4d73..12eb175f9 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetFollowers.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/twitter/procedures/GetFollowers.java @@ -57,7 +57,7 @@ public void run(Connection conn, long uid) throws SQLException { } } } - // LOG.warn("No followers for user : "+uid); //... so what ? + // LOG.warn("No followers for user : "+uid); //... so what ? } } From 6de6378e4ad0f1d4fc0b7b7f326c00cd4ea6b154 Mon Sep 17 00:00:00 2001 From: anjagruenheid <87397397+anjagruenheid@users.noreply.github.com> Date: Fri, 28 Apr 2023 14:54:50 +0200 Subject: [PATCH 44/67] Update src/main/java/com/oltpbenchmark/DBWorkload.java Co-authored-by: Brian Kroth --- src/main/java/com/oltpbenchmark/DBWorkload.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/oltpbenchmark/DBWorkload.java b/src/main/java/com/oltpbenchmark/DBWorkload.java index ba21d0cba..267ea8dd0 100644 --- a/src/main/java/com/oltpbenchmark/DBWorkload.java +++ b/src/main/java/com/oltpbenchmark/DBWorkload.java @@ -159,7 +159,7 @@ public static void main(String[] args) throws Exception { } // Set monitoring enabled, if all requirements are met. - if (monitorInfo.getMonitoringInterval()>0 && monitorInfo.getMonitoringType()==MonitoringType.ADVANCED + if (monitorInfo.getMonitoringInterval() > 0 && monitorInfo.getMonitoringType() == MonitoringType.ADVANCED && DatabaseType.get(xmlConfig.getString("type")).shouldCreateMonitoringPrefix()) { LOG.info("Advanced monitoring enabled, prefix will be added to queries."); wrkld.setAdvancedMonitoringEnabled(true); From 56680abcf575475d4dfe4c687d319f1c33ccdada Mon Sep 17 00:00:00 2001 From: anjagruenheid <87397397+anjagruenheid@users.noreply.github.com> Date: Fri, 28 Apr 2023 14:55:02 +0200 Subject: [PATCH 45/67] Update src/main/java/com/oltpbenchmark/WorkloadConfiguration.java Co-authored-by: Brian Kroth --- src/main/java/com/oltpbenchmark/WorkloadConfiguration.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/oltpbenchmark/WorkloadConfiguration.java b/src/main/java/com/oltpbenchmark/WorkloadConfiguration.java index 15b448b51..acdd2e205 100644 --- a/src/main/java/com/oltpbenchmark/WorkloadConfiguration.java +++ b/src/main/java/com/oltpbenchmark/WorkloadConfiguration.java @@ -129,7 +129,7 @@ public void setAdvancedMonitoringEnabled(boolean advancedMonitoringEnabled) { this.advancedMonitoringEnabled = true; } - public boolean getMonitoringEnabled() { + public boolean getAdvancedMonitoringEnabled() { return this.advancedMonitoringEnabled; } From f7fe6a23d5c739a51c4d4cbf879435d03a50fce6 Mon Sep 17 00:00:00 2001 From: anjagruenheid <87397397+anjagruenheid@users.noreply.github.com> Date: Fri, 28 Apr 2023 14:55:11 +0200 Subject: [PATCH 46/67] Update src/main/java/com/oltpbenchmark/api/Procedure.java Co-authored-by: Brian Kroth --- src/main/java/com/oltpbenchmark/api/Procedure.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/oltpbenchmark/api/Procedure.java b/src/main/java/com/oltpbenchmark/api/Procedure.java index 2700b5d53..af248b338 100644 --- a/src/main/java/com/oltpbenchmark/api/Procedure.java +++ b/src/main/java/com/oltpbenchmark/api/Procedure.java @@ -161,7 +161,7 @@ protected final void loadSQLDialect(StatementDialects dialects) { /** * Enable monitoring for this procedure by adding a monitoring prefixes. */ - protected final void enabledAdvancedMonitoring() { + protected final void enableAdvancedMonitoring() { for (String stmtName : this.getStatements().keySet()) { SQLStmt stmt = this.name_stmt_xref.get(stmtName); if (LOG.isDebugEnabled()) { From 5491cb6b9d2cba63a9a4154cde4004202178c9c9 Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Fri, 28 Apr 2023 15:12:40 +0200 Subject: [PATCH 47/67] Reset TPC-C, add worker rejoin variable. --- .../benchmarks/tpcc/procedures/Delivery.java | 83 +++++------- .../benchmarks/tpcc/procedures/NewOrder.java | 98 ++++++-------- .../tpcc/procedures/OrderStatus.java | 60 ++++----- .../benchmarks/tpcc/procedures/Payment.java | 124 ++++++++---------- .../tpcc/procedures/StockLevel.java | 30 ++--- 5 files changed, 165 insertions(+), 230 deletions(-) diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Delivery.java b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Delivery.java index 111334d70..5ff941c5f 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Delivery.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Delivery.java @@ -34,66 +34,53 @@ public class Delivery extends TPCCProcedure { private static final Logger LOG = LoggerFactory.getLogger(Delivery.class); public SQLStmt delivGetOrderIdSQL = new SQLStmt( - """ - SELECT NO_O_ID FROM %s - WHERE NO_D_ID = ? - AND NO_W_ID = ? - ORDER BY NO_O_ID ASC - LIMIT 1 - """.formatted(TPCCConstants.TABLENAME_NEWORDER)); + "SELECT NO_O_ID FROM " + TPCCConstants.TABLENAME_NEWORDER + + " WHERE NO_D_ID = ? " + + " AND NO_W_ID = ? " + + " ORDER BY NO_O_ID ASC " + + " LIMIT 1"); public SQLStmt delivDeleteNewOrderSQL = new SQLStmt( - """ - DELETE FROM %s - WHERE NO_O_ID = ? - AND NO_D_ID = ? - AND NO_W_ID = ? - """.formatted(TPCCConstants.TABLENAME_NEWORDER)); + "DELETE FROM " + TPCCConstants.TABLENAME_NEWORDER + + " WHERE NO_O_ID = ? " + + " AND NO_D_ID = ?" + + " AND NO_W_ID = ?"); public SQLStmt delivGetCustIdSQL = new SQLStmt( - """ - SELECT O_C_ID FROM %s - WHERE O_ID = ? - AND O_D_ID = ? - AND O_W_ID = ? - """.formatted(TPCCConstants.TABLENAME_OPENORDER)); + "SELECT O_C_ID FROM " + TPCCConstants.TABLENAME_OPENORDER + + " WHERE O_ID = ? " + + " AND O_D_ID = ? " + + " AND O_W_ID = ?"); public SQLStmt delivUpdateCarrierIdSQL = new SQLStmt( - """ - UPDATE %s - SET O_CARRIER_ID = ? - WHERE O_ID = ? - AND O_D_ID = ? - AND O_W_ID = ? - """.formatted(TPCCConstants.TABLENAME_OPENORDER)); + "UPDATE " + TPCCConstants.TABLENAME_OPENORDER + + " SET O_CARRIER_ID = ? " + + " WHERE O_ID = ? " + + " AND O_D_ID = ?" + + " AND O_W_ID = ?"); public SQLStmt delivUpdateDeliveryDateSQL = new SQLStmt( - """ - UPDATE %s - SET OL_DELIVERY_D = ? - WHERE OL_O_ID = ? - AND OL_D_ID = ? - AND OL_W_ID = ? - """.formatted(TPCCConstants.TABLENAME_ORDERLINE)); + "UPDATE " + TPCCConstants.TABLENAME_ORDERLINE + + " SET OL_DELIVERY_D = ? " + + " WHERE OL_O_ID = ? " + + " AND OL_D_ID = ? " + + " AND OL_W_ID = ? "); public SQLStmt delivSumOrderAmountSQL = new SQLStmt( - """ - SELECT SUM(OL_AMOUNT) AS OL_TOTAL - FROM %s - WHERE OL_O_ID = ? - AND OL_D_ID = ? - AND OL_W_ID = ? - """.formatted(TPCCConstants.TABLENAME_ORDERLINE)); + "SELECT SUM(OL_AMOUNT) AS OL_TOTAL " + + " FROM " + TPCCConstants.TABLENAME_ORDERLINE + + " WHERE OL_O_ID = ? " + + " AND OL_D_ID = ? " + + " AND OL_W_ID = ?"); public SQLStmt delivUpdateCustBalDelivCntSQL = new SQLStmt( - """ - UPDATE %s - SET C_BALANCE = C_BALANCE + ?, - C_DELIVERY_CNT = C_DELIVERY_CNT + 1 - WHERE C_W_ID = ? - AND C_D_ID = ? - AND C_ID = ? - """.formatted(TPCCConstants.TABLENAME_CUSTOMER)); + "UPDATE " + TPCCConstants.TABLENAME_CUSTOMER + + " SET C_BALANCE = C_BALANCE + ?," + + " C_DELIVERY_CNT = C_DELIVERY_CNT + 1 " + + " WHERE C_W_ID = ? " + + " AND C_D_ID = ? " + + " AND C_ID = ? "); + public void run(Connection conn, Random gen, int w_id, int numWarehouses, int terminalDistrictLowerID, int terminalDistrictUpperID, TPCCWorker w) throws SQLException { diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/NewOrder.java b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/NewOrder.java index 99d0a4267..3f941969e 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/NewOrder.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/NewOrder.java @@ -34,83 +34,63 @@ public class NewOrder extends TPCCProcedure { private static final Logger LOG = LoggerFactory.getLogger(NewOrder.class); public final SQLStmt stmtGetCustSQL = new SQLStmt( - """ - SELECT C_DISCOUNT, C_LAST, C_CREDIT - FROM %s - WHERE C_W_ID = ? - AND C_D_ID = ? - AND C_ID = ? - """.formatted(TPCCConstants.TABLENAME_CUSTOMER)); + "SELECT C_DISCOUNT, C_LAST, C_CREDIT" + + " FROM " + TPCCConstants.TABLENAME_CUSTOMER + + " WHERE C_W_ID = ? " + + " AND C_D_ID = ? " + + " AND C_ID = ?"); public final SQLStmt stmtGetWhseSQL = new SQLStmt( - """ - SELECT W_TAX - FROM %s - WHERE W_ID = ? - """.formatted(TPCCConstants.TABLENAME_WAREHOUSE)); + "SELECT W_TAX " + + " FROM " + TPCCConstants.TABLENAME_WAREHOUSE + + " WHERE W_ID = ?"); public final SQLStmt stmtGetDistSQL = new SQLStmt( - """ - SELECT D_NEXT_O_ID, D_TAX - FROM %s - WHERE D_W_ID = ? AND D_ID = ? FOR UPDATE - """.formatted(TPCCConstants.TABLENAME_DISTRICT)); + "SELECT D_NEXT_O_ID, D_TAX " + + " FROM " + TPCCConstants.TABLENAME_DISTRICT + + " WHERE D_W_ID = ? AND D_ID = ? FOR UPDATE"); public final SQLStmt stmtInsertNewOrderSQL = new SQLStmt( - """ - INSERT INTO %s - (NO_O_ID, NO_D_ID, NO_W_ID) - VALUES ( ?, ?, ?) - """.formatted(TPCCConstants.TABLENAME_NEWORDER)); + "INSERT INTO " + TPCCConstants.TABLENAME_NEWORDER + + " (NO_O_ID, NO_D_ID, NO_W_ID) " + + " VALUES ( ?, ?, ?)"); public final SQLStmt stmtUpdateDistSQL = new SQLStmt( - """ - UPDATE %s - SET D_NEXT_O_ID = D_NEXT_O_ID + 1 - WHERE D_W_ID = ? - AND D_ID = ? - """.formatted(TPCCConstants.TABLENAME_DISTRICT)); + "UPDATE " + TPCCConstants.TABLENAME_DISTRICT + + " SET D_NEXT_O_ID = D_NEXT_O_ID + 1 " + + " WHERE D_W_ID = ? " + + " AND D_ID = ?"); public final SQLStmt stmtInsertOOrderSQL = new SQLStmt( - """ - INSERT INTO %s - (O_ID, O_D_ID, O_W_ID, O_C_ID, O_ENTRY_D, O_OL_CNT, O_ALL_LOCAL) - VALUES (?, ?, ?, ?, ?, ?, ?) - """.formatted(TPCCConstants.TABLENAME_OPENORDER)); + "INSERT INTO " + TPCCConstants.TABLENAME_OPENORDER + + " (O_ID, O_D_ID, O_W_ID, O_C_ID, O_ENTRY_D, O_OL_CNT, O_ALL_LOCAL)" + + " VALUES (?, ?, ?, ?, ?, ?, ?)"); public final SQLStmt stmtGetItemSQL = new SQLStmt( - """ - SELECT I_PRICE, I_NAME , I_DATA - FROM %s - WHERE I_ID = ? - """.formatted(TPCCConstants.TABLENAME_ITEM)); + "SELECT I_PRICE, I_NAME , I_DATA " + + " FROM " + TPCCConstants.TABLENAME_ITEM + + " WHERE I_ID = ?"); public final SQLStmt stmtGetStockSQL = new SQLStmt( - """ - SELECT S_QUANTITY, S_DATA, S_DIST_01, S_DIST_02, S_DIST_03, S_DIST_04, S_DIST_05, - S_DIST_06, S_DIST_07, S_DIST_08, S_DIST_09, S_DIST_10 - FROM %s - WHERE S_I_ID = ? - AND S_W_ID = ? FOR UPDATE - """.formatted(TPCCConstants.TABLENAME_STOCK)); + "SELECT S_QUANTITY, S_DATA, S_DIST_01, S_DIST_02, S_DIST_03, S_DIST_04, S_DIST_05, " + + " S_DIST_06, S_DIST_07, S_DIST_08, S_DIST_09, S_DIST_10" + + " FROM " + TPCCConstants.TABLENAME_STOCK + + " WHERE S_I_ID = ? " + + " AND S_W_ID = ? FOR UPDATE"); public final SQLStmt stmtUpdateStockSQL = new SQLStmt( - """ - UPDATE %s - SET S_QUANTITY = ? , - S_YTD = S_YTD + ?, - S_ORDER_CNT = S_ORDER_CNT + 1, - S_REMOTE_CNT = S_REMOTE_CNT + ? - WHERE S_I_ID = ? - AND S_W_ID = ? - """.formatted(TPCCConstants.TABLENAME_STOCK)); + "UPDATE " + TPCCConstants.TABLENAME_STOCK + + " SET S_QUANTITY = ? , " + + " S_YTD = S_YTD + ?, " + + " S_ORDER_CNT = S_ORDER_CNT + 1, " + + " S_REMOTE_CNT = S_REMOTE_CNT + ? " + + " WHERE S_I_ID = ? " + + " AND S_W_ID = ?"); public final SQLStmt stmtInsertOrderLineSQL = new SQLStmt( - """ - INSERT INTO %s - (OL_O_ID, OL_D_ID, OL_W_ID, OL_NUMBER, OL_I_ID, OL_SUPPLY_W_ID, OL_QUANTITY, OL_AMOUNT, OL_DIST_INFO) - VALUES (?,?,?,?,?,?,?,?,?) - """.formatted(TPCCConstants.TABLENAME_ORDERLINE)); + "INSERT INTO " + TPCCConstants.TABLENAME_ORDERLINE + + " (OL_O_ID, OL_D_ID, OL_W_ID, OL_NUMBER, OL_I_ID, OL_SUPPLY_W_ID, OL_QUANTITY, OL_AMOUNT, OL_DIST_INFO) " + + " VALUES (?,?,?,?,?,?,?,?,?)"); public void run(Connection conn, Random gen, int terminalWarehouseID, int numWarehouses, int terminalDistrictLowerID, int terminalDistrictUpperID, TPCCWorker w) throws SQLException { diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/OrderStatus.java b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/OrderStatus.java index 0dc158b69..2524c2687 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/OrderStatus.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/OrderStatus.java @@ -39,46 +39,38 @@ public class OrderStatus extends TPCCProcedure { private static final Logger LOG = LoggerFactory.getLogger(OrderStatus.class); public SQLStmt ordStatGetNewestOrdSQL = new SQLStmt( - """ - SELECT O_ID, O_CARRIER_ID, O_ENTRY_D - FROM %s - WHERE O_W_ID = ? - AND O_D_ID = ? - AND O_C_ID = ? - ORDER BY O_ID DESC LIMIT 1 - """.formatted(TPCCConstants.TABLENAME_OPENORDER)); + "SELECT O_ID, O_CARRIER_ID, O_ENTRY_D " + + " FROM " + TPCCConstants.TABLENAME_OPENORDER + + " WHERE O_W_ID = ? " + + " AND O_D_ID = ? " + + " AND O_C_ID = ? " + + " ORDER BY O_ID DESC LIMIT 1"); public SQLStmt ordStatGetOrderLinesSQL = new SQLStmt( - """ - SELECT OL_I_ID, OL_SUPPLY_W_ID, OL_QUANTITY, OL_AMOUNT, OL_DELIVERY_D - FROM %s - WHERE OL_O_ID = ? - AND OL_D_ID = ? - AND OL_W_ID = ? - """.formatted(TPCCConstants.TABLENAME_ORDERLINE)); + "SELECT OL_I_ID, OL_SUPPLY_W_ID, OL_QUANTITY, OL_AMOUNT, OL_DELIVERY_D " + + " FROM " + TPCCConstants.TABLENAME_ORDERLINE + + " WHERE OL_O_ID = ?" + + " AND OL_D_ID = ?" + + " AND OL_W_ID = ?"); public SQLStmt payGetCustSQL = new SQLStmt( - """ - SELECT C_FIRST, C_MIDDLE, C_LAST, C_STREET_1, C_STREET_2, - C_CITY, C_STATE, C_ZIP, C_PHONE, C_CREDIT, C_CREDIT_LIM, - C_DISCOUNT, C_BALANCE, C_YTD_PAYMENT, C_PAYMENT_CNT, C_SINCE - FROM %s - WHERE C_W_ID = ? - AND C_D_ID = ? - AND C_ID = ? - """.formatted(TPCCConstants.TABLENAME_CUSTOMER)); + "SELECT C_FIRST, C_MIDDLE, C_LAST, C_STREET_1, C_STREET_2, " + + " C_CITY, C_STATE, C_ZIP, C_PHONE, C_CREDIT, C_CREDIT_LIM, " + + " C_DISCOUNT, C_BALANCE, C_YTD_PAYMENT, C_PAYMENT_CNT, C_SINCE " + + " FROM " + TPCCConstants.TABLENAME_CUSTOMER + + " WHERE C_W_ID = ? " + + " AND C_D_ID = ? " + + " AND C_ID = ?"); public SQLStmt customerByNameSQL = new SQLStmt( - """ - SELECT C_FIRST, C_MIDDLE, C_ID, C_STREET_1, C_STREET_2, C_CITY, - C_STATE, C_ZIP, C_PHONE, C_CREDIT, C_CREDIT_LIM, C_DISCOUNT, - C_BALANCE, C_YTD_PAYMENT, C_PAYMENT_CNT, C_SINCE - FROM %s - WHERE C_W_ID = ? - AND C_D_ID = ? - AND C_LAST = ? - ORDER BY C_FIRST - """.formatted(TPCCConstants.TABLENAME_CUSTOMER)); + "SELECT C_FIRST, C_MIDDLE, C_ID, C_STREET_1, C_STREET_2, C_CITY, " + + " C_STATE, C_ZIP, C_PHONE, C_CREDIT, C_CREDIT_LIM, C_DISCOUNT, " + + " C_BALANCE, C_YTD_PAYMENT, C_PAYMENT_CNT, C_SINCE " + + " FROM " + TPCCConstants.TABLENAME_CUSTOMER + + " WHERE C_W_ID = ? " + + " AND C_D_ID = ? " + + " AND C_LAST = ? " + + " ORDER BY C_FIRST"); public void run(Connection conn, Random gen, int w_id, int numWarehouses, int terminalDistrictLowerID, int terminalDistrictUpperID, TPCCWorker w) throws SQLException { diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Payment.java b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Payment.java index 2a55c6d5c..0a141962c 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Payment.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Payment.java @@ -38,96 +38,76 @@ public class Payment extends TPCCProcedure { private static final Logger LOG = LoggerFactory.getLogger(Payment.class); public SQLStmt payUpdateWhseSQL = new SQLStmt( - """ - UPDATE %s - SET W_YTD = W_YTD + ? - WHERE W_ID = ? - """.formatted(TPCCConstants.TABLENAME_WAREHOUSE)); + "UPDATE " + TPCCConstants.TABLENAME_WAREHOUSE + + " SET W_YTD = W_YTD + ? " + + " WHERE W_ID = ? "); public SQLStmt payGetWhseSQL = new SQLStmt( - """ - SELECT W_STREET_1, W_STREET_2, W_CITY, W_STATE, W_ZIP, W_NAME - FROM %s - WHERE W_ID = ? - """.formatted(TPCCConstants.TABLENAME_WAREHOUSE)); + "SELECT W_STREET_1, W_STREET_2, W_CITY, W_STATE, W_ZIP, W_NAME" + + " FROM " + TPCCConstants.TABLENAME_WAREHOUSE + + " WHERE W_ID = ?"); public SQLStmt payUpdateDistSQL = new SQLStmt( - """ - UPDATE %s - SET D_YTD = D_YTD + ? - WHERE D_W_ID = ? - AND D_ID = ? - """.formatted(TPCCConstants.TABLENAME_DISTRICT)); + "UPDATE " + TPCCConstants.TABLENAME_DISTRICT + + " SET D_YTD = D_YTD + ? " + + " WHERE D_W_ID = ? " + + " AND D_ID = ?"); public SQLStmt payGetDistSQL = new SQLStmt( - """ - SELECT D_STREET_1, D_STREET_2, D_CITY, D_STATE, D_ZIP, D_NAME - FROM %s - WHERE D_W_ID = ? - AND D_ID = ? - """.formatted(TPCCConstants.TABLENAME_DISTRICT)); + "SELECT D_STREET_1, D_STREET_2, D_CITY, D_STATE, D_ZIP, D_NAME" + + " FROM " + TPCCConstants.TABLENAME_DISTRICT + + " WHERE D_W_ID = ? " + + " AND D_ID = ?"); public SQLStmt payGetCustSQL = new SQLStmt( - """ - SELECT C_FIRST, C_MIDDLE, C_LAST, C_STREET_1, C_STREET_2, - C_CITY, C_STATE, C_ZIP, C_PHONE, C_CREDIT, C_CREDIT_LIM, - C_DISCOUNT, C_BALANCE, C_YTD_PAYMENT, C_PAYMENT_CNT, C_SINCE - FROM %s - WHERE C_W_ID = ? - AND C_D_ID = ? - AND C_ID = ? - """.formatted(TPCCConstants.TABLENAME_CUSTOMER)); + "SELECT C_FIRST, C_MIDDLE, C_LAST, C_STREET_1, C_STREET_2, " + + " C_CITY, C_STATE, C_ZIP, C_PHONE, C_CREDIT, C_CREDIT_LIM, " + + " C_DISCOUNT, C_BALANCE, C_YTD_PAYMENT, C_PAYMENT_CNT, C_SINCE " + + " FROM " + TPCCConstants.TABLENAME_CUSTOMER + + " WHERE C_W_ID = ? " + + " AND C_D_ID = ? " + + " AND C_ID = ?"); public SQLStmt payGetCustCdataSQL = new SQLStmt( - """ - SELECT C_DATA - FROM %s - WHERE C_W_ID = ? - AND C_D_ID = ? - AND C_ID = ? - """.formatted(TPCCConstants.TABLENAME_CUSTOMER)); + "SELECT C_DATA " + + " FROM " + TPCCConstants.TABLENAME_CUSTOMER + + " WHERE C_W_ID = ? " + + " AND C_D_ID = ? " + + " AND C_ID = ?"); public SQLStmt payUpdateCustBalCdataSQL = new SQLStmt( - """ - UPDATE %s - SET C_BALANCE = ?, - C_YTD_PAYMENT = ?, - C_PAYMENT_CNT = ?, - C_DATA = ? - WHERE C_W_ID = ? - AND C_D_ID = ? - AND C_ID = ? - """.formatted(TPCCConstants.TABLENAME_CUSTOMER)); + "UPDATE " + TPCCConstants.TABLENAME_CUSTOMER + + " SET C_BALANCE = ?, " + + " C_YTD_PAYMENT = ?, " + + " C_PAYMENT_CNT = ?, " + + " C_DATA = ? " + + " WHERE C_W_ID = ? " + + " AND C_D_ID = ? " + + " AND C_ID = ?"); public SQLStmt payUpdateCustBalSQL = new SQLStmt( - """ - UPDATE %s - SET C_BALANCE = ?, - C_YTD_PAYMENT = ?, - C_PAYMENT_CNT = ? - WHERE C_W_ID = ? - AND C_D_ID = ? - AND C_ID = ? - """.formatted(TPCCConstants.TABLENAME_CUSTOMER)); + "UPDATE " + TPCCConstants.TABLENAME_CUSTOMER + + " SET C_BALANCE = ?, " + + " C_YTD_PAYMENT = ?, " + + " C_PAYMENT_CNT = ? " + + " WHERE C_W_ID = ? " + + " AND C_D_ID = ? " + + " AND C_ID = ?"); public SQLStmt payInsertHistSQL = new SQLStmt( - """ - INSERT INTO %s - (H_C_D_ID, H_C_W_ID, H_C_ID, H_D_ID, H_W_ID, H_DATE, H_AMOUNT, H_DATA) - VALUES (?,?,?,?,?,?,?,?) - """.formatted(TPCCConstants.TABLENAME_HISTORY)); + "INSERT INTO " + TPCCConstants.TABLENAME_HISTORY + + " (H_C_D_ID, H_C_W_ID, H_C_ID, H_D_ID, H_W_ID, H_DATE, H_AMOUNT, H_DATA) " + + " VALUES (?,?,?,?,?,?,?,?)"); public SQLStmt customerByNameSQL = new SQLStmt( - """ - SELECT C_FIRST, C_MIDDLE, C_ID, C_STREET_1, C_STREET_2, C_CITY, - C_STATE, C_ZIP, C_PHONE, C_CREDIT, C_CREDIT_LIM, C_DISCOUNT, - C_BALANCE, C_YTD_PAYMENT, C_PAYMENT_CNT, C_SINCE - FROM %s - WHERE C_W_ID = ? - AND C_D_ID = ? - AND C_LAST = ? - ORDER BY C_FIRST - """.formatted(TPCCConstants.TABLENAME_CUSTOMER)); + "SELECT C_FIRST, C_MIDDLE, C_ID, C_STREET_1, C_STREET_2, C_CITY, " + + " C_STATE, C_ZIP, C_PHONE, C_CREDIT, C_CREDIT_LIM, C_DISCOUNT, " + + " C_BALANCE, C_YTD_PAYMENT, C_PAYMENT_CNT, C_SINCE " + + " FROM " + TPCCConstants.TABLENAME_CUSTOMER + + " WHERE C_W_ID = ? " + + " AND C_D_ID = ? " + + " AND C_LAST = ? " + + " ORDER BY C_FIRST"); public void run(Connection conn, Random gen, int w_id, int numWarehouses, int terminalDistrictLowerID, int terminalDistrictUpperID, TPCCWorker worker) throws SQLException { diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/StockLevel.java b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/StockLevel.java index ca5f836b4..657aa8063 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/StockLevel.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/StockLevel.java @@ -35,25 +35,21 @@ public class StockLevel extends TPCCProcedure { private static final Logger LOG = LoggerFactory.getLogger(StockLevel.class); public SQLStmt stockGetDistOrderIdSQL = new SQLStmt( - """ - SELECT D_NEXT_O_ID - FROM %s - WHERE D_W_ID = ? - AND D_ID = ? - """.formatted(TPCCConstants.TABLENAME_DISTRICT)); + "SELECT D_NEXT_O_ID " + + " FROM " + TPCCConstants.TABLENAME_DISTRICT + + " WHERE D_W_ID = ? " + + " AND D_ID = ?"); public SQLStmt stockGetCountStockSQL = new SQLStmt( - """ - SELECT COUNT(DISTINCT (S_I_ID)) AS STOCK_COUNT - FROM %s, %s - WHERE OL_W_ID = ? - AND OL_D_ID = ? - AND OL_O_ID < ? - AND OL_O_ID >= ? - AND S_W_ID = ? - AND S_I_ID = OL_I_ID - AND S_QUANTITY < ? - """.formatted(TPCCConstants.TABLENAME_ORDERLINE, TPCCConstants.TABLENAME_STOCK)); + "SELECT COUNT(DISTINCT (S_I_ID)) AS STOCK_COUNT " + + " FROM " + TPCCConstants.TABLENAME_ORDERLINE + ", " + TPCCConstants.TABLENAME_STOCK + + " WHERE OL_W_ID = ?" + + " AND OL_D_ID = ?" + + " AND OL_O_ID < ?" + + " AND OL_O_ID >= ?" + + " AND S_W_ID = ?" + + " AND S_I_ID = OL_I_ID" + + " AND S_QUANTITY < ?"); public void run(Connection conn, Random gen, int w_id, int numWarehouses, int terminalDistrictLowerID, int terminalDistrictUpperID, TPCCWorker w) throws SQLException { From 34be7b40154b49f945db59c9a0a4bc8a8d7cc0cb Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Fri, 28 Apr 2023 15:15:53 +0200 Subject: [PATCH 48/67] Quick bugfixes due to changes in naming. --- src/main/java/com/oltpbenchmark/api/BenchmarkModule.java | 2 +- src/main/java/com/oltpbenchmark/api/Procedure.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/oltpbenchmark/api/BenchmarkModule.java b/src/main/java/com/oltpbenchmark/api/BenchmarkModule.java index 377a518c8..9c5762006 100644 --- a/src/main/java/com/oltpbenchmark/api/BenchmarkModule.java +++ b/src/main/java/com/oltpbenchmark/api/BenchmarkModule.java @@ -363,7 +363,7 @@ public Map getProcedures() { proc.initialize(this.workConf.getDatabaseType()); proc_xref.put(txn, proc); proc.loadSQLDialect(this.dialects); - if (this.workConf.getMonitoringEnabled()) { + if (this.workConf.getAdvancedMonitoringEnabled()) { proc.enabledAdvancedMonitoring(); } } diff --git a/src/main/java/com/oltpbenchmark/api/Procedure.java b/src/main/java/com/oltpbenchmark/api/Procedure.java index af248b338..2700b5d53 100644 --- a/src/main/java/com/oltpbenchmark/api/Procedure.java +++ b/src/main/java/com/oltpbenchmark/api/Procedure.java @@ -161,7 +161,7 @@ protected final void loadSQLDialect(StatementDialects dialects) { /** * Enable monitoring for this procedure by adding a monitoring prefixes. */ - protected final void enableAdvancedMonitoring() { + protected final void enabledAdvancedMonitoring() { for (String stmtName : this.getStatements().keySet()) { SQLStmt stmt = this.name_stmt_xref.get(stmtName); if (LOG.isDebugEnabled()) { From 3d5d61c01b4b6984acca996bc0b7e6160426e927 Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Fri, 28 Apr 2023 15:22:27 +0200 Subject: [PATCH 49/67] Monitor option parsing update. --- src/main/java/com/oltpbenchmark/DBWorkload.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/oltpbenchmark/DBWorkload.java b/src/main/java/com/oltpbenchmark/DBWorkload.java index 267ea8dd0..14d84f99c 100644 --- a/src/main/java/com/oltpbenchmark/DBWorkload.java +++ b/src/main/java/com/oltpbenchmark/DBWorkload.java @@ -89,8 +89,15 @@ public static void main(String[] args) throws Exception { builder.monitoringInterval(Integer.parseInt(argsLine.getOptionValue("im"))); } if (argsLine.hasOption("mt")) { - if (argsLine.getOptionValue("mt").equals("advanced")) { - builder.monitoringType(MonitorInfo.MonitoringType.ADVANCED); + switch (argsLine.getOptionValue("mt")) { + case "advanced": + builder.monitoringType(MonitorInfo.MonitoringType.ADVANCED); + break; + case "throughput": + builder.monitoringType(MonitorInfo.MonitoringType.THROUGHPUT); + break; + default: + throw new ParseException("Monitoring type '" + argsLine.getOptionValue("mt") + "' is undefined, allowed values are: advanced/throughput"); } } MonitorInfo monitorInfo = builder.build(); From 8d049155af54bc066a4b995caf365f873b1734e2 Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Fri, 28 Apr 2023 16:33:25 +0200 Subject: [PATCH 50/67] Regex pattern extraction #1 --- .../java/com/oltpbenchmark/api/Procedure.java | 5 +- .../monitoring/PostgreSQLMonitor.java | 56 +++++++--------- .../monitoring/SQLServerMonitor.java | 65 ++++++++++--------- .../oltpbenchmark/util/MonitoringUtil.java | 18 ++--- 4 files changed, 69 insertions(+), 75 deletions(-) diff --git a/src/main/java/com/oltpbenchmark/api/Procedure.java b/src/main/java/com/oltpbenchmark/api/Procedure.java index 2700b5d53..e552b2a96 100644 --- a/src/main/java/com/oltpbenchmark/api/Procedure.java +++ b/src/main/java/com/oltpbenchmark/api/Procedure.java @@ -164,10 +164,7 @@ protected final void loadSQLDialect(StatementDialects dialects) { protected final void enabledAdvancedMonitoring() { for (String stmtName : this.getStatements().keySet()) { SQLStmt stmt = this.name_stmt_xref.get(stmtName); - if (LOG.isDebugEnabled()) { - LOG.debug(String.format("Enabling advanced monitoring for query %s", - stmtName)); - } + LOG.debug("Enabling advanced monitoring for query {}.", stmtName); // Create monitoring prefix. String prefix = MonitoringUtil.getMonitoringMarker(); prefix = prefix.replace(MonitoringUtil.getMonitoringQueryId(), stmtName); diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/PostgreSQLMonitor.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/PostgreSQLMonitor.java index c9e895253..62b6f887c 100644 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/PostgreSQLMonitor.java +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/PostgreSQLMonitor.java @@ -10,6 +10,7 @@ import java.util.List; import java.util.Map; import java.util.Set; +import java.util.regex.Matcher; import java.util.regex.Pattern; import com.oltpbenchmark.BenchmarkState; @@ -33,7 +34,6 @@ public class PostgreSQLMonitor extends DatabaseMonitor { FROM pg_stat_statements; """; private final String CLEAN_CACHE = "SELECT pg_stat_statements_reset();"; - private final List singleQueryProperties; private final List repeatedQueryProperties; private final Set stored_queries; @@ -44,12 +44,6 @@ public PostgreSQLMonitor(MonitorInfo monitorInfo, BenchmarkState testState, this.stored_queries = new HashSet(); - this.singleQueryProperties = new ArrayList() { - { - add("query_text"); - } - }; - this.repeatedQueryProperties = new ArrayList() { { add("execution_count"); @@ -85,40 +79,36 @@ private void extractQueryMetrics(Instant instant) { continue; } // Get identifier from commment in query text. - String[] split = query_text.split(Pattern.quote(MonitoringUtil.getMonitoringPrefix())); - split = split[1].split(Pattern.quote(MonitoringUtil.getMonitoringSuffix())); - String identifier = split[0]; - - // Handle one-off query info, may occur when a plan gets - // executed for the first time. - Map propertyValues; - if (!stored_queries.contains(identifier)) { - stored_queries.add(identifier); + Matcher m = MonitoringUtil.getMonitoringPattern().matcher(query_text); + if (m.find()) { + String identifier = m.group("queryId"); + query_text = m.replaceAll(""); + + // Handle one-off query info, may occur when a plan gets + // executed for the first time. + Map propertyValues; + if (!stored_queries.contains(identifier)) { + stored_queries.add(identifier); + + singleQueryEventBuilder.queryId(identifier); + propertyValues = new HashMap(); + propertyValues.put("query_text", query_text); + singleQueryEventBuilder.propertyValues(propertyValues); + this.singleQueryEvents.add(singleQueryEventBuilder.build()); + } - singleQueryEventBuilder.queryId(identifier); + // Handle repeated query events. + repeatedQueryEventBuilder.queryId(identifier).instant(instant); propertyValues = new HashMap(); - // Add single events. - for (String property : this.singleQueryProperties) { + for (String property : this.repeatedQueryProperties) { String value = rs.getString(property); if (value != null) { propertyValues.put(property, value); } } - singleQueryEventBuilder.propertyValues(propertyValues); - this.singleQueryEvents.add(singleQueryEventBuilder.build()); - } - - // Handle repeated query events. - repeatedQueryEventBuilder.queryId(identifier).instant(instant); - propertyValues = new HashMap(); - for (String property : this.repeatedQueryProperties) { - String value = rs.getString(property); - if (value != null) { - propertyValues.put(property, value); - } + repeatedQueryEventBuilder.propertyValues(propertyValues); + this.repeatedQueryEvents.add(repeatedQueryEventBuilder.build()); } - repeatedQueryEventBuilder.propertyValues(propertyValues); - this.repeatedQueryEvents.add(repeatedQueryEventBuilder.build()); } } catch (SQLException sqlError) { LOG.error("Error when extracting per query metrics."); diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java index a8448d822..148a444bb 100644 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java @@ -10,6 +10,7 @@ import java.util.List; import java.util.Map; import java.util.Set; +import java.util.regex.Matcher; import java.util.regex.Pattern; import com.oltpbenchmark.BenchmarkState; @@ -72,7 +73,6 @@ public SQLServerMonitor(MonitorInfo monitorInfo, BenchmarkState testState, this.singleQueryProperties = new ArrayList() { { add("query_plan"); - add("query_text"); add("plan_handle"); } }; @@ -141,42 +141,47 @@ private void extractQueryMetrics(Instant instant) { } // Get identifier from commment in query text. - String[] split = query_text.split(Pattern.quote(MonitoringUtil.getMonitoringPrefix())); - split = split[1].split(Pattern.quote(MonitoringUtil.getMonitoringSuffix())); - String identifier = split[0]; - // Get plan_handle for plan identification. - String plan_handle = rs.getString("plan_handle"); - - // Handle one-off query information, may occur when a plan gets - // executed for the first time. - Map propertyValues; - if (!cached_plans.contains(plan_handle)) { - cached_plans.add(plan_handle); - - singleQueryEventBuilder.queryId(identifier); + Matcher m = MonitoringUtil.getMonitoringPattern().matcher(query_text); + if (m.find()) { + String identifier = m.group("queryId"); + query_text = m.replaceAll(""); + LOG.info("identifier: " + identifier); + LOG.info("query text: " + query_text); + // Get plan_handle for plan identification. + String plan_handle = rs.getString("plan_handle"); + + // Handle one-off query information, may occur when a plan gets + // executed for the first time. + Map propertyValues; + if (!cached_plans.contains(plan_handle)) { + cached_plans.add(plan_handle); + + singleQueryEventBuilder.queryId(identifier); + propertyValues = new HashMap(); + propertyValues.put("query_text", query_text); + // Add single events. + for (String property : this.singleQueryProperties) { + String value = rs.getString(property); + if (value != null) { + propertyValues.put(property, value); + } + } + singleQueryEventBuilder.propertyValues(propertyValues); + this.singleQueryEvents.add(singleQueryEventBuilder.build()); + } + + // Handle repeated query events. + repeatedQueryEventBuilder.queryId(identifier).instant(instant); propertyValues = new HashMap(); - // Add single events. - for (String property : this.singleQueryProperties) { + for (String property : this.repeatedQueryProperties) { String value = rs.getString(property); if (value != null) { propertyValues.put(property, value); } } - singleQueryEventBuilder.propertyValues(propertyValues); - this.singleQueryEvents.add(singleQueryEventBuilder.build()); - } - - // Handle repeated query events. - repeatedQueryEventBuilder.queryId(identifier).instant(instant); - propertyValues = new HashMap(); - for (String property : this.repeatedQueryProperties) { - String value = rs.getString(property); - if (value != null) { - propertyValues.put(property, value); - } + repeatedQueryEventBuilder.propertyValues(propertyValues); + this.repeatedQueryEvents.add(repeatedQueryEventBuilder.build()); } - repeatedQueryEventBuilder.propertyValues(propertyValues); - this.repeatedQueryEvents.add(repeatedQueryEventBuilder.build()); } } catch (SQLException sqlError) { LOG.error("Error when extracting per query measurements."); diff --git a/src/main/java/com/oltpbenchmark/util/MonitoringUtil.java b/src/main/java/com/oltpbenchmark/util/MonitoringUtil.java index 914fe5eb7..a33f4f4f9 100644 --- a/src/main/java/com/oltpbenchmark/util/MonitoringUtil.java +++ b/src/main/java/com/oltpbenchmark/util/MonitoringUtil.java @@ -17,16 +17,25 @@ package com.oltpbenchmark.util; +import java.util.regex.Pattern; + public abstract class MonitoringUtil { + private static final Pattern MONITORING_PATTERN = Pattern.compile("/[*] MONITOR-(?\\S+) [*]/"); private final static String MONITORING_MARKER = "/* MONITOR-$queryId */"; private final static String MONITORING_PREFIX = "/* MONITOR-"; private final static String MONITORING_QUERYID = "$queryId"; - private final static String MONITORING_SUFFIX = " */"; /** * Universal monitoring prefix. */ + public static Pattern getMonitoringPattern() { + return MonitoringUtil.MONITORING_PATTERN; + } + + /** + * Get monitoring marker. + */ public static String getMonitoringMarker() { return MonitoringUtil.MONITORING_MARKER; } @@ -44,11 +53,4 @@ public static String getMonitoringPrefix() { public static String getMonitoringQueryId() { return MonitoringUtil.MONITORING_QUERYID; } - - /** - * Comment suffix. - */ - public static String getMonitoringSuffix() { - return MonitoringUtil.MONITORING_SUFFIX; - } } From 8ab9fedefb6ef0e2f3c9a5bb10764f3b6c24c7de Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Fri, 28 Apr 2023 16:50:06 +0200 Subject: [PATCH 51/67] SQLServer instance extraction fix. --- .../monitoring/PostgreSQLMonitor.java | 1 - .../monitoring/SQLServerMonitor.java | 48 +++++++++---------- 2 files changed, 22 insertions(+), 27 deletions(-) diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/PostgreSQLMonitor.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/PostgreSQLMonitor.java index 62b6f887c..1eab7d5f2 100644 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/PostgreSQLMonitor.java +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/PostgreSQLMonitor.java @@ -11,7 +11,6 @@ import java.util.Map; import java.util.Set; import java.util.regex.Matcher; -import java.util.regex.Pattern; import com.oltpbenchmark.BenchmarkState; import com.oltpbenchmark.WorkloadConfiguration; diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java index 148a444bb..6feaa8042 100644 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java @@ -27,26 +27,29 @@ public class SQLServerMonitor extends DatabaseMonitor { private final String DM_EXEC_QUERY_STATS = """ - SELECT q.text AS query_text, st.plan_handle, pl.query_plan, - q.text AS query_text, st.plan_handle, pl.query_plan, - st.execution_count, st.min_worker_time, st.max_worker_time, - st.total_worker_time, st.min_physical_reads, st.max_physical_reads, - st.total_physical_reads, st.min_elapsed_time, st.max_elapsed_time, - st.total_elapsed_time, st.total_rows, st.min_rows, st.max_rows, - st.min_spills, st.max_spills, st.total_spills, - st.min_logical_writes, st.max_logical_writes, st.total_logical_writes, - st.min_logical_reads, st.max_logical_reads, st.total_logical_reads, - st.min_used_grant_kb, st.max_used_grant_kb, st.total_used_grant_kb, - st.min_used_threads, st.max_used_threads, st.total_used_threads - FROM sys.dm_exec_query_stats st - CROSS APPLY sys.dm_exec_sql_text(st.plan_handle) q - CROSS APPLY sys.dm_exec_query_plan(st.plan_handle) pl + SELECT q.text AS query_text, st.plan_handle, pl.query_plan, + q.text AS query_text, st.plan_handle, pl.query_plan, + st.execution_count, st.min_worker_time, st.max_worker_time, + st.total_worker_time, st.min_physical_reads, st.max_physical_reads, + st.total_physical_reads, st.min_elapsed_time, st.max_elapsed_time, + st.total_elapsed_time, st.total_rows, st.min_rows, st.max_rows, + st.min_spills, st.max_spills, st.total_spills, + st.min_logical_writes, st.max_logical_writes, st.total_logical_writes, + st.min_logical_reads, st.max_logical_reads, st.total_logical_reads, + st.min_used_grant_kb, st.max_used_grant_kb, st.total_used_grant_kb, + st.min_used_threads, st.max_used_threads, st.total_used_threads + FROM sys.dm_exec_query_stats st + CROSS APPLY sys.dm_exec_sql_text(st.plan_handle) q + CROSS APPLY sys.dm_exec_query_plan(st.plan_handle) pl """; private String DM_OS_PERFORMANCE_STATS = """ - SELECT cntr_value, counter_name FROM sys.dm_os_performance_counters - WHERE instance_name='$DB_INSTANCE'; + SELECT cntr_value, counter_name + FROM sys.dm_os_performance_counters + WHERE instance_name='%s'; """; private final String CLEAN_CACHE = "DBCC FREEPROCCACHE;"; + private final Pattern DATABASE_URL_PATTERN = Pattern.compile("database=(?\\S+);"); + private final List singleQueryProperties; private final List repeatedQueryProperties; private final List repeatedSystemProperties; @@ -58,14 +61,9 @@ public SQLServerMonitor(MonitorInfo monitorInfo, BenchmarkState testState, super(monitorInfo, testState, workers, conf); // Extract the database instance from url. - String[] params = conf.getUrl().split(";"); - for (String param : params) { - String[] values = param.split("="); - if (values[0].equals("database")) { - DM_OS_PERFORMANCE_STATS = DM_OS_PERFORMANCE_STATS.replace( - "$DB_INSTANCE", values[1]); - break; - } + Matcher m = DATABASE_URL_PATTERN.matcher(conf.getUrl()); + if (m.find()) { + DM_OS_PERFORMANCE_STATS = DM_OS_PERFORMANCE_STATS.formatted(m.group("instanceName")); } this.cached_plans = new HashSet(); @@ -145,8 +143,6 @@ private void extractQueryMetrics(Instant instant) { if (m.find()) { String identifier = m.group("queryId"); query_text = m.replaceAll(""); - LOG.info("identifier: " + identifier); - LOG.info("query text: " + query_text); // Get plan_handle for plan identification. String plan_handle = rs.getString("plan_handle"); From c87f14171f8b774c4c11d39fcc55f23fea0b68d8 Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Fri, 28 Apr 2023 17:05:52 +0200 Subject: [PATCH 52/67] Function consolidation. --- .../monitoring/DatabaseMonitor.java | 30 ++++++++++++++----- .../monitoring/PostgreSQLMonitor.java | 20 +++++-------- .../monitoring/SQLServerMonitor.java | 19 ++++-------- 3 files changed, 35 insertions(+), 34 deletions(-) diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/DatabaseMonitor.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/DatabaseMonitor.java index 01fcef5fc..a50fa3d72 100644 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/DatabaseMonitor.java +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/DatabaseMonitor.java @@ -6,6 +6,7 @@ import java.nio.file.Paths; import java.sql.Connection; import java.sql.DriverManager; +import java.sql.PreparedStatement; import java.sql.SQLException; import java.time.Instant; import java.util.ArrayList; @@ -180,6 +181,25 @@ protected String getFilePath(String filename, int fileCounter) { OUTPUT_DIR, filename + "_" + fileCounter + ".csv"); } + protected void cleanupCache() { + try (PreparedStatement stmt = conn.prepareStatement(this.getCleanupStmt())) { + stmt.execute(); + } catch (SQLException sqlError) { + LOG.error("Error when cleaning up cached plans."); + LOG.error(sqlError.getMessage()); + } + } + + protected void writeQueryMetrics() { + this.writeSingleQueryEventsToCSV(); + this.writeRepeatedQueryEventsToCSV(); + } + + protected void writeToCSV() { + this.writeQueryMetrics(); + this.writeSystemMetrics(); + } + @Value.Immutable public interface SingleQueryEvent { @@ -213,20 +233,14 @@ public interface RepeatedSystemEvent { Map getPropertyValues(); } - /** - * DBMS-specific cache cleaning process. - */ - protected abstract void cleanupCache(); + protected abstract String getCleanupStmt(); /** * Execute the extraction of desired query and performance metrics. */ protected abstract void runExtraction(); - /** - * Write events to csv. - */ - protected abstract void writeToCSV(); + protected abstract void writeSystemMetrics(); /** * Run monitor. Clean up cache first and do initial extraction, then sleep diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/PostgreSQLMonitor.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/PostgreSQLMonitor.java index 1eab7d5f2..df441073f 100644 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/PostgreSQLMonitor.java +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/PostgreSQLMonitor.java @@ -115,6 +115,11 @@ private void extractQueryMetrics(Instant instant) { } } + @Override + protected String getCleanupStmt() { + return CLEAN_CACHE; + } + @Override protected void runExtraction() { Instant time = Instant.now(); @@ -123,18 +128,7 @@ protected void runExtraction() { } @Override - protected void cleanupCache() { - try (PreparedStatement stmt = conn.prepareStatement(CLEAN_CACHE)) { - stmt.execute(); - } catch (SQLException sqlError) { - LOG.error("Error when cleaning up cached plans."); - LOG.error(sqlError.getMessage()); - } - } - - @Override - protected void writeToCSV() { - this.writeSingleQueryEventsToCSV(); - this.writeRepeatedQueryEventsToCSV(); + protected void writeSystemMetrics() { + return; } } diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java index 6feaa8042..57be09034 100644 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java @@ -212,6 +212,11 @@ private void extractPerformanceMetrics(Instant instant) { this.repeatedSystemEvents.add(repeatedSystemEventBuilder.build()); } + @Override + protected String getCleanupStmt() { + return CLEAN_CACHE; + } + @Override protected void runExtraction() { Instant time = Instant.now(); @@ -221,19 +226,7 @@ protected void runExtraction() { } @Override - protected void cleanupCache() { - try (PreparedStatement stmt = conn.prepareStatement(CLEAN_CACHE)) { - stmt.execute(); - } catch (SQLException sqlError) { - LOG.error("Error when cleaning up cached plans."); - LOG.error(sqlError.getMessage()); - } - } - - @Override - protected void writeToCSV() { - this.writeSingleQueryEventsToCSV(); - this.writeRepeatedQueryEventsToCSV(); + protected void writeSystemMetrics() { this.writeRepeatedSystemEventsToCSV(); } From a238e7ddb1c181b251e5e59acc200207ea0dc581 Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Wed, 17 May 2023 15:30:45 +0200 Subject: [PATCH 53/67] Add advanced monitoring check to CI pipeline. --- .github/workflows/maven.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index a26393412..f8e46905d 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -422,12 +422,16 @@ jobs: - name: Run benchmark # Note: user/pass should match those used in sample configs. run: | - java -jar benchbase.jar -b ${{matrix.benchmark}} -c config/sqlserver/sample_${{matrix.benchmark}}_config.xml --create=true --load=true --execute=true --json-histograms results/histograms.json + java -jar benchbase.jar -b ${{matrix.benchmark}} -c config/sqlserver/sample_${{matrix.benchmark}}_config.xml -im 1000 -mt advanced --create=true --load=true --execute=true --json-histograms results/histograms.json # FIXME: Reduce the error rate so we don't need these overrides. if [ ${{matrix.benchmark}} == tatp ]; then ERRORS_THRESHOLD=0.05 fi ./scripts/check_histogram_results.sh results/histograms.json $ERRORS_THRESHOLD + if ![ -d "./results/monitor" ]; then + echo "ERROR: Advanced monitoring unsuccessful, file directory not created." >&2 + exit 1 + fi ## ---------------------------------------------------------------------------------- ## Docker Build Test Publish From aeaad23bad1eec15de87fb069b74219bea2d80b1 Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Mon, 28 Aug 2023 15:11:18 +0200 Subject: [PATCH 54/67] Modify directory check --- .github/workflows/maven.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index cf6a39962..7ab56041f 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -429,8 +429,10 @@ jobs: ERRORS_THRESHOLD=0.05 fi ./scripts/check_histogram_results.sh results/histograms.json $ERRORS_THRESHOLD - if ![ -d "./results/monitor" ]; then - echo "ERROR: Advanced monitoring unsuccessful, file directory not created." >&2 + + # Running the monitor should create at least three files in the 'monitor' directory. + if ![(find "./results/monitor" -maxdepth 1 -mindepth 1 | wc -l) > 2] + echo "ERROR: Advanced monitoring unsuccessful, file directory and/or appropriate files not created." >&2 exit 1 fi From 9c231b3fcc9ee22747531bbd5a68419990fc6fec Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Tue, 29 Aug 2023 08:31:53 +0200 Subject: [PATCH 55/67] try modified command --- .github/workflows/maven.yml | 2 +- src/main/java/com/oltpbenchmark/util/MonitoringUtil.java | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 7ab56041f..cdf7454d6 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -431,7 +431,7 @@ jobs: ./scripts/check_histogram_results.sh results/histograms.json $ERRORS_THRESHOLD # Running the monitor should create at least three files in the 'monitor' directory. - if ![(find "./results/monitor" -maxdepth 1 -mindepth 1 | wc -l) > 2] + if ![ $(find "./results/monitor" -maxdepth 1 -mindepth 1 | wc -l) -gt 2]; then echo "ERROR: Advanced monitoring unsuccessful, file directory and/or appropriate files not created." >&2 exit 1 fi diff --git a/src/main/java/com/oltpbenchmark/util/MonitoringUtil.java b/src/main/java/com/oltpbenchmark/util/MonitoringUtil.java index a33f4f4f9..5ab01fa8d 100644 --- a/src/main/java/com/oltpbenchmark/util/MonitoringUtil.java +++ b/src/main/java/com/oltpbenchmark/util/MonitoringUtil.java @@ -20,8 +20,7 @@ import java.util.regex.Pattern; public abstract class MonitoringUtil { - private static final Pattern MONITORING_PATTERN = Pattern.compile("/[*] MONITOR-(?\\S+) [*]/"); - + private final static Pattern MONITORING_PATTERN = Pattern.compile("/[*] MONITOR-(?\\S+) [*]/"); private final static String MONITORING_MARKER = "/* MONITOR-$queryId */"; private final static String MONITORING_PREFIX = "/* MONITOR-"; private final static String MONITORING_QUERYID = "$queryId"; From c3ce9125fb25e88de51adcbc5300085a0a675188 Mon Sep 17 00:00:00 2001 From: Anja Gruenheid Date: Tue, 29 Aug 2023 08:46:47 +0200 Subject: [PATCH 56/67] Minor modifications to documentation. --- .../java/com/oltpbenchmark/api/collectors/monitoring/README.md | 1 + .../api/collectors/monitoring/SQLServerMonitor.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/README.md b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/README.md index e1a3b44c2..5ffb93af0 100644 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/README.md +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/README.md @@ -20,5 +20,6 @@ Which events are collected depends on the database system and is customized in c The code for the drivers can be found in package [`src.main.java.com.oltpbenchmark.api.collectors.monitoring`](./../monitoring/). For advanced monitoring to function with SQLServer, the user needs to have access to the system tables, for Postgres, `pg_stat_statements` needs to be enabled. +Queries will fail gracefully, i.e., without interrupting the benchmark execution but instead logging an error. Note that in either database system, frequent (additional) queries against the DBMS may distort the benchmarking results. That is, a high additional query load via frequent pulling of data from the DBMS will incur system load and can potentially block the execution of the actual benchmark queries. \ No newline at end of file diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java index 57be09034..b12dff232 100644 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java @@ -187,7 +187,7 @@ private void extractQueryMetrics(Instant instant) { /** * Extract system events using the extraction query and properties defined - * above. + * above, will fail gracefully to not interrupt benchmarking. */ private void extractPerformanceMetrics(Instant instant) { ImmutableRepeatedSystemEvent.Builder repeatedSystemEventBuilder = ImmutableRepeatedSystemEvent.builder(); From 07fc4307b2f126397c86dc56396ad55bf6570206 Mon Sep 17 00:00:00 2001 From: anjagruenheid <87397397+anjagruenheid@users.noreply.github.com> Date: Tue, 26 Mar 2024 11:18:47 +0100 Subject: [PATCH 57/67] fmt plugin --- .../java/com/oltpbenchmark/DBWorkload.java | 45 +++--- .../java/com/oltpbenchmark/ThreadBench.java | 44 +++--- .../oltpbenchmark/WorkloadConfiguration.java | 78 +++++++++-- .../oltpbenchmark/api/BenchmarkModule.java | 32 +++-- .../java/com/oltpbenchmark/api/Procedure.java | 5 +- .../monitoring/DatabaseMonitor.java | 76 +++++----- .../api/collectors/monitoring/Monitor.java | 12 +- .../api/collectors/monitoring/MonitorGen.java | 29 ++-- .../monitoring/PostgreSQLMonitor.java | 54 ++++---- .../monitoring/SQLServerMonitor.java | 130 +++++++++--------- .../com/oltpbenchmark/types/DatabaseType.java | 20 +-- .../com/oltpbenchmark/util/MonitorInfo.java | 8 +- .../oltpbenchmark/util/MonitoringUtil.java | 24 ++-- 13 files changed, 320 insertions(+), 237 deletions(-) diff --git a/src/main/java/com/oltpbenchmark/DBWorkload.java b/src/main/java/com/oltpbenchmark/DBWorkload.java index ef8a3b650..9365be6d2 100644 --- a/src/main/java/com/oltpbenchmark/DBWorkload.java +++ b/src/main/java/com/oltpbenchmark/DBWorkload.java @@ -29,8 +29,6 @@ import java.io.PrintStream; import java.sql.SQLException; import java.util.*; - - import org.apache.commons.cli.*; import org.apache.commons.collections4.map.ListOrderedMap; import org.apache.commons.configuration2.HierarchicalConfiguration; @@ -84,19 +82,22 @@ public static void main(String[] args) throws Exception { // Monitoring setup. ImmutableMonitorInfo.Builder builder = ImmutableMonitorInfo.builder(); if (argsLine.hasOption("im")) { - builder.monitoringInterval(Integer.parseInt(argsLine.getOptionValue("im"))); + builder.monitoringInterval(Integer.parseInt(argsLine.getOptionValue("im"))); } if (argsLine.hasOption("mt")) { - switch (argsLine.getOptionValue("mt")) { - case "advanced": - builder.monitoringType(MonitorInfo.MonitoringType.ADVANCED); - break; - case "throughput": - builder.monitoringType(MonitorInfo.MonitoringType.THROUGHPUT); - break; - default: - throw new ParseException("Monitoring type '" + argsLine.getOptionValue("mt") + "' is undefined, allowed values are: advanced/throughput"); - } + switch (argsLine.getOptionValue("mt")) { + case "advanced": + builder.monitoringType(MonitorInfo.MonitoringType.ADVANCED); + break; + case "throughput": + builder.monitoringType(MonitorInfo.MonitoringType.THROUGHPUT); + break; + default: + throw new ParseException( + "Monitoring type '" + + argsLine.getOptionValue("mt") + + "' is undefined, allowed values are: advanced/throughput"); + } } MonitorInfo monitorInfo = builder.build(); @@ -166,12 +167,13 @@ public static void main(String[] args) throws Exception { // Nothing to do here ! } - // Set monitoring enabled, if all requirements are met. - if (monitorInfo.getMonitoringInterval() > 0 && monitorInfo.getMonitoringType() == MonitoringType.ADVANCED - && DatabaseType.get(xmlConfig.getString("type")).shouldCreateMonitoringPrefix()) { - LOG.info("Advanced monitoring enabled, prefix will be added to queries."); - wrkld.setAdvancedMonitoringEnabled(true); - } + // Set monitoring enabled, if all requirements are met. + if (monitorInfo.getMonitoringInterval() > 0 + && monitorInfo.getMonitoringType() == MonitoringType.ADVANCED + && DatabaseType.get(xmlConfig.getString("type")).shouldCreateMonitoringPrefix()) { + LOG.info("Advanced monitoring enabled, prefix will be added to queries."); + wrkld.setAdvancedMonitoringEnabled(true); + } // ---------------------------------------------------------------- // CREATE BENCHMARK MODULE @@ -580,9 +582,8 @@ private static Options buildOptions(XMLConfiguration pluginConfig) { options.addOption(null, "execute", true, "Execute the benchmark workload"); options.addOption("h", "help", false, "Print this help"); options.addOption("s", "sample", true, "Sampling window"); - options.addOption( - "im", "interval-monitor", true, "Monitoring Interval in milliseconds"); - options.addOption("mt", "monitor-type", true, "Type of Monitoring (throughput/advanced)"); + options.addOption("im", "interval-monitor", true, "Monitoring Interval in milliseconds"); + options.addOption("mt", "monitor-type", true, "Type of Monitoring (throughput/advanced)"); options.addOption( "d", "directory", diff --git a/src/main/java/com/oltpbenchmark/ThreadBench.java b/src/main/java/com/oltpbenchmark/ThreadBench.java index a2aafc4e3..4f1cb93ac 100644 --- a/src/main/java/com/oltpbenchmark/ThreadBench.java +++ b/src/main/java/com/oltpbenchmark/ThreadBench.java @@ -44,8 +44,10 @@ public class ThreadBench implements Thread.UncaughtExceptionHandler { private Monitor monitor = null; - private ThreadBench(List> workers, - List workConfs, MonitorInfo monitorInfo) { + private ThreadBench( + List> workers, + List workConfs, + MonitorInfo monitorInfo) { this.workers = workers; this.workConfs = workConfs; this.workerThreads = new ArrayList<>(workers.size()); @@ -53,8 +55,10 @@ private ThreadBench(List> workers, this.testState = new BenchmarkState(workers.size() + 1); } - public static Results runRateLimitedBenchmark(List> workers, - List workConfs, MonitorInfo monitorInfo) { + public static Results runRateLimitedBenchmark( + List> workers, + List workConfs, + MonitorInfo monitorInfo) { ThreadBench bench = new ThreadBench(workers, workConfs, monitorInfo); return bench.runRateLimitedMultiPhase(); } @@ -159,8 +163,9 @@ private Results runRateLimitedMultiPhase() { // Initialize the Monitor if (this.monitorInfo.getMonitoringInterval() > 0) { - this.monitor = MonitorGen.getMonitor(this.monitorInfo, this.testState, this.workers, - this.workConfs.get(0)); + this.monitor = + MonitorGen.getMonitor( + this.monitorInfo, this.testState, this.workers, this.workConfs.get(0)); this.monitor.start(); } @@ -237,8 +242,8 @@ private Results runRateLimitedMultiPhase() { lastEntry = true; testState.startCoolDown(); measureEnd = now; - LOG.info("{} :: Waiting for all terminals to finish ..", - StringUtil.bold("TERMINATE")); + LOG.info( + "{} :: Waiting for all terminals to finish ..", StringUtil.bold("TERMINATE")); } else if (phase != null) { // Reset serial execution parameters. if (phase.isLatencyRun()) { @@ -335,11 +340,16 @@ private Results runRateLimitedMultiPhase() { } DistributionStatistics stats = DistributionStatistics.computeStatistics(latencies); - Results results = new Results( - // If any errors were thrown during the execution, proprogate that fact to the - // final Results state so we can exit non-zero *after* we output the results. - errorsThrown ? State.ERROR : testState.getState(), startTs, measureEnd - start, requests, - stats, samples); + Results results = + new Results( + // If any errors were thrown during the execution, proprogate that fact to the + // final Results state so we can exit non-zero *after* we output the results. + errorsThrown ? State.ERROR : testState.getState(), + startTs, + measureEnd - start, + requests, + stats, + samples); // Compute transaction histogram Set txnTypes = new HashSet<>(); @@ -412,8 +422,8 @@ public static final class TimeBucketIterable implements Iterable samples, int windowSizeSeconds, - TransactionType transactionType) { + public TimeBucketIterable( + Iterable samples, int windowSizeSeconds, TransactionType transactionType) { this.samples = samples; this.windowSizeSeconds = windowSizeSeconds; this.transactionType = transactionType; @@ -440,8 +450,8 @@ private static final class TimeBucketIterator implements Iterator samples, int windowSizeSeconds, - TransactionType txType) { + public TimeBucketIterator( + Iterator samples, int windowSizeSeconds, TransactionType txType) { this.samples = samples; this.windowSizeSeconds = windowSizeSeconds; this.txType = txType; diff --git a/src/main/java/com/oltpbenchmark/WorkloadConfiguration.java b/src/main/java/com/oltpbenchmark/WorkloadConfiguration.java index bf1e9d622..5ace0362c 100644 --- a/src/main/java/com/oltpbenchmark/WorkloadConfiguration.java +++ b/src/main/java/com/oltpbenchmark/WorkloadConfiguration.java @@ -175,11 +175,32 @@ public void initializeState(BenchmarkState benchmarkState) { this.workloadState = new WorkloadState(benchmarkState, phases, terminals); } - public void addPhase(int id, int time, int warmup, double rate, List weights, - boolean rateLimited, boolean disabled, boolean serial, boolean timed, int active_terminals, + public void addPhase( + int id, + int time, + int warmup, + double rate, + List weights, + boolean rateLimited, + boolean disabled, + boolean serial, + boolean timed, + int active_terminals, Phase.Arrival arrival) { - phases.add(new Phase(benchmarkName, id, time, warmup, rate, weights, rateLimited, disabled, - serial, timed, active_terminals, arrival)); + phases.add( + new Phase( + benchmarkName, + id, + time, + warmup, + rate, + weights, + rateLimited, + disabled, + serial, + timed, + active_terminals, + arrival)); } /** @@ -353,12 +374,47 @@ public String getIsolationString() { @Override public String toString() { - return "WorkloadConfiguration{" + "phases=" + phases + ", databaseType=" + databaseType - + ", benchmarkName='" + benchmarkName + '\'' + ", url='" + url + '\'' + ", username='" - + username + '\'' + ", password='" + password + '\'' + ", driverClass='" + driverClass - + '\'' + ", batchSize=" + batchSize + ", maxRetries=" + maxRetries + ", scaleFactor=" - + scaleFactor + ", selectivity=" + selectivity + ", terminals=" + terminals - + ", loaderThreads=" + loaderThreads + ", workloadState=" + workloadState + ", transTypes=" - + transTypes + ", isolationMode=" + isolationMode + ", dataDir='" + dataDir + '\'' + '}'; + return "WorkloadConfiguration{" + + "phases=" + + phases + + ", databaseType=" + + databaseType + + ", benchmarkName='" + + benchmarkName + + '\'' + + ", url='" + + url + + '\'' + + ", username='" + + username + + '\'' + + ", password='" + + password + + '\'' + + ", driverClass='" + + driverClass + + '\'' + + ", batchSize=" + + batchSize + + ", maxRetries=" + + maxRetries + + ", scaleFactor=" + + scaleFactor + + ", selectivity=" + + selectivity + + ", terminals=" + + terminals + + ", loaderThreads=" + + loaderThreads + + ", workloadState=" + + workloadState + + ", transTypes=" + + transTypes + + ", isolationMode=" + + isolationMode + + ", dataDir='" + + dataDir + + '\'' + + '}'; } } diff --git a/src/main/java/com/oltpbenchmark/api/BenchmarkModule.java b/src/main/java/com/oltpbenchmark/api/BenchmarkModule.java index 33e5a8a83..d8e9dbb9f 100644 --- a/src/main/java/com/oltpbenchmark/api/BenchmarkModule.java +++ b/src/main/java/com/oltpbenchmark/api/BenchmarkModule.java @@ -82,8 +82,8 @@ public final Connection makeConnection() throws SQLException { if (StringUtils.isEmpty(workConf.getUsername())) { return DriverManager.getConnection(workConf.getUrl()); } else { - return DriverManager.getConnection(workConf.getUrl(), workConf.getUsername(), - workConf.getPassword()); + return DriverManager.getConnection( + workConf.getUrl(), workConf.getUsername(), workConf.getPassword()); } } @@ -162,8 +162,7 @@ public String getDatabaseDDLPath(DatabaseType db_type) { if (db_type != null) { DatabaseType ddl_db_type = db_type; // HACK: Use MySQL if we're given MariaDB - if (ddl_db_type == DatabaseType.MARIADB) - ddl_db_type = DatabaseType.MYSQL; + if (ddl_db_type == DatabaseType.MARIADB) ddl_db_type = DatabaseType.MYSQL; names.add("ddl-" + ddl_db_type.name().toLowerCase() + ".sql"); } names.add("ddl-generic.sql"); @@ -262,17 +261,20 @@ public final Loader loadDatabase() } } finally { if (LOG.isDebugEnabled()) { - LOG.debug(String.format("Finished loading the %s database", - this.getBenchmarkName().toUpperCase())); + LOG.debug( + String.format( + "Finished loading the %s database", this.getBenchmarkName().toUpperCase())); } } } if (this.afterLoadScriptPath != null) { - LOG.debug("Running script after load for {} benchmark...", + LOG.debug( + "Running script after load for {} benchmark...", this.workConf.getBenchmarkName().toUpperCase()); runScript(this.afterLoadScriptPath); - LOG.debug("Finished running script after load for {} benchmark...", + LOG.debug( + "Finished running script after load for {} benchmark...", this.workConf.getBenchmarkName().toUpperCase()); } @@ -330,12 +332,16 @@ public final String toString() { * @return */ @SuppressWarnings("unchecked") - public final TransactionType initTransactionType(String procName, int id, long preExecutionWait, - long postExecutionWait) { + public final TransactionType initTransactionType( + String procName, int id, long preExecutionWait, long postExecutionWait) { if (id == TransactionType.INVALID_ID) { - throw new RuntimeException(String.format( - "Procedure %s.%s cannot use the reserved id '%d' for %s", getBenchmarkName(), procName, - id, TransactionType.INVALID.getClass().getSimpleName())); + throw new RuntimeException( + String.format( + "Procedure %s.%s cannot use the reserved id '%d' for %s", + getBenchmarkName(), + procName, + id, + TransactionType.INVALID.getClass().getSimpleName())); } Package pkg = this.getProcedurePackageImpl(); diff --git a/src/main/java/com/oltpbenchmark/api/Procedure.java b/src/main/java/com/oltpbenchmark/api/Procedure.java index 953609598..548c29d80 100644 --- a/src/main/java/com/oltpbenchmark/api/Procedure.java +++ b/src/main/java/com/oltpbenchmark/api/Procedure.java @@ -20,7 +20,6 @@ import com.oltpbenchmark.jdbc.AutoIncrementPreparedStatement; import com.oltpbenchmark.types.DatabaseType; import com.oltpbenchmark.util.MonitoringUtil; - import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.sql.Connection; @@ -162,9 +161,7 @@ protected final void loadSQLDialect(StatementDialects dialects) { } } - /** - * Enable monitoring for this procedure by adding a monitoring prefixes. - */ + /** Enable monitoring for this procedure by adding a monitoring prefixes. */ protected final void enabledAdvancedMonitoring() { for (String stmtName : this.getStatements().keySet()) { SQLStmt stmt = this.name_stmt_xref.get(stmtName); diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/DatabaseMonitor.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/DatabaseMonitor.java index 06ae384c1..3706d14c5 100644 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/DatabaseMonitor.java +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/DatabaseMonitor.java @@ -1,5 +1,12 @@ package com.oltpbenchmark.api.collectors.monitoring; +import com.oltpbenchmark.BenchmarkState; +import com.oltpbenchmark.WorkloadConfiguration; +import com.oltpbenchmark.api.BenchmarkModule; +import com.oltpbenchmark.api.Worker; +import com.oltpbenchmark.util.FileUtil; +import com.oltpbenchmark.util.MonitorInfo; +import com.oltpbenchmark.util.StringUtil; import java.io.IOException; import java.io.PrintStream; import java.nio.file.Files; @@ -12,24 +19,15 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; -import org.immutables.value.Value; - -import com.oltpbenchmark.BenchmarkState; -import com.oltpbenchmark.WorkloadConfiguration; -import com.oltpbenchmark.api.BenchmarkModule; -import com.oltpbenchmark.api.Worker; -import com.oltpbenchmark.util.FileUtil; -import com.oltpbenchmark.util.MonitorInfo; -import com.oltpbenchmark.util.StringUtil; - import org.apache.commons.lang3.StringUtils; +import org.immutables.value.Value; -/** - * Generic database monitor that consolidates functionality used across DBMS. - */ +/** Generic database monitor that consolidates functionality used across DBMS. */ public abstract class DatabaseMonitor extends Monitor { protected enum DatabaseState { - READY, INVALID, TEST + READY, + INVALID, + TEST }; protected final String OUTPUT_DIR = "results/monitor"; @@ -64,7 +62,9 @@ private final Connection makeConnection() throws SQLException { } } - public DatabaseMonitor(MonitorInfo monitorInfo, BenchmarkState testState, + public DatabaseMonitor( + MonitorInfo monitorInfo, + BenchmarkState testState, List> workers, WorkloadConfiguration workloadConf) { super(monitorInfo, testState, workers); @@ -100,11 +100,14 @@ protected void writeSingleQueryEventsToCSV() { LOG.warn("File at " + filePath + " deleted before writing query events to file."); } PrintStream out = new PrintStream(filePath); - out.println("QueryId," - + StringUtil.join(",", this.singleQueryEvents.get(0).getPropertyValues().keySet())); + out.println( + "QueryId," + + StringUtil.join(",", this.singleQueryEvents.get(0).getPropertyValues().keySet())); for (SingleQueryEvent event : this.singleQueryEvents) { - out.println(event.getQueryId() + "," - + StringUtil.join(",", this.singleQueryEvents.get(0).getPropertyValues().values())); + out.println( + event.getQueryId() + + "," + + StringUtil.join(",", this.singleQueryEvents.get(0).getPropertyValues().values())); } out.close(); this.singleQueryEvents = new ArrayList<>(); @@ -127,11 +130,17 @@ protected void writeRepeatedQueryEventsToCSV() { LOG.warn("File at " + filePath + " deleted before writing repeated query events to file."); } PrintStream out = new PrintStream(filePath); - out.println("QueryId,Instant," - + StringUtil.join(",", this.repeatedQueryEvents.get(0).getPropertyValues().keySet())); + out.println( + "QueryId,Instant," + + StringUtil.join(",", this.repeatedQueryEvents.get(0).getPropertyValues().keySet())); for (RepeatedQueryEvent event : this.repeatedQueryEvents) { - out.println(event.getQueryId() + "," + event.getInstant().toString() + "," - + StringUtil.join(",", this.repeatedQueryEvents.get(0).getPropertyValues().values())); + out.println( + event.getQueryId() + + "," + + event.getInstant().toString() + + "," + + StringUtil.join( + ",", this.repeatedQueryEvents.get(0).getPropertyValues().values())); } out.close(); this.repeatedQueryEvents = new ArrayList<>(); @@ -154,11 +163,16 @@ protected void writeRepeatedSystemEventsToCSV() { LOG.warn("File at " + filePath + " deleted before writing repeated system events to file."); } PrintStream out = new PrintStream(filePath); - out.println("Instant," - + StringUtil.join(",", this.repeatedSystemEvents.get(0).getPropertyValues().keySet())); + out.println( + "Instant," + + StringUtil.join( + ",", this.repeatedSystemEvents.get(0).getPropertyValues().keySet())); for (RepeatedSystemEvent event : this.repeatedSystemEvents) { - out.println(event.getInstant().toString() + "," - + StringUtil.join(",", this.repeatedSystemEvents.get(0).getPropertyValues().values())); + out.println( + event.getInstant().toString() + + "," + + StringUtil.join( + ",", this.repeatedSystemEvents.get(0).getPropertyValues().values())); } out.close(); this.repeatedSystemEvents = new ArrayList<>(); @@ -227,9 +241,7 @@ public interface RepeatedSystemEvent { protected abstract String getCleanupStmt(); - /** - * Execute the extraction of desired query and performance metrics. - */ + /** Execute the extraction of desired query and performance metrics. */ protected abstract void runExtraction(); protected abstract void writeSystemMetrics(); @@ -274,9 +286,7 @@ public void run() { writeToCSV(); } - /** - * Called at the end of the test to do any clean up that may be required. - */ + /** Called at the end of the test to do any clean up that may be required. */ @Override public void tearDown() { if (this.conn != null) { diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/Monitor.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/Monitor.java index 9b441aa67..e014f17bd 100644 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/Monitor.java +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/Monitor.java @@ -1,12 +1,10 @@ package com.oltpbenchmark.api.collectors.monitoring; -import java.util.List; - import com.oltpbenchmark.BenchmarkState; import com.oltpbenchmark.api.BenchmarkModule; import com.oltpbenchmark.api.Worker; import com.oltpbenchmark.util.MonitorInfo; - +import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -28,7 +26,9 @@ public class Monitor extends Thread { /** * @param interval How long to wait between polling in milliseconds */ - Monitor(MonitorInfo monitorInfo, BenchmarkState testState, + Monitor( + MonitorInfo monitorInfo, + BenchmarkState testState, List> workers) { this.monitorInfo = monitorInfo; this.testState = testState; @@ -61,9 +61,7 @@ public void run() { } } - /** - * Called at the end of the test to do any clean up that may be required. - */ + /** Called at the end of the test to do any clean up that may be required. */ public void tearDown() { // nothing to do here } diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/MonitorGen.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/MonitorGen.java index 261c0a1b8..7e002634b 100644 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/MonitorGen.java +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/MonitorGen.java @@ -1,31 +1,34 @@ package com.oltpbenchmark.api.collectors.monitoring; -import java.util.List; - import com.oltpbenchmark.BenchmarkState; import com.oltpbenchmark.WorkloadConfiguration; import com.oltpbenchmark.api.BenchmarkModule; import com.oltpbenchmark.api.Worker; import com.oltpbenchmark.util.MonitorInfo; +import java.util.List; /** * Monitor generator that picks the appropriate monitoring implemnetation based on the database * type. */ public class MonitorGen { - public static Monitor getMonitor(MonitorInfo monitorInfo, BenchmarkState testState, - List> workers, WorkloadConfiguration conf) { + public static Monitor getMonitor( + MonitorInfo monitorInfo, + BenchmarkState testState, + List> workers, + WorkloadConfiguration conf) { switch (monitorInfo.getMonitoringType()) { - case ADVANCED: { - switch (conf.getDatabaseType()) { - case SQLSERVER: - return new SQLServerMonitor(monitorInfo, testState, workers, conf); - case POSTGRES: - return new PostgreSQLMonitor(monitorInfo, testState, workers, conf); - default: - return new Monitor(monitorInfo, testState, workers); + case ADVANCED: + { + switch (conf.getDatabaseType()) { + case SQLSERVER: + return new SQLServerMonitor(monitorInfo, testState, workers, conf); + case POSTGRES: + return new PostgreSQLMonitor(monitorInfo, testState, workers, conf); + default: + return new Monitor(monitorInfo, testState, workers); + } } - } default: return new Monitor(monitorInfo, testState, workers); } diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/PostgreSQLMonitor.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/PostgreSQLMonitor.java index b5183202e..6248450bd 100644 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/PostgreSQLMonitor.java +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/PostgreSQLMonitor.java @@ -1,5 +1,11 @@ package com.oltpbenchmark.api.collectors.monitoring; +import com.oltpbenchmark.BenchmarkState; +import com.oltpbenchmark.WorkloadConfiguration; +import com.oltpbenchmark.api.BenchmarkModule; +import com.oltpbenchmark.api.Worker; +import com.oltpbenchmark.util.MonitorInfo; +import com.oltpbenchmark.util.MonitoringUtil; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; @@ -12,20 +18,14 @@ import java.util.Set; import java.util.regex.Matcher; -import com.oltpbenchmark.BenchmarkState; -import com.oltpbenchmark.WorkloadConfiguration; -import com.oltpbenchmark.api.BenchmarkModule; -import com.oltpbenchmark.api.Worker; -import com.oltpbenchmark.util.MonitorInfo; -import com.oltpbenchmark.util.MonitoringUtil; - /** * Implementation of a monitor specific to PostgreSQL. Uses the 'pg_stat_statements' add-on to * extract relevant query and system information. */ public class PostgreSQLMonitor extends DatabaseMonitor { - private final String PG_STAT_STATEMENTS = """ + private final String PG_STAT_STATEMENTS = + """ SELECT query AS query_text, calls as execution_count, rows, total_exec_time, min_exec_time, max_exec_time, shared_blks_read, shared_blks_written, local_blks_read, @@ -37,27 +37,31 @@ public class PostgreSQLMonitor extends DatabaseMonitor { private final Set stored_queries; - public PostgreSQLMonitor(MonitorInfo monitorInfo, BenchmarkState testState, - List> workers, WorkloadConfiguration conf) { + public PostgreSQLMonitor( + MonitorInfo monitorInfo, + BenchmarkState testState, + List> workers, + WorkloadConfiguration conf) { super(monitorInfo, testState, workers, conf); this.stored_queries = new HashSet(); - this.repeatedQueryProperties = new ArrayList() { - { - add("execution_count"); - add("min_exec_time"); - add("max_exec_time"); - add("total_exec_time"); - add("rows"); - add("shared_blks_read"); - add("shared_blks_written"); - add("local_blks_read"); - add("local_blks_written"); - add("temp_blks_read"); - add("temp_blks_written"); - } - }; + this.repeatedQueryProperties = + new ArrayList() { + { + add("execution_count"); + add("min_exec_time"); + add("max_exec_time"); + add("total_exec_time"); + add("rows"); + add("shared_blks_read"); + add("shared_blks_written"); + add("local_blks_read"); + add("local_blks_written"); + add("temp_blks_read"); + add("temp_blks_written"); + } + }; } /** diff --git a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java index b79a3fbd2..d3d9143f1 100644 --- a/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java +++ b/src/main/java/com/oltpbenchmark/api/collectors/monitoring/SQLServerMonitor.java @@ -1,5 +1,11 @@ package com.oltpbenchmark.api.collectors.monitoring; +import com.oltpbenchmark.BenchmarkState; +import com.oltpbenchmark.WorkloadConfiguration; +import com.oltpbenchmark.api.BenchmarkModule; +import com.oltpbenchmark.api.Worker; +import com.oltpbenchmark.util.MonitorInfo; +import com.oltpbenchmark.util.MonitoringUtil; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; @@ -13,20 +19,14 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import com.oltpbenchmark.BenchmarkState; -import com.oltpbenchmark.WorkloadConfiguration; -import com.oltpbenchmark.api.BenchmarkModule; -import com.oltpbenchmark.api.Worker; -import com.oltpbenchmark.util.MonitorInfo; -import com.oltpbenchmark.util.MonitoringUtil; - /** * Implementation of a monitor specific to SQLServer. Uses SQLServer's system tables to extract * relevant query and system information. */ public class SQLServerMonitor extends DatabaseMonitor { - private final String DM_EXEC_QUERY_STATS = """ + private final String DM_EXEC_QUERY_STATS = + """ SELECT q.text AS query_text, st.plan_handle, pl.query_plan, q.text AS query_text, st.plan_handle, pl.query_plan, st.execution_count, st.min_worker_time, st.max_worker_time, @@ -42,7 +42,8 @@ public class SQLServerMonitor extends DatabaseMonitor { CROSS APPLY sys.dm_exec_sql_text(st.plan_handle) q CROSS APPLY sys.dm_exec_query_plan(st.plan_handle) pl """; - private String DM_OS_PERFORMANCE_STATS = """ + private String DM_OS_PERFORMANCE_STATS = + """ SELECT cntr_value, counter_name FROM sys.dm_os_performance_counters WHERE instance_name='%s'; @@ -56,8 +57,11 @@ public class SQLServerMonitor extends DatabaseMonitor { private final Set cached_plans; - public SQLServerMonitor(MonitorInfo monitorInfo, BenchmarkState testState, - List> workers, WorkloadConfiguration conf) { + public SQLServerMonitor( + MonitorInfo monitorInfo, + BenchmarkState testState, + List> workers, + WorkloadConfiguration conf) { super(monitorInfo, testState, workers, conf); // Extract the database instance from url. @@ -68,56 +72,59 @@ public SQLServerMonitor(MonitorInfo monitorInfo, BenchmarkState testState, this.cached_plans = new HashSet(); - this.singleQueryProperties = new ArrayList() { - { - add("query_plan"); - add("plan_handle"); - } - }; - - this.repeatedQueryProperties = new ArrayList() { - { - add("execution_count"); - add("min_worker_time"); - add("max_worker_time"); - add("total_worker_time"); - add("min_physical_reads"); - add("max_physical_reads"); - add("total_physical_reads"); - add("min_elapsed_time"); - add("max_elapsed_time"); - add("total_elapsed_time"); - add("min_rows"); - add("max_rows"); - add("total_rows"); - add("min_spills"); - add("max_spills"); - add("total_spills"); - add("min_logical_writes"); - add("max_logical_writes"); - add("total_logical_writes"); - add("min_logical_reads"); - add("max_logical_reads"); - add("total_logical_reads"); - add("min_used_grant_kb"); - add("max_used_grant_kb"); - add("total_used_grant_kb"); - add("min_used_threads"); - add("max_used_threads"); - add("total_used_threads"); - add("plan_handle"); - } - }; - - this.repeatedSystemProperties = new ArrayList() { - { - add("Data File(s) Size (KB)"); - add("Transactions/sec"); - add("Write Transactions/sec"); - add("Cache Hit Ratio"); - add("Cache Entries Count"); - } - }; + this.singleQueryProperties = + new ArrayList() { + { + add("query_plan"); + add("plan_handle"); + } + }; + + this.repeatedQueryProperties = + new ArrayList() { + { + add("execution_count"); + add("min_worker_time"); + add("max_worker_time"); + add("total_worker_time"); + add("min_physical_reads"); + add("max_physical_reads"); + add("total_physical_reads"); + add("min_elapsed_time"); + add("max_elapsed_time"); + add("total_elapsed_time"); + add("min_rows"); + add("max_rows"); + add("total_rows"); + add("min_spills"); + add("max_spills"); + add("total_spills"); + add("min_logical_writes"); + add("max_logical_writes"); + add("total_logical_writes"); + add("min_logical_reads"); + add("max_logical_reads"); + add("total_logical_reads"); + add("min_used_grant_kb"); + add("max_used_grant_kb"); + add("total_used_grant_kb"); + add("min_used_threads"); + add("max_used_threads"); + add("total_used_threads"); + add("plan_handle"); + } + }; + + this.repeatedSystemProperties = + new ArrayList() { + { + add("Data File(s) Size (KB)"); + add("Transactions/sec"); + add("Write Transactions/sec"); + add("Cache Hit Ratio"); + add("Cache Entries Count"); + } + }; } /** @@ -231,5 +238,4 @@ protected void runExtraction() { protected void writeSystemMetrics() { this.writeRepeatedSystemEventsToCSV(); } - } diff --git a/src/main/java/com/oltpbenchmark/types/DatabaseType.java b/src/main/java/com/oltpbenchmark/types/DatabaseType.java index 100e0e7e7..805ad810e 100644 --- a/src/main/java/com/oltpbenchmark/types/DatabaseType.java +++ b/src/main/java/com/oltpbenchmark/types/DatabaseType.java @@ -50,14 +50,18 @@ public enum DatabaseType { PHOENIX(true, true); DatabaseType( - boolean escapeNames, boolean includeColNames, boolean loadNeedsUpdateColumnSequence, boolean needsMonitoringPrefix) { + boolean escapeNames, + boolean includeColNames, + boolean loadNeedsUpdateColumnSequence, + boolean needsMonitoringPrefix) { this.escapeNames = escapeNames; this.includeColNames = includeColNames; this.loadNeedsUpdateColumnSequence = loadNeedsUpdateColumnSequence; this.needsMonitoringPrefix = needsMonitoringPrefix; } - DatabaseType(boolean escapeNames, boolean includeColNames, boolean loadNeedsUpdateColumnSequence) { + DatabaseType( + boolean escapeNames, boolean includeColNames, boolean loadNeedsUpdateColumnSequence) { this(escapeNames, includeColNames, loadNeedsUpdateColumnSequence, false); } @@ -79,12 +83,9 @@ public enum DatabaseType { * loading data. */ private final boolean loadNeedsUpdateColumnSequence; - /** - * If this flag is set to true, the framework will add a monitoring prefix - * to each query. - */ - private final boolean needsMonitoringPrefix; + /** If this flag is set to true, the framework will add a monitoring prefix to each query. */ + private final boolean needsMonitoringPrefix; // --------------------------------------------------------------- // ACCESSORS @@ -114,11 +115,10 @@ public boolean shouldUpdateColumnSequenceAfterLoad() { } /** - * @return True if the framework should add a monitoring prefix to each - * query. + * @return True if the framework should add a monitoring prefix to each query. */ public boolean shouldCreateMonitoringPrefix() { - return (this.needsMonitoringPrefix); + return (this.needsMonitoringPrefix); } // ---------------------------------------------------------------- diff --git a/src/main/java/com/oltpbenchmark/util/MonitorInfo.java b/src/main/java/com/oltpbenchmark/util/MonitorInfo.java index 5a6981f06..41f8bdb3f 100644 --- a/src/main/java/com/oltpbenchmark/util/MonitorInfo.java +++ b/src/main/java/com/oltpbenchmark/util/MonitorInfo.java @@ -21,19 +21,19 @@ public interface MonitorInfo { public enum MonitoringType { - ADVANCED, THROUGHPUT; + ADVANCED, + THROUGHPUT; } /** Monitoring interval. */ @Value.Default - default public int getMonitoringInterval() { + public default int getMonitoringInterval() { return 0; } /** Monitoring type. */ @Value.Default - default public MonitoringType getMonitoringType() { + public default MonitoringType getMonitoringType() { return MonitoringType.THROUGHPUT; } - } diff --git a/src/main/java/com/oltpbenchmark/util/MonitoringUtil.java b/src/main/java/com/oltpbenchmark/util/MonitoringUtil.java index e3c1c01d8..8339e4da3 100644 --- a/src/main/java/com/oltpbenchmark/util/MonitoringUtil.java +++ b/src/main/java/com/oltpbenchmark/util/MonitoringUtil.java @@ -18,36 +18,28 @@ import java.util.regex.Pattern; public abstract class MonitoringUtil { - private final static Pattern MONITORING_PATTERN = + private static final Pattern MONITORING_PATTERN = Pattern.compile("/[*] MONITOR-(?\\S+) [*]/"); - private final static String MONITORING_MARKER = "/* MONITOR-$queryId */"; - private final static String MONITORING_PREFIX = "/* MONITOR-"; - private final static String MONITORING_QUERYID = "$queryId"; + private static final String MONITORING_MARKER = "/* MONITOR-$queryId */"; + private static final String MONITORING_PREFIX = "/* MONITOR-"; + private static final String MONITORING_QUERYID = "$queryId"; - /** - * Universal monitoring prefix. - */ + /** Universal monitoring prefix. */ public static Pattern getMonitoringPattern() { return MonitoringUtil.MONITORING_PATTERN; } - /** - * Get monitoring marker. - */ + /** Get monitoring marker. */ public static String getMonitoringMarker() { return MonitoringUtil.MONITORING_MARKER; } - /** - * Get monitoring identifier. - */ + /** Get monitoring identifier. */ public static String getMonitoringPrefix() { return MonitoringUtil.MONITORING_PREFIX; } - /** - * Query identifier in monitoring prefix. - */ + /** Query identifier in monitoring prefix. */ public static String getMonitoringQueryId() { return MonitoringUtil.MONITORING_QUERYID; } From 0e7bfab11ff1464a4847d93cc10a760c04018e41 Mon Sep 17 00:00:00 2001 From: anjagruenheid <87397397+anjagruenheid@users.noreply.github.com> Date: Tue, 26 Mar 2024 11:23:25 +0100 Subject: [PATCH 58/67] bugfix --- src/main/java/com/oltpbenchmark/DBWorkload.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/oltpbenchmark/DBWorkload.java b/src/main/java/com/oltpbenchmark/DBWorkload.java index 9365be6d2..d5af2f5d6 100644 --- a/src/main/java/com/oltpbenchmark/DBWorkload.java +++ b/src/main/java/com/oltpbenchmark/DBWorkload.java @@ -169,7 +169,7 @@ public static void main(String[] args) throws Exception { // Set monitoring enabled, if all requirements are met. if (monitorInfo.getMonitoringInterval() > 0 - && monitorInfo.getMonitoringType() == MonitoringType.ADVANCED + && monitorInfo.getMonitoringType() == MonitorInfo.MonitoringType.ADVANCED && DatabaseType.get(xmlConfig.getString("type")).shouldCreateMonitoringPrefix()) { LOG.info("Advanced monitoring enabled, prefix will be added to queries."); wrkld.setAdvancedMonitoringEnabled(true); From b45368c901c1dcc880548567c597588306199ab1 Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Fri, 10 May 2024 19:27:40 +0000 Subject: [PATCH 59/67] Enable use of pg_stat_statement extension in local docker-compose and CI pipeline --- .github/workflows/maven.yml | 47 ++++++++++++++++------- .gitignore | 4 +- docker/postgres-latest/docker-compose.yml | 8 +++- docker/postgres-latest/up.sh | 18 +++++++++ 4 files changed, 61 insertions(+), 16 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index b0f386977..867d63ec2 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -86,6 +86,21 @@ jobs: name: benchbase-${{matrix.profile}} path: target/benchbase-${{matrix.profile}}.tgz + # Needed for running a customized service containers using docker/*/up.sh scripts. + # See postgres example below. + # https://github.com/actions/runner/issues/2139 + - name: Package docker-compose configs + if: ${{ matrix.profile == 'postgres' }} + run: | + tar czvpf docker-compose-${{matrix.profile}}.tar.gz docker/${{matrix.profile}}-latest + + - name: Upload docker-compose configs + if: ${{ matrix.profile == 'postgres' }} + uses: actions/upload-artifact@v4 + with: + name: docker-compose-${{matrix.profile}} + path: docker-compose-${{matrix.profile}}.tar.gz + ## ---------------------------------------------------------------------------------- ## SQLITE ## ---------------------------------------------------------------------------------- @@ -406,21 +421,25 @@ jobs: fail-fast: false matrix: benchmark: [ 'auctionmark', 'epinions', 'hyadapt', 'noop', 'otmetrics', 'resourcestresser', 'seats', 'sibench', 'smallbank', 'tatp', 'templated', 'tpcc', 'tpcc-with-reconnects', 'tpch', 'twitter', 'voter', 'wikipedia', 'ycsb' ] - services: - postgres: # https://hub.docker.com/_/postgres - image: postgres:latest - env: - POSTGRES_DB: benchbase - POSTGRES_USER: admin - POSTGRES_PASSWORD: password - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - - 5432:5432 steps: + # Note: we download just the docker-compose scripts/configs rather than the + # whole source code repo for better testing. + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: docker-compose-postgres + + - name: Extract docker-compose artifacts + run: | + tar xvzf docker-compose-postgres.tar.gz + + # Use docker-compose to start the postgres service so we can modify the + # command line args to include extensions. + # https://github.com/actions/runner/issues/2139 + - name: Start custom postgres service + run: | + ./docker/postgres-latest/up.sh + - name: Download artifact uses: actions/download-artifact@v4 with: diff --git a/.gitignore b/.gitignore index da45607e2..756c1fb4f 100644 --- a/.gitignore +++ b/.gitignore @@ -55,4 +55,6 @@ build/ # vim swap files .*.swp -.env \ No newline at end of file +.env + +docker-compose-*.tar.gz diff --git a/docker/postgres-latest/docker-compose.yml b/docker/postgres-latest/docker-compose.yml index 982a2b517..56294cc34 100644 --- a/docker/postgres-latest/docker-compose.yml +++ b/docker/postgres-latest/docker-compose.yml @@ -6,13 +6,19 @@ services: container_name: postgres hostname: postgres image: postgres:alpine - command: postgres -N 500 + command: postgres -N 500 -c shared_preload_libraries=pg_stat_statements environment: POSTGRES_USER: admin POSTGRES_PASSWORD: password POSTGRES_DB: benchbase ports: - "5432:5432" + healthcheck: + test: pg_isready + interval: 10s + timeout: 5s + retries: 5 + start_period: 30s postgres-ui: container_name: postgres-ui diff --git a/docker/postgres-latest/up.sh b/docker/postgres-latest/up.sh index d05249baf..57aa331f4 100755 --- a/docker/postgres-latest/up.sh +++ b/docker/postgres-latest/up.sh @@ -5,3 +5,21 @@ scriptdir=$(dirname "$(readlink -f "$0")") cd "$scriptdir/" docker compose up -d + +# Wait until ready +for i in {1..30}; do + if docker exec postgres pg_isready; then + break + else + sleep 1 + fi +done + +function run_psql_in_docker() { + set -x + docker exec --env PGPASSWORD=password postgres psql -h localhost -U admin benchbase --csv -c "$@" + set +x +} + +run_psql_in_docker "CREATE EXTENSION pg_stat_statements" +run_psql_in_docker "SELECT COUNT(*) FROM pg_stat_statements" | egrep '^[1-9][0-9]*$' \ No newline at end of file From 88af8e65bcc3489c953f36aaf7cb9c3151008614 Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Fri, 10 May 2024 19:27:40 +0000 Subject: [PATCH 60/67] Enable use of pg_stat_statement extension in local docker-compose and CI pipeline --- .github/workflows/maven.yml | 47 ++++++++++++++++------- .gitignore | 4 +- docker/postgres-latest/docker-compose.yml | 8 +++- docker/postgres-latest/up.sh | 18 +++++++++ 4 files changed, 61 insertions(+), 16 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 345c52b86..0256d2b96 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -86,6 +86,21 @@ jobs: name: benchbase-${{matrix.profile}} path: target/benchbase-${{matrix.profile}}.tgz + # Needed for running a customized service containers using docker/*/up.sh scripts. + # See postgres example below. + # https://github.com/actions/runner/issues/2139 + - name: Package docker-compose configs + if: ${{ matrix.profile == 'postgres' }} + run: | + tar czvpf docker-compose-${{matrix.profile}}.tar.gz docker/${{matrix.profile}}-latest + + - name: Upload docker-compose configs + if: ${{ matrix.profile == 'postgres' }} + uses: actions/upload-artifact@v4 + with: + name: docker-compose-${{matrix.profile}} + path: docker-compose-${{matrix.profile}}.tar.gz + ## ---------------------------------------------------------------------------------- ## SQLITE ## ---------------------------------------------------------------------------------- @@ -406,21 +421,25 @@ jobs: fail-fast: false matrix: benchmark: [ 'auctionmark', 'epinions', 'hyadapt', 'noop', 'otmetrics', 'resourcestresser', 'seats', 'sibench', 'smallbank', 'tatp', 'templated', 'tpcc', 'tpcc-with-reconnects', 'tpch', 'twitter', 'voter', 'wikipedia', 'ycsb' ] - services: - postgres: # https://hub.docker.com/_/postgres - image: postgres:latest - env: - POSTGRES_DB: benchbase - POSTGRES_USER: admin - POSTGRES_PASSWORD: password - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - - 5432:5432 steps: + # Note: we download just the docker-compose scripts/configs rather than the + # whole source code repo for better testing. + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: docker-compose-postgres + + - name: Extract docker-compose artifacts + run: | + tar xvzf docker-compose-postgres.tar.gz + + # Use docker-compose to start the postgres service so we can modify the + # command line args to include extensions. + # https://github.com/actions/runner/issues/2139 + - name: Start custom postgres service + run: | + ./docker/postgres-latest/up.sh + - name: Download artifact uses: actions/download-artifact@v4 with: diff --git a/.gitignore b/.gitignore index da45607e2..756c1fb4f 100644 --- a/.gitignore +++ b/.gitignore @@ -55,4 +55,6 @@ build/ # vim swap files .*.swp -.env \ No newline at end of file +.env + +docker-compose-*.tar.gz diff --git a/docker/postgres-latest/docker-compose.yml b/docker/postgres-latest/docker-compose.yml index 982a2b517..56294cc34 100644 --- a/docker/postgres-latest/docker-compose.yml +++ b/docker/postgres-latest/docker-compose.yml @@ -6,13 +6,19 @@ services: container_name: postgres hostname: postgres image: postgres:alpine - command: postgres -N 500 + command: postgres -N 500 -c shared_preload_libraries=pg_stat_statements environment: POSTGRES_USER: admin POSTGRES_PASSWORD: password POSTGRES_DB: benchbase ports: - "5432:5432" + healthcheck: + test: pg_isready + interval: 10s + timeout: 5s + retries: 5 + start_period: 30s postgres-ui: container_name: postgres-ui diff --git a/docker/postgres-latest/up.sh b/docker/postgres-latest/up.sh index d05249baf..57aa331f4 100755 --- a/docker/postgres-latest/up.sh +++ b/docker/postgres-latest/up.sh @@ -5,3 +5,21 @@ scriptdir=$(dirname "$(readlink -f "$0")") cd "$scriptdir/" docker compose up -d + +# Wait until ready +for i in {1..30}; do + if docker exec postgres pg_isready; then + break + else + sleep 1 + fi +done + +function run_psql_in_docker() { + set -x + docker exec --env PGPASSWORD=password postgres psql -h localhost -U admin benchbase --csv -c "$@" + set +x +} + +run_psql_in_docker "CREATE EXTENSION pg_stat_statements" +run_psql_in_docker "SELECT COUNT(*) FROM pg_stat_statements" | egrep '^[1-9][0-9]*$' \ No newline at end of file From 1e5614897920650156ab14d8ad208e207c3b10d6 Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Fri, 10 May 2024 19:34:36 +0000 Subject: [PATCH 61/67] enable advanced monitoring for pg as well --- .github/workflows/maven.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 867d63ec2..1f119e543 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -468,14 +468,14 @@ jobs: # In this case, we load the tpcc data. if [[ ${{matrix.benchmark}} == templated ]]; then java -jar benchbase.jar -b tpcc -c config/postgres/sample_tpcc_config.xml --create=true --load=true --execute=false --json-histograms results/histograms.json - java -jar benchbase.jar -b ${{matrix.benchmark}} -c config/postgres/sample_${{matrix.benchmark}}_config.xml --create=false --load=false --execute=true --json-histograms results/histograms.json + java -jar benchbase.jar -b ${{matrix.benchmark}} -c config/postgres/sample_${{matrix.benchmark}}_config.xml -im 1000 -mt advanced --create=false --load=false --execute=true --json-histograms results/histograms.json elif [[ ${{matrix.benchmark}} == tpcc-with-reconnects ]]; then # See Also: WITH_SERVICE_INTERRUPTIONS=true docker/build-run-benchmark-with-docker.sh java -jar benchbase.jar -b tpcc -c config/postgres/sample_tpcc_config.xml --create=true --load=true (sleep 10 && ./scripts/interrupt-docker-db-service.sh postgres) & - java -jar benchbase.jar -b tpcc -c config/postgres/sample_tpcc_config.xml --execute=true --json-histograms results/histograms.json + java -jar benchbase.jar -b tpcc -c config/postgres/sample_tpcc_config.xml -im 1000 --mt advanced --execute=true --json-histograms results/histograms.json else - java -jar benchbase.jar -b ${{matrix.benchmark}} -c config/postgres/sample_${{matrix.benchmark}}_config.xml --create=true --load=true --execute=true --json-histograms results/histograms.json + java -jar benchbase.jar -b ${{matrix.benchmark}} -c config/postgres/sample_${{matrix.benchmark}}_config.xml -im 1000 --mt advanced --create=true --load=true --execute=true --json-histograms results/histograms.json fi # FIXME: Reduce the error rate so we don't need these overrides. @@ -491,6 +491,12 @@ jobs: ./scripts/check_latest_benchmark_results.sh $results_benchmark ./scripts/check_histogram_results.sh results/histograms.json $ERRORS_THRESHOLD + # Running the monitor should create at least three files in the 'monitor' directory. + if ![ $(find "./results/monitor" -maxdepth 1 -mindepth 1 | wc -l) -gt 2]; then + echo "ERROR: Advanced monitoring unsuccessful, file directory and/or appropriate files not created." >&2 + exit 1 + fi + ## ---------------------------------------------------------------------------------- ## COCKROACHDB ## ---------------------------------------------------------------------------------- From 3733b189ef494054351d851512c93fa5658edc26 Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Fri, 10 May 2024 19:48:15 +0000 Subject: [PATCH 62/67] allow selectively upping services --- .github/workflows/maven.yml | 2 +- docker/postgres-latest/up.sh | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 0256d2b96..dfc98c6d5 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -438,7 +438,7 @@ jobs: # https://github.com/actions/runner/issues/2139 - name: Start custom postgres service run: | - ./docker/postgres-latest/up.sh + ./docker/postgres-latest/up.sh postgres - name: Download artifact uses: actions/download-artifact@v4 diff --git a/docker/postgres-latest/up.sh b/docker/postgres-latest/up.sh index 57aa331f4..2741158cf 100755 --- a/docker/postgres-latest/up.sh +++ b/docker/postgres-latest/up.sh @@ -4,7 +4,9 @@ set -eu scriptdir=$(dirname "$(readlink -f "$0")") cd "$scriptdir/" -docker compose up -d +services="$@" + +docker compose up -d $services # Wait until ready for i in {1..30}; do @@ -22,4 +24,4 @@ function run_psql_in_docker() { } run_psql_in_docker "CREATE EXTENSION pg_stat_statements" -run_psql_in_docker "SELECT COUNT(*) FROM pg_stat_statements" | egrep '^[1-9][0-9]*$' \ No newline at end of file +run_psql_in_docker "SELECT COUNT(*) FROM pg_stat_statements" | egrep '^[1-9][0-9]*$' From 43dacf82c9dd7f82eef5a29250feb600185d19e7 Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Fri, 10 May 2024 19:49:03 +0000 Subject: [PATCH 63/67] down service --- .github/workflows/maven.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index dfc98c6d5..370587c2c 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -491,6 +491,10 @@ jobs: ./scripts/check_latest_benchmark_results.sh $results_benchmark ./scripts/check_histogram_results.sh results/histograms.json $ERRORS_THRESHOLD + - name: Stop custom postgres service + run: | + ./docker/postgres-latest/down.sh + ## ---------------------------------------------------------------------------------- ## COCKROACHDB ## ---------------------------------------------------------------------------------- From f41255eccbc2854da2286e5eb7a2cd5df97768bd Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Fri, 10 May 2024 20:06:37 +0000 Subject: [PATCH 64/67] fixup --- docker/postgres-latest/up.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/postgres-latest/up.sh b/docker/postgres-latest/up.sh index 2741158cf..6acd12517 100755 --- a/docker/postgres-latest/up.sh +++ b/docker/postgres-latest/up.sh @@ -23,5 +23,5 @@ function run_psql_in_docker() { set +x } -run_psql_in_docker "CREATE EXTENSION pg_stat_statements" +run_psql_in_docker "CREATE EXTENSION IF NOT EXISTS pg_stat_statements" run_psql_in_docker "SELECT COUNT(*) FROM pg_stat_statements" | egrep '^[1-9][0-9]*$' From 9231f1c4af6e03dad198e2826a168223a65d84a6 Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Fri, 10 May 2024 20:19:46 +0000 Subject: [PATCH 65/67] tweaks --- docker/postgres-latest/up.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/postgres-latest/up.sh b/docker/postgres-latest/up.sh index 6acd12517..540439c32 100755 --- a/docker/postgres-latest/up.sh +++ b/docker/postgres-latest/up.sh @@ -9,11 +9,11 @@ services="$@" docker compose up -d $services # Wait until ready -for i in {1..30}; do - if docker exec postgres pg_isready; then +for i in {1..5}; do + if docker exec postgres pg_isready && sleep 2 && docker exec postgres pg_isready; then break else - sleep 1 + sleep 5 fi done From 848887055d7b098155d7b2d9d147d9394759fe90 Mon Sep 17 00:00:00 2001 From: Brian Kroth Date: Fri, 10 May 2024 20:22:21 +0000 Subject: [PATCH 66/67] quiet --- .github/workflows/maven.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 05ff2a6df..41d6ed456 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -438,7 +438,7 @@ jobs: # https://github.com/actions/runner/issues/2139 - name: Start custom postgres service run: | - ./docker/postgres-latest/up.sh postgres + ./docker/postgres-latest/up.sh --quiet-pull postgres - name: Download artifact uses: actions/download-artifact@v4 From 87d4c8012c0c7bd2e75baba208f12c123cdc1ddd Mon Sep 17 00:00:00 2001 From: anjagruenheid <87397397+anjagruenheid@users.noreply.github.com> Date: Mon, 13 May 2024 17:03:52 +0200 Subject: [PATCH 67/67] bugfix --- .github/workflows/maven.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 41d6ed456..823589ee8 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -473,9 +473,9 @@ jobs: # See Also: WITH_SERVICE_INTERRUPTIONS=true docker/build-run-benchmark-with-docker.sh java -jar benchbase.jar -b tpcc -c config/postgres/sample_tpcc_config.xml --create=true --load=true (sleep 10 && ./scripts/interrupt-docker-db-service.sh postgres) & - java -jar benchbase.jar -b tpcc -c config/postgres/sample_tpcc_config.xml -im 1000 --mt advanced --execute=true --json-histograms results/histograms.json + java -jar benchbase.jar -b tpcc -c config/postgres/sample_tpcc_config.xml -im 1000 -mt advanced --execute=true --json-histograms results/histograms.json else - java -jar benchbase.jar -b ${{matrix.benchmark}} -c config/postgres/sample_${{matrix.benchmark}}_config.xml -im 1000 --mt advanced --create=true --load=true --execute=true --json-histograms results/histograms.json + java -jar benchbase.jar -b ${{matrix.benchmark}} -c config/postgres/sample_${{matrix.benchmark}}_config.xml -im 1000 -mt advanced --create=true --load=true --execute=true --json-histograms results/histograms.json fi # FIXME: Reduce the error rate so we don't need these overrides.