From 2fd7a05605569a9a5725f24563fc71a5cd0e1f51 Mon Sep 17 00:00:00 2001
From: Johan Oskarsson <johan@oskarsson.nu>
Date: Mon, 3 May 2010 12:52:18 +0200
Subject: [PATCH] Moved db specific code and configs into new IDE friendly
 directory structure

---
 .gitignore                                    |  7 +++
 build.xml                                     | 59 +++++++++----------
 .../com/yahoo/ycsb/db/CassandraClient5.java   |  0
 .../com/yahoo/ycsb/db/CassandraClient6.java   |  4 +-
 .../ycsb/db => db/hbase}/conf/hbase-site.xml  |  0
 .../ycsb/db/hbaselib => db/hbase/lib}/README  |  0
 .../src}/com/yahoo/ycsb/db/HBaseClient.java   |  0
 src/com/yahoo/ycsb/db/cassandralib/README     |  1 -
 8 files changed, 36 insertions(+), 35 deletions(-)
 create mode 100644 .gitignore
 rename {src => db/cassandra-0.5/src}/com/yahoo/ycsb/db/CassandraClient5.java (100%)
 rename src/com/yahoo/ycsb/db/CassandraClient.java => db/cassandra-0.6/src/com/yahoo/ycsb/db/CassandraClient6.java (99%)
 rename {src/com/yahoo/ycsb/db => db/hbase}/conf/hbase-site.xml (100%)
 rename {src/com/yahoo/ycsb/db/hbaselib => db/hbase/lib}/README (100%)
 rename {src => db/hbase/src}/com/yahoo/ycsb/db/HBaseClient.java (100%)
 delete mode 100644 src/com/yahoo/ycsb/db/cassandralib/README

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000..29d348d4
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,7 @@
+build
+.classpath
+.project
+.settings
+db/cassandra-0.5/lib
+db/cassandra-0.6/lib
+db/hbase/lib
diff --git a/build.xml b/build.xml
index 2cdc62ef..4c68f6f8 100644
--- a/build.xml
+++ b/build.xml
@@ -3,56 +3,51 @@
    
     <property name="src.dir"     value="src"/>
     <property name="doc.dir"     value="doc"/>
-    <property name="dbsrc.dir"     value="${src.dir}/com/yahoo/ycsb/db"/>
-    <property name="cassandralib.dir"   value="${dbsrc.dir}/cassandralib"/>
-    <property name="hbaselib.dir"   value="${dbsrc.dir}/hbaselib"/>
 
     <property name="build.dir"   value="build"/>
     <property name="classes.dir" value="${build.dir}/classes"/>
     <property name="jar.dir"     value="${build.dir}/jar"/>
 
-
-    <path id="cassandraclasspath">
-        <fileset dir="${cassandralib.dir}" includes="**/*.jar"/>
-        <fileset file="build/ycsb.jar"/>
-    </path>
-
-    <path id="hbaseclasspath">
-        <fileset dir="${hbaselib.dir}" includes="**/*.jar"/>
-        <fileset file="build/ycsb.jar"/>
-    </path>
-
-
-      <target name="compile">
-        <mkdir dir="${classes.dir}"/>
-        <javac srcdir="${src.dir}" destdir="${classes.dir}" excludes="com/yahoo/ycsb/db/**" deprecation="on">
-          <compilerarg value="-Xlint:unchecked"/>
-        </javac>
-        <antcall target="makejar"/>
+    <target name="dbcompile-cassandra-0.5" depends="compile">
+    	<property name="db.dir" value="db/cassandra-0.5"/>
+        <antcall target="dbcompile"/>
     </target>
-
-    
-      <target name="dbcompile-cassandra">
+    	
+   	<target name="dbcompile-cassandra-0.6" depends="compile">
+		<property name="db.dir" value="db/cassandra-0.6"/>
+		<antcall target="dbcompile"/>
+	</target>
+   	
+   	<target name="dbcompile-hbase" depends="compile">
+		<property name="db.dir" value="db/hbase"/>
+		<antcall target="dbcompile"/>
+	</target>
+
+	<target name="compile">
         <mkdir dir="${classes.dir}"/>
-        <javac includes="CassandraClient.java" srcdir="${dbsrc.dir}" destdir="${classes.dir}" classpathref="cassandraclasspath" deprecation="on">
+        <javac srcdir="${src.dir}" destdir="${classes.dir}" excludes="com/yahoo/ycsb/db/**" deprecation="on">
           <compilerarg value="-Xlint:unchecked"/>
         </javac>
         <antcall target="makejar"/>
     </target>
 
-      <target name="dbcompile-hbase">
-        <mkdir dir="${classes.dir}"/>
-        <javac includes="HBaseClient.java" srcdir="${dbsrc.dir}" destdir="${classes.dir}" classpathref="hbaseclasspath" deprecation="on">
+	<target name="dbcompile">
+	    <path id="dbclasspath">
+	        <fileset dir="${db.dir}/lib" includes="**/*.jar"/>
+	        <fileset file="build/ycsb.jar"/>
+	    </path>
+		
+    	<mkdir dir="${classes.dir}"/>
+        <javac srcdir="${db.dir}/src" destdir="${classes.dir}" classpathref="dbclasspath" deprecation="on">
           <compilerarg value="-Xlint:unchecked"/>
         </javac>
         <antcall target="makejar"/>
     </target>
 
    	<target name ="makejar" description="Create a jar for the YCSB project">
-   	      
-   	         <jar jarfile="build/ycsb.jar" includes="**/*.class" basedir="${classes.dir}"/>
-   	         
-   	      </target>
+		<jar jarfile="build/ycsb.jar" includes="**/*.class" basedir="${classes.dir}"/>
+	</target>
+   	
     <target name="clean">
        <delete includeemptydirs="true">
           <fileset dir="build" includes="**/*"/>
diff --git a/src/com/yahoo/ycsb/db/CassandraClient5.java b/db/cassandra-0.5/src/com/yahoo/ycsb/db/CassandraClient5.java
similarity index 100%
rename from src/com/yahoo/ycsb/db/CassandraClient5.java
rename to db/cassandra-0.5/src/com/yahoo/ycsb/db/CassandraClient5.java
diff --git a/src/com/yahoo/ycsb/db/CassandraClient.java b/db/cassandra-0.6/src/com/yahoo/ycsb/db/CassandraClient6.java
similarity index 99%
rename from src/com/yahoo/ycsb/db/CassandraClient.java
rename to db/cassandra-0.6/src/com/yahoo/ycsb/db/CassandraClient6.java
index 3a358af4..e224b22b 100644
--- a/src/com/yahoo/ycsb/db/CassandraClient.java
+++ b/db/cassandra-0.6/src/com/yahoo/ycsb/db/CassandraClient6.java
@@ -36,7 +36,7 @@ import org.apache.cassandra.thrift.*;
 /**
  * XXXX if we do replication, fix the consistency levels
  */
-public class CassandraClient extends DB
+public class CassandraClient6 extends DB
 {
 	static Random random=new Random();
 	public static final int Ok=0;
@@ -422,7 +422,7 @@ public class CassandraClient extends DB
 
 	public static void main(String[] args)
 	{
-		CassandraClient cli=new CassandraClient();
+		CassandraClient6 cli=new CassandraClient6();
 
 		Properties props=new Properties();
 
diff --git a/src/com/yahoo/ycsb/db/conf/hbase-site.xml b/db/hbase/conf/hbase-site.xml
similarity index 100%
rename from src/com/yahoo/ycsb/db/conf/hbase-site.xml
rename to db/hbase/conf/hbase-site.xml
diff --git a/src/com/yahoo/ycsb/db/hbaselib/README b/db/hbase/lib/README
similarity index 100%
rename from src/com/yahoo/ycsb/db/hbaselib/README
rename to db/hbase/lib/README
diff --git a/src/com/yahoo/ycsb/db/HBaseClient.java b/db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java
similarity index 100%
rename from src/com/yahoo/ycsb/db/HBaseClient.java
rename to db/hbase/src/com/yahoo/ycsb/db/HBaseClient.java
diff --git a/src/com/yahoo/ycsb/db/cassandralib/README b/src/com/yahoo/ycsb/db/cassandralib/README
deleted file mode 100644
index e6e6e185..00000000
--- a/src/com/yahoo/ycsb/db/cassandralib/README
+++ /dev/null
@@ -1 +0,0 @@
-This directory should contain jars for building and running Cassandra
-- 
GitLab