Package org.apache.accumulo.core.iterators.system

Examples of org.apache.accumulo.core.iterators.system.MultiIterator


   
    TreeMap<Key,Value> tm1 = new TreeMap<Key,Value>();
   
    List<SortedKeyValueIterator<Key,Value>> skvil = new ArrayList<SortedKeyValueIterator<Key,Value>>(1);
    skvil.add(new SortedMapIterator(tm1));
    MultiIterator mi = new MultiIterator(skvil, true);
   
    assertFalse(mi.hasTop());
   
    mi.seek(nrng(0, 6), EMPTY_COL_FAMS, false);
    assertFalse(mi.hasTop());
  }
View Full Code Here


    nkv(tm1, 4, 0, false, "2");
    nkv(tm1, 6, 0, false, "3");
   
    List<SortedKeyValueIterator<Key,Value>> skvil = new ArrayList<SortedKeyValueIterator<Key,Value>>(1);
    skvil.add(new SortedMapIterator(tm1));
    MultiIterator mi = new MultiIterator(skvil, true);
    mi.seek(new Range(null, true, nk(5, 9), false), EMPTY_COL_FAMS, false);
   
    assertTrue(mi.hasTop());
    assertTrue(mi.getTopKey().equals(nk(3, 0)));
    assertTrue(mi.getTopValue().toString().equals("1"));
    mi.next();
   
    assertTrue(mi.hasTop());
    assertTrue(mi.getTopKey().equals(nk(4, 0)));
    assertTrue(mi.getTopValue().toString().equals("2"));
    mi.next();
   
    assertFalse(mi.hasTop());
   
    mi.seek(new Range(nk(4, 10), true, nk(5, 9), false), EMPTY_COL_FAMS, false);
    assertTrue(mi.hasTop());
    assertTrue(mi.getTopKey().equals(nk(4, 0)));
    assertTrue(mi.getTopValue().toString().equals("2"));
    mi.next();
   
    assertFalse(mi.hasTop());
   
    mi.seek(new Range(nk(4, 10), true, nk(6, 0), false), EMPTY_COL_FAMS, false);
    assertTrue(mi.hasTop());
    assertTrue(mi.getTopKey().equals(nk(4, 0)));
    assertTrue(mi.getTopValue().toString().equals("2"));
    mi.next();
   
    assertFalse(mi.hasTop());
   
    mi.seek(new Range(nk(4, 10), true, nk(6, 0), true), EMPTY_COL_FAMS, false);
    assertTrue(mi.hasTop());
    assertTrue(mi.getTopKey().equals(nk(4, 0)));
    assertTrue(mi.getTopValue().toString().equals("2"));
    mi.next();
   
    assertTrue(mi.hasTop());
    assertTrue(mi.getTopKey().equals(nk(6, 0)));
    assertTrue(mi.getTopValue().toString().equals("3"));
    mi.next();
   
    assertFalse(mi.hasTop());
   
    mi.seek(new Range(nk(4, 0), true, nk(6, 0), false), EMPTY_COL_FAMS, false);
    assertTrue(mi.hasTop());
    assertTrue(mi.getTopKey().equals(nk(4, 0)));
    assertTrue(mi.getTopValue().toString().equals("2"));
    mi.next();
   
    assertFalse(mi.hasTop());
   
    mi.seek(new Range(nk(4, 0), false, nk(6, 0), false), EMPTY_COL_FAMS, false);
    assertFalse(mi.hasTop());
   
    mi.seek(new Range(nk(4, 0), false, nk(6, 0), true), EMPTY_COL_FAMS, false);
    assertTrue(mi.hasTop());
    assertTrue(mi.getTopKey().equals(nk(6, 0)));
    assertTrue(mi.getTopValue().toString().equals("3"));
    mi.next();
    assertFalse(mi.hasTop());
   
  }
View Full Code Here

   
    SortedMap<Key,Value> map = new TreeMap<Key,Value>();
    map.putAll(map1);
    map.putAll(map2);
   
    MultiIterator source = new MultiIterator(Collections.singletonList((SortedKeyValueIterator<Key,Value>) new SortedMapIterator(map)), new Range(null, true,
        new Text("row1"), true));
    WholeRowIterator iter = new WholeRowIterator(source);
   
    Range range = new Range(new Text("row1"), true, new Text("row2"), true);
    iter.seek(range, new ArrayList<ByteSequence>(), false);
View Full Code Here

      iters.addAll(memIters);
     
      for (SortedKeyValueIterator<Key,Value> skvi : iters)
        ((InterruptibleIterator) skvi).setInterruptFlag(interruptFlag);
     
      MultiIterator multiIter = new MultiIterator(iters, extent);
     
      TabletIteratorEnvironment iterEnv = new TabletIteratorEnvironment(IteratorScope.scan, acuTableConf, fileManager, files);
     
      DeletingIterator delIter = new DeletingIterator(multiIter, false);
     
View Full Code Here

     
      if (imm != null) {
        iters.add(imm.compactionIterator());
      }
     
      CountingIterator citr = new CountingIterator(new MultiIterator(iters, extent.toDataRange()));
      DeletingIterator delIter = new DeletingIterator(citr, propogateDeletes);
     
      // if(env.getIteratorScope() )
     
      TabletIteratorEnvironment iterEnv;
View Full Code Here

    for (String file : absFiles) {
      FileSKVIterator reader = FileOperations.getInstance().openReader(file, false, fs, conf, acuTableConf, null, null);
      readers.add(reader);
    }
   
    MultiIterator multiIter = new MultiIterator(readers, extent);
   
    OfflineIteratorEnvironment iterEnv = new OfflineIteratorEnvironment();
   
    DeletingIterator delIter = new DeletingIterator(multiIter, false);
   
View Full Code Here

    SortedKeyValueIterator<Key,Value> getTopLevelIterator(SortedKeyValueIterator<Key,Value> iter) {
      if (topLevelIterators.isEmpty())
        return iter;
      ArrayList<SortedKeyValueIterator<Key,Value>> allIters = new ArrayList<SortedKeyValueIterator<Key,Value>>(topLevelIterators);
      allIters.add(iter);
      return new MultiIterator(allIters, false);
    }
View Full Code Here

      iters.addAll(memIters);
     
      for (SortedKeyValueIterator<Key,Value> skvi : iters)
        ((InterruptibleIterator) skvi).setInterruptFlag(interruptFlag);
     
      MultiIterator multiIter = new MultiIterator(iters, extent);
     
      TabletIteratorEnvironment iterEnv = new TabletIteratorEnvironment(IteratorScope.scan, acuTableConf, fileManager, files);
     
      DeletingIterator delIter = new DeletingIterator(multiIter, false);
     
View Full Code Here

    List<SortedKeyValueIterator<Key,Value>> sources = new ArrayList<SortedKeyValueIterator<Key,Value>>(3);
    sources.add(new SortedMapIterator(tm1));
    sources.add(new SortedMapIterator(tm2));
    sources.add(new SortedMapIterator(tm3));
   
    MultiIterator mi = new MultiIterator(sources, true);
    ai.init(mi, is.getOptions(), null);
    ai.seek(new Range(), EMPTY_COL_FAMS, false);
   
    assertTrue(ai.hasTop());
    assertEquals(nk(1, 1, 1, 1), ai.getTopKey());
View Full Code Here

TOP

Related Classes of org.apache.accumulo.core.iterators.system.MultiIterator

Copyright © 2018 www.massapicom. 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.