Package org.apache.hadoop.zebra.io

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


    Assert.assertEquals(key, new BytesWritable("k11".getBytes()));
    scanner.getValue(RowValue);
    Assert.assertEquals("hello world 1", RowValue.get(0));
    Assert.assertEquals(true, RowValue.get(1));

    scanner.advance();

    scanner.getKey(key);
    Assert.assertEquals(key, new BytesWritable("k12".getBytes()));
    scanner.getValue(RowValue);
    Assert.assertEquals("hello world 2", RowValue.get(0));
View Full Code Here


    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(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();
    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

    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();
    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

    scanner.getValue(RowValue);
    Assert.assertEquals(false, RowValue.isNull());
    Assert.assertEquals(null, RowValue.get(0));
    Assert.assertEquals(1, RowValue.size());

    scanner.advance();
    scanner.getKey(key);
    Assert.assertEquals(key, new BytesWritable("k12".getBytes()));
    scanner.getValue(RowValue);
    Assert.assertEquals(false, RowValue.isNull());
    Assert.assertEquals(null, RowValue.get(0));
View Full Code Here

    scanner.getValue(RowValue);
    Assert.assertEquals(1, RowValue.get(0));
    Long expected = 1001L;
    Assert.assertEquals(expected, RowValue.get(1));

    scanner.advance();
    scanner.getKey(key);
    Assert.assertEquals(key, new BytesWritable("k12".getBytes()));
    scanner.getValue(RowValue);
    Assert.assertEquals(2, RowValue.get(0));
    expected = 1002L;
View Full Code Here

    scanner.getValue(RowValue);
    Assert.assertEquals(1, ((Map) (RowValue.get(0))).get("a"));
    Assert.assertEquals(2, ((Map) RowValue.get(0)).get("b"));
    Assert.assertEquals(1.3F, ((Map<String, Float>) RowValue.get(1)).get("x"));

    scanner.advance();
    scanner.getKey(key);
    Assert.assertEquals(key, new BytesWritable("k12".getBytes()));
    scanner.getValue(RowValue);
    Assert.assertEquals(null, ((Map) RowValue.get(0)).get("a"));
    Assert.assertEquals(null, ((Map) RowValue.get(0)).get("b"));
View Full Code Here

    Assert.assertEquals(key, new BytesWritable("k11".getBytes()));
    scanner.getValue(RowValue);
    Assert.assertEquals(1, RowValue.get(0));
    Assert.assertEquals(1.3F, ((Map<String, Float>) RowValue.get(1)).get("x"));

    scanner.advance();

    scanner.getKey(key);
    Assert.assertEquals(key, new BytesWritable("k12".getBytes()));
    scanner.getValue(RowValue);
    Assert.assertEquals(2, RowValue.get(0));
View Full Code Here

    tmp = 2;
    Assert.assertEquals(tmp, f4.get("b"));
    tmp = 3;
    Assert.assertEquals(tmp, f4.get("c"));

    scanner.advance();

    scanner.getKey(key);
    Assert.assertEquals(key, new BytesWritable("k12".getBytes()));
    scanner.getValue(RowValue);
    Assert.assertEquals(2, ((Tuple) RowValue.get(0)).get(0));
View Full Code Here

    Assert.assertEquals(tmp, f4.get("b"));
    tmp = 3;
    Assert.assertEquals(tmp, f4.get("c"));
    Assert.assertEquals(null, f4.get("x"));

    scanner.advance();

    scanner.getKey(key);
    Assert.assertEquals(key, new BytesWritable("k12".getBytes()));
    scanner.getValue(RowValue);
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.