com.carrotsearch.junitbenchmarks.h2
Class H2Consumer

java.lang.Object
  extended by com.carrotsearch.junitbenchmarks.AutocloseConsumer
      extended by com.carrotsearch.junitbenchmarks.db.DbConsumer
          extended by com.carrotsearch.junitbenchmarks.h2.H2Consumer
All Implemented Interfaces:
IResultsConsumer, Closeable

public final class H2Consumer
extends DbConsumer

DbConsumer implementation for H2.


Field Summary
 
Fields inherited from class com.carrotsearch.junitbenchmarks.db.DbConsumer
BENCHMARK_ROUNDS, CLASSNAME, GC_AVG, GC_INVOCATIONS, GC_STDDEV, GC_TIME, NAME, ROUND_AVG, ROUND_STDDEV, RUN_ID, TIME_BENCHMARK, TIME_WARMUP, WARMUP_ROUNDS
 
Constructor Summary
H2Consumer()
          Creates a consumer with the default file name.
H2Consumer(File dbFileName)
          Creates a consumer with the default charts and custom key dirs.
H2Consumer(File dbFileName, File chartsDir, String customKeyValue)
          Creates a consumer with the specified database file, charts directory, and custom key value.
 
Method Summary
protected  Connection createConnection()
          Instantiates the database connection.
protected  String getAddCustomKeySql()
          Gets the SQL for adding a custom key.
protected  String getCreateDbVersionSql()
          Gets the SQL for creating the DB Version table.
protected  String getCreateRunsSql()
          Gets the SQL for creating the runs table.
protected  String getCreateTestsSql()
          Gets the SQL for creating the tests table.
 String getMethodChartPropertiesQuery()
          Gets the SQL for obtaining method chart properties.
 String getMethodChartResultsQuery()
          Gets the SQL for obtaining method chart results.
protected  String getNewRunSql()
          Gets the SQL for inserting into the runs table.
protected  String getTestInsertSql()
          Gets the SQL for inserting into the test table.
 
Methods inherited from class com.carrotsearch.junitbenchmarks.db.DbConsumer
accept, checkSchema, close, getChartsDir, getConnection, getCustomKeyValue, getDbVersion, getDefaultChartsDir, getDefaultCustomKey, getHistoryHtmlTemplate, getMethodHtmlTemplate, getResource, getRunId, getTestInsertStatement, rollback
 
Methods inherited from class com.carrotsearch.junitbenchmarks.AutocloseConsumer
addAutoclose, removeAutoclose
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

H2Consumer

public H2Consumer()
Creates a consumer with the default file name.


H2Consumer

public H2Consumer(File dbFileName)
Creates a consumer with the default charts and custom key dirs.

Parameters:
dbFileName - the database file name

H2Consumer

public H2Consumer(File dbFileName,
                  File chartsDir,
                  String customKeyValue)
Creates a consumer with the specified database file, charts directory, and custom key value.

Parameters:
dbFileName - the database file
chartsDir - the charts directory
customKeyValue - the custom key value
Method Detail

createConnection

protected Connection createConnection()
                               throws SQLException
Description copied from class: DbConsumer
Instantiates the database connection.

Specified by:
createConnection in class DbConsumer
Returns:
a new, open database connection
Throws:
SQLException - if the database connection cannot be created

getMethodChartResultsQuery

public String getMethodChartResultsQuery()
Description copied from class: DbConsumer
Gets the SQL for obtaining method chart results.

Specified by:
getMethodChartResultsQuery in class DbConsumer
Returns:
the SQL for obtaining method chart results

getMethodChartPropertiesQuery

public String getMethodChartPropertiesQuery()
Description copied from class: DbConsumer
Gets the SQL for obtaining method chart properties.

Specified by:
getMethodChartPropertiesQuery in class DbConsumer
Returns:
the SQL for obtaining method chart properties

getCreateRunsSql

protected String getCreateRunsSql()
Description copied from class: DbConsumer
Gets the SQL for creating the runs table.

Specified by:
getCreateRunsSql in class DbConsumer
Returns:
the SQL for creating the runs table

getCreateTestsSql

protected String getCreateTestsSql()
Description copied from class: DbConsumer
Gets the SQL for creating the tests table.

Specified by:
getCreateTestsSql in class DbConsumer
Returns:
the SQL for creating the tests table

getNewRunSql

protected String getNewRunSql()
Description copied from class: DbConsumer
Gets the SQL for inserting into the runs table.

Specified by:
getNewRunSql in class DbConsumer
Returns:
the SQL for inserting into the runs table

getTestInsertSql

protected String getTestInsertSql()
Description copied from class: DbConsumer
Gets the SQL for inserting into the test table.

Specified by:
getTestInsertSql in class DbConsumer
Returns:
the SQL for inserting into the test table

getCreateDbVersionSql

protected String getCreateDbVersionSql()
Description copied from class: DbConsumer
Gets the SQL for creating the DB Version table.

Specified by:
getCreateDbVersionSql in class DbConsumer
Returns:
the SQL for creating the DB version table

getAddCustomKeySql

protected String getAddCustomKeySql()
Description copied from class: DbConsumer
Gets the SQL for adding a custom key.

Specified by:
getAddCustomKeySql in class DbConsumer
Returns:
the SQL for adding a custom key


Copyright © 2013 Carrot Search s.c.. All Rights Reserved.