Skip to content

Commit 2976f44

Browse files
committed
commit to new repo
1 parent 4a74da2 commit 2976f44

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+12107
-0
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
11
*.swp
2+
*.pyc
23
*.csv
4+
*.out
5+
*.log
6+
*.log.*
7+
*.config
8+
temp*

README

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
+ ----------------------------------------------- +
2+
+ Python TPC-C +
3+
+ ----------------------------------------------- +
4+
5+
6+
The basic idea is that you will need to create a new driver file that
7+
implements the functions defined in "abstractdriver.py". One function will
8+
load in the tuples into your database for a given table. Then there are five
9+
separate functions that execute the given transaction based on a set of input
10+
parameters. All the work for generating the tuples and the input parameters
11+
for the transactions has been done for you.
12+
13+
Here's what you need to do to get started:
14+
15+
(1) Download the source code from Github:
16+
17+
https://github.com/apavlo/py-tpcc/tree/master/pytpcc
18+
19+
(2) Create a new file in the 'drivers' directory for your system that follows
20+
the proper naming convention. For example, if your system is 'MongoDB', then
21+
your new file will be called 'mongodbdriver.py' and that file will contain a
22+
new class called 'MongodbDriver' (note the capitalization).
23+
24+
(3) Inside your class you will need to implement the required functions of
25+
defined in AbstractDriver. There is documentation on what these need to do
26+
also available on Github:
27+
28+
https://github.com/apavlo/py-tpcc/wiki
29+
30+
(3) Try running your system. I would start by defining the configuration file
31+
that gets returned with by the 'makeDefaultConfig' function in your driver and
32+
then implement the data loading part first, since that will guide how you
33+
actually execute the transactions. Using 'MongoDB' as an example again, you
34+
can print out the driver's configuration dict to a file:
35+
36+
$ python ./tpcc.py --print-config mongodb > mongodb.config
37+
38+
Make any changes you need to 'mongodb.config' (e.g., passwords, hostnames).
39+
Then test the loader:
40+
41+
$ python ./tpcc.py --no-execute --config=mongodb.config mongodb
42+
43+
You can use the CSV driver if you want to see what the data or transaction
44+
input parameters will look like. The following command will dump out just the
45+
input to the driver's functions to files in /tmp/tpcc-*
46+
47+
$ python ./tpcc.py csv
48+
49+
You can also look at my SqliteDriver implementation to get an idea of what
50+
your transaction implementation functions need to do:
51+
52+
https://github.com/apavlo/py-tpcc/blob/master/pytpcc/drivers/sqlitedriver.py

py_tpcc.egg-info/PKG-INFO

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Metadata-Version: 1.0
2+
Name: py-tpcc
3+
Version: 0.0dev
4+
Summary: Python implementation of the TPC-C benchmark
5+
Home-page: http://www.cs.brown.edu/~pavlo/
6+
Author: Andy Pavlo
7+
Author-email: [email protected]
8+
License: BSD
9+
Description: UNKNOWN
10+
Platform: UNKNOWN

py_tpcc.egg-info/SOURCES.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
setup.cfg
2+
setup.py
3+
py_tpcc.egg-info/PKG-INFO
4+
py_tpcc.egg-info/SOURCES.txt
5+
py_tpcc.egg-info/dependency_links.txt
6+
py_tpcc.egg-info/entry_points.txt
7+
py_tpcc.egg-info/not-zip-safe
8+
py_tpcc.egg-info/top_level.txt
9+
pytpcc/__init__.py

py_tpcc.egg-info/dependency_links.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

py_tpcc.egg-info/entry_points.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
# -*- Entry points: -*-
3+

py_tpcc.egg-info/not-zip-safe

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

py_tpcc.egg-info/top_level.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pytpcc

pytpcc/CONFIG_EXAMPLE

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# HypertableDriver Configuration File
2+
# Created 2011-05-02 01:43:37.859545
3+
[hypertable]
4+
5+
# hostname
6+
host = localhost
7+
8+
# namespace name
9+
namespace = tpcc
10+
11+
# port
12+
port = 38080
13+
14+
#clientnodes splited by spaces
15+
clients =u1 u2 192.168.3.21
16+
#directories of the code on the client node
17+
path =./code/tpcc/py-tpcc/mtpcc

pytpcc/MONGODB_EXAMPLE

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# MongodbDriver Configuration File
2+
# generate example with default values via `tpcc.py --print-config mongodb`
3+
[mongodb]
4+
# The mongodb connection string or full URI or mongodb+srv string
5+
uri = mongodb://localhost:27017
6+
causal_consistency = True
7+
findandmodify = True
8+
name = tpcc
9+
secondary_reads = True
10+
denormalize = True
11+
retry_writes = True
12+
# user = username
13+
# passwd = passwd

0 commit comments

Comments
 (0)