Package fm.last.darling.hbase

Examples of fm.last.darling.hbase.HBaseJSONOutputReader


  @Test
  public void test() throws IOException {
    PipeReducer pipeReducer = new MockPipeReducer();
    pipeReducer.configure(new JobConf());

    HBaseJSONOutputReader outputReader = new HBaseJSONOutputReader();
    outputReader.initialize(pipeReducer);

    assertTrue(outputReader.readKeyValue());

    //first key value
    ImmutableBytesWritable expectedKey1 = new ImmutableBytesWritable(keyString1.getBytes("UTF-8"));
    assertEquals(expectedKey1, outputReader.getCurrentKey());
   
    BatchUpdate expectedValue1 = new BatchUpdate(keyString1);
    expectedValue1.put(column1, new byte[] {49, 57});
    assertEquals(0, expectedValue1.compareTo(outputReader.getCurrentValue())); //no equals

   
    assertTrue(outputReader.readKeyValue());
   
    //second one
    ImmutableBytesWritable expectedKey2 = new ImmutableBytesWritable(keyString2.getBytes("UTF-8"));
    assertEquals(expectedKey2, outputReader.getCurrentKey());
   
    BatchUpdate expectedValue2 = new BatchUpdate(keyString2);
    expectedValue2.put(column2, new byte[] {49, 57});
    assertEquals(0, expectedValue2.compareTo(outputReader.getCurrentValue())); //no equals

   
    assertFalse(outputReader.readKeyValue());
  }
View Full Code Here

TOP

Related Classes of fm.last.darling.hbase.HBaseJSONOutputReader

Copyright © 2018 www.massapicom. 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.