Examples of atEnd()


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

    reader.setProjection("count");
    TableScanner scanner = reader.getScanner(null, true);
    Tuple tuple = TypesUtils.createTuple(Projection.toSchema(scanner
        .getProjection()));
    BytesWritable key = new BytesWritable();
    for (; !scanner.atEnd(); scanner.advance()) {
      scanner.getKey(key);
      scanner.getValue(tuple);
      int count = 0;
      try {
        count = (Integer) tuple.get(0);
View Full Code Here

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

    TableScanner scanner = reader.getScanner(null, true);
    BytesWritable key = new BytesWritable();
    Schema schema = Projection.toSchema(scanner.getProjection());
    int idxCount = schema.getColumnIndex("count");
    Tuple value = TypesUtils.createTuple(schema);
    for (; !scanner.atEnd(); scanner.advance()) {
      scanner.getKey(key);
      scanner.getValue(value);
      try {
        String word = new String(key.getBytes(), 0, key.getLength());
        int count = (Integer) value.get(idxCount);
View Full Code Here

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

  long countRows(Path tablePath) throws IOException, ParseException {
    BasicTable.Reader reader = new BasicTable.Reader(tablePath, conf);
    reader.setProjection("");
    long 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.io.TableScanner.atEnd()

    reader.setProjection("count");
    TableScanner scanner = reader.getScanner(null, true);
    Tuple tuple = TypesUtils.createTuple(Projection.toSchema(scanner
        .getProjection()));
    BytesWritable key = new BytesWritable();
    for (; !scanner.atEnd(); scanner.advance()) {
      scanner.getKey(key);
      scanner.getValue(tuple);
      int count = 0;
      try {
        count = (Integer) tuple.get(0);
View Full Code Here

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

    TableScanner scanner = reader.getScanner(null, true);
    BytesWritable key = new BytesWritable();
    Schema schema = Projection.toSchema(scanner.getProjection());
    int idxCount = schema.getColumnIndex("count");
    Tuple value = TypesUtils.createTuple(schema);
    for (; !scanner.atEnd(); scanner.advance()) {
      scanner.getKey(key);
      scanner.getValue(value);
      try {
        String word = new String(key.get(), 0, key.getSize());
        int count = (Integer) value.get(idxCount);
View Full Code Here

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

    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.io.TableScanner.atEnd()

    System.out.println("rowvalue size:"+RowValue.size());
    System.out.println("read a : " + RowValue.get(0).toString());
    System.out.println("read string: " + RowValue.get(1).toString());
 
    scanner.advance();
    if(!scanner.atEnd()) {
      scanner.getValue(RowValue);
      System.out.println("read float in 2nd row: "+ RowValue.get(1).toString());
      System.out.println("done insert table");
    }
 
View Full Code Here

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

    System.out.println("rowvalue size:"+RowValue.size());
    System.out.println("read a : " + RowValue.get(7).toString());
    System.out.println("read string: " + RowValue.get(6).toString());
  
    scanner.advance();
    if(!scanner.atEnd()) {
      scanner.getValue(RowValue);
      System.out.println("read float in 2nd row: "+ RowValue.get(6).toString());
      System.out.println("done insert table");
   
View Full Code Here

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

    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.atEnd()

    for (int i = 0; i < numSplit; ++i, offset += splitSize) {
      Scanner scanner = reader.createScannerByByteRange(offset, splitSize);
      int count = 0;
      key = new BytesWritable();
      value = new BytesWritable();
      while (!scanner.atEnd()) {
        scanner.entry().get(key, value);
        ++count;
        scanner.advance();
      }
      scanner.close();
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.