Package org.apache.hadoop.mapred.lib

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


  @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))
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.IdentityReducer

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.