accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject [07/10] git commit: ACCUMULO-1000 Cleaned up conditional writer type parameter warnings
Date Wed, 17 Jul 2013 12:58:21 GMT
ACCUMULO-1000 Cleaned up conditional writer type parameter warnings

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

Branch: refs/heads/ACCUMULO-1000
Commit: b08663e912df79f673c38c5085923d82a0c8ea57
Parents: 7faaf11
Author: Keith Turner <kturner@apache.org>
Authored: Tue Jul 16 11:10:26 2013 -0400
Committer: Keith Turner <kturner@apache.org>
Committed: Tue Jul 16 11:10:26 2013 -0400

----------------------------------------------------------------------
 .../core/client/impl/ConditionalWriterImpl.java | 66 +++++++++-----------
 .../core/client/impl/RootTabletLocator.java     |  8 +--
 .../core/client/impl/TabletLocator.java         | 16 ++---
 .../core/client/impl/TabletLocatorImpl.java     | 16 ++---
 .../client/impl/TabletServerBatchWriter.java    | 32 +++++-----
 .../core/client/impl/TimeoutTabletLocator.java  |  4 +-
 .../core/client/mock/MockTabletLocator.java     |  8 +--
 .../core/client/impl/TabletLocatorImplTest.java |  6 +-
 .../server/client/BulkImporterTest.java         |  7 +--
 9 files changed, 77 insertions(+), 86 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/b08663e9/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java
b/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java
index 3c6ac85..b8238ac 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java
@@ -26,7 +26,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.NoSuchElementException;
-import java.util.Set;
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.DelayQueue;
 import java.util.concurrent.Delayed;
@@ -45,7 +44,6 @@ import org.apache.accumulo.core.data.ByteSequence;
 import org.apache.accumulo.core.data.Condition;
 import org.apache.accumulo.core.data.ConditionalMutation;
 import org.apache.accumulo.core.data.KeyExtent;
-import org.apache.accumulo.core.data.Mutation;
 import org.apache.accumulo.core.data.thrift.IterInfo;
 import org.apache.accumulo.core.data.thrift.TCMResult;
 import org.apache.accumulo.core.data.thrift.TCMStatus;
@@ -75,16 +73,16 @@ import org.apache.thrift.transport.TTransportException;
 
 class ConditionalWriterImpl implements ConditionalWriter {
   
-  private Text tableId;
   private Authorizations auths;
   private VisibilityEvaluator ve;
-  private Map cache;
+  @SuppressWarnings("unchecked")
+  private Map<Text,Boolean> cache = Collections.synchronizedMap(new LRUMap(1000));;
   private Instance instance;
   private TCredentials credentials;
   private TabletLocator locator;
 
 
-  private Map<String,BlockingQueue<TabletServerMutations>> serverQueues;
+  private Map<String,BlockingQueue<TabletServerMutations<QCMutation>>>
serverQueues;
   private DelayQueue<QCMutation> failedMutations = new DelayQueue<QCMutation>();
   private ScheduledThreadPoolExecutor threadPool;
   
@@ -161,12 +159,12 @@ class ConditionalWriterImpl implements ConditionalWriter {
     }
   }
   
-  private BlockingQueue<TabletServerMutations> getServerQueue(String location) {
-    BlockingQueue<TabletServerMutations> queue;
+  private BlockingQueue<TabletServerMutations<QCMutation>> getServerQueue(String
location) {
+    BlockingQueue<TabletServerMutations<QCMutation>> queue;
     synchronized (serverQueues) {
       queue = serverQueues.get(location);
       if (queue == null) {
-        queue = new LinkedBlockingQueue<TabletServerMutations>();
+        queue = new LinkedBlockingQueue<TabletServerMutations<QCMutation>>();
         serverQueues.put(location, queue);
       }
     }
@@ -182,13 +180,11 @@ class ConditionalWriterImpl implements ConditionalWriter {
   }
 
   private void queue(List<QCMutation> mutations) {
-    List<Mutation> failures = new ArrayList<Mutation>();
-    Map<String,TabletServerMutations> binnedMutations = new HashMap<String,TabletLocator.TabletServerMutations>();
-    
-    List<Mutation> ml = (List<Mutation>) (List<? extends Mutation>) mutations;
+    List<QCMutation> failures = new ArrayList<QCMutation>();
+    Map<String,TabletServerMutations<QCMutation>> binnedMutations = new HashMap<String,TabletLocator.TabletServerMutations<QCMutation>>();
     
     try {
-      locator.binMutations(ml, binnedMutations, failures, credentials);
+      locator.binMutations(mutations, binnedMutations, failures, credentials);
     } catch (AccumuloException e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
@@ -201,26 +197,26 @@ class ConditionalWriterImpl implements ConditionalWriter {
     }
     
     if (failures.size() > 0)
-      queueFailed((List<QCMutation>) (List<? extends Mutation>) failures);
+      queueFailed(failures);
 
-    for (Entry<String,TabletServerMutations> entry : binnedMutations.entrySet()) {
+    for (Entry<String,TabletServerMutations<QCMutation>> entry : binnedMutations.entrySet())
{
       queue(entry.getKey(), entry.getValue());
     }
 
   }
 
-  private void queue(String location, TabletServerMutations mutations) {
+  private void queue(String location, TabletServerMutations<QCMutation> mutations)
{
     
-    BlockingQueue<TabletServerMutations> queue = getServerQueue(location);
+    BlockingQueue<TabletServerMutations<QCMutation>> queue = getServerQueue(location);
     
     queue.add(mutations);
     threadPool.execute(new SendTask(location));
   }
 
-  private TabletServerMutations dequeue(String location) {
-    BlockingQueue<TabletServerMutations> queue = getServerQueue(location);
+  private TabletServerMutations<QCMutation> dequeue(String location) {
+    BlockingQueue<TabletServerMutations<QCMutation>> queue = getServerQueue(location);
     
-    ArrayList<TabletServerMutations> mutations = new ArrayList<TabletLocator.TabletServerMutations>();
+    ArrayList<TabletServerMutations<QCMutation>> mutations = new ArrayList<TabletLocator.TabletServerMutations<QCMutation>>();
     queue.drainTo(mutations);
     
     if (mutations.size() == 0)
@@ -230,13 +226,13 @@ class ConditionalWriterImpl implements ConditionalWriter {
       return mutations.get(0);
     } else {
       // merge multiple request to a single tablet server
-      TabletServerMutations tsm = mutations.get(0);
+      TabletServerMutations<QCMutation> tsm = mutations.get(0);
       
       for (int i = 1; i < mutations.size(); i++) {
-        for (Entry<KeyExtent,List<Mutation>> entry : mutations.get(i).getMutations().entrySet())
{
-          List<Mutation> list = tsm.getMutations().get(entry.getKey());
+        for (Entry<KeyExtent,List<QCMutation>> entry : mutations.get(i).getMutations().entrySet())
{
+          List<QCMutation> list = tsm.getMutations().get(entry.getKey());
           if (list == null) {
-            list = new ArrayList<Mutation>();
+            list = new ArrayList<QCMutation>();
             tsm.getMutations().put(entry.getKey(), list);
           }
           
@@ -249,17 +245,15 @@ class ConditionalWriterImpl implements ConditionalWriter {
   }
 
   ConditionalWriterImpl(Instance instance, TCredentials credentials, String tableId, Authorizations
authorizations) {
-    cache = Collections.synchronizedMap(new LRUMap(1000));
     this.instance = instance;
     this.credentials = credentials;
-    this.tableId = new Text(tableId);
     this.auths = authorizations;
     this.ve = new VisibilityEvaluator(authorizations);
     // TODO make configurable
     this.threadPool = new ScheduledThreadPoolExecutor(3);
     this.threadPool.setMaximumPoolSize(3);
     this.locator = TabletLocator.getLocator(instance, new Text(tableId));
-    this.serverQueues = new HashMap<String,BlockingQueue<TabletServerMutations>>();
+    this.serverQueues = new HashMap<String,BlockingQueue<TabletServerMutations<QCMutation>>>();
     
     Runnable failureHandler = new Runnable() {
       
@@ -282,7 +276,7 @@ class ConditionalWriterImpl implements ConditionalWriter {
 
   public Iterator<Result> write(Iterator<ConditionalMutation> mutations) {
 
-    BlockingQueue resultQueue = new LinkedBlockingQueue<Result>();
+    BlockingQueue<Result> resultQueue = new LinkedBlockingQueue<Result>();
 
     List<QCMutation> mutationList = new ArrayList<QCMutation>();
 
@@ -322,7 +316,7 @@ class ConditionalWriterImpl implements ConditionalWriter {
     
     @Override
     public void run() {
-      TabletServerMutations mutations = dequeue(location);
+      TabletServerMutations<QCMutation> mutations = dequeue(location);
       if (mutations != null)
         sendToServer(location, mutations);
     }
@@ -339,7 +333,7 @@ class ConditionalWriterImpl implements ConditionalWriter {
     }
   }
 
-  private void sendToServer(String location, TabletServerMutations mutations) {
+  private void sendToServer(String location, TabletServerMutations<QCMutation> mutations)
{
     TabletClientService.Iface client = null;
     
     TInfo tinfo = Tracer.traceInfo();
@@ -411,22 +405,20 @@ class ConditionalWriterImpl implements ConditionalWriter {
     }
   }
 
-  private void convertMutations(TabletServerMutations mutations, Map<Long,CMK> cmidToCm,
MutableLong cmid,
+  private void convertMutations(TabletServerMutations<QCMutation> mutations, Map<Long,CMK>
cmidToCm, MutableLong cmid,
       Map<TKeyExtent,List<TConditionalMutation>> tmutations) {
 
     // TODO compress repeated iterator configurations
 
-    Set<Entry<KeyExtent,List<Mutation>>> es = mutations.getMutations().entrySet();
-    for (Entry<KeyExtent,List<Mutation>> entry : es) {
+    for (Entry<KeyExtent,List<QCMutation>> entry : mutations.getMutations().entrySet())
{
       TKeyExtent tke = entry.getKey().toThrift();
       ArrayList<TConditionalMutation> tcondMutaions = new ArrayList<TConditionalMutation>();
       
-      List<QCMutation> condMutations = (List<QCMutation>) (List<? extends
Mutation>) entry.getValue();
+      List<QCMutation> condMutations = entry.getValue();
       
       for (QCMutation cm : condMutations) {
         TMutation tm = cm.toThrift();
-        
-        
+
         List<TCondition> conditions = convertConditions(cm);
 
         cmidToCm.put(cmid.longValue(), new CMK(entry.getKey(), cm));
@@ -483,7 +475,7 @@ class ConditionalWriterImpl implements ConditionalWriter {
     if (testVis.getLength() == 0)
       return true;
     
-    Boolean b = (Boolean) cache.get(testVis);
+    Boolean b = cache.get(testVis);
     if (b != null)
       return b;
     

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b08663e9/core/src/main/java/org/apache/accumulo/core/client/impl/RootTabletLocator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/RootTabletLocator.java
b/core/src/main/java/org/apache/accumulo/core/client/impl/RootTabletLocator.java
index 18b2a27..88e5c3a 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/RootTabletLocator.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/RootTabletLocator.java
@@ -42,12 +42,12 @@ public class RootTabletLocator extends TabletLocator {
   }
   
   @Override
-  public void binMutations(List<Mutation> mutations, Map<String,TabletServerMutations>
binnedMutations, List<Mutation> failures, TCredentials credentials)
-      throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
+  public <T extends Mutation> void binMutations(List<T> mutations, Map<String,TabletServerMutations<T>>
binnedMutations, List<T> failures,
+      TCredentials credentials) throws AccumuloException, AccumuloSecurityException, TableNotFoundException
{
     String rootTabletLocation = instance.getRootTabletLocation();
     if (rootTabletLocation != null) {
-      TabletServerMutations tsm = new TabletServerMutations();
-      for (Mutation mutation : mutations) {
+      TabletServerMutations<T> tsm = new TabletServerMutations<T>();
+      for (T mutation : mutations) {
         tsm.addMutation(RootTable.EXTENT, mutation);
       }
       binnedMutations.put(rootTabletLocation, tsm);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b08663e9/core/src/main/java/org/apache/accumulo/core/client/impl/TabletLocator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/TabletLocator.java b/core/src/main/java/org/apache/accumulo/core/client/impl/TabletLocator.java
index de8e053..f9110b2 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/TabletLocator.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/TabletLocator.java
@@ -43,7 +43,7 @@ public abstract class TabletLocator {
   public abstract TabletLocation locateTablet(Text row, boolean skipRow, boolean retry, TCredentials
credentials) throws AccumuloException,
       AccumuloSecurityException, TableNotFoundException;
   
-  public abstract void binMutations(List<Mutation> mutations, Map<String,TabletServerMutations>
binnedMutations, List<Mutation> failures,
+  public abstract <T extends Mutation> void binMutations(List<T> mutations, Map<String,TabletServerMutations<T>>
binnedMutations, List<T> failures,
       TCredentials credentials) throws AccumuloException, AccumuloSecurityException, TableNotFoundException;
   
   public abstract List<Range> binRanges(List<Range> ranges, Map<String,Map<KeyExtent,List<Range>>>
binnedRanges, TCredentials credentials)
@@ -187,24 +187,24 @@ public abstract class TabletLocator {
     }
   }
   
-  public static class TabletServerMutations {
-    private Map<KeyExtent,List<Mutation>> mutations;
+  public static class TabletServerMutations<T extends Mutation> {
+    private Map<KeyExtent,List<T>> mutations;
     
     public TabletServerMutations() {
-      mutations = new HashMap<KeyExtent,List<Mutation>>();
+      mutations = new HashMap<KeyExtent,List<T>>();
     }
     
-    public void addMutation(KeyExtent ke, Mutation m) {
-      List<Mutation> mutList = mutations.get(ke);
+    public void addMutation(KeyExtent ke, T m) {
+      List<T> mutList = mutations.get(ke);
       if (mutList == null) {
-        mutList = new ArrayList<Mutation>();
+        mutList = new ArrayList<T>();
         mutations.put(ke, mutList);
       }
       
       mutList.add(m);
     }
     
-    public Map<KeyExtent,List<Mutation>> getMutations() {
+    public Map<KeyExtent,List<T>> getMutations() {
       return mutations;
     }
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b08663e9/core/src/main/java/org/apache/accumulo/core/client/impl/TabletLocatorImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/TabletLocatorImpl.java
b/core/src/main/java/org/apache/accumulo/core/client/impl/TabletLocatorImpl.java
index df5d66b..4b2e1d3 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/TabletLocatorImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/TabletLocatorImpl.java
@@ -113,14 +113,14 @@ public class TabletLocatorImpl extends TabletLocator {
   }
   
   @Override
-  public void binMutations(List<Mutation> mutations, Map<String,TabletServerMutations>
binnedMutations, List<Mutation> failures, TCredentials credentials)
-      throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
+  public <T extends Mutation> void binMutations(List<T> mutations, Map<String,TabletServerMutations<T>>
binnedMutations, List<T> failures,
+      TCredentials credentials) throws AccumuloException, AccumuloSecurityException, TableNotFoundException
{
     
     OpTimer opTimer = null;
     if (log.isTraceEnabled())
       opTimer = new OpTimer(log, Level.TRACE).start("Binning " + mutations.size() + " mutations
for table " + tableId);
     
-    ArrayList<Mutation> notInCache = new ArrayList<Mutation>();
+    ArrayList<T> notInCache = new ArrayList<T>();
     Text row = new Text();
     
     rLock.lock();
@@ -133,7 +133,7 @@ public class TabletLocatorImpl extends TabletLocator {
       // For this to be efficient, need to avoid fine grained synchronization and fine grained
logging.
       // Therefore methods called by this are not synchronized and should not log.
       
-      for (Mutation mutation : mutations) {
+      for (T mutation : mutations) {
         row.set(mutation.getRow());
         TabletLocation tl = locateTabletInCache(row);
         if (tl == null)
@@ -157,7 +157,7 @@ public class TabletLocatorImpl extends TabletLocator {
       wLock.lock();
       try {
         boolean failed = false;
-        for (Mutation mutation : notInCache) {
+        for (T mutation : notInCache) {
           if (failed) {
             // when one table does not return a location, something is probably
             // screwy, go ahead and fail everything.
@@ -185,11 +185,11 @@ public class TabletLocatorImpl extends TabletLocator {
       opTimer.stop("Binned " + mutations.size() + " mutations for table " + tableId + " to
" + binnedMutations.size() + " tservers in %DURATION%");
   }
   
-  private void addMutation(Map<String,TabletServerMutations> binnedMutations, Mutation
mutation, TabletLocation tl) {
-    TabletServerMutations tsm = binnedMutations.get(tl.tablet_location);
+  private <T extends Mutation> void addMutation(Map<String,TabletServerMutations<T>>
binnedMutations, T mutation, TabletLocation tl) {
+    TabletServerMutations<T> tsm = binnedMutations.get(tl.tablet_location);
     
     if (tsm == null) {
-      tsm = new TabletServerMutations();
+      tsm = new TabletServerMutations<T>();
       binnedMutations.put(tl.tablet_location, tsm);
     }
     

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b08663e9/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchWriter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchWriter.java
b/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchWriter.java
index 40a9da4..12f5243 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchWriter.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchWriter.java
@@ -415,13 +415,13 @@ public class TabletServerBatchWriter {
     totalSendTime.addAndGet(time);
   }
   
-  public void updateBinningStats(int count, long time, Map<String,TabletServerMutations>
binnedMutations) {
+  public void updateBinningStats(int count, long time, Map<String,TabletServerMutations<Mutation>>
binnedMutations) {
     totalBinTime.addAndGet(time);
     totalBinned.addAndGet(count);
     updateBatchStats(binnedMutations);
   }
   
-  private synchronized void updateBatchStats(Map<String,TabletServerMutations> binnedMutations)
{
+  private synchronized void updateBatchStats(Map<String,TabletServerMutations<Mutation>>
binnedMutations) {
     tabletServersBatchSum += binnedMutations.size();
     
     minTabletServersBatch = Math.min(minTabletServersBatch, binnedMutations.size());
@@ -429,8 +429,8 @@ public class TabletServerBatchWriter {
     
     int numTablets = 0;
     
-    for (Entry<String,TabletServerMutations> entry : binnedMutations.entrySet()) {
-      TabletServerMutations tsm = entry.getValue();
+    for (Entry<String,TabletServerMutations<Mutation>> entry : binnedMutations.entrySet())
{
+      TabletServerMutations<Mutation> tsm = entry.getValue();
       numTablets += tsm.getMutations().size();
     }
     
@@ -577,7 +577,7 @@ public class TabletServerBatchWriter {
       init().addAll(failures);
     }
     
-    synchronized void add(String location, TabletServerMutations tsm) {
+    synchronized void add(String location, TabletServerMutations<Mutation> tsm) {
       init();
       for (Entry<KeyExtent,List<Mutation>> entry : tsm.getMutations().entrySet())
{
         recentFailures.addAll(entry.getKey().getTableId().toString(), entry.getValue());
@@ -617,12 +617,12 @@ public class TabletServerBatchWriter {
     
     private static final int MUTATION_BATCH_SIZE = 1 << 17;
     private ExecutorService sendThreadPool;
-    private Map<String,TabletServerMutations> serversMutations;
+    private Map<String,TabletServerMutations<Mutation>> serversMutations;
     private Set<String> queued;
     private Map<String,TabletLocator> locators;
     
     public MutationWriter(int numSendThreads) {
-      serversMutations = new HashMap<String,TabletServerMutations>();
+      serversMutations = new HashMap<String,TabletServerMutations<Mutation>>();
       queued = new HashSet<String>();
       sendThreadPool = new SimpleThreadPool(numSendThreads, this.getClass().getName());
       locators = new HashMap<String,TabletLocator>();
@@ -639,7 +639,7 @@ public class TabletServerBatchWriter {
       return ret;
     }
     
-    private void binMutations(MutationSet mutationsToProcess, Map<String,TabletServerMutations>
binnedMutations) {
+    private void binMutations(MutationSet mutationsToProcess, Map<String,TabletServerMutations<Mutation>>
binnedMutations) {
       try {
         Set<Entry<String,List<Mutation>>> es = mutationsToProcess.getMutations().entrySet();
         for (Entry<String,List<Mutation>> entry : es) {
@@ -687,7 +687,7 @@ public class TabletServerBatchWriter {
     }
     
     void addMutations(MutationSet mutationsToSend) {
-      Map<String,TabletServerMutations> binnedMutations = new HashMap<String,TabletServerMutations>();
+      Map<String,TabletServerMutations<Mutation>> binnedMutations = new HashMap<String,TabletServerMutations<Mutation>>();
       Span span = Trace.start("binMutations");
       try {
         long t1 = System.currentTimeMillis();
@@ -700,15 +700,15 @@ public class TabletServerBatchWriter {
       addMutations(binnedMutations);
     }
     
-    private synchronized void addMutations(Map<String,TabletServerMutations> binnedMutations)
{
+    private synchronized void addMutations(Map<String,TabletServerMutations<Mutation>>
binnedMutations) {
       
       int count = 0;
       
       // merge mutations into existing mutations for a tablet server
-      for (Entry<String,TabletServerMutations> entry : binnedMutations.entrySet())
{
+      for (Entry<String,TabletServerMutations<Mutation>> entry : binnedMutations.entrySet())
{
         String server = entry.getKey();
         
-        TabletServerMutations currentMutations = serversMutations.get(server);
+        TabletServerMutations<Mutation> currentMutations = serversMutations.get(server);
         
         if (currentMutations == null) {
           serversMutations.put(server, entry.getValue());
@@ -740,8 +740,8 @@ public class TabletServerBatchWriter {
         }
     }
     
-    private synchronized TabletServerMutations getMutationsToSend(String server) {
-      TabletServerMutations tsmuts = serversMutations.remove(server);
+    private synchronized TabletServerMutations<Mutation> getMutationsToSend(String
server) {
+      TabletServerMutations<Mutation> tsmuts = serversMutations.remove(server);
       if (tsmuts == null)
         queued.remove(server);
       
@@ -759,7 +759,7 @@ public class TabletServerBatchWriter {
       @Override
       public void run() {
         try {
-          TabletServerMutations tsmuts = getMutationsToSend(location);
+          TabletServerMutations<Mutation> tsmuts = getMutationsToSend(location);
           
           while (tsmuts != null) {
             send(tsmuts);
@@ -772,7 +772,7 @@ public class TabletServerBatchWriter {
         }
       }
       
-      public void send(TabletServerMutations tsm) throws AccumuloServerException, AccumuloSecurityException
{
+      public void send(TabletServerMutations<Mutation> tsm) throws AccumuloServerException,
AccumuloSecurityException {
         
         MutationSet failures = null;
         

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b08663e9/core/src/main/java/org/apache/accumulo/core/client/impl/TimeoutTabletLocator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/TimeoutTabletLocator.java
b/core/src/main/java/org/apache/accumulo/core/client/impl/TimeoutTabletLocator.java
index 62518ec..e8cd678 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/TimeoutTabletLocator.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/TimeoutTabletLocator.java
@@ -76,8 +76,8 @@ public class TimeoutTabletLocator extends TabletLocator {
   }
   
   @Override
-  public void binMutations(List<Mutation> mutations, Map<String,TabletServerMutations>
binnedMutations, List<Mutation> failures, TCredentials credentials)
-      throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
+  public <T extends Mutation> void binMutations(List<T> mutations, Map<String,TabletServerMutations<T>>
binnedMutations, List<T> failures,
+      TCredentials credentials) throws AccumuloException, AccumuloSecurityException, TableNotFoundException
{
     try {
       locator.binMutations(mutations, binnedMutations, failures, credentials);
       

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b08663e9/core/src/main/java/org/apache/accumulo/core/client/mock/MockTabletLocator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/mock/MockTabletLocator.java
b/core/src/main/java/org/apache/accumulo/core/client/mock/MockTabletLocator.java
index aca3ba4..8d91d5d 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/mock/MockTabletLocator.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/mock/MockTabletLocator.java
@@ -40,10 +40,10 @@ public class MockTabletLocator extends TabletLocator {
   }
   
   @Override
-  public void binMutations(List<Mutation> mutations, Map<String,TabletServerMutations>
binnedMutations, List<Mutation> failures, TCredentials credentials) throws AccumuloException,
-      AccumuloSecurityException, TableNotFoundException {
-    TabletServerMutations tsm = new TabletServerMutations();
-    for (Mutation m : mutations)
+  public <T extends Mutation> void binMutations(List<T> mutations, Map<String,TabletServerMutations<T>>
binnedMutations, List<T> failures,
+      TCredentials credentials) throws AccumuloException, AccumuloSecurityException, TableNotFoundException
{
+    TabletServerMutations<T> tsm = new TabletServerMutations<T>();
+    for (T m : mutations)
       tsm.addMutation(new KeyExtent(), m);
     binnedMutations.put("", tsm);
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b08663e9/core/src/test/java/org/apache/accumulo/core/client/impl/TabletLocatorImplTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/client/impl/TabletLocatorImplTest.java
b/core/src/test/java/org/apache/accumulo/core/client/impl/TabletLocatorImplTest.java
index f160cb3..7b2a82b 100644
--- a/core/src/test/java/org/apache/accumulo/core/client/impl/TabletLocatorImplTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/client/impl/TabletLocatorImplTest.java
@@ -219,7 +219,7 @@ public class TabletLocatorImplTest extends TestCase {
   }
   
   private void runTest(TabletLocatorImpl metaCache, List<Mutation> ml, Map<String,Map<KeyExtent,List<String>>>
emb, String... efailures) throws Exception {
-    Map<String,TabletServerMutations> binnedMutations = new HashMap<String,TabletServerMutations>();
+    Map<String,TabletServerMutations<Mutation>> binnedMutations = new HashMap<String,TabletServerMutations<Mutation>>();
     List<Mutation> afailures = new ArrayList<Mutation>();
     metaCache.binMutations(ml, binnedMutations, afailures, credential);
     
@@ -239,11 +239,11 @@ public class TabletLocatorImplTest extends TestCase {
     
   }
   
-  private void verify(Map<String,Map<KeyExtent,List<String>>> expected,
Map<String,TabletServerMutations> actual) {
+  private void verify(Map<String,Map<KeyExtent,List<String>>> expected,
Map<String,TabletServerMutations<Mutation>> actual) {
     assertEquals(expected.keySet(), actual.keySet());
     
     for (String server : actual.keySet()) {
-      TabletServerMutations atb = actual.get(server);
+      TabletServerMutations<Mutation> atb = actual.get(server);
       Map<KeyExtent,List<String>> etb = expected.get(server);
       
       assertEquals(etb.keySet(), atb.getMutations().keySet());

http://git-wip-us.apache.org/repos/asf/accumulo/blob/b08663e9/server/src/test/java/org/apache/accumulo/server/client/BulkImporterTest.java
----------------------------------------------------------------------
diff --git a/server/src/test/java/org/apache/accumulo/server/client/BulkImporterTest.java
b/server/src/test/java/org/apache/accumulo/server/client/BulkImporterTest.java
index 451a079..205cebc 100644
--- a/server/src/test/java/org/apache/accumulo/server/client/BulkImporterTest.java
+++ b/server/src/test/java/org/apache/accumulo/server/client/BulkImporterTest.java
@@ -23,8 +23,6 @@ import java.util.Map;
 import java.util.SortedSet;
 import java.util.TreeSet;
 
-import org.junit.Assert;
-
 import org.apache.accumulo.core.client.AccumuloException;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.TableNotFoundException;
@@ -44,6 +42,7 @@ import org.apache.commons.lang.NotImplementedException;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.io.Text;
+import org.junit.Assert;
 import org.junit.Test;
 
 public class BulkImporterTest {
@@ -67,8 +66,8 @@ public class BulkImporterTest {
     }
     
     @Override
-    public void binMutations(List<Mutation> mutations, Map<String,TabletServerMutations>
binnedMutations, List<Mutation> failures, TCredentials credentials) throws AccumuloException,
-        AccumuloSecurityException, TableNotFoundException {
+    public <T extends Mutation> void binMutations(List<T> mutations, Map<String,TabletServerMutations<T>>
binnedMutations, List<T> failures,
+        TCredentials credentials) throws AccumuloException, AccumuloSecurityException, TableNotFoundException
{
       throw new NotImplementedException();
     }
     


Mime
View raw message