GithubHelp home page GithubHelp logo

tpcc's Introduction

Java TPC-C

This project is a Java implementation of the TPC-C benchmark.

========= Compiling

Use this command to compile the code and produce a fat jar.

mvn package assembly:single

======== Database

To create the tpcc schema in MySQL:

cd database
mysql -u root
> create database tpcc;
> use tpcc;
> source create_tables.sql
> source add_fkey_idx.sql

It is possible to load data without the foreign keys and indexes in place and then add those after loading data to improve loading times.

================================= Generating and loading TPC-C data

Data can be loaded directly into a MySQL instance and can also be generated to CSV files that can be loaded into MySQL later using LOAD DATA INFILE.

In tpcc.properties set the MODE to either CSV or JDBC.

To run the load process:

java -classpath target/tpcc-1.0.0-SNAPSHOT-jar-with-dependencies.jar com.codefutures.tpcc.TpccLoad

It is possible to load data into shards where the warehouse ID is used as a shard key. The SHARDCOUNT and SHARDID properties must be set correctly when generating or loading data.

This option requires the use of a JDBC driver that supports automatic sharding, such as dbShards (http://www.dbshards.com).

=========================== Running the TPC-C Benchmark

Review the TPC-C settings in tpcc.properties, then run this command To run the tpcc benchmarks:

java -classpath target/tpcc-1.0.0-SNAPSHOT-jar-with-dependencies.jar com.codefutures.tpcc.Tpcc

Bugs can be reported to [email protected].

(c) 2014 CodeFutures Corporation.

tpcc's People

Contributors

andygrove avatar jdschmidt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tpcc's Issues

commit will always suceed

Hi,
with your current implementation transaction will always "suceed". At "TpccStatements.java" you have a commit method that catch the SQL Exception. You call this method to commit transaction at "Delivery.java", "NewOrder.java", etc.

However, since you catch the SQL exception inside the commit method, you will always "return 1" at the end of a transaction.

Solution: do not catch SQL exception in "commit" method in "TpccStatements.java" and add the throws signature. This way, you will "return 0/1" properly.

Thanks,
David

suggest:use connectionPool and client Connections testWhileIdle

mysql server's default wait_timeout is 8 hours,if some one change it to a shorter time such as 30 minutes,it will occur problems bellow:
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 41,330,583 milliseconds ago. The last packet sent successfully to the server was 41,330,582 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.

load data order is wrong

also in load_data.sql

LOAD DATA local INFILE 'new_orders.txt' INTO TABLE new_orders; --then execute this one
LOAD DATA local INFILE 'orders.txt' INTO TABLE orders; --should execute first

resultset bug

in NewOrders.neworder

...
ResultSet rs0 = pstmt35.executeQuery();
// ResultSet rs1 = pstmt35.executeQuery();
if (rs0.next()) {
c_discount = rs0.getFloat(1);
c_last = rs0.getString(2);
c_credit = rs0.getString(3);
// }
// if (rs1.next()) {
// w_tax = rs1.getFloat(1);
w_tax = rs0.getFloat(1);
}
rs0.close();
// rs1.close();

                should merge rs0 and rs1,or jdbc will throw exception

...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.