accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1397700 - /accumulo/branches/1.4/src/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormatTest.java
Date Fri, 12 Oct 2012 19:41:50 GMT
Author: ecn
Date: Fri Oct 12 19:41:50 2012
New Revision: 1397700

URL: http://svn.apache.org/viewvc?rev=1397700&view=rev
Log:
ACCUMULO-507 test the read/write of large numbers of ranges

Modified:
    accumulo/branches/1.4/src/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormatTest.java

Modified: accumulo/branches/1.4/src/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormatTest.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.4/src/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormatTest.java?rev=1397700&r1=1397699&r2=1397700&view=diff
==============================================================================
--- accumulo/branches/1.4/src/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormatTest.java
(original)
+++ accumulo/branches/1.4/src/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormatTest.java
Fri Oct 12 19:41:50 2012
@@ -20,6 +20,7 @@ import static org.junit.Assert.assertEqu
 import static org.junit.Assert.assertTrue;
 
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.List;
 
@@ -103,6 +104,24 @@ public class AccumuloInputFormatTest {
     String iterators = conf.get("AccumuloInputFormat.iterators");
     assertEquals("1:org.apache.accumulo.core.iterators.WholeRowIterator:WholeRow", iterators);
   }
+
+  static abstract class GetRanges<K, V> extends InputFormatBase<K,V> {
+    public static List<Range> getRanges(Configuration conf) throws IOException {
+      return InputFormatBase.getRanges(conf);
+    }
+  };
+
+  @Test
+  public void testSetRanges() throws IOException {
+    JobContext job = new JobContext(new Configuration(), new JobID());
+    List<Range> ranges = new ArrayList<Range>();
+    for (int i = 0; i < 100000; i++) {
+      ranges.add(new Range(new Text(String.format("%05x", i))));
+    }
+    AccumuloInputFormat.setRanges(job.getConfiguration(), ranges);
+    List<Range> ranges2 = GetRanges.getRanges(job.getConfiguration());
+    assertEquals(ranges, ranges2);
+  }
   
   @Test
   public void testAddIterator() {



Mime
View raw message