{"id":754,"date":"2011-06-02T22:34:08","date_gmt":"2011-06-03T02:34:08","guid":{"rendered":"http:\/\/hstore.cs.brown.edu\/?page_id=754"},"modified":"2013-11-30T17:29:33","modified_gmt":"2013-11-30T22:29:33","slug":"executing","status":"publish","type":"page","link":"https:\/\/hstore.cs.brown.edu\/documentation\/deployment\/executing\/","title":{"rendered":"Executing H-Store"},"content":{"rendered":"

\u00ab<\/B> Building H-Store<\/a><\/div>
Command-line Terminal<\/a> \u00bb<\/B><\/div>
<\/div><\/p>\n

Since the H-Store database is used for research purposes, it comes with several OLTP benchmarks<\/a> built in and ready for execution.<\/p>\n

<\/a><\/p>\n

Creating Benchmark Project Jar<\/h2>\n

The hstore-prepare<\/tt> command will create a project jar file for the target benchmark in H-Store’s base directory. This project file contains the compiled stored procedures and system catalog for the benchmark, as well as the list of nodes<\/a> in your cluster. For example, the following command will create the project file tpcc.jar<\/tt>:<\/p>\n

ant hstore-prepare<\/tt> -Dproject=tpcc<\/pre>\n

You can use H-Store’s Catalog Viewer Tool<\/a> to examine the contents of the JAR file, including viewing the query plans that get generated for each of the stored procedures.<\/p>\n

By default, hstore-prepare<\/tt> creates a catalog with a cluster of only one host (global.defaulthost<\/a>) two sites, each with two partitions. You can use a custom specification file<\/a> that defines the host\/site\/partition layout of the target cluster and use the hosts<\/tt> option to pass that file when building the catalog:<\/p>\n

ant hstore-prepare<\/tt> -Dproject=tpcc -Dhosts=\/path\/to\/cluster.txt<\/pre>\n

Alternatively, you can specify the cluster configuration directly from the command-line. The hosts<\/tt> option also accepts a semi-colon separated list of triplets. Each triplet is formatted as HOSTNAME:SITE#:PARTITION#<\/tt>. The PARTITION#<\/tt> may be either a single partition number, a comma-separate listed of partition numbers, or a range of partition numbers. For example, the following command will create a cluster where host0.csail.mit.edu<\/tt> will execute with HStoreSite #0 that manages partitions #0, #1, #2, and #3, while host1.csail.mit.edu<\/tt> will execute HStoreSite #1 that manages partitions #4, #5, #6, and #7:<\/p>\n

ant hstore-prepare<\/tt> -Dproject=tpcc -Dhosts=\"host0.csail.mit.edu:0:0-3;host1.csail.mit.edu:1:4,5,6,7\"<\/pre>\n

You can use the catalog-info<\/tt> command to view the cluster configuration for the target benchmark jar file:<\/p>\n

\r\nant catalog-info<\/tt> -Dproject=tpcc\r\n Catalog File:    tpcc.jar\r\n # of Hosts:      2\r\n # of Sites:      2\r\n # of Partitions: 8\r\n ----------------------------------------------------------------------\r\n Cluster Information:\r\n \r\n [00] HOST host0.csail.mit.edu \u2503 [01] HOST host1.csail.mit.edu\r\n      \u2514 SITE H00: [0, 1, 2, 3] \u2503      \u2514 SITE H01: [4, 5, 6, 7]<\/pre>\n

<\/a><\/p>\n

Executing Benchmark<\/h2>\n
ant hstore-benchmark<\/tt> -Dproject=$BENCHMARK<\/pre>\n

<\/a><\/p>\n

Executing Single Transactions<\/h2>\n

To execute transactions by one-by-one (rather than using the built-in BenchmarkController), you can use the hstore-invoke<\/tt> command. In this example, we first start an H-Store cluster using the hstore-benchmark<\/tt> but pass the noexecute<\/tt> option to prevent it from executing the full benchmark workload and the noshutdown<\/tt> option to keep the system online after the loading phase is complete:<\/p>\n

ant hstore-benchmark<\/tt> -Dproject=$BENCHMARK -Dnoexecute=true -Dnoshutdown=true<\/pre>\n

You will get a message at the end that says that the H-Store database cluster will remain online until it receives a kill signal (SIGINT<\/tt> or higher). You can now execute hstore-invoke<\/tt> to execute transactions individually. This command will connect to a random HStoreSite in the cluster and execute a new transaction. The proc<\/tt> option is the name of the procedure that you want to invoke and the params<\/tt> are a comma-separated list of parameters used for that transaction request. These parameters will be cast according to the benchmark’s catalog information for that procedure.<\/p>\n

For example, to execute the GetAccessData<\/a> procedure from the TM1 benchmark, we can execute the following command. Note that the string parameters should be enclosed in quotation marks:<\/p>\n

ant hstore-invoke<\/tt> -Dproject=tm1 -Dproc=GetAccessData -Dparam0=100 -Dparam1=1<\/pre>\n

The raw output from H-Store node will be printed out:<\/p>\n

GetAccessData Txn #1027476228166123520 - Status OK\r\n [00]:  header size: 43\r\n        status code: -128 column count: 4\r\n        cols (DATA1:SMALLINT), (DATA2:SMALLINT), (DATA3:STRING), (DATA4:STRING), \r\n        rows -\r\n          147, 161, UHJ, JUETN,<\/pre>\n

Command-line Options<\/h2>\n\n\n\n\n\n
Name<\/th>\nDefault Value<\/th>\nDescription<\/th>\n<\/tr>\n
noexecute<\/tt><\/td>\nfalse<\/tt><\/td>\nDo not start the clients and execute the workload portion of a benchmark.<\/td>\n<\/tr>\n
noshutdown<\/tt><\/td>\nfalse<\/tt><\/td>\nDo not stop the H-Store database cluster. The BenchmarkController will wait until it is interrupted before stopping all the HStoreSites. You will want to disable the site.status_kill_if_hung<\/a> configuration option to ensure that the database stays online even there is no work to execute.<\/td>\n<\/tr>\nnodataload<\/tt><\/td>\nfalse<\/tt><\/td>\nDisable loading testing data. Only execute benchmark workload<\/td>\n<\/tr>\n
trace<\/tt><\/td>\nnull<\/td>\nTo enable transaction traces<\/a>, provide a file path with this parameter to specify where H-Store will write out trace logs.<\/td>\n<\/tr>\n<\/table>\n

\u00ab<\/B> Building H-Store<\/a><\/div>
Command-line Terminal<\/a> \u00bb<\/B><\/div>
<\/div><\/p>\n","protected":false},"excerpt":{"rendered":"

Since the H-Store database is used for research purposes, it comes with several OLTP benchmarks built in and ready for execution. Creating Benchmark Project Jar The hstore-prepare command will create a project jar file for the target benchmark in H-Store’s base directory. This project file contains the compiled stored procedures and system catalog for the […]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":626,"menu_order":2,"comment_status":"closed","ping_status":"open","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/hstore.cs.brown.edu\/wp-json\/wp\/v2\/pages\/754"}],"collection":[{"href":"https:\/\/hstore.cs.brown.edu\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/hstore.cs.brown.edu\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/hstore.cs.brown.edu\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hstore.cs.brown.edu\/wp-json\/wp\/v2\/comments?post=754"}],"version-history":[{"count":28,"href":"https:\/\/hstore.cs.brown.edu\/wp-json\/wp\/v2\/pages\/754\/revisions"}],"predecessor-version":[{"id":2347,"href":"https:\/\/hstore.cs.brown.edu\/wp-json\/wp\/v2\/pages\/754\/revisions\/2347"}],"up":[{"embeddable":true,"href":"https:\/\/hstore.cs.brown.edu\/wp-json\/wp\/v2\/pages\/626"}],"wp:attachment":[{"href":"https:\/\/hstore.cs.brown.edu\/wp-json\/wp\/v2\/media?parent=754"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}