Package org.apache.accumulo.core.iterators

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


    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(new ColumnFamilySkippingIterator(smi));
   
    MultiIterator multiIter = new MultiIterator(iters, ke);
    DeletingIterator delIter = new DeletingIterator(multiIter, false);
   
    SystemScanIterator systemIter;
View Full Code Here


    put(tm1, "r1", "cf1", "cq1", 5, "v1");
    put(tm1, "r2", "", "cq1", 5, "v1");
    put(tm1, "r2", "cf1", "cq1", 5, "v1");
   
    RowDeletingIterator rdi = new RowDeletingIterator();
    rdi.init(new ColumnFamilySkippingIterator(new SortedMapIterator(tm1)), null, new TestIE(IteratorScope.scan, false));
   
    HashSet<ByteSequence> cols = new HashSet<ByteSequence>();
    cols.add(new ArrayByteSequence("cf1".getBytes()));
   
    rdi.seek(new Range(), cols, true);
View Full Code Here

  }
 
  public SortedKeyValueIterator<Key,Value> createFilter(SortedKeyValueIterator<Key,Value> inner) throws IOException {
    IteratorEnvironment iterEnv = null;
    byte[] defaultLabels = {};
    inner = new ColumnFamilySkippingIterator(new DeletingIterator(inner, false));
    SystemScanIterator systemIter = new SystemScanIterator(inner, auths, defaultLabels, columns);
    AccumuloConfiguration conf = new MockConfiguration(table.settings);
    SortedKeyValueIterator<Key,Value> result = IteratorUtil.loadIterators(IteratorScope.scan, systemIter, null, conf, ssiList, ssio, iterEnv);
    return result;
  }
View Full Code Here

  private LargeRowFilter setupIterator(TreeMap<Key,Value> testData, int maxColumns, IteratorScope scope) throws IOException {
    SortedMapIterator smi = new SortedMapIterator(testData);
    LargeRowFilter lrfi = new LargeRowFilter();
    HashMap<String,String> options = new HashMap<String,String>();
    options.put(LargeRowFilter.MAX_COLUMNS, "" + maxColumns);
    lrfi.init(new ColumnFamilySkippingIterator(smi), options, new RowDeletingIteratorTest.TestIE(scope, false));
    return lrfi;
  }
View Full Code Here

            .toString());
       
        FileOperations fileOps = FileOperations.getInstance();
        mfw = fileOps.openWriter(dirname, fs, conf, tableConf);
       
        DeletingIterator sourceItr = new DeletingIterator(new ColumnFamilySkippingIterator(map.skvIterator()), true);
       
        TabletIteratorEnvironment iterEnv = new TabletIteratorEnvironment(IteratorScope.minc, tableConf);
        SortedKeyValueIterator<Key,Value> fai = IteratorUtil.loadIterators(IteratorScope.minc, sourceItr, extent, tableConf, iterEnv);
        fai.seek(new Range(), LocalityGroupUtil.EMPTY_CF_SET, false);
       
View Full Code Here

      throw new IllegalStateException("Can not obtain iterator after map deleted");
   
    int mc = mutationCount.get();
    MemoryDataSource mds = new MemoryDataSource();
    SourceSwitchingIterator ssi = new SourceSwitchingIterator(new MemoryDataSource());
    MemoryIterator mi = new MemoryIterator(new ColumnFamilySkippingIterator(new PartialMutationSkippingIterator(ssi, mc)));
    mi.setSSI(ssi);
    mi.setMDS(mds);
    activeIters.add(mi);
    return mi;
  }
View Full Code Here

    put(tm1, "r2", "cf1", "cq1", 5, "v3");
    put(tm1, "r2", "cf2", "cq4", 5, "v4");
    put(tm1, "r2", "cf2", "cq5", 5, "v5");
    put(tm1, "r3", "cf3", "cq6", 5, "v6");
   
    ColumnFamilySkippingIterator cfi = new ColumnFamilySkippingIterator(new SortedMapIterator(tm1));
   
    cfi.seek(new Range(), EMPTY_SET, true);
    assertFalse(cfi.hasTop());
   
    cfi.seek(new Range(), EMPTY_SET, false);
    assertTrue(cfi.hasTop());
    TreeMap<Key,Value> tm2 = new TreeMap<Key,Value>();
    while (cfi.hasTop()) {
      tm2.put(cfi.getTopKey(), cfi.getTopValue());
      cfi.next();
    }
    assertEquals(tm1, tm2);
   
    HashSet<ByteSequence> colfams = new HashSet<ByteSequence>();
    colfams.add(new ArrayByteSequence("cf2"));
    cfi.seek(new Range(), colfams, true);
    aten(cfi, "r2", "cf2", "cq4", 5, "v4");
    aten(cfi, "r2", "cf2", "cq5", 5, "v5");
    assertFalse(cfi.hasTop());
   
    colfams.add(new ArrayByteSequence("cf3"));
    colfams.add(new ArrayByteSequence("cf4"));
    cfi.seek(new Range(), colfams, true);
    aten(cfi, "r2", "cf2", "cq4", 5, "v4");
    aten(cfi, "r2", "cf2", "cq5", 5, "v5");
    aten(cfi, "r3", "cf3", "cq6", 5, "v6");
    assertFalse(cfi.hasTop());
   
    cfi.seek(new Range(), colfams, false);
    aten(cfi, "r1", "cf1", "cq1", 5, "v1");
    aten(cfi, "r1", "cf1", "cq3", 5, "v2");
    aten(cfi, "r2", "cf1", "cq1", 5, "v3");
    assertFalse(cfi.hasTop());
   
  }
View Full Code Here

    HashSet<ByteSequence> allColfams = new HashSet<ByteSequence>();
    for (int cf = 0; cf < 1000; cf++) {
      allColfams.add(new ArrayByteSequence(String.format("%06d", cf)));
    }
   
    ColumnFamilySkippingIterator cfi = new ColumnFamilySkippingIterator(new SortedMapIterator(tm1));
    HashSet<ByteSequence> colfams = new HashSet<ByteSequence>();
   
    runTest(cfi, 30000, 0, allColfams, colfams);
   
    colfams.add(new ArrayByteSequence(String.format("%06d", 60)));
View Full Code Here

        }
      }
    }
   
    CountingIterator ci = new CountingIterator(new SortedMapIterator(tm1));
    ColumnFamilySkippingIterator cfi = new ColumnFamilySkippingIterator(ci);
    HashSet<ByteSequence> colfams = new HashSet<ByteSequence>();
    colfams.add(new ArrayByteSequence(String.format("%06d", 4)));
   
    Range range = new Range(nk(0, 4, 0, 6), true, nk(0, 400, 0, 6), true);
    cfi.seek(range, colfams, true);
   
    assertTrue(cfi.hasTop());
    assertEquals(nk(0, 4, 0, 6), cfi.getTopKey());
    cfi.next();
    assertFalse(cfi.hasTop());
   
    colfams.add(new ArrayByteSequence(String.format("%06d", 500)));
    cfi.seek(range, colfams, true);
   
    assertTrue(cfi.hasTop());
    assertEquals(nk(0, 4, 0, 6), cfi.getTopKey());
    cfi.next();
    assertFalse(cfi.hasTop());
   
    range = new Range(nk(0, 4, 0, 6), true, nk(1, 400, 0, 6), true);
    cfi.seek(range, colfams, true);
   
    assertTrue(cfi.hasTop());
    assertEquals(nk(0, 4, 0, 6), cfi.getTopKey());
    cfi.next();
    assertTrue(cfi.hasTop());
    assertEquals(nk(0, 500, 0, 6), cfi.getTopKey());
    cfi.next();
    assertTrue(cfi.hasTop());
    assertEquals(nk(1, 4, 0, 6), cfi.getTopKey());
    cfi.next();
    assertFalse(cfi.hasTop());
   
    // System.out.println(ci.getCount());
  }
View Full Code Here

TOP

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

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.