Package org.apache.accumulo.core.iterators

Examples of org.apache.accumulo.core.iterators.SortedMapIterator


    tm1.put(new Key("r1", "cf1", "cq1", Long.MAX_VALUE), new Value("v1".getBytes()));
    tm1.put(new Key("r1", "cf1", "cq1", 90l), new Value("v2".getBytes()));
    tm1.put(new Key("r1", "cf1", "cq1", 0l), new Value("v3".getBytes()));
    tm1.put(new Key("r2", "cf1", "cq1", 6l), new Value("v4".getBytes()));
   
    TimeSettingIterator tsi = new TimeSettingIterator(new SortedMapIterator(tm1), 50);
   
    tsi.seek(new Range(new Key("r1", "cf1", "cq1", 50l), true, new Key("r1", "cf1", "cq1", 50l), true), new HashSet<ByteSequence>(), false);
   
    assertTrue(tsi.hasTop());
    assertEquals(new Key("r1", "cf1", "cq1", 50l), tsi.getTopKey());
View Full Code Here


      throw new IllegalStateException("ranges not set");
    }

    IteratorChain chain = new IteratorChain();
    for (Range range : ranges) {
      SortedKeyValueIterator<Key,Value> i = new SortedMapIterator(table.table);
      try {
        i = new RangesFilter(createFilter(i), ranges);
        i.seek(range, createColumnBSS(fetchedColumns), !fetchedColumns.isEmpty());
        chain.addIterator(new IteratorAdapter(i));
      } catch (IOException e) {
        throw new RuntimeException(e);
      }
    }
View Full Code Here

 
  private static SortedKeyValueIterator<Key,Value> createScanIterator(KeyExtent ke, Collection<SortedKeyValueIterator<Key,Value>> mapfiles,
      Authorizations authorizations, byte[] defaultLabels, HashSet<Column> columnSet, List<IterInfo> ssiList, Map<String,Map<String,String>> ssio,
      boolean useTableIterators) throws IOException {
   
    SortedMapIterator smi = new SortedMapIterator(new TreeMap<Key,Value>());
   
    List<SortedKeyValueIterator<Key,Value>> iters = new ArrayList<SortedKeyValueIterator<Key,Value>>(mapfiles.size() + 1);
   
    iters.addAll(mapfiles);
    iters.add(smi);
View Full Code Here

    }
  }
 
  @Override
  public Iterator<Entry<Key,Value>> iterator() {
    SortedKeyValueIterator<Key,Value> i = new SortedMapIterator(table.table);
    try {
      i = new RangeFilter(createFilter(i), range);
      i.seek(range, createColumnBSS(fetchedColumns), !fetchedColumns.isEmpty());
      return new IteratorAdapter(i);
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
   
View Full Code Here

   
    public synchronized InterruptibleIterator skvIterator() {
      if (map == null)
        throw new IllegalStateException();
     
      return new SortedMapIterator(map);
    }
View Full Code Here

   
    try {
      VersioningIterator it = new VersioningIterator();
      IteratorSetting is = new IteratorSetting(1, VersioningIterator.class);
      VersioningIterator.setMaxVersions(is, 3);
      it.init(new SortedMapIterator(tm), is.getOptions(), null);
      it.seek(new Range(), EMPTY_COL_FAMS, false);
     
      TreeMap<Key,Value> tmOut = iteratorOverTestData(it);
     
      for (Entry<Key,Value> e : tmOut.entrySet()) {
View Full Code Here

   
    try {
      VersioningIterator it = new VersioningIterator();
      IteratorSetting is = new IteratorSetting(1, VersioningIterator.class);
      VersioningIterator.setMaxVersions(is, 3);
      it.init(new SortedMapIterator(tm), is.getOptions(), null);
     
      // after doing this seek, should only get two keys for row 1
      // since we are seeking to the middle of the most recent
      // three keys
      Key seekKey = new Key(new Text(String.format("%03d", 1)), colf, colq, 18);
View Full Code Here

   
    try {
      VersioningIterator it = new VersioningIterator();
      IteratorSetting is = new IteratorSetting(1, VersioningIterator.class);
      VersioningIterator.setMaxVersions(is, 3);
      it.init(new SortedMapIterator(tm), is.getOptions(), null);
     
      // after doing this seek, should get zero keys for row 1
      Key seekKey = new Key(new Text(String.format("%03d", 1)), colf, colq, 15);
      it.seek(new Range(seekKey, null), EMPTY_COL_FAMS, false);
     
View Full Code Here

    for (int i = 1; i <= 30; i++) {
      try {
        VersioningIterator it = new VersioningIterator();
        IteratorSetting is = new IteratorSetting(1, VersioningIterator.class);
        VersioningIterator.setMaxVersions(is, i);
        it.init(new SortedMapIterator(tm), is.getOptions(), null);
        it.seek(new Range(), EMPTY_COL_FAMS, false);
       
        TreeMap<Key,Value> tmOut = iteratorOverTestData(it);
       
        assertTrue("size after keeping " + i + " versions was " + tmOut.size(), tmOut.size() == Math.min(40, 2 * i));
 
View Full Code Here

    createTestData(tm, colf, colq);
   
    VersioningIterator it = new VersioningIterator();
    IteratorSetting is = new IteratorSetting(1, VersioningIterator.class);
    VersioningIterator.setMaxVersions(is, 3);
    it.init(new SortedMapIterator(tm), is.getOptions(), null);
   
    Key seekKey = new Key(new Text(String.format("%03d", 1)), colf, colq, 19);
    it.seek(new Range(seekKey, false, null, true), EMPTY_COL_FAMS, false);
   
    assertTrue(it.hasTop());
View Full Code Here

TOP

Related Classes of org.apache.accumulo.core.iterators.SortedMapIterator

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.