de.uni.leipzig.IR15.Benchmark.mysql
Class MySQLBenchmark

java.lang.Object
  extended by de.uni.leipzig.IR15.Benchmark.Benchmark
      extended by de.uni.leipzig.IR15.Benchmark.mysql.MySQLBenchmark
Direct Known Subclasses:
Query1_Benchmark, Query2_Benchmark, Query3_Benchmark

public abstract class MySQLBenchmark
extends Benchmark

Abstract Base Class for all benchmarks running on sql database. It holds a reference to the database it also cares about generating random (and existing) node ids.

Author:
Martin 's1ck' Junghanns

Constructor Summary
MySQLBenchmark()
           
 
Method Summary
 void afterRun()
          This method is called after each single call of run()
 void beforeRun()
          Prepare the statement before each run.
 int getRandomStartNode(int treshold)
          Returns a random start node.
 void run()
          Run and execute the prepared statement.
 void setUp()
          Setup the database connection.
 void tearDown()
          Cleanup after benchmarking.
 void warmup()
          This method is called once before the benchmark starts
 
Methods inherited from class de.uni.leipzig.IR15.Benchmark.Benchmark
getCurrentRun, getName, getResults, getRuns, setCurrentRun, setRuns
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MySQLBenchmark

public MySQLBenchmark()
Method Detail

setUp

public void setUp()
Setup the database connection.

Specified by:
setUp in class Benchmark

tearDown

public void tearDown()
Cleanup after benchmarking.

Specified by:
tearDown in class Benchmark

beforeRun

public void beforeRun()
Prepare the statement before each run.

Specified by:
beforeRun in class Benchmark

afterRun

public void afterRun()
Description copied from class: Benchmark
This method is called after each single call of run()

Specified by:
afterRun in class Benchmark

run

public void run()
Run and execute the prepared statement.

Specified by:
run in class Benchmark

getRandomStartNode

public int getRandomStartNode(int treshold)
Returns a random start node. Loops with a random w_id until a existing entity is found.

Returns:

warmup

public void warmup()
Description copied from class: Benchmark
This method is called once before the benchmark starts

Specified by:
warmup in class Benchmark