incubator-hcatalog-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tra...@apache.org
Subject svn commit: r1383152 [24/27] - in /incubator/hcatalog/trunk: ./ hcatalog-pig-adapter/src/main/java/org/apache/hcatalog/pig/ hcatalog-pig-adapter/src/main/java/org/apache/hcatalog/pig/drivers/ hcatalog-pig-adapter/src/test/java/org/apache/hcatalog/pig/ ...
Date Mon, 10 Sep 2012 23:29:03 GMT
Modified: incubator/hcatalog/trunk/storage-handlers/hbase/src/test/org/apache/hcatalog/hbase/TestSnapshots.java
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/storage-handlers/hbase/src/test/org/apache/hcatalog/hbase/TestSnapshots.java?rev=1383152&r1=1383151&r2=1383152&view=diff
==============================================================================
--- incubator/hcatalog/trunk/storage-handlers/hbase/src/test/org/apache/hcatalog/hbase/TestSnapshots.java (original)
+++ incubator/hcatalog/trunk/storage-handlers/hbase/src/test/org/apache/hcatalog/hbase/TestSnapshots.java Mon Sep 10 23:28:55 2012
@@ -42,16 +42,16 @@ import org.apache.hcatalog.mapreduce.Inp
 import org.junit.Test;
 
 public class TestSnapshots extends SkeletonHBaseTest {
-    private static HiveConf   hcatConf;
+    private static HiveConf hcatConf;
     private static HCatDriver hcatDriver;
 
     public void Initialize() throws Exception {
         hcatConf = getHiveConf();
         hcatConf.set(ConfVars.SEMANTIC_ANALYZER_HOOK.varname,
-                HCatSemanticAnalyzer.class.getName());
+            HCatSemanticAnalyzer.class.getName());
         URI fsuri = getFileSystem().getUri();
         Path whPath = new Path(fsuri.getScheme(), fsuri.getAuthority(),
-                getTestDir());
+            getTestDir());
         hcatConf.set(HiveConf.ConfVars.HADOOPFS.varname, fsuri.toString());
         hcatConf.set(ConfVars.METASTOREWAREHOUSE.varname, whPath.toString());
 
@@ -69,18 +69,18 @@ public class TestSnapshots extends Skele
     }
 
     @Test
-    public void TestSnapshotConversion() throws Exception{
+    public void TestSnapshotConversion() throws Exception {
         Initialize();
         String tableName = newTableName("mytableOne");
         String databaseName = newTableName("mydatabase");
         String fullyQualTableName = databaseName + "." + tableName;
         String db_dir = getTestDir() + "/hbasedb";
         String dbquery = "CREATE DATABASE IF NOT EXISTS " + databaseName + " LOCATION '"
-                            + db_dir + "'";
+            + db_dir + "'";
         String tableQuery = "CREATE TABLE " + fullyQualTableName
-                              + "(key string, value1 string, value2 string) STORED BY " +
-                              "'org.apache.hcatalog.hbase.HBaseHCatStorageHandler'"
-                              + "TBLPROPERTIES ('hbase.columns.mapping'=':key,cf1:q1,cf2:q2')" ;
+            + "(key string, value1 string, value2 string) STORED BY " +
+            "'org.apache.hcatalog.hbase.HBaseHCatStorageHandler'"
+            + "TBLPROPERTIES ('hbase.columns.mapping'=':key,cf1:q1,cf2:q2')";
 
         CommandProcessorResponse cmdResponse = hcatDriver.run(dbquery);
         assertEquals(0, cmdResponse.getResponseCode());
@@ -90,7 +90,7 @@ public class TestSnapshots extends Skele
         InputJobInfo inputInfo = InputJobInfo.create(databaseName, tableName, null);
         Configuration conf = new Configuration(hcatConf);
         conf.set(HCatConstants.HCAT_KEY_HIVE_CONF,
-                HCatUtil.serialize(getHiveConf().getAllProperties()));
+            HCatUtil.serialize(getHiveConf().getAllProperties()));
         Job job = new Job(conf);
         inputInfo.getProperties().setProperty(HBaseConstants.PROPERTY_TABLE_SNAPSHOT_KEY, "dummysnapshot");
         InitializeInput.setInput(job, inputInfo);
@@ -100,7 +100,7 @@ public class TestSnapshots extends Skele
         Map<String, Long> revMap = new HashMap<String, Long>();
         revMap.put("cf1", 3L);
         revMap.put("cf2", 5L);
-        TableSnapshot hbaseSnapshot = new TableSnapshot(fullyQualTableName, revMap,-1);
+        TableSnapshot hbaseSnapshot = new TableSnapshot(fullyQualTableName, revMap, -1);
         HCatTableSnapshot hcatSnapshot = HBaseRevisionManagerUtil.convertSnapshot(hbaseSnapshot, inputInfo.getTableInfo());
 
         assertEquals(hcatSnapshot.getRevision("value1"), 3);
@@ -113,9 +113,9 @@ public class TestSnapshots extends Skele
         tableName = newTableName("mytableTwo");
         fullyQualTableName = databaseName + "." + tableName;
         tableQuery = "CREATE TABLE " + fullyQualTableName
-        + "(key string, value1 string, value2 string) STORED BY " +
-        "'org.apache.hcatalog.hbase.HBaseHCatStorageHandler'"
-        + "TBLPROPERTIES ('hbase.columns.mapping'=':key,cf1:q1,cf1:q2')" ;
+            + "(key string, value1 string, value2 string) STORED BY " +
+            "'org.apache.hcatalog.hbase.HBaseHCatStorageHandler'"
+            + "TBLPROPERTIES ('hbase.columns.mapping'=':key,cf1:q1,cf1:q2')";
         cmdResponse = hcatDriver.run(tableQuery);
         assertEquals(0, cmdResponse.getResponseCode());
         revMap.clear();

Modified: incubator/hcatalog/trunk/storage-handlers/hbase/src/test/org/apache/hcatalog/hbase/snapshot/TestIDGenerator.java
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/storage-handlers/hbase/src/test/org/apache/hcatalog/hbase/snapshot/TestIDGenerator.java?rev=1383152&r1=1383151&r2=1383152&view=diff
==============================================================================
--- incubator/hcatalog/trunk/storage-handlers/hbase/src/test/org/apache/hcatalog/hbase/snapshot/TestIDGenerator.java (original)
+++ incubator/hcatalog/trunk/storage-handlers/hbase/src/test/org/apache/hcatalog/hbase/snapshot/TestIDGenerator.java Mon Sep 10 23:28:55 2012
@@ -16,6 +16,7 @@
  * limitations under the License.
  */
 package org.apache.hcatalog.hbase.snapshot;
+
 import static org.junit.Assert.assertTrue;
 
 import java.util.ArrayList;
@@ -26,7 +27,7 @@ import org.apache.hcatalog.hbase.Skeleto
 import org.junit.Assert;
 import org.junit.Test;
 
-public class TestIDGenerator extends SkeletonHBaseTest{
+public class TestIDGenerator extends SkeletonHBaseTest {
 
     @Test
     public void testIDGeneration() throws Exception {
@@ -35,7 +36,7 @@ public class TestIDGenerator extends Ske
         String servers = getHbaseConf().get("hbase.zookeeper.quorum");
         String[] splits = servers.split(",");
         StringBuffer sb = new StringBuffer();
-        for(String split : splits){
+        for (String split : splits) {
             sb.append(split);
             sb.append(':');
             sb.append(port);
@@ -44,20 +45,20 @@ public class TestIDGenerator extends Ske
 
         String tableName = "myTable";
         long initId = zkutil.nextId(tableName);
-        for (int i=0; i<10; i++) {
+        for (int i = 0; i < 10; i++) {
             long id = zkutil.nextId(tableName);
             Assert.assertEquals(initId + (i + 1), id);
         }
     }
 
     @Test
-    public void testMultipleClients() throws InterruptedException{
+    public void testMultipleClients() throws InterruptedException {
 
         int port = getHbaseConf().getInt("hbase.zookeeper.property.clientPort", 2181);
         String servers = getHbaseConf().get("hbase.zookeeper.quorum");
         String[] splits = servers.split(",");
         StringBuffer sb = new StringBuffer();
-        for(String split : splits){
+        for (String split : splits) {
             sb.append(split);
             sb.append(':');
             sb.append(port);
@@ -65,30 +66,30 @@ public class TestIDGenerator extends Ske
 
         ArrayList<IDGenClient> clients = new ArrayList<IDGenClient>();
 
-        for(int i =0; i < 5; i++){
+        for (int i = 0; i < 5; i++) {
             IDGenClient idClient = new IDGenClient(sb.toString(), "/rm_base", 10, "testTable");
             clients.add(idClient);
         }
 
-        for(IDGenClient idClient : clients){
+        for (IDGenClient idClient : clients) {
             idClient.run();
         }
 
-        for(IDGenClient idClient : clients){
+        for (IDGenClient idClient : clients) {
             idClient.join();
         }
 
         HashMap<Long, Long> idMap = new HashMap<Long, Long>();
-        for(IDGenClient idClient : clients){
+        for (IDGenClient idClient : clients) {
             idMap.putAll(idClient.getIdMap());
         }
 
         ArrayList<Long> keys = new ArrayList<Long>(idMap.keySet());
         Collections.sort(keys);
         int startId = 1;
-        for(Long key: keys){
+        for (Long key : keys) {
             Long id = idMap.get(key);
-            System.out.println("Key: " + key + " Value "+ id);
+            System.out.println("Key: " + key + " Value " + id);
             assertTrue(id == startId);
             startId++;
 

Modified: incubator/hcatalog/trunk/storage-handlers/hbase/src/test/org/apache/hcatalog/hbase/snapshot/TestRevisionManager.java
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/storage-handlers/hbase/src/test/org/apache/hcatalog/hbase/snapshot/TestRevisionManager.java?rev=1383152&r1=1383151&r2=1383152&view=diff
==============================================================================
--- incubator/hcatalog/trunk/storage-handlers/hbase/src/test/org/apache/hcatalog/hbase/snapshot/TestRevisionManager.java (original)
+++ incubator/hcatalog/trunk/storage-handlers/hbase/src/test/org/apache/hcatalog/hbase/snapshot/TestRevisionManager.java Mon Sep 10 23:28:55 2012
@@ -33,16 +33,16 @@ import org.apache.zookeeper.ZooKeeper;
 import org.apache.zookeeper.data.Stat;
 import org.junit.Test;
 
-public class TestRevisionManager extends SkeletonHBaseTest{
+public class TestRevisionManager extends SkeletonHBaseTest {
 
     @Test
-    public void testBasicZNodeCreation() throws IOException, KeeperException, InterruptedException{
+    public void testBasicZNodeCreation() throws IOException, KeeperException, InterruptedException {
 
         int port = getHbaseConf().getInt("hbase.zookeeper.property.clientPort", 2181);
         String servers = getHbaseConf().get("hbase.zookeeper.quorum");
         String[] splits = servers.split(",");
         StringBuffer sb = new StringBuffer();
-        for(String split : splits){
+        for (String split : splits) {
             sb.append(split);
             sb.append(':');
             sb.append(port);
@@ -64,7 +64,7 @@ public class TestRevisionManager extends
         Stat result = zk.exists(transactionDataTablePath, false);
         assertTrue(result != null);
 
-        for(String colFamiliy : columnFamilies){
+        for (String colFamiliy : columnFamilies) {
             String cfPath = transactionDataTablePath + "/" + colFamiliy;
             Stat resultTwo = zk.exists(cfPath, false);
             assertTrue(resultTwo != null);
@@ -73,13 +73,13 @@ public class TestRevisionManager extends
     }
 
     @Test
-    public void testCommitTransaction() throws IOException{
+    public void testCommitTransaction() throws IOException {
 
         int port = getHbaseConf().getInt("hbase.zookeeper.property.clientPort", 2181);
         String servers = getHbaseConf().get("hbase.zookeeper.quorum");
         String[] splits = servers.split(",");
         StringBuffer sb = new StringBuffer();
-        for(String split : splits){
+        for (String split : splits) {
             sb.append(split);
             sb.append(':');
             sb.append(port);
@@ -87,7 +87,7 @@ public class TestRevisionManager extends
 
         Configuration conf = RevisionManagerConfiguration.create(getHbaseConf());
         conf.set(RMConstants.ZOOKEEPER_DATADIR, "/rm_base");
-        ZKBasedRevisionManager  manager = new ZKBasedRevisionManager();
+        ZKBasedRevisionManager manager = new ZKBasedRevisionManager();
         manager.initialize(conf);
         manager.open();
         ZKUtil zkutil = new ZKUtil(sb.toString(), "/rm_base");
@@ -95,15 +95,15 @@ public class TestRevisionManager extends
         String tableName = newTableName("testTable");
         List<String> columnFamilies = Arrays.asList("cf1", "cf2", "cf3");
         Transaction txn = manager.beginWriteTransaction(tableName,
-                columnFamilies);
+            columnFamilies);
 
         List<String> cfs = zkutil.getColumnFamiliesOfTable(tableName);
         assertTrue(cfs.size() == columnFamilies.size());
-        for (String cf : cfs){
+        for (String cf : cfs) {
             assertTrue(columnFamilies.contains(cf));
         }
 
-        for(String colFamily : columnFamilies){
+        for (String colFamily : columnFamilies) {
             String path = PathUtil.getRunningTxnInfoPath("/rm_base", tableName, colFamily);
             byte[] data = zkutil.getRawData(path, null);
             StoreFamilyRevisionList list = new StoreFamilyRevisionList();
@@ -115,7 +115,7 @@ public class TestRevisionManager extends
 
         }
         manager.commitWriteTransaction(txn);
-        for(String colFamiliy : columnFamilies){
+        for (String colFamiliy : columnFamilies) {
             String path = PathUtil.getRunningTxnInfoPath("/rm_base", tableName, colFamiliy);
             byte[] data = zkutil.getRawData(path, null);
             StoreFamilyRevisionList list = new StoreFamilyRevisionList();
@@ -128,13 +128,13 @@ public class TestRevisionManager extends
     }
 
     @Test
-    public void testAbortTransaction() throws IOException{
+    public void testAbortTransaction() throws IOException {
 
         int port = getHbaseConf().getInt("hbase.zookeeper.property.clientPort", 2181);
         String host = getHbaseConf().get("hbase.zookeeper.quorum");
         Configuration conf = RevisionManagerConfiguration.create(getHbaseConf());
         conf.set(RMConstants.ZOOKEEPER_DATADIR, "/rm_base");
-        ZKBasedRevisionManager  manager = new ZKBasedRevisionManager();
+        ZKBasedRevisionManager manager = new ZKBasedRevisionManager();
         manager.initialize(conf);
         manager.open();
         ZKUtil zkutil = new ZKUtil(host + ':' + port, "/rm_base");
@@ -145,12 +145,12 @@ public class TestRevisionManager extends
         List<String> cfs = zkutil.getColumnFamiliesOfTable(tableName);
 
         assertTrue(cfs.size() == columnFamilies.size());
-        for (String cf : cfs){
+        for (String cf : cfs) {
             assertTrue(columnFamilies.contains(cf));
         }
 
-        for(String colFamiliy : columnFamilies){
-            String path = PathUtil.getRunningTxnInfoPath("/rm_base",tableName, colFamiliy);
+        for (String colFamiliy : columnFamilies) {
+            String path = PathUtil.getRunningTxnInfoPath("/rm_base", tableName, colFamiliy);
             byte[] data = zkutil.getRawData(path, null);
             StoreFamilyRevisionList list = new StoreFamilyRevisionList();
             ZKUtil.deserialize(list, data);
@@ -161,8 +161,8 @@ public class TestRevisionManager extends
 
         }
         manager.abortWriteTransaction(txn);
-        for(String colFamiliy : columnFamilies){
-            String path = PathUtil.getRunningTxnInfoPath("/rm_base",tableName, colFamiliy);
+        for (String colFamiliy : columnFamilies) {
+            String path = PathUtil.getRunningTxnInfoPath("/rm_base", tableName, colFamiliy);
             byte[] data = zkutil.getRawData(path, null);
             StoreFamilyRevisionList list = new StoreFamilyRevisionList();
             ZKUtil.deserialize(list, data);
@@ -170,8 +170,8 @@ public class TestRevisionManager extends
 
         }
 
-        for(String colFamiliy : columnFamilies){
-            String path = PathUtil.getAbortInformationPath("/rm_base",tableName, colFamiliy);
+        for (String colFamiliy : columnFamilies) {
+            String path = PathUtil.getAbortInformationPath("/rm_base", tableName, colFamiliy);
             byte[] data = zkutil.getRawData(path, null);
             StoreFamilyRevisionList list = new StoreFamilyRevisionList();
             ZKUtil.deserialize(list, data);
@@ -189,7 +189,7 @@ public class TestRevisionManager extends
         String servers = getHbaseConf().get("hbase.zookeeper.quorum");
         String[] splits = servers.split(",");
         StringBuffer sb = new StringBuffer();
-        for(String split : splits){
+        for (String split : splits) {
             sb.append(split);
             sb.append(':');
             sb.append(port);
@@ -197,31 +197,31 @@ public class TestRevisionManager extends
 
         Configuration conf = RevisionManagerConfiguration.create(getHbaseConf());
         conf.set(RMConstants.ZOOKEEPER_DATADIR, "/rm_base");
-        ZKBasedRevisionManager  manager = new ZKBasedRevisionManager();
+        ZKBasedRevisionManager manager = new ZKBasedRevisionManager();
         manager.initialize(conf);
         manager.open();
         String tableName = newTableName("testTable");
         List<String> columnFamilies = Arrays.asList("cf1", "cf2");
         Transaction txn = manager.beginWriteTransaction(tableName,
-                columnFamilies, 40);
+            columnFamilies, 40);
         Thread.sleep(100);
         try {
             manager.commitWriteTransaction(txn);
         } catch (Exception e) {
             assertTrue(e instanceof IOException);
             assertEquals(e.getMessage(),
-                    "The transaction to be removed not found in the data.");
+                "The transaction to be removed not found in the data.");
         }
 
     }
 
     @Test
-    public void testCreateSnapshot() throws IOException{
+    public void testCreateSnapshot() throws IOException {
         int port = getHbaseConf().getInt("hbase.zookeeper.property.clientPort", 2181);
         String host = getHbaseConf().get("hbase.zookeeper.quorum");
         Configuration conf = RevisionManagerConfiguration.create(getHbaseConf());
         conf.set(RMConstants.ZOOKEEPER_DATADIR, "/rm_base");
-        ZKBasedRevisionManager  manager = new ZKBasedRevisionManager();
+        ZKBasedRevisionManager manager = new ZKBasedRevisionManager();
         manager.initialize(conf);
         manager.open();
         String tableName = newTableName("testTable");

Modified: incubator/hcatalog/trunk/storage-handlers/hbase/src/test/org/apache/hcatalog/hbase/snapshot/TestRevisionManagerEndpoint.java
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/storage-handlers/hbase/src/test/org/apache/hcatalog/hbase/snapshot/TestRevisionManagerEndpoint.java?rev=1383152&r1=1383151&r2=1383152&view=diff
==============================================================================
--- incubator/hcatalog/trunk/storage-handlers/hbase/src/test/org/apache/hcatalog/hbase/snapshot/TestRevisionManagerEndpoint.java (original)
+++ incubator/hcatalog/trunk/storage-handlers/hbase/src/test/org/apache/hcatalog/hbase/snapshot/TestRevisionManagerEndpoint.java Mon Sep 10 23:28:55 2012
@@ -34,172 +34,172 @@ import org.junit.Test;
 
 public class TestRevisionManagerEndpoint extends SkeletonHBaseTest {
 
-  static {
-    // test case specific mini cluster settings
-    testConf = new Configuration(false);
-    testConf.setStrings(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY,
-        "org.apache.hcatalog.hbase.snapshot.RevisionManagerEndpoint",
-        "org.apache.hadoop.hbase.coprocessor.GenericEndpoint");
-    testConf.set(RMConstants.REVISION_MGR_ENDPOINT_IMPL_CLASS, MockRM.class.getName());
-  }
-
-  /**
-   * Mock implementation to test the protocol/serialization
-   */
-  public static class MockRM implements RevisionManager {
-
-    private static class Invocation {
-      Invocation(String methodName, Object ret, Object... args) {
-          this.methodName = methodName;
-          this.args = args;
-          this.ret = ret;
-      }
-
-      String methodName;
-      Object[] args;
-      Object ret;
-
-      private static boolean equals(Object obj1, Object obj2) {
-        if (obj1 == obj2) return true;
-        if (obj1 == null || obj2 == null) return false;
-        if (obj1 instanceof Transaction || obj1 instanceof TableSnapshot) {
-          return obj1.toString().equals(obj2.toString());
-        }
-        return obj1.equals(obj2);
-      }
-
-      @Override
-      public boolean equals(Object obj) {
-        Invocation other = (Invocation)obj;
-        if (this == other) return true;
-        if (other == null) return false;
-        if (this.args != other.args) {
-          if (this.args == null || other.args == null) return false;
-          if (this.args.length != other.args.length) return false;
-          for (int i=0; i<args.length; i++) {
-            if (!equals(this.args[i], other.args[i])) return false;
-          }
-        }
-        return equals(this.ret, other.ret);
-      }
-
-      @Override
-      public String toString() {
-        return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).
-            append("method", this.methodName).
-            append("args", this.args).
-            append("returns", this.ret).
-            toString();
-      }
-    }
+    static {
+        // test case specific mini cluster settings
+        testConf = new Configuration(false);
+        testConf.setStrings(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY,
+            "org.apache.hcatalog.hbase.snapshot.RevisionManagerEndpoint",
+            "org.apache.hadoop.hbase.coprocessor.GenericEndpoint");
+        testConf.set(RMConstants.REVISION_MGR_ENDPOINT_IMPL_CLASS, MockRM.class.getName());
+    }
+
+    /**
+     * Mock implementation to test the protocol/serialization
+     */
+    public static class MockRM implements RevisionManager {
+
+        private static class Invocation {
+            Invocation(String methodName, Object ret, Object... args) {
+                this.methodName = methodName;
+                this.args = args;
+                this.ret = ret;
+            }
+
+            String methodName;
+            Object[] args;
+            Object ret;
+
+            private static boolean equals(Object obj1, Object obj2) {
+                if (obj1 == obj2) return true;
+                if (obj1 == null || obj2 == null) return false;
+                if (obj1 instanceof Transaction || obj1 instanceof TableSnapshot) {
+                    return obj1.toString().equals(obj2.toString());
+                }
+                return obj1.equals(obj2);
+            }
+
+            @Override
+            public boolean equals(Object obj) {
+                Invocation other = (Invocation) obj;
+                if (this == other) return true;
+                if (other == null) return false;
+                if (this.args != other.args) {
+                    if (this.args == null || other.args == null) return false;
+                    if (this.args.length != other.args.length) return false;
+                    for (int i = 0; i < args.length; i++) {
+                        if (!equals(this.args[i], other.args[i])) return false;
+                    }
+                }
+                return equals(this.ret, other.ret);
+            }
+
+            @Override
+            public String toString() {
+                return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).
+                    append("method", this.methodName).
+                    append("args", this.args).
+                    append("returns", this.ret).
+                    toString();
+            }
+        }
 
-    final static String DEFAULT_INSTANCE = "default";
-    final static Map<String, MockRM> INSTANCES = new ConcurrentHashMap<String, MockRM>();
-    Invocation lastCall;
-    boolean isOpen = false;
-
-    private <T extends Object> T recordCall(T result, Object...args) {
-      StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
-      lastCall = new Invocation(stackTrace[2].getMethodName(), result, args);
-      return result;
-    }
+        final static String DEFAULT_INSTANCE = "default";
+        final static Map<String, MockRM> INSTANCES = new ConcurrentHashMap<String, MockRM>();
+        Invocation lastCall;
+        boolean isOpen = false;
+
+        private <T extends Object> T recordCall(T result, Object... args) {
+            StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
+            lastCall = new Invocation(stackTrace[2].getMethodName(), result, args);
+            return result;
+        }
 
-    @Override
-    public void initialize(Configuration conf) {
-      if(!INSTANCES.containsKey(DEFAULT_INSTANCE))
-        INSTANCES.put(DEFAULT_INSTANCE, this);
-    }
+        @Override
+        public void initialize(Configuration conf) {
+            if (!INSTANCES.containsKey(DEFAULT_INSTANCE))
+                INSTANCES.put(DEFAULT_INSTANCE, this);
+        }
 
-    @Override
-    public void open() throws IOException {
-      isOpen = true;
-    }
+        @Override
+        public void open() throws IOException {
+            isOpen = true;
+        }
 
-    @Override
-    public void close() throws IOException {
-      isOpen = false;
-    }
+        @Override
+        public void close() throws IOException {
+            isOpen = false;
+        }
 
-    @Override
-    public void createTable(String table, List<String> columnFamilies) throws IOException {
-    }
+        @Override
+        public void createTable(String table, List<String> columnFamilies) throws IOException {
+        }
 
-    @Override
-    public void dropTable(String table) throws IOException {
-    }
+        @Override
+        public void dropTable(String table) throws IOException {
+        }
 
-    @Override
-    public Transaction beginWriteTransaction(String table,
-        List<String> families) throws IOException {
-      return recordCall(null, table, families);
-    }
+        @Override
+        public Transaction beginWriteTransaction(String table,
+                                                 List<String> families) throws IOException {
+            return recordCall(null, table, families);
+        }
 
-    @Override
-    public Transaction beginWriteTransaction(String table,
-      List<String> families, long keepAlive) throws IOException {
-      return recordCall(null, table, families, keepAlive);
-    }
+        @Override
+        public Transaction beginWriteTransaction(String table,
+                                                 List<String> families, long keepAlive) throws IOException {
+            return recordCall(null, table, families, keepAlive);
+        }
 
-    @Override
-    public void commitWriteTransaction(Transaction transaction)
-        throws IOException {
-    }
+        @Override
+        public void commitWriteTransaction(Transaction transaction)
+            throws IOException {
+        }
 
-    @Override
-    public void abortWriteTransaction(Transaction transaction)
-        throws IOException {
-    }
+        @Override
+        public void abortWriteTransaction(Transaction transaction)
+            throws IOException {
+        }
 
-    @Override
-    public List<FamilyRevision> getAbortedWriteTransactions(String table,
-        String columnFamily) throws IOException {
-      return null;
-    }
+        @Override
+        public List<FamilyRevision> getAbortedWriteTransactions(String table,
+                                                                String columnFamily) throws IOException {
+            return null;
+        }
 
-    @Override
-    public TableSnapshot createSnapshot(String tableName)
-        throws IOException {
-      return null;
-    }
+        @Override
+        public TableSnapshot createSnapshot(String tableName)
+            throws IOException {
+            return null;
+        }
 
-    @Override
-    public TableSnapshot createSnapshot(String tableName, long revision)
-        throws IOException {
-      TableSnapshot ret = new TableSnapshot(tableName, new HashMap<String, Long>(), revision);
-      return recordCall(ret, tableName, revision);
-    }
+        @Override
+        public TableSnapshot createSnapshot(String tableName, long revision)
+            throws IOException {
+            TableSnapshot ret = new TableSnapshot(tableName, new HashMap<String, Long>(), revision);
+            return recordCall(ret, tableName, revision);
+        }
 
-    @Override
-    public void keepAlive(Transaction transaction) throws IOException {
-      recordCall(null, transaction);
+        @Override
+        public void keepAlive(Transaction transaction) throws IOException {
+            recordCall(null, transaction);
+        }
     }
-  }
 
-  @Test
-  public void testRevisionManagerProtocol() throws Throwable {
+    @Test
+    public void testRevisionManagerProtocol() throws Throwable {
 
-    Configuration conf = getHbaseConf();
-    RevisionManager rm = RevisionManagerFactory.getOpenedRevisionManager(
-        RevisionManagerEndpointClient.class.getName(), conf);
-
-    MockRM mockImpl = MockRM.INSTANCES.get(MockRM.DEFAULT_INSTANCE);
-    Assert.assertNotNull(mockImpl);
-    Assert.assertTrue(mockImpl.isOpen);
-
-    Transaction t = new Transaction("t1", Arrays.asList("f1", "f2"), 0, 0);
-    MockRM.Invocation call = new MockRM.Invocation("keepAlive", null, t);
-    rm.keepAlive(t);
-    Assert.assertEquals(call.methodName, call, mockImpl.lastCall);
-
-    t = new Transaction("t2", Arrays.asList("f21", "f22"), 0, 0);
-    call = new MockRM.Invocation("beginWriteTransaction", null, t.getTableName(),  t.getColumnFamilies());
-    call.ret = rm.beginWriteTransaction(t.getTableName(), t.getColumnFamilies());
-    Assert.assertEquals(call.methodName, call, mockImpl.lastCall);
-
-    call = new MockRM.Invocation("createSnapshot", null, "t3", 1L);
-    call.ret = rm.createSnapshot("t3", 1);
-    Assert.assertEquals(call.methodName, call, mockImpl.lastCall);
+        Configuration conf = getHbaseConf();
+        RevisionManager rm = RevisionManagerFactory.getOpenedRevisionManager(
+            RevisionManagerEndpointClient.class.getName(), conf);
+
+        MockRM mockImpl = MockRM.INSTANCES.get(MockRM.DEFAULT_INSTANCE);
+        Assert.assertNotNull(mockImpl);
+        Assert.assertTrue(mockImpl.isOpen);
+
+        Transaction t = new Transaction("t1", Arrays.asList("f1", "f2"), 0, 0);
+        MockRM.Invocation call = new MockRM.Invocation("keepAlive", null, t);
+        rm.keepAlive(t);
+        Assert.assertEquals(call.methodName, call, mockImpl.lastCall);
+
+        t = new Transaction("t2", Arrays.asList("f21", "f22"), 0, 0);
+        call = new MockRM.Invocation("beginWriteTransaction", null, t.getTableName(), t.getColumnFamilies());
+        call.ret = rm.beginWriteTransaction(t.getTableName(), t.getColumnFamilies());
+        Assert.assertEquals(call.methodName, call, mockImpl.lastCall);
+
+        call = new MockRM.Invocation("createSnapshot", null, "t3", 1L);
+        call.ret = rm.createSnapshot("t3", 1);
+        Assert.assertEquals(call.methodName, call, mockImpl.lastCall);
 
-  }
+    }
 
 }

Modified: incubator/hcatalog/trunk/storage-handlers/hbase/src/test/org/apache/hcatalog/hbase/snapshot/TestThriftSerialization.java
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/storage-handlers/hbase/src/test/org/apache/hcatalog/hbase/snapshot/TestThriftSerialization.java?rev=1383152&r1=1383151&r2=1383152&view=diff
==============================================================================
--- incubator/hcatalog/trunk/storage-handlers/hbase/src/test/org/apache/hcatalog/hbase/snapshot/TestThriftSerialization.java (original)
+++ incubator/hcatalog/trunk/storage-handlers/hbase/src/test/org/apache/hcatalog/hbase/snapshot/TestThriftSerialization.java Mon Sep 10 23:28:55 2012
@@ -23,6 +23,7 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
+
 import org.apache.hcatalog.hbase.snapshot.transaction.thrift.StoreFamilyRevision;
 import org.apache.hcatalog.hbase.snapshot.transaction.thrift.StoreFamilyRevisionList;
 import org.junit.Test;
@@ -30,8 +31,8 @@ import org.junit.Test;
 public class TestThriftSerialization {
 
     @Test
-    public void testLightWeightTransaction(){
-       StoreFamilyRevision trxn = new StoreFamilyRevision(0, 1000);
+    public void testLightWeightTransaction() {
+        StoreFamilyRevision trxn = new StoreFamilyRevision(0, 1000);
         try {
 
             byte[] data = ZKUtil.serialize(trxn);
@@ -47,11 +48,11 @@ public class TestThriftSerialization {
     }
 
     @Test
-    public void testWriteTransactionList(){
+    public void testWriteTransactionList() {
         List<StoreFamilyRevision> txnList = new ArrayList<StoreFamilyRevision>();
         long version;
         long timestamp;
-        for( int i = 0; i < 10; i++){
+        for (int i = 0; i < 10; i++) {
             version = i;
             timestamp = 1000 + i;
             StoreFamilyRevision wtx = new StoreFamilyRevision(version, timestamp);
@@ -68,9 +69,9 @@ public class TestThriftSerialization {
 
             Iterator<StoreFamilyRevision> itr = newList.getRevisionListIterator();
             int i = 0;
-            while(itr.hasNext()){
+            while (itr.hasNext()) {
                 StoreFamilyRevision txn = itr.next();
-                assertTrue(txn.getRevision() ==  i);
+                assertTrue(txn.getRevision() == i);
                 assertTrue(txn.getTimestamp() == (i + 1000));
                 i++;
             }

Modified: incubator/hcatalog/trunk/storage-handlers/hbase/src/test/org/apache/hcatalog/hbase/snapshot/TestZNodeSetUp.java
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/storage-handlers/hbase/src/test/org/apache/hcatalog/hbase/snapshot/TestZNodeSetUp.java?rev=1383152&r1=1383151&r2=1383152&view=diff
==============================================================================
--- incubator/hcatalog/trunk/storage-handlers/hbase/src/test/org/apache/hcatalog/hbase/snapshot/TestZNodeSetUp.java (original)
+++ incubator/hcatalog/trunk/storage-handlers/hbase/src/test/org/apache/hcatalog/hbase/snapshot/TestZNodeSetUp.java Mon Sep 10 23:28:55 2012
@@ -40,19 +40,19 @@ import org.apache.zookeeper.data.Stat;
 import org.junit.Test;
 
 
-public class TestZNodeSetUp extends SkeletonHBaseTest{
+public class TestZNodeSetUp extends SkeletonHBaseTest {
 
-    private static HiveConf   hcatConf;
+    private static HiveConf hcatConf;
     private static HCatDriver hcatDriver;
 
     public void Initialize() throws Exception {
 
         hcatConf = getHiveConf();
         hcatConf.set(ConfVars.SEMANTIC_ANALYZER_HOOK.varname,
-                HCatSemanticAnalyzer.class.getName());
+            HCatSemanticAnalyzer.class.getName());
         URI fsuri = getFileSystem().getUri();
         Path whPath = new Path(fsuri.getScheme(), fsuri.getAuthority(),
-                getTestDir());
+            getTestDir());
         hcatConf.set(HiveConf.ConfVars.HADOOPFS.varname, fsuri.toString());
         hcatConf.set(ConfVars.METASTOREWAREHOUSE.varname, whPath.toString());
 
@@ -64,7 +64,7 @@ public class TestZNodeSetUp extends Skel
             }
         }
         HBaseConfiguration.merge(hcatConf,
-                RevisionManagerConfiguration.create());
+            RevisionManagerConfiguration.create());
         hcatConf.set(RMConstants.ZOOKEEPER_DATADIR, "/rm_base");
         SessionState.start(new CliSessionState(hcatConf));
         hcatDriver = new HCatDriver();
@@ -72,14 +72,14 @@ public class TestZNodeSetUp extends Skel
     }
 
     @Test
-    public void testBasicZNodeCreation() throws Exception{
+    public void testBasicZNodeCreation() throws Exception {
 
         Initialize();
         int port = getHbaseConf().getInt("hbase.zookeeper.property.clientPort", 2181);
         String servers = getHbaseConf().get("hbase.zookeeper.quorum");
         String[] splits = servers.split(",");
         StringBuffer sb = new StringBuffer();
-        for(String split : splits){
+        for (String split : splits) {
             sb.append(split);
             sb.append(':');
             sb.append(port);
@@ -87,9 +87,9 @@ public class TestZNodeSetUp extends Skel
 
         hcatDriver.run("drop table test_table");
         CommandProcessorResponse response = hcatDriver
-                .run("create table test_table(key int, value string) STORED BY " +
-                     "'org.apache.hcatalog.hbase.HBaseHCatStorageHandler'"
-                    + "TBLPROPERTIES ('hbase.columns.mapping'=':key,cf1:val')");
+            .run("create table test_table(key int, value string) STORED BY " +
+                "'org.apache.hcatalog.hbase.HBaseHCatStorageHandler'"
+                + "TBLPROPERTIES ('hbase.columns.mapping'=':key,cf1:val')");
 
         assertEquals(0, response.getResponseCode());
 

Modified: incubator/hcatalog/trunk/storage-handlers/hbase/src/test/org/apache/hcatalog/hbase/snapshot/lock/WriteLockTest.java
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/storage-handlers/hbase/src/test/org/apache/hcatalog/hbase/snapshot/lock/WriteLockTest.java?rev=1383152&r1=1383151&r2=1383152&view=diff
==============================================================================
--- incubator/hcatalog/trunk/storage-handlers/hbase/src/test/org/apache/hcatalog/hbase/snapshot/lock/WriteLockTest.java (original)
+++ incubator/hcatalog/trunk/storage-handlers/hbase/src/test/org/apache/hcatalog/hbase/snapshot/lock/WriteLockTest.java Mon Sep 10 23:28:55 2012
@@ -57,6 +57,7 @@ public class WriteLockTest extends Clien
         }
 
     }
+
     protected void runTest(int count) throws Exception {
         nodes = new WriteLock[count];
         for (int i = 0; i < count; i++) {
@@ -85,21 +86,21 @@ public class WriteLockTest extends Clien
 
         if (count > 1) {
             if (killLeader) {
-            System.out.println("Now killing the leader");
-            // now lets kill the leader
-            latch = new CountDownLatch(1);
-            first.unlock();
-            latch.await(30, TimeUnit.SECONDS);
-            //Thread.sleep(10000);
-            WriteLock second = nodes[1];
-            dumpNodes(count);
-            // lets assert that the first election is the leader
-            Assert.assertTrue("The second znode should be the leader " + second.getId(), second.isOwner());
+                System.out.println("Now killing the leader");
+                // now lets kill the leader
+                latch = new CountDownLatch(1);
+                first.unlock();
+                latch.await(30, TimeUnit.SECONDS);
+                //Thread.sleep(10000);
+                WriteLock second = nodes[1];
+                dumpNodes(count);
+                // lets assert that the first election is the leader
+                Assert.assertTrue("The second znode should be the leader " + second.getId(), second.isOwner());
 
-            for (int i = 2; i < count; i++) {
-                WriteLock node = nodes[i];
-                Assert.assertFalse("Node should not be the leader " + node.getId(), node.isOwner());
-            }
+                for (int i = 2; i < count; i++) {
+                    WriteLock node = nodes[i];
+                    Assert.assertFalse("Node should not be the leader " + node.getId(), node.isOwner());
+                }
             }
 
 
@@ -130,7 +131,7 @@ public class WriteLockTest extends Clien
         for (int i = 0; i < count; i++) {
             WriteLock node = nodes[i];
             System.out.println("node: " + i + " id: " +
-                    node.getId() + " is leader: " + node.isOwner());
+                node.getId() + " is leader: " + node.isOwner());
         }
     }
 

Modified: incubator/hcatalog/trunk/webhcat/java-client/src/main/java/org/apache/hcatalog/api/HCatAddPartitionDesc.java
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/webhcat/java-client/src/main/java/org/apache/hcatalog/api/HCatAddPartitionDesc.java?rev=1383152&r1=1383151&r2=1383152&view=diff
==============================================================================
--- incubator/hcatalog/trunk/webhcat/java-client/src/main/java/org/apache/hcatalog/api/HCatAddPartitionDesc.java (original)
+++ incubator/hcatalog/trunk/webhcat/java-client/src/main/java/org/apache/hcatalog/api/HCatAddPartitionDesc.java Mon Sep 10 23:28:55 2012
@@ -42,14 +42,14 @@ public class HCatAddPartitionDesc {
     private String tableName;
     private String dbName;
     private String location;
-    private Map<String,String> partSpec;
+    private Map<String, String> partSpec;
 
-     private HCatAddPartitionDesc(String dbName, String tbl, String loc, Map<String,String> spec){
-         this.dbName = dbName;
-         this.tableName = tbl;
-         this.location = loc;
-         this.partSpec = spec;
-     }
+    private HCatAddPartitionDesc(String dbName, String tbl, String loc, Map<String, String> spec) {
+        this.dbName = dbName;
+        this.tableName = tbl;
+        this.location = loc;
+        this.partSpec = spec;
+    }
 
     /**
      * Gets the location.
@@ -88,97 +88,97 @@ public class HCatAddPartitionDesc {
         return this.dbName;
     }
 
-     @Override
+    @Override
     public String toString() {
         return "HCatAddPartitionDesc ["
-                + (tableName != null ? "tableName=" + tableName + ", " : "tableName=null")
-                + (dbName != null ? "dbName=" + dbName + ", " : "dbName=null")
-                + (location != null ? "location=" + location + ", " : "location=null")
-                + (partSpec != null ? "partSpec=" + partSpec : "partSpec=null") + "]";
+            + (tableName != null ? "tableName=" + tableName + ", " : "tableName=null")
+            + (dbName != null ? "dbName=" + dbName + ", " : "dbName=null")
+            + (location != null ? "location=" + location + ", " : "location=null")
+            + (partSpec != null ? "partSpec=" + partSpec : "partSpec=null") + "]";
     }
 
     /**
-      * Creates the builder for specifying attributes.
-      *
-      * @param dbName the db name
-      * @param tableName the table name
-      * @param location the location
-      * @param partSpec the part spec
-      * @return the builder
-      * @throws HCatException
-      */
-     public static Builder create(String dbName, String tableName, String location,
-             Map<String,String> partSpec) throws HCatException {
-         return new Builder(dbName, tableName, location, partSpec);
-     }
-
-     Partition toHivePartition(Table hiveTable) throws HCatException{
-         Partition hivePtn = new Partition();
-         hivePtn.setDbName(this.dbName);
-         hivePtn.setTableName(this.tableName);
-
-         List<String> pvals = new ArrayList<String>();
-         for (FieldSchema field : hiveTable.getPartitionKeys()) {
-           String val = partSpec.get(field.getName());
-           if (val == null || val.length() == 0) {
-               throw new HCatException("create partition: Value for key "
-                   + field.getName() + " is null or empty");
-             }
-           pvals.add(val);
-         }
-
-         hivePtn.setValues(pvals);
-         StorageDescriptor sd = new StorageDescriptor(hiveTable.getSd());
-         hivePtn.setSd(sd);
-         hivePtn.setParameters(hiveTable.getParameters());
-         if (this.location != null) {
-             hivePtn.getSd().setLocation(this.location);
-         } else {
-             String partName;
+     * Creates the builder for specifying attributes.
+     *
+     * @param dbName the db name
+     * @param tableName the table name
+     * @param location the location
+     * @param partSpec the part spec
+     * @return the builder
+     * @throws HCatException
+     */
+    public static Builder create(String dbName, String tableName, String location,
+                                 Map<String, String> partSpec) throws HCatException {
+        return new Builder(dbName, tableName, location, partSpec);
+    }
+
+    Partition toHivePartition(Table hiveTable) throws HCatException {
+        Partition hivePtn = new Partition();
+        hivePtn.setDbName(this.dbName);
+        hivePtn.setTableName(this.tableName);
+
+        List<String> pvals = new ArrayList<String>();
+        for (FieldSchema field : hiveTable.getPartitionKeys()) {
+            String val = partSpec.get(field.getName());
+            if (val == null || val.length() == 0) {
+                throw new HCatException("create partition: Value for key "
+                    + field.getName() + " is null or empty");
+            }
+            pvals.add(val);
+        }
+
+        hivePtn.setValues(pvals);
+        StorageDescriptor sd = new StorageDescriptor(hiveTable.getSd());
+        hivePtn.setSd(sd);
+        hivePtn.setParameters(hiveTable.getParameters());
+        if (this.location != null) {
+            hivePtn.getSd().setLocation(this.location);
+        } else {
+            String partName;
             try {
                 partName = Warehouse.makePartName(
-                         hiveTable.getPartitionKeys(), pvals);
+                    hiveTable.getPartitionKeys(), pvals);
                 LOG.info("Setting partition location to :" + partName);
             } catch (MetaException e) {
                 throw new HCatException("Exception while creating partition name.", e);
             }
-             Path partPath = new Path(hiveTable.getSd().getLocation(), partName);
-             hivePtn.getSd().setLocation(partPath.toString());
-         }
-         hivePtn.setCreateTime((int) (System.currentTimeMillis() / 1000));
-         hivePtn.setLastAccessTimeIsSet(false);
-         return hivePtn;
-     }
-
-     public static class Builder {
-
-         private String tableName;
-         private String location;
-         private Map<String,String> values;
-         private String dbName;
-
-         private Builder(String dbName, String tableName, String location, Map<String,String> values){
-             this.dbName = dbName;
-             this.tableName = tableName;
-             this.location = location;
-             this.values = values;
-         }
-
-         /**
-          * Builds the HCatAddPartitionDesc.
-          *
-          * @return the h cat add partition desc
-          * @throws HCatException
-          */
-         public HCatAddPartitionDesc build() throws HCatException {
-             if(this.dbName == null){
-                 this.dbName = MetaStoreUtils.DEFAULT_DATABASE_NAME;
-             }
-             HCatAddPartitionDesc desc = new HCatAddPartitionDesc(
-                     this.dbName, this.tableName, this.location,
-                     this.values);
-             return desc;
-         }
-     }
+            Path partPath = new Path(hiveTable.getSd().getLocation(), partName);
+            hivePtn.getSd().setLocation(partPath.toString());
+        }
+        hivePtn.setCreateTime((int) (System.currentTimeMillis() / 1000));
+        hivePtn.setLastAccessTimeIsSet(false);
+        return hivePtn;
+    }
+
+    public static class Builder {
+
+        private String tableName;
+        private String location;
+        private Map<String, String> values;
+        private String dbName;
+
+        private Builder(String dbName, String tableName, String location, Map<String, String> values) {
+            this.dbName = dbName;
+            this.tableName = tableName;
+            this.location = location;
+            this.values = values;
+        }
+
+        /**
+         * Builds the HCatAddPartitionDesc.
+         *
+         * @return the h cat add partition desc
+         * @throws HCatException
+         */
+        public HCatAddPartitionDesc build() throws HCatException {
+            if (this.dbName == null) {
+                this.dbName = MetaStoreUtils.DEFAULT_DATABASE_NAME;
+            }
+            HCatAddPartitionDesc desc = new HCatAddPartitionDesc(
+                this.dbName, this.tableName, this.location,
+                this.values);
+            return desc;
+        }
+    }
 
 }

Modified: incubator/hcatalog/trunk/webhcat/java-client/src/main/java/org/apache/hcatalog/api/HCatClient.java
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/webhcat/java-client/src/main/java/org/apache/hcatalog/api/HCatClient.java?rev=1383152&r1=1383151&r2=1383152&view=diff
==============================================================================
--- incubator/hcatalog/trunk/webhcat/java-client/src/main/java/org/apache/hcatalog/api/HCatClient.java (original)
+++ incubator/hcatalog/trunk/webhcat/java-client/src/main/java/org/apache/hcatalog/api/HCatClient.java Mon Sep 10 23:28:55 2012
@@ -30,8 +30,10 @@ import org.apache.hcatalog.common.HCatEx
  */
 public abstract class HCatClient {
 
-    public enum DROP_DB_MODE { RESTRICT, CASCADE };
+    public enum DROP_DB_MODE {RESTRICT, CASCADE}
+
     public static final String HCAT_CLIENT_IMPL_CLASS = "hcat.client.impl.class";
+
     /**
      * Creates an instance of HCatClient.
      *
@@ -40,32 +42,32 @@ public abstract class HCatClient {
      * @throws HCatException,ConnectionFailureException
      */
     public static HCatClient create(Configuration conf) throws HCatException,
-            ConnectionFailureException {
+        ConnectionFailureException {
         HCatClient client = null;
         String className = conf.get(HCAT_CLIENT_IMPL_CLASS,
-                HCatClientHMSImpl.class.getName());
+            HCatClientHMSImpl.class.getName());
         try {
             Class<? extends HCatClient> clientClass = Class.forName(className,
-                    true, JavaUtils.getClassLoader()).asSubclass(
+                true, JavaUtils.getClassLoader()).asSubclass(
                     HCatClient.class);
             client = (HCatClient) clientClass.newInstance();
         } catch (ClassNotFoundException e) {
             throw new HCatException(
-                    "ClassNotFoundException while creating client class.", e);
+                "ClassNotFoundException while creating client class.", e);
         } catch (InstantiationException e) {
             throw new HCatException(
-                    "InstantiationException while creating client class.", e);
+                "InstantiationException while creating client class.", e);
         } catch (IllegalAccessException e) {
             throw new HCatException(
-                    "IllegalAccessException while creating client class.", e);
+                "IllegalAccessException while creating client class.", e);
         }
-        if(client != null){
+        if (client != null) {
             client.initialize(conf);
         }
         return client;
     }
 
-    abstract void initialize(Configuration conf) throws HCatException,ConnectionFailureException;
+    abstract void initialize(Configuration conf) throws HCatException, ConnectionFailureException;
 
     /**
      * Get all existing databases that match the given
@@ -76,7 +78,7 @@ public abstract class HCatClient {
      * @throws HCatException,ConnectionFailureException
      */
     public abstract List<String> listDatabaseNamesByPattern(String pattern)
-            throws HCatException, ConnectionFailureException;
+        throws HCatException, ConnectionFailureException;
 
     /**
      * Gets the database.
@@ -85,7 +87,7 @@ public abstract class HCatClient {
      * @return An instance of HCatDatabaseInfo.
      * @throws HCatException,ConnectionFailureException
      */
-    public abstract HCatDatabase getDatabase(String dbName) throws HCatException,ConnectionFailureException;
+    public abstract HCatDatabase getDatabase(String dbName) throws HCatException, ConnectionFailureException;
 
     /**
      * Creates the database.
@@ -94,7 +96,7 @@ public abstract class HCatClient {
      * @throws HCatException,ConnectionFailureException
      */
     public abstract void createDatabase(HCatCreateDBDesc dbInfo)
-            throws HCatException,ConnectionFailureException;
+        throws HCatException, ConnectionFailureException;
 
     /**
      * Drops a database.
@@ -108,7 +110,7 @@ public abstract class HCatClient {
      * @throws HCatException,ConnectionFailureException
      */
     public abstract void dropDatabase(String dbName, boolean ifExists,
-            DROP_DB_MODE mode) throws HCatException, ConnectionFailureException;
+                                      DROP_DB_MODE mode) throws HCatException, ConnectionFailureException;
 
     /**
      * Returns all existing tables from the specified database which match the given
@@ -119,7 +121,7 @@ public abstract class HCatClient {
      * @throws HCatException,ConnectionFailureException
      */
     public abstract List<String> listTableNamesByPattern(String dbName, String tablePattern)
-            throws HCatException,ConnectionFailureException;
+        throws HCatException, ConnectionFailureException;
 
     /**
      * Gets the table.
@@ -130,7 +132,7 @@ public abstract class HCatClient {
      * @throws HCatException,ConnectionFailureException
      */
     public abstract HCatTable getTable(String dbName, String tableName)
-            throws HCatException,ConnectionFailureException;
+        throws HCatException, ConnectionFailureException;
 
     /**
      * Creates the table.
@@ -139,7 +141,7 @@ public abstract class HCatClient {
      * @throws HCatException,ConnectionFailureException
      */
     public abstract void createTable(HCatCreateTableDesc createTableDesc)
-            throws HCatException,ConnectionFailureException;
+        throws HCatException, ConnectionFailureException;
 
     /**
      * Creates the table like an existing table.
@@ -154,8 +156,8 @@ public abstract class HCatClient {
      * @throws HCatException,ConnectionFailureException
      */
     public abstract void createTableLike(String dbName, String existingTblName,
-            String newTableName, boolean ifNotExists, boolean isExternal,
-            String location) throws HCatException,ConnectionFailureException;
+                                         String newTableName, boolean ifNotExists, boolean isExternal,
+                                         String location) throws HCatException, ConnectionFailureException;
 
     /**
      * Drop table.
@@ -167,7 +169,7 @@ public abstract class HCatClient {
      * @throws HCatException,ConnectionFailureException
      */
     public abstract void dropTable(String dbName, String tableName,
-            boolean ifExists) throws HCatException,ConnectionFailureException;
+                                   boolean ifExists) throws HCatException, ConnectionFailureException;
 
     /**
      * Renames a table.
@@ -178,7 +180,7 @@ public abstract class HCatClient {
      * @throws HCatException,ConnectionFailureException
      */
     public abstract void renameTable(String dbName, String oldName,
-            String newName) throws HCatException, ConnectionFailureException;
+                                     String newName) throws HCatException, ConnectionFailureException;
 
     /**
      * Gets all the partitions.
@@ -189,7 +191,7 @@ public abstract class HCatClient {
      * @throws HCatException,ConnectionFailureException
      */
     public abstract List<HCatPartition> getPartitions(String dbName, String tblName)
-            throws HCatException,ConnectionFailureException;
+        throws HCatException, ConnectionFailureException;
 
     /**
      * Gets the partition.
@@ -201,7 +203,7 @@ public abstract class HCatClient {
      * @throws HCatException,ConnectionFailureException
      */
     public abstract HCatPartition getPartition(String dbName, String tableName,
-            Map<String,String> partitionSpec) throws HCatException,ConnectionFailureException;
+                                               Map<String, String> partitionSpec) throws HCatException, ConnectionFailureException;
 
     /**
      * Adds the partition.
@@ -210,7 +212,7 @@ public abstract class HCatClient {
      * @throws HCatException,ConnectionFailureException
      */
     public abstract void addPartition(HCatAddPartitionDesc partInfo)
-            throws HCatException, ConnectionFailureException;
+        throws HCatException, ConnectionFailureException;
 
     /**
      * Adds a list of partitions.
@@ -220,7 +222,7 @@ public abstract class HCatClient {
      * @throws HCatException,ConnectionFailureException
      */
     public abstract int addPartitions(List<HCatAddPartitionDesc> partInfoList)
-            throws HCatException, ConnectionFailureException;
+        throws HCatException, ConnectionFailureException;
 
     /**
      * Drops partition.
@@ -232,8 +234,8 @@ public abstract class HCatClient {
      * @throws HCatException,ConnectionFailureException
      */
     public abstract void dropPartition(String dbName, String tableName,
-            Map<String, String> partitionSpec, boolean ifExists)
-            throws HCatException, ConnectionFailureException;
+                                       Map<String, String> partitionSpec, boolean ifExists)
+        throws HCatException, ConnectionFailureException;
 
     /**
      * List partitions by filter.
@@ -247,7 +249,7 @@ public abstract class HCatClient {
      * @throws HCatException,ConnectionFailureException
      */
     public abstract List<HCatPartition> listPartitionsByFilter(String dbName, String tblName,
-            String filter) throws HCatException,ConnectionFailureException;
+                                                               String filter) throws HCatException, ConnectionFailureException;
 
     /**
      * Mark partition for event.
@@ -259,8 +261,8 @@ public abstract class HCatClient {
      * @throws HCatException,ConnectionFailureException
      */
     public abstract void markPartitionForEvent(String dbName, String tblName,
-            Map<String, String> partKVs, PartitionEventType eventType)
-            throws HCatException,ConnectionFailureException;
+                                               Map<String, String> partKVs, PartitionEventType eventType)
+        throws HCatException, ConnectionFailureException;
 
     /**
      * Checks if a partition is marked for event.
@@ -273,8 +275,8 @@ public abstract class HCatClient {
      * @throws HCatException,ConnectionFailureException
      */
     public abstract boolean isPartitionMarkedForEvent(String dbName, String tblName,
-            Map<String, String> partKVs, PartitionEventType eventType)
-            throws HCatException,ConnectionFailureException;
+                                                      Map<String, String> partKVs, PartitionEventType eventType)
+        throws HCatException, ConnectionFailureException;
 
     /**
      * Gets the delegation token.
@@ -285,8 +287,8 @@ public abstract class HCatClient {
      * @throws HCatException,ConnectionFailureException
      */
     public abstract String getDelegationToken(String owner,
-            String renewerKerberosPrincipalName) throws HCatException,
-            ConnectionFailureException;
+                                              String renewerKerberosPrincipalName) throws HCatException,
+        ConnectionFailureException;
 
     /**
      * Renew delegation token.
@@ -296,7 +298,7 @@ public abstract class HCatClient {
      * @throws HCatException,ConnectionFailureException
      */
     public abstract long renewDelegationToken(String tokenStrForm)
-            throws HCatException, ConnectionFailureException;
+        throws HCatException, ConnectionFailureException;
 
     /**
      * Cancel delegation token.
@@ -305,7 +307,7 @@ public abstract class HCatClient {
      * @throws HCatException,ConnectionFailureException
      */
     public abstract void cancelDelegationToken(String tokenStrForm)
-            throws HCatException, ConnectionFailureException;
+        throws HCatException, ConnectionFailureException;
 
     /**
      * Close the hcatalog client.



Mime
View raw message