apavlo/h-store — Issue #6: Restore Support for VoltDB's Regression Suite
Author: apavlo
Created: 2012-01-04 22:06:02+00:00
State: open

I looked over the regression suite stuff this afternoon. Here is some basic information for you to help you get started. Overall I don't think that it will be that much work to get the basic tests working (e.g., for single- partition transactions). We'll have to see what kind of tests they have for distributed transactions, which is the thing that we really are about.

The first test case that we should focus on is 'TestFixedSQLSuite'. Just as before, you will be able to test it from the command-line (but it obviously won't work now):

`$ ant compile junitclass -Djunitclass=TestFixedSQLSuite`

The following are the steps that will help guide you to getting this working:

1. The base class for all of these tests cases is 'RegressionSuite'. This class is responsible for starting up the cluster configuration defined in 'VoltServerConfig'. There are different 'VoltServerConfig' implementations that define the different types of cluster deployments to use for a test. We'll eventually want to get all of them working, but for now let's start with a simple single server node test (e.g., 'LocalSingleProcessServer')

2. If you look in 'LocalSingleProcessServer', you will see that it implements a startUp() and a shutDown() method. In LocalSingleProcessServer.startUp() you will see that it creates a new 'ServerThread' instance, starts that thread, and then blocks until the cluster is initialized. I think that this is the main thing that we need to fix. We will need to make it so that we will start an H-Store cluster instead of a VoltDB cluster.

3. The 'ServerThread' code is pretty basic. You will see that it in ServerThread.run() invokes the 'VoltDB' wrapper to get a VoltDB instance and then starts it. Then in ServerThread.waitForInitialization() it blocks until the VoltDB instance is up and running.

The good news is that I went ahead and wrote a new wrapper class 'HStore' that almost has the same interface as 'VoltDB'. I added some sample code in 'ServerThread' that invokes the equivalent

The only thing that is different is that our 'HStore' wrapper requires you to pass in the Site catalog object and the 'HStoreConf' handle (which is different than the 'VoltDB.Configuration'). A Site represents a single JVM instance, and can have one or more Partitions. I updated 'ServerThread' so it automatically loads the base Catalog object for you. Check out our viewer tool to learn about what the Catalog contains:

http://hstore.cs.brown.edu/documentation/deployment/catalog-viewer-tool/

For example, after you try to execute the 'TestFixedSQLSuite' test case, you can use the viewer to look at the catalog information:

`$ ant catalog-viewer -Djar=./obj/release/testobjects/fixedsql-onesite.jar`

After looking at this for a bit, I think what needs to happen is that the constructor to 'ServerThread' should be given the Site catalog and the HStoreConf handle. For 'LocalSingleProcessServer', there should only be one Site to pass in. I've added some code in LocalSingleProcessServer.startUp() that gets everything you need.