Package org.apache.hadoop.mapred.lib

Examples of org.apache.hadoop.mapred.lib.IdentityMapper


  @Test
  public void testOutputFormatWithMismatchInOutputClasses() throws IOException {
    @SuppressWarnings({ "rawtypes", "unchecked" })
    final MapDriver<Text, Text, LongWritable, Text> driver = MapDriver
        .newMapDriver(new IdentityMapper());
    driver.withOutputFormat(TextOutputFormat.class, TextInputFormat.class);
    driver.withInput(new Text("a"), new Text("1"));
    driver.withOutput(new LongWritable(), new Text("a\t1"));
    driver.runTest();
  }
View Full Code Here


  @Test
  public void testOutputFormatWithMismatchInOutputClasses() throws IOException {
    @SuppressWarnings({ "rawtypes", "unchecked" })
    final MapDriver<Text, Text, LongWritable, Text> driver = MapDriver
        .newMapDriver(new IdentityMapper());
    driver.withOutputFormat(TextOutputFormat.class, TextInputFormat.class);
    driver.withInput(new Text("a"), new Text("1"));
    driver.withOutput(new LongWritable(), new Text("a\t1"));
    driver.runTest();
  }
View Full Code Here

  @Test
  public void testSingleIdentity() {
    // Test that an identity mapper and identity reducer work
    PipelineMapReduceDriver driver = new PipelineMapReduceDriver();
    driver.withMapReduce(new IdentityMapper(), new IdentityReducer())
          .withInput(new Text("foo"), new Text("bar"))
          .withOutput(new Text("foo"), new Text("bar"))
          .runTest();
  }
View Full Code Here

  @Test
  public void testMultipleIdentities() {
    // Test that a pipeline of identity mapper and reducers work
    PipelineMapReduceDriver driver = new PipelineMapReduceDriver();
    driver.withMapReduce(new IdentityMapper(), new IdentityReducer())
          .withMapReduce(new IdentityMapper(), new IdentityReducer())
          .withMapReduce(new IdentityMapper(), new IdentityReducer())
          .withInput(new Text("foo"), new Text("bar"))
          .withOutput(new Text("foo"), new Text("bar"))
          .runTest();
  }
View Full Code Here

  }

  @Test
  public void testSumAtEnd() {
    PipelineMapReduceDriver driver = new PipelineMapReduceDriver();
    driver.withMapReduce(new IdentityMapper(), new IdentityReducer())
          .withMapReduce(new IdentityMapper(), new IdentityReducer())
          .withMapReduce(new IdentityMapper(), new LongSumReducer())
          .withInput(new Text("foo"), new LongWritable(FOO_IN_A))
          .withInput(new Text("bar"), new LongWritable(BAR_IN))
          .withInput(new Text("foo"), new LongWritable(FOO_IN_B))
          .withOutput(new Text("bar"), new LongWritable(BAR_OUT))
          .withOutput(new Text("foo"), new LongWritable(FOO_OUT))
View Full Code Here

  }

  @Test
  public void testSumInMiddle() {
    PipelineMapReduceDriver driver = new PipelineMapReduceDriver();
    driver.withMapReduce(new IdentityMapper(), new IdentityReducer())
          .withMapReduce(new IdentityMapper(), new LongSumReducer())
          .withMapReduce(new IdentityMapper(), new IdentityReducer())
          .withInput(new Text("foo"), new LongWritable(FOO_IN_A))
          .withInput(new Text("bar"), new LongWritable(BAR_IN))
          .withInput(new Text("foo"), new LongWritable(FOO_IN_B))
          .withOutput(new Text("bar"), new LongWritable(BAR_OUT))
          .withOutput(new Text("foo"), new LongWritable(FOO_OUT))
View Full Code Here

TOP

Related Classes of org.apache.hadoop.mapred.lib.IdentityMapper

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.