Examples of seek()


Examples of org.antlr.runtime.tree.TreeNodeStream.seek()

        TreeNodeStream stream = newStream(r0);
        stream.consume(); // consume 101
        stream.consume(); // consume DN
        stream.consume(); // consume 102
        stream.seek(7);   // seek to 107
        assertEquals(107, ((Tree)stream.LT(1)).getType());
        stream.consume(); // consume 107
        stream.consume(); // consume UP
        stream.consume(); // consume UP
        assertEquals(104, ((Tree)stream.LT(1)).getType());
View Full Code Here

Examples of org.antlr.v4.runtime.CharStream.seek()

  }

  @Test(expected = IllegalArgumentException.class)
  public void testNegativeSeek() {
    CharStream input = createStream("");
    input.seek(-1);
  }

  @Test
  public void testSeekPastEOF() {
    CharStream input = createStream("");
View Full Code Here

Examples of org.antlr.v4.runtime.TokenStream.seek()

    int alt = interp.adaptivePredict(input, decision, ParserRuleContext.EMPTY);

    assertEquals(expectedAlt, alt);

    // Check adaptive prediction
    input.seek(0);
    alt = interp.adaptivePredict(input, decision, null);
    assertEquals(expectedAlt, alt);
    // run 2x; first time creates DFA in atn
    input.seek(0);
    alt = interp.adaptivePredict(input, decision, null);
View Full Code Here

Examples of org.apache.accumulo.core.file.FileCFSkippingIterator.seek()

       
        if (include) {
          if (exclude) {
            // want a subset of what is in the locality group, therefore filtering is need
            FileCFSkippingIterator cfe = new FileCFSkippingIterator(lgr);
            cfe.seek(range, cfSet, inclusive);
            addSource(cfe);
          } else {
            // want everything in this locality group, therefore no filtering is needed
            lgr.seek(range, EMPTY_CF_SET, false);
            addSource(lgr);
View Full Code Here

Examples of org.apache.accumulo.core.file.FileSKVIterator.seek()

 
  @Override
  public FileSKVIterator openReader(String file, Range range, Set<ByteSequence> columnFamilies, boolean inclusive, FileSystem fs, Configuration conf,
      AccumuloConfiguration tableConf) throws IOException {
    FileSKVIterator iter = openReader(file, false, fs, conf, tableConf, null, null);
    iter.seek(range, columnFamilies, inclusive);
    return iter;
  }
 
  @Override
  public FileSKVIterator openReader(String file, Range range, Set<ByteSequence> columnFamilies, boolean inclusive, FileSystem fs, Configuration conf,
View Full Code Here

Examples of org.apache.accumulo.core.file.rfile.RFile.Reader.seek()

      iter.printInfo();
      System.out.println();
      org.apache.accumulo.core.file.rfile.bcfile.PrintInfo.main(new String[] {arg});
     
      if (opts.histogram || opts.dump) {
        iter.seek(new Range((Key) null, (Key) null), new ArrayList<ByteSequence>(), false);
        while (iter.hasTop()) {
          Key key = iter.getTopKey();
          Value value = iter.getTopValue();
          if (opts.dump)
            System.out.println(key + " -> " + value);
View Full Code Here

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

   
    assertFalse(ai.hasTop());
   
    // try seeking
   
    ai.seek(nr(1, 1, 1, 2), EMPTY_COL_FAMS, false);
   
    assertTrue(ai.hasTop());
    assertEquals(nk(1, 1, 1, 2), ai.getTopKey());
    assertEquals("3", ai.getTopValue().toString());
   
View Full Code Here

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

    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>();
View Full Code Here

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

    Combiner ai = new BigDecimalCombiner.BigDecimalSummingCombiner();
    IteratorSetting is = new IteratorSetting(1, BigDecimalCombiner.BigDecimalSummingCombiner.class);
    Combiner.setColumns(is, Collections.singletonList(new IteratorSetting.Column("cf001")));

    ai.init(new SortedMapIterator(tm1), is.getOptions(), null);
    ai.seek(new Range(), EMPTY_COL_FAMS, false);
   
    assertTrue(ai.hasTop());
    assertEquals(CombinerTest.nk(1, 1, 1, 3), ai.getTopKey());
    assertEquals(-9.7, encoder.decode(ai.getTopValue().get()).doubleValue(),delta);
   
View Full Code Here

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

    nkv(tm, "r000", 1, false, "v1");
   
    DeletingIterator it = new DeletingIterator(new SortedMapIterator(tm), false);
   
    // SEEK two keys before delete
    it.seek(nr("r000", 4), EMPTY_COL_FAMS, false);
   
    assertTrue(it.hasTop());
    assertEquals(nk("r000", 4), it.getTopKey());
    assertEquals("v4", it.getTopValue().toString());
   
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.