Monday, March 31, 2014

Doxygen

To use Doxygen to document your source code on Ubuntu, first install doxygen and graphviz:
$ sudo apt-get install doxygen
$ sudo apt-get install graphviz

To generate a doxygen configuration file:
$ doxygen -g # this will generate a configuration file named Doxyfile

Then, edit Doxyfile. In my case, I only modified:
OUTPUT_DIRECTORY = doc
HAVE_DOT = YES
CALL_GRAPH = YES
CALLER_GRAPH = YES

Then run
$ doxygen Doxyfile

Doxygen will automatically find your source code if Doxyfile is placed in the same directory. The resulting documentations are in doc.

For more detail:
http://www.stack.nl/~dimitri/doxygen/index.html

Monday, March 3, 2014

Setting up the Data Serving benchmark (YCSB) from CloudSuite

(This post is mostly taken from http://parsa.epfl.ch/cloudsuite/dataserving.html)

Assuming you’re running on Ubuntu. We start with installing Oracle Java 6
$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java6-installer

Alternatively, install Java 1.6.0_23 (1.6.023 were tested by the CloudSuite authors):
http://diegobenna.blogspot.com/2011/01/install-jdk-6-update-21-in-ubuntu-1010.html

Note that although later Java versions are also available, extra effort might be required to compile/run Cassandra and YCSB if not using Java 6.

Make sure to set your $JAVA_HOME. This can be done by
$ which java

In my case, the path is /usr/bin/java, so I did
$ export JAVA_HOME=/usr

Next, install Apache Ant
$ sudo apt-get install ant

Ant (another neat tool), is a tool for automating build, similar to Make (Ant:Java=Make:C/C++)

The next step is to download and install YCSB. The package can be downloaded from here:

Although you can also clone YCSB using git, the one on github doesn’t seem to have the appropriate build.xml (build.xml is required for Ant). To make things easy, I use the tarball.

Follow the steps from here to build YCSB:

While building, keep in mind that if you compile and run a program under different JDKs, an error will show up saying “Unsupported major.minor version”. So just remember to use a Java version consistently.

You’ll also need to download and install Cassandra. It can be found here:

Apache Cassandra is basically a database management system. YCSB uses Cassandra to populate and operate on data systems.

Similarly, although there are also later versions of Cassandra, they are not always compatible with the Java/Ant/YCSB version you’re using. For instance, there’ll be a stack size problem when starting Cassandra if the Cassandra version and the Java version are not compatible. So again, to make things easy, I use the tarball instead of installing it via Ubuntu deb.

To install and run Cassandra, follow the steps in README inside the Cassandra directory. Alternatively, there are some instructions here:

Now you should be ready to generate a dataset. To do so
$ cd <path to cassandra>
$ ./bin/cassandra –f # this will run Cassandra

Open another terminal
$ cd <path to cassandra>
$ ./bin/cassandra-cli -host localhost # this will invoke the cli utility, which is connected your local-running Cassandra

Upon entering the cassandra-cli prompt, use the commands provided in http://parsa.epfl.ch/cloudsuite/dataserving.html

Note that different versions of Cassandra use slightly different commands. In this example, we're using 0.73.

Then, populate the database
$ cd <path to ycsb>
$ ./run_load.command # modify this shell script and settings_load.dat accordingly

Finally, run the benchmark
$ ./run.command # modify this shell script and settings.dat accordingly

Please visit the CloudSuite and YCSB website for detailed information

And also