{"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":"
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 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 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 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 You can use the catalog-info<\/tt> command to view the cluster configuration for the target benchmark jar file:<\/p>\n <\/a><\/p>\n <\/a><\/p>\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 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>\nCreating Benchmark Project Jar<\/h2>\n
ant hstore-prepare<\/tt> -Dproject=tpcc<\/pre>\n
ant hstore-prepare<\/tt> -Dproject=tpcc -Dhosts=\/path\/to\/cluster.txt<\/pre>\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
\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
Executing Benchmark<\/h2>\n
ant hstore-benchmark<\/tt> -Dproject=$BENCHMARK<\/pre>\n
Executing Single Transactions<\/h2>\n
ant hstore-benchmark<\/tt> -Dproject=$BENCHMARK -Dnoexecute=true -Dnoshutdown=true<\/pre>\n
\n
\n Name<\/th>\n Default Value<\/th>\n Description<\/th>\n<\/tr>\n \n noexecute<\/tt><\/td>\n false<\/tt><\/td>\n Do not start the clients and execute the workload portion of a benchmark.<\/td>\n<\/tr>\n \n noshutdown<\/tt><\/td>\n false<\/tt><\/td>\n Do 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>\n nodataload<\/tt><\/td>\n false<\/tt><\/td>\n Disable loading testing data. Only execute benchmark workload<\/td>\n<\/tr>\n \n trace<\/tt><\/td>\n null<\/td>\n To 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