accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r1469530 - in /accumulo/branches/1.5: core/src/main/java/org/apache/accumulo/core/client/mock/ proxy/src/test/java/org/apache/accumulo/proxy/
Date Thu, 18 Apr 2013 19:18:01 GMT
Author: vines
Date: Thu Apr 18 19:17:54 2013
New Revision: 1469530

URL: http://svn.apache.org/r1469530
Log:
ACCUMULO-1306 - Mock merging


Modified:
    accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/mock/MockAccumulo.java
    accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java
    accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/mock/MockTableOperations.java
    accumulo/branches/1.5/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyTableOperations.java

Modified: accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/mock/MockAccumulo.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/mock/MockAccumulo.java?rev=1469530&r1=1469529&r2=1469530&view=diff
==============================================================================
--- accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/mock/MockAccumulo.java
(original)
+++ accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/mock/MockAccumulo.java
Thu Apr 18 19:17:54 2013
@@ -88,4 +88,8 @@ public class MockAccumulo {
   public Collection<Text> getSplits(String tableName) {
     return tables.get(tableName).getSplits();
   }
+
+  public void merge(String tableName, Text start, Text end) {
+    tables.get(tableName).merge(start, end);
+  }  
 }

Modified: accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java?rev=1469530&r1=1469529&r2=1469530&view=diff
==============================================================================
--- accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java
(original)
+++ accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java
Thu Apr 18 19:17:54 2013
@@ -132,4 +132,13 @@ public class MockTable {
   public Map<String,Set<Text>> getLocalityGroups() {
     return localityGroups;
   }
+  
+  public void merge(Text start, Text end) {
+    boolean reAdd = false;
+    if (splits.contains(start))
+      reAdd = true;
+    splits.removeAll(splits.subSet(start, end));
+    if (reAdd)
+      splits.add(start);
+  }
 }

Modified: accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/mock/MockTableOperations.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/mock/MockTableOperations.java?rev=1469530&r1=1469529&r2=1469530&view=diff
==============================================================================
--- accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/mock/MockTableOperations.java
(original)
+++ accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/mock/MockTableOperations.java
Thu Apr 18 19:17:54 2013
@@ -303,6 +303,7 @@ public class MockTableOperations extends
   public void merge(String tableName, Text start, Text end) throws AccumuloException, AccumuloSecurityException,
TableNotFoundException {
     if (!exists(tableName))
       throw new TableNotFoundException(tableName, tableName, "");
+    acu.merge(tableName, start, end);
   }
   
   @Override

Modified: accumulo/branches/1.5/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyTableOperations.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyTableOperations.java?rev=1469530&r1=1469529&r2=1469530&view=diff
==============================================================================
--- accumulo/branches/1.5/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyTableOperations.java
(original)
+++ accumulo/branches/1.5/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyTableOperations.java
Thu Apr 18 19:17:54 2013
@@ -112,8 +112,7 @@ public class TestProxyTableOperations {
   }
   
   // This test does not yet function because the backing Mock instance does not yet support
merging
-  // TODO: add back in as a test when Mock is improved - ACCUMULO-1306
-  // @Test
+  @Test
   public void merge() throws TException {
     Set<ByteBuffer> splits = new HashSet<ByteBuffer>();
     splits.add(ByteBuffer.wrap("a".getBytes()));



Mime
View raw message