Examples of advance()


Examples of org.apache.hadoop.hbase.codec.Decoder.advance()

      length = in.readInt();
    }

    // read in all the key values
    kvs.ensureCapacity(length);
    for(int i=0; i< length && decoder.advance(); i++) {
      kvs.add(decoder.current());
    }

    //its a new style WAL, so we need replication scopes too
    if (versionOrLength == VERSION_2) {
View Full Code Here

Examples of org.apache.hadoop.hbase.codec.prefixtree.scanner.CellSearcher.advance()

    ByteBuffer result = ByteBuffer.wrap(keyValueBytesWithHeader);
    result.rewind();
    CellSearcher searcher = null;
    try {
      searcher = DecoderFactory.checkOut(sourceAsBuffer, includesMvccVersion);
      while (searcher.advance()) {
        KeyValue currentCell = KeyValueUtil.copyToNewKeyValue(searcher.current());
        // needs to be modified for DirectByteBuffers. no existing methods to
        // write VLongs to byte[]
        int offset = result.arrayOffset() + result.position();
        KeyValueUtil.appendToByteArray(currentCell, result.array(), offset);
View Full Code Here

Examples of org.apache.hadoop.io.file.tfile.TFile.Reader.Scanner.advance()

      byte[] vbuf = new byte[BUF_SIZE];
      int vlen = scanner.entry().getValueLength();
      scanner.entry().getValue(vbuf);
      Assert.assertEquals(new String(vbuf, 0, vlen), "valueZ");

      scanner.advance();

      // now try get value first
      vbuf = new byte[BUF_SIZE];
      vlen = scanner.entry().getValueLength();
      scanner.entry().getValue(vbuf);
View Full Code Here

Examples of org.apache.hadoop.zebra.io.TableScanner.advance()

    if (projection != null) {
      reader.setProjection(projection);
    }
    int totalRows = 0;
    TableScanner scanner = reader.getScanner(null, true);
    for (; !scanner.atEnd(); scanner.advance()) {
      ++totalRows;
    }
    scanner.close();
    return totalRows;
  }
View Full Code Here

Examples of org.apache.hadoop.zebra.tfile.TFile.Reader.Scanner.advance()

      key = new BytesWritable();
      value = new BytesWritable();
      while (!scanner.atEnd()) {
        scanner.entry().get(key, value);
        ++count;
        scanner.advance();
      }
      scanner.close();
      Assert.assertTrue(count > 0);
      rowCount += count;
    }
View Full Code Here

Examples of org.apache.james.mime4j.parser.EntityStateMachine.advance()

       
        EntityStateMachine p1 = entity.advance();
        assertNotNull(p1);
       
        assertEquals(EntityStates.T_START_BODYPART, p1.getState());
        p1.advance();
        assertEquals(EntityStates.T_START_HEADER, p1.getState());
        p1.advance();
        assertEquals(EntityStates.T_FIELD, p1.getState());
        assertEquals("Content-Type", p1.getFieldName());
        assertEquals(" text/plain; charset=US-ASCII", p1.getFieldValue());
View Full Code Here

Examples of org.apache.james.mime4j.parser.MimeEntity.advance()

        assertEquals(" Tue, 12 Feb 2008 17:34:09 +0000 (GMT)", entity.getFieldValue());
        entity.advance();
        assertEquals(EntityStates.T_FIELD, entity.getState());
        assertEquals("Subject", entity.getFieldName());
        assertEquals(" Mail", entity.getFieldValue());
        entity.advance();
        assertEquals(EntityStates.T_FIELD, entity.getState());
        assertEquals("Content-Type", entity.getFieldName());
        assertEquals(" text/plain", entity.getFieldValue());
        entity.advance();
        assertEquals(EntityStates.T_END_HEADER, entity.getState());
View Full Code Here

Examples of org.apache.lucene.index.DocsAndPositionsEnum.advance()

        de = postings[i] = termsEnum.docsAndPositions(null, null, DocsAndPositionsEnum.FLAG_OFFSETS);
        if (de == null) {
          // no positions available
          throw new IllegalArgumentException("field '" + field + "' was indexed without offsets, cannot highlight");
        }
        pDoc = de.advance(doc);
      } else {
        pDoc = de.docID();
        if (pDoc < doc) {
          pDoc = de.advance(doc);
        }
View Full Code Here

Examples of org.apache.lucene.index.DocsEnum.advance()

             
              @Override
              public int advance(int target) throws IOException {
                assertTrue("queryFirst: "+ queryFirst + " advanced: " + advanceCalled + " next: "+ nextCalled, advanceCalled || nextCalled ^ queryFirst)
                advanceCalled = true;
                return termDocsEnum.advance(target);
              }
             
              @Override
              public long cost() {
                return termDocsEnum.cost();
View Full Code Here

Examples of org.apache.lucene.search.DocIdSetIterator.advance()

              target = filterDocIdIterator.nextDoc();
            }
            else
            {
              // skip to the next possible docid
              target = filterDocIdIterator.advance(validator._nextTarget);
            }
          }
          else // doc > target
          {
            if(doc == DocIdSetIterator.NO_MORE_DOCS) break;
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.