ACCUMULO-2551 Fix type safety and import warnings.

Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/5363d781
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/5363d781
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/5363d781

Branch: refs/heads/1.5.2-SNAPSHOT
Commit: 5363d781d3c7f304765c1bdef93969e84f1d934f
Parents: e33c1f4
Author: Christopher Tubbs <ctubb...@apache.org>
Authored: Mon Apr 7 20:07:28 2014 -0400
Committer: Christopher Tubbs <ctubb...@apache.org>
Committed: Mon Apr 7 20:07:28 2014 -0400

----------------------------------------------------------------------
 .../org/apache/accumulo/fate/ReadOnlyStore.java | 22 ++++++------
 .../java/org/apache/accumulo/fate/TStore.java   | 16 ++++-----
 .../org/apache/accumulo/server/fate/Admin.java  | 38 +++++++++-----------
 .../test/continuous/ContinuousVerify.java       |  1 -
 4 files changed, 35 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/5363d781/fate/src/main/java/org/apache/accumulo/fate/ReadOnlyStore.java
----------------------------------------------------------------------
diff --git a/fate/src/main/java/org/apache/accumulo/fate/ReadOnlyStore.java 
b/fate/src/main/java/org/apache/accumulo/fate/ReadOnlyStore.java
index 7cb20ff..ad5e7e1 100644
--- a/fate/src/main/java/org/apache/accumulo/fate/ReadOnlyStore.java
+++ b/fate/src/main/java/org/apache/accumulo/fate/ReadOnlyStore.java
@@ -16,26 +16,25 @@
  */
 package org.apache.accumulo.fate;
 
-import org.apache.accumulo.fate.ReadOnlyTStore.TStatus;
-import com.google.common.base.Preconditions;
-
 import java.io.Serializable;
 import java.util.EnumSet;
 import java.util.List;
 
+import com.google.common.base.Preconditions;
+
 /**
  * This store decorates a TStore to make sure it can not be modified.
- *
- * Unlike relying directly on the ReadOnlyTStore interface, this class will 
not allow subsequent users to cast back to a
- * mutable TStore successfully.
- *
+ * 
+ * Unlike relying directly on the ReadOnlyTStore interface, this class will 
not allow subsequent users to cast back to a mutable TStore successfully.
+ * 
  */
 public class ReadOnlyStore<T> implements ReadOnlyTStore<T> {
 
   private final TStore<T> store;
 
   /**
-   * @param store may not be null
+   * @param store
+   *          may not be null
    */
   public ReadOnlyStore(TStore<T> store) {
     Preconditions.checkNotNull(store);
@@ -59,14 +58,15 @@ public class ReadOnlyStore<T> implements ReadOnlyTStore<T> {
 
   /**
    * Decorates a Repo to make sure it is treated as a ReadOnlyRepo.
-   *
+   * 
    * Similar to ReadOnlyStore, won't allow subsequent user to cast a 
ReadOnlyRepo back to a mutable Repo.
    */
   protected static class ReadOnlyRepoWrapper<X> implements ReadOnlyRepo<X> {
     private final Repo<X> repo;
 
     /**
-     * @param repo may not be null
+     * @param repo
+     *          may not be null
      */
     public ReadOnlyRepoWrapper(Repo<X> repo) {
       Preconditions.checkNotNull(repo);
@@ -86,7 +86,7 @@ public class ReadOnlyStore<T> implements ReadOnlyTStore<T> {
 
   @Override
   public ReadOnlyRepo<T> top(long tid) {
-    return new ReadOnlyRepoWrapper(store.top(tid));
+    return new ReadOnlyRepoWrapper<T>(store.top(tid));
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/accumulo/blob/5363d781/fate/src/main/java/org/apache/accumulo/fate/TStore.java
----------------------------------------------------------------------
diff --git a/fate/src/main/java/org/apache/accumulo/fate/TStore.java 
b/fate/src/main/java/org/apache/accumulo/fate/TStore.java
index 5ca24fc..882cdbd 100644
--- a/fate/src/main/java/org/apache/accumulo/fate/TStore.java
+++ b/fate/src/main/java/org/apache/accumulo/fate/TStore.java
@@ -17,8 +17,6 @@
 package org.apache.accumulo.fate;
 
 import java.io.Serializable;
-import java.util.EnumSet;
-import java.util.List;
 
 /**
  * Transaction Store: a place to save transactions
@@ -28,14 +26,14 @@ import java.util.List;
  * fails, the stack can be unwound, undoing each operation.
  */
 public interface TStore<T> extends ReadOnlyTStore<T> {
-  
+
   /**
    * Create a new transaction id
    * 
    * @return a transaction id
    */
   long create();
-  
+
   /**
    * Get the current operation for the given transaction id.
    * 
@@ -45,7 +43,7 @@ public interface TStore<T> extends ReadOnlyTStore<T> {
    */
   @Override
   Repo<T> top(long tid);
-  
+
   /**
    * Update the given transaction with the next operation
    * 
@@ -55,14 +53,14 @@ public interface TStore<T> extends ReadOnlyTStore<T> {
    *          the operation
    */
   void push(long tid, Repo<T> repo) throws StackOverflowException;
-  
+
   /**
    * Remove the last pushed operation from the given transaction.
    * 
    * @param tid
    */
   void pop(long tid);
-  
+
   /**
    * Update the state of a given transaction
    * 
@@ -72,9 +70,9 @@ public interface TStore<T> extends ReadOnlyTStore<T> {
    *          execution status
    */
   void setStatus(long tid, TStatus status);
-  
+
   void setProperty(long tid, String prop, Serializable val);
-  
+
   /**
    * Remove the transaction from the store.
    * 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/5363d781/server/src/main/java/org/apache/accumulo/server/fate/Admin.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/fate/Admin.java 
b/server/src/main/java/org/apache/accumulo/server/fate/Admin.java
index fc9e342..16bfd0c 100644
--- a/server/src/main/java/org/apache/accumulo/server/fate/Admin.java
+++ b/server/src/main/java/org/apache/accumulo/server/fate/Admin.java
@@ -24,8 +24,8 @@ import org.apache.accumulo.core.cli.Help;
 import org.apache.accumulo.core.client.Instance;
 import org.apache.accumulo.core.zookeeper.ZooUtil;
 import org.apache.accumulo.fate.AdminUtil;
-import org.apache.accumulo.fate.ZooStore;
 import org.apache.accumulo.fate.ReadOnlyStore;
+import org.apache.accumulo.fate.ZooStore;
 import org.apache.accumulo.fate.zookeeper.IZooReaderWriter;
 import org.apache.accumulo.server.client.HdfsZooInstance;
 import org.apache.accumulo.server.master.Master;
@@ -35,29 +35,25 @@ import com.beust.jcommander.JCommander;
 import com.beust.jcommander.Parameter;
 import com.beust.jcommander.Parameters;
 
-
 /**
  * A utility to administer FATE operations
  */
 public class Admin {
-  
+
   static class TxOpts {
-    @Parameter(description="<txid>", required=true)
+    @Parameter(description = "<txid>", required = true)
     List<String> args = new ArrayList<String>();
   }
-  
-  @Parameters(commandDescription="Stop an existing FATE by transaction id")
-  static class FailOpts extends TxOpts {
-  }
-  
-  @Parameters(commandDescription="Delete an existing FATE by transaction id")
-  static class DeleteOpts extends TxOpts {
-  }
-  
-  @Parameters(commandDescription="List the existing FATE transactions")
-  static class PrintOpts {
-  }
-  
+
+  @Parameters(commandDescription = "Stop an existing FATE by transaction id")
+  static class FailOpts extends TxOpts {}
+
+  @Parameters(commandDescription = "Delete an existing FATE by transaction id")
+  static class DeleteOpts extends TxOpts {}
+
+  @Parameters(commandDescription = "List the existing FATE transactions")
+  static class PrintOpts {}
+
   public static void main(String[] args) throws Exception {
     Help opts = new Help();
     JCommander jc = new JCommander(opts);
@@ -70,15 +66,15 @@ public class Admin {
       jc.usage();
       System.exit(-1);
     }
-    
+
     AdminUtil<Master> admin = new AdminUtil<Master>();
-    
+
     Instance instance = HdfsZooInstance.getInstance();
     String path = ZooUtil.getRoot(instance) + Constants.ZFATE;
     String masterPath = ZooUtil.getRoot(instance) + Constants.ZMASTER_LOCK;
     IZooReaderWriter zk = ZooReaderWriter.getRetryingInstance();
     ZooStore<Master> zs = new ZooStore<Master>(path, zk);
-    
+
     if (jc.getParsedCommand().equals("fail")) {
       if (!admin.prepFail(zs, zk, masterPath, args[1])) {
         System.exit(1);
@@ -89,7 +85,7 @@ public class Admin {
       }
       admin.deleteLocks(zs, zk, ZooUtil.getRoot(instance) + 
Constants.ZTABLE_LOCKS, args[1]);
     } else if (jc.getParsedCommand().equals("print")) {
-      admin.print(new ReadOnlyStore(zs), zk, ZooUtil.getRoot(instance) + 
Constants.ZTABLE_LOCKS);
+      admin.print(new ReadOnlyStore<Master>(zs), zk, ZooUtil.getRoot(instance) 
+ Constants.ZTABLE_LOCKS);
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/5363d781/test/src/main/java/org/apache/accumulo/test/continuous/ContinuousVerify.java
----------------------------------------------------------------------
diff --git 
a/test/src/main/java/org/apache/accumulo/test/continuous/ContinuousVerify.java 
b/test/src/main/java/org/apache/accumulo/test/continuous/ContinuousVerify.java
index 8095b50..06b9a7c 100644
--- 
a/test/src/main/java/org/apache/accumulo/test/continuous/ContinuousVerify.java
+++ 
b/test/src/main/java/org/apache/accumulo/test/continuous/ContinuousVerify.java
@@ -38,7 +38,6 @@ import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.io.LongWritable;
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.io.VLongWritable;
-import org.apache.hadoop.mapred.Counters.Counter;
 import org.apache.hadoop.mapreduce.Job;
 import org.apache.hadoop.mapreduce.Mapper;
 import org.apache.hadoop.mapreduce.Reducer;

Reply via email to