Package org.apache.hadoop.hbase.mapreduce.SampleUploader

Examples of org.apache.hadoop.hbase.mapreduce.SampleUploader.Uploader


  @SuppressWarnings("unchecked")
  @Test
  public void testSampleUploader() throws Exception {

    Configuration configuration = new Configuration();
    Uploader uploader = new Uploader();
    Mapper<LongWritable, Text, ImmutableBytesWritable, Put>.Context ctx = mock(Context.class);
    doAnswer(new Answer<Void>() {

      @Override
      public Void answer(InvocationOnMock invocation) throws Throwable {
        ImmutableBytesWritable writer = (ImmutableBytesWritable) invocation.getArguments()[0];
        Put put = (Put) invocation.getArguments()[1];
        assertEquals("row", Bytes.toString(writer.get()));
        assertEquals("row", Bytes.toString(put.getRow()));
        return null;
      }
    }).when(ctx).write(any(ImmutableBytesWritable.class), any(Put.class));

    uploader.map(null, new Text("row,family,qualifier,value"), ctx);

    Path dir = util.getDataTestDirOnTestFS("testSampleUploader");

    String[] args = { dir.toString(), "simpleTable" };
    Job job = SampleUploader.configureJob(configuration, args);
View Full Code Here


  @SuppressWarnings("unchecked")
  @Test
  public void testSampleUploader() throws Exception {

    Configuration configuration = new Configuration();
    Uploader uploader = new Uploader();
    Mapper<LongWritable, Text, ImmutableBytesWritable, Put>.Context ctx = mock(Context.class);
    doAnswer(new Answer<Void>() {

      @Override
      public Void answer(InvocationOnMock invocation) throws Throwable {
        ImmutableBytesWritable writer = (ImmutableBytesWritable) invocation.getArguments()[0];
        Put put = (Put) invocation.getArguments()[1];
        assertEquals("row", Bytes.toString(writer.get()));
        assertEquals("row", Bytes.toString(put.getRow()));
        return null;
      }
    }).when(ctx).write(any(ImmutableBytesWritable.class), any(Put.class));

    uploader.map(null, new Text("row,family,qualifier,value"), ctx);

    Path dir = util.getDataTestDirOnTestFS("testSampleUploader");

    String[] args = { dir.toString(), "simpleTable" };
    Job job = SampleUploader.configureJob(configuration, args);
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.mapreduce.SampleUploader.Uploader

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.