Package org.apache.hadoop.zebra.io

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


    TypesUtils.resetTuple(row);
    scanner2.getValue(row);
    Assert.assertEquals("val2", row.get(0));

    // test advance
    scanner2.advance();
    BytesWritable key4 = new BytesWritable();
    scanner2.getKey(key4);
    Assert
        .assertTrue(key4.compareTo(new BytesWritable("key23".getBytes())) == 0);
    TypesUtils.resetTuple(row);
View Full Code Here


        scanner.getKey(key);
        String keyString = String
            .format("key%02d%02d", partIdx + 1, keyIdx + 1);
        Assert.assertTrue(new String(key.get()) + " != " + keyString, key
            .equals(new BytesWritable(keyString.getBytes())));
        scanner.advance();
      }
    }

    scanner.close();
    scanner = null;
View Full Code Here

      String val3 = String.format("col3_%02d%02d", count, nx + 1);
      Assert.assertEquals(val3, row.get(2));

      if (nx < count - 1) {
        scanner.advance();
      }
    }
    scanner.close();
    scanner = null;
    reader.close();
View Full Code Here

    String simpVal = String.format("smpcol%02d%02d", 1, 1);
    Assert.assertEquals(simpVal, row.get(3));

    // move to next row
    scanner.advance();
    scanner.getValue(row);

    simpVal = String.format("smpcol%02d%02d", 2, 1);
    Assert.assertEquals(simpVal, row.get(3));
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

    Assert.assertEquals(key, new BytesWritable("k11".getBytes()));
    scanner.getValue(RowValue);
    System.out.println("read1 : " + RowValue.toString());
    Assert.assertEquals("{a=A}", 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("{a=A2}", RowValue.get(0).toString());
View Full Code Here

    Assert.assertEquals(null, ((Map) ((Map) RowValue.get(0)).get("c")));

    System.out.println("rowValue.get)1): " + RowValue.get(1).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(null, ((Map) RowValue.get(0)).get("b"));
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

    Assert.assertEquals(key, new BytesWritable("k11".getBytes()));
    scanner.getValue(RowValue);
    System.out.println("read1 : " + RowValue.toString());
    Assert.assertEquals("{}", 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("{}", RowValue.get(0).toString());
View Full Code Here

    Assert.assertEquals(1, RowValue.get(4));
    Assert.assertEquals(1001L, RowValue.get(3));
    Assert.assertEquals(1.1, RowValue.get(2));
    Assert.assertEquals("hello world 1", RowValue.get(1));
    Assert.assertEquals("hello byte 1", RowValue.get(0).toString());
    scanner.advance();
    scanner.getKey(key);
    Assert.assertEquals(key, new BytesWritable("k12".getBytes()));
    scanner.getValue(RowValue);
    Assert.assertEquals(false, RowValue.get(5));
    Assert.assertEquals(2, RowValue.get(4));
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.