Package org.apache.hadoop.zebra.io

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


    scanner.getValue(value);

    Assert.assertEquals(1001L, value.get(0));
    Assert.assertEquals(true, value.get(1));

    scanner.advance();
    scanner.getKey(key);
    Assert.assertEquals(key, new BytesWritable("k12".getBytes()));
    scanner.getValue(value);
    Assert.assertEquals(1002L, value.get(0));
    Assert.assertEquals(false, value.get(1));
View Full Code Here

      scanner.getValue(RowValue);
      System.out.println("read record or record:" + RowValue.toString());
      Assert.assertEquals(i + "_00", RowValue.get(0));
      Assert.assertEquals(i + "_01", RowValue.get(1));
      Assert.assertEquals(i + "_02", RowValue.get(2));
      scanner.advance();
    }
    for (int i = 0; i <= 9; i++) {
      scanner.getValue(RowValue);
      System.out.println("read record or record:" + RowValue.toString());
      Assert.assertEquals(i + "_10", RowValue.get(0));
View Full Code Here

      scanner.getValue(RowValue);
      System.out.println("read record or record:" + RowValue.toString());
      Assert.assertEquals(i + "_10", RowValue.get(0));
      Assert.assertEquals(i + "_11", RowValue.get(1));
      Assert.assertEquals(i + "_12", RowValue.get(2));
      scanner.advance();
    }

    reader.close();
  }
View Full Code Here

    Assert.assertEquals(key, new BytesWritable("k11".getBytes()));
    scanner.getValue(RowValue);
    System.out.println("read1 : " + RowValue.toString());
    Assert.assertEquals("{key51=key511}", RowValue.get(0).toString());

    scanner.advance();
    scanner.getKey(key);
    Assert.assertEquals(key, new BytesWritable("k12".getBytes()));
    scanner.getValue(RowValue);
    System.out.println(RowValue.get(0).toString());
    Assert.assertEquals("{key51=key512}", RowValue.get(0).toString());
View Full Code Here

    Assert.assertEquals(null, (((Map) RowValue.get(6)).get("ytestid")));
    Assert.assertEquals(null, ((Map) ((Map) RowValue.get(6)).get("x")));
    System.out.println("rowValue.get)1): " + RowValue.get(6).toString());
    // rowValue.get)1): {z=null, x={m311=311, m321=321, m331=331}}

    scanner.advance();

    scanner.getKey(key);
    Assert.assertEquals(key, new BytesWritable("k12".getBytes()));
    scanner.getValue(RowValue);
    Assert.assertEquals("key572", ((Map) RowValue.get(4)).get("key57"));
View Full Code Here

    scanner.getValue(RowValue);
    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();
    scanner.getValue(RowValue);
    System.out.println("read float in 2nd row: "+ RowValue.get(1).toString());
    System.out.println("done insert table");
 
    reader.close();
View Full Code Here

    if (s2dropped == true) {
      Assert.assertEquals(null, RowValue.get(1));
    } else {
      Assert.assertEquals("column2_1", RowValue.get(1));
    }
    scanner.advance();
    scanner.getKey(key);
    // Assert.assertEquals(key, new BytesWritable("k12".getBytes()));
    scanner.getValue(RowValue);
    if (s1dropped == true) {
      Assert.assertEquals(null, RowValue.get(0));
View Full Code Here

    scanner.getValue(RowValue);
    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();
    scanner.getValue(RowValue);
    System.out.println("read float in 2nd row: "+ RowValue.get(1).toString());
    System.out.println("done insert table");
 
    reader.close();
View Full Code Here

    scanner.getValue(RowValue);
    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();
    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

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.