incubator-accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject svn commit: r1227273 - in /incubator/accumulo/trunk/src/core: ./ src/main/java/org/apache/accumulo/core/client/mock/MockTable.java src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java
Date Wed, 04 Jan 2012 19:27:47 GMT
Author: kturner
Date: Wed Jan  4 19:27:46 2012
New Revision: 1227273

URL: http://svn.apache.org/viewvc?rev=1227273&view=rev
Log:
ACCUMULO-218 made mock accumulo sort incoming mutations the same as accumulo (merged from
1.4)

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

Propchange: incubator/accumulo/trunk/src/core/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Wed Jan  4 19:27:46 2012
@@ -0,0 +1,3 @@
+/incubator/accumulo/branches/1.3.5rc/src/core:1209938
+/incubator/accumulo/branches/1.3/src/core:1190280,1190413,1190420,1190427,1190500,1195622,1195625,1195629,1195635,1196044,1196054,1196057,1196071-1196072,1196106,1197066,1198935,1199383,1203683,1204625,1205547,1205880,1206169,1208031,1209124,1209526,1209532,1209539,1209541,1209587,1209657,1210518,1210571,1210596,1210598,1213424,1214320,1225006,1227215
+/incubator/accumulo/branches/1.4/src/core:1201902-1227271

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java?rev=1227273&r1=1227272&r2=1227273&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java
(original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/client/mock/MockTable.java
Wed Jan  4 19:27:46 2012
@@ -69,9 +69,9 @@ public class MockTable {
       if (o instanceof MockMemKey) {
         MockMemKey other = (MockMemKey) o;
         if (count < other.count)
-          return -1;
-        if (count > other.count)
           return 1;
+        if (count > other.count)
+          return -1;
       } else {
         return 1;
       }

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=1227273&r1=1227272&r2=1227273&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
Wed Jan  4 19:27:46 2012
@@ -278,6 +278,7 @@ public class MockConnectorTest {
     assertEquals(value, next.getValue().toString());
   }
   
+  @Test
   public void testMockMultiTableBatchWriter() throws Exception {
     Connector c = new MockConnector("root");
     c.tableOperations().create("a");
@@ -299,6 +300,7 @@ public class MockConnectorTest {
       count++;
     }
     assertEquals(1, count);
+    count = 0;
     scanner = c.createScanner("b", Constants.NO_AUTHS);
     for (@SuppressWarnings("unused")
     Entry<Key,Value> entry : scanner) {
@@ -307,5 +309,27 @@ public class MockConnectorTest {
     assertEquals(1, count);
 
   }
+  
+  @Test
+  public void testUpdate() throws Exception {
+    Connector c = new MockConnector("root");
+    c.tableOperations().create("test");
+    BatchWriter bw = c.createBatchWriter("test", 1000, 1000l, 1);
+    
+    for (int i = 0; i < 10; i++) {
+      Mutation m = new Mutation("r1");
+      m.put("cf1", "cq1", "" + i);
+      bw.addMutation(m);
+    }
+    
+    bw.close();
+    
+    Scanner scanner = c.createScanner("test", Constants.NO_AUTHS);
+    
+    Entry<Key,Value> entry = scanner.iterator().next();
+    
+    assertEquals("9", entry.getValue().toString());
+
+  }
 
 }



Mime
View raw message