Package org.apache.accumulo.core.iterators

Examples of org.apache.accumulo.core.iterators.LargeRowFilter.seek()


    for (int i = 1; i <= 20; i++) {
      TreeMap<Key,Value> expectedData = new TreeMap<Key,Value>();
      genTestData(expectedData, i);
     
      LargeRowFilter lrfi = setupIterator(testData, i, IteratorScope.scan);
      lrfi.seek(new Range(), LocalityGroupUtil.EMPTY_CF_SET, false);
     
      TreeMap<Key,Value> filteredData = new TreeMap<Key,Value>();
     
      while (lrfi.hasTop()) {
        filteredData.put(lrfi.getTopKey(), lrfi.getTopValue());
View Full Code Here


     
      TreeMap<Key,Value> filteredData = new TreeMap<Key,Value>();
     
      // seek to each row... rows that exceed max columns should be filtered
      for (int j = 1; j <= i; j++) {
        lrfi.seek(new Range(genRow(j), genRow(j)), LocalityGroupUtil.EMPTY_CF_SET, false);
       
        while (lrfi.hasTop()) {
          assertEquals(genRow(j), lrfi.getTopKey().getRow().toString());
          filteredData.put(lrfi.getTopKey(), lrfi.getTopValue());
          lrfi.next();
View Full Code Here

    genTestData(testData, 20);
   
    LargeRowFilter lrfi = setupIterator(testData, 13, IteratorScope.scan);
   
    // test seeking to the middle of a row
    lrfi.seek(new Range(new Key(genRow(15), "cf001", genCQ(4), 5), true, new Key(genRow(15)).followingKey(PartialKey.ROW), false),
        LocalityGroupUtil.EMPTY_CF_SET, false);
    assertFalse(lrfi.hasTop());
   
    lrfi.seek(new Range(new Key(genRow(10), "cf001", genCQ(4), 5), true, new Key(genRow(10)).followingKey(PartialKey.ROW), false),
        LocalityGroupUtil.EMPTY_CF_SET, false);
View Full Code Here

    // test seeking to the middle of a row
    lrfi.seek(new Range(new Key(genRow(15), "cf001", genCQ(4), 5), true, new Key(genRow(15)).followingKey(PartialKey.ROW), false),
        LocalityGroupUtil.EMPTY_CF_SET, false);
    assertFalse(lrfi.hasTop());
   
    lrfi.seek(new Range(new Key(genRow(10), "cf001", genCQ(4), 5), true, new Key(genRow(10)).followingKey(PartialKey.ROW), false),
        LocalityGroupUtil.EMPTY_CF_SET, false);
    TreeMap<Key,Value> expectedData = new TreeMap<Key,Value>();
    genRow(expectedData, 10, 4, 10);
   
    TreeMap<Key,Value> filteredData = new TreeMap<Key,Value>();
View Full Code Here

    TreeMap<Key,Value> testData = new TreeMap<Key,Value>();
   
    genTestData(testData, 20);
   
    LargeRowFilter lrfi = setupIterator(testData, 13, IteratorScope.majc);
    lrfi.seek(new Range(), LocalityGroupUtil.EMPTY_CF_SET, false);
   
    TreeMap<Key,Value> compactedData = new TreeMap<Key,Value>();
    while (lrfi.hasTop()) {
      compactedData.put(lrfi.getTopKey(), lrfi.getTopValue());
      lrfi.next();
View Full Code Here

   
    // scanning over data w/ higher max columns should not change behavior
    // because there are suppression markers.. if there was a bug and data
    // was not suppressed, increasing the threshold would expose the bug
    lrfi = setupIterator(compactedData, 20, IteratorScope.scan);
    lrfi.seek(new Range(), LocalityGroupUtil.EMPTY_CF_SET, false);
   
    // only expect to see 13 rows
    TreeMap<Key,Value> expectedData = new TreeMap<Key,Value>();
    genTestData(expectedData, 13);
   
View Full Code Here

   
    assertEquals(expectedData.size() + 8, compactedData.size());
    assertEquals(expectedData, filteredData);
   
    // try seeking to the middle of row 15... row has data and suppression marker... this seeks past the marker but before the column
    lrfi.seek(new Range(new Key(genRow(15), "cf001", genCQ(4), 5), true, new Key(genRow(15)).followingKey(PartialKey.ROW), false),
        LocalityGroupUtil.EMPTY_CF_SET, false);
    assertFalse(lrfi.hasTop());
   
    // test seeking w/ column families
    HashSet<ByteSequence> colfams = new HashSet<ByteSequence>();
View Full Code Here

    assertFalse(lrfi.hasTop());
   
    // test seeking w/ column families
    HashSet<ByteSequence> colfams = new HashSet<ByteSequence>();
    colfams.add(new ArrayByteSequence("cf001"));
    lrfi.seek(new Range(new Key(genRow(15), "cf001", genCQ(4), 5), true, new Key(genRow(15)).followingKey(PartialKey.ROW), false), colfams, true);
    assertFalse(lrfi.hasTop());
  }
 
  // in other test data is generated in such a way that once a row
  // is suppressed, all subsequent rows are suppressed
View Full Code Here

    TreeMap<Key,Value> expectedData = new TreeMap<Key,Value>();
    genRow(expectedData, 1, 0, 2);
    genRow(expectedData, 4, 0, 5);
   
    LargeRowFilter lrfi = setupIterator(testData, 13, IteratorScope.scan);
    lrfi.seek(new Range(), LocalityGroupUtil.EMPTY_CF_SET, false);
   
    TreeMap<Key,Value> filteredData = new TreeMap<Key,Value>();
    while (lrfi.hasTop()) {
      filteredData.put(lrfi.getTopKey(), lrfi.getTopValue());
      lrfi.next();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.