Documentation > Debugging > Debugging Java Frontend

Debugging H-Store in Eclipse

The following instructions will allow you to execute a single node H-Store cluster from Eclipse. Note that you must build the EE libraries first from the command-line before you can execute these commands. In this example, we will use the TPC-C benchmark that comes with H-Store.

  1. After starting Eclipse, right click on HStore.java and select Debug As → Java Application. Create a new debug configuration for HStore with the following parameters:
    • Program Arguments:
      catalog.jar=tpcc.jar
      site.id=0
      conf=properties/default.properties
      
    • VM Arguments:
      -ea
      -server
      -Xmx2048m
      -Xcheck:jni
      -Djava.library.path=obj/release/nativelibs
    • Working Directory: File System →
      /path/to/h-store
  2. Build H-Store and create the TPC-C project catalog:
    ant hstore-prepare -Dproject=tpcc -Dhosts=localhost:0:0-1
  3. Execute the HStore profile target in Eclipse. Once it prints the message “Site is ready for action“, it is ready for new incoming connections. You can test that the database is online by executing the following command:
    ant hstore-invoke -Dproject=tpcc -Dproc="@NoOp"
  4. You can now use H-Store’s BenchmarkController to load data into the database. The following command will connect to the cluster running in Eclipse, load data for the target benchmark, and then immediately exit.
    ant hstore-benchmark -Dproject=tpcc -Dnosites=true -Dnoexecute=true 

Multi-Node Clusters:

You can also debug a multi-node cluster in Eclipse. In this example, we will create a two site cluster on the same machine and then launch one of the sites in Eclipse and one of the sites from the command-line. Note that the two sites do not need to be on the same machine, but for simplicity we will assume that they are.

  1. Create a two-node / two-site / two-partition cluster project jar:
    ant hstore-prepare -Dproject=tpcc -Dhosts="localhost:0:0;localhost:1:1"
  2. Start the first HStoreSite in Eclipse using the instructions above.
  3. Immediately start the second HStoreSite from the command-line using the following command. The nostart option is a comma-separated list of the sites that should not be started by the BenchmarkController. This must be executed right after the first HStoreSite is started in Eclipse so that the two sites can find each other on the network.
    ant hstore-benchmark -Dproject=tpcc -Dnoloader=true -Dnoshutdown=true -Dnostart=0
  4. Once the first site prints the message “Site is ready for action” in the Eclipse console, you can then test that the database is online by executing the following command:
    ant hstore-invoke -Dproject=tpcc -Dproc="@NoOp"

H-Store Status Thread

In order to better understand what each HStoreSite is doing at run time, you can use the HStoreSiteStatus feature to print non-blocking debug information about the current status of the system.

The functionality of HStoreSiteStatus can be controlled with the following H-Store configuration parameters. The site.status_show_txn_info, site.status_show_executor_info, and site.status_show_thread_info options can be used to control the amount of information printed in each status update. Note that although this additional information does not cause the system to block, there is increased overhead for adding this throttling information.

site.status_enable If set to true, then this will enable the HStoreSiteStatus thread.
site.status_interval How often (in milliseconds) will the HStoreSiteStatus print an update.
site.status_kill_if_hung Allow the HStoreSiteStatus thread to kill the cluster if the local HStoreSite appears to be hung.
site.status_show_txn_info Print a summarization table of how transactions were executed. This includes information such as the number of transactions that were single-partitioned, multi-partitioned, speculatively executed, and committed/aborted.
site.status_show_executor_info Print information about each PartitionExecutor. This includes information such as the amount of time that the execution thread was blocked waiting for work, the average time it took to execute transactions.
site.status_show_thread_info Print abbreviated stack traces for all of the threads running at a site.
site.status_check_for_zombies Allow the HStoreSiteStatus thread to check whether there any zombie transactions. This can occur if the transaction has already sent back the ClientResponse, but its internal state has not been cleaned up.

For example, the following command will execute the TM1 benchmark and have each HStoreSite in the cluster print out a summary table about transactions every 10 seconds. The table will appear in the site’s log files (site.log_dir)

ant hstore-benchmark -Dproject=tm1 \
   -Dsite.status_enable=true \
   -Dsite.status_interval=10000 \
   -Dsite.status_show_txn_info=true

And example of this table is show below:

****************************************************************************************************************************************************************
* HStoreSite Status:        H01                                                                                                                                *
* Number of Partitions:     1                                                                                                                                  *
* ------------------------------------------------------------------------------------------------------------------------------------------------------------ *
* Completed Txns:           229955                                                                                                                             *
* # of Connections:         12                                                                                                                                 *
* Client Interface Queue:   190 txns [limit=1500, release=1200, bytes=13198]                                                                                   *
* InFlight Txns:            53188 total / 270 dtxn / 0 finished [totalMin=0, totalMax=53188]                                                                   *
* ------------------------------------------------------------------------------------------------------------------------------------------------------------ *
*                           RECEIVED  REJECTED  REDIRECTED  EXECUTED | SINGLE-P  MULTI-P | COMPLETED  ABORTED  RESTARTED  MISPREDICTED | SPECULATIVE  NO-UNDO  *
* @GarbageCollection:              1         -           -         2 |        -        - |         1        -          -             - |           -        -  *
* @LoadMultipartitionTable:       83         -           -       166 |        -        - |        83        -          -             - |           -        -  *
* @ResetProfiling:                 1         -           -         2 |        -        - |         1        -          -             - |           -        -  *
* DeleteCallForwarding:        13557      9210        4248     12722 |        -       21 |        21        -        915         11733 |         915        -  *
* GetAccessData:              108922      9039           -     99994 |    99916        - |     99916        -         78             - |        7507    99994  *
* GetNewDestination:           30813      2586           -     28267 |    28239        - |     28239        -         28             - |        2074    28267  *
* GetSubscriberData:          108661      9112           -     99641 |    99569        - |     99569        -         72             - |        7595    99641  *
* InsertCallForwarding:         8947      6107        2789      8367 |        -       29 |        29        -        549          7784 |         549        -  *
* UpdateLocation:              63567     43059       20115     59821 |        -      311 |       311        -       4189         55321 |        4189        -  *
* UpdateSubscriberData:         3109       282           -      2830 |     2827        - |      1785     1042          3             - |         232        -  *
*                           -----------------------------------------------------------------------------------------------------------------------------------*
* TOTAL:                      337661     79395       27152    311812 |   230551      361 |    229955     1042       5834         74838 |       23061   227902  *
*                                        0.235       0.080     0.923 |    0.998    0.002 |              0.003      0.019         0.240 |       0.100    0.731  *
****************************************************************************************************************************************************************