incubator-accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1190429 - in /incubator/accumulo/trunk: ./ src/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java
Date Fri, 28 Oct 2011 16:29:54 GMT
Author: ecn
Date: Fri Oct 28 16:29:54 2011
New Revision: 1190429

URL: http://svn.apache.org/viewvc?rev=1190429&view=rev
Log:
ACCUMULO-95: merge from trunk

Modified:
    incubator/accumulo/trunk/   (props changed)
    incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java

Propchange: incubator/accumulo/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Oct 28 16:29:54 2011
@@ -1 +1 @@
-/incubator/accumulo/branches/1.3:1190280,1190413,1190420
+/incubator/accumulo/branches/1.3:1190280,1190413,1190420,1190427

Modified: incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java?rev=1190429&r1=1190428&r2=1190429&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java
(original)
+++ incubator/accumulo/trunk/src/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java
Fri Oct 28 16:29:54 2011
@@ -31,6 +31,7 @@ import org.apache.accumulo.core.client.B
 import org.apache.accumulo.core.client.BatchWriter;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.IteratorSetting;
+import org.apache.accumulo.core.client.MultiTableBatchWriter;
 import org.apache.accumulo.core.client.Scanner;
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.Mutation;
@@ -268,4 +269,34 @@ public class MockConnectorTest {
     assertEquals(value, next.getValue().toString());
   }
   
+  public void testMockMultiTableBatchWriter() throws Exception {
+    Connector c = new MockConnector("root");
+    c.tableOperations().create("a");
+    c.tableOperations().create("b");
+    MultiTableBatchWriter bw = c.createMultiTableBatchWriter(10000L, 1000L, 4);
+    Mutation m1 = new Mutation("r1");
+    m1.put("cf1", "cq1", 1, "v1");
+    BatchWriter b = bw.getBatchWriter("a");
+    b.addMutation(m1);
+    b.flush();
+    b = bw.getBatchWriter("b");
+    b.addMutation(m1);
+    b.flush();
+    
+    Scanner scanner = c.createScanner("a", Constants.NO_AUTHS);
+    int count = 0;
+    for (@SuppressWarnings("unused")
+    Entry<Key,Value> entry : scanner) {
+      count++;
+    }
+    assertEquals(1, count);
+    scanner = c.createScanner("b", Constants.NO_AUTHS);
+    for (@SuppressWarnings("unused")
+    Entry<Key,Value> entry : scanner) {
+      count++;
+    }
+    assertEquals(1, count);
+
+  }
+
 }



Mime
View raw message