Package org.apache.hadoop.mrunit.mapreduce.mock

Examples of org.apache.hadoop.mrunit.mapreduce.mock.MockReduceContextWrapper


  public List<Pair<K2, V2>> run() throws IOException {
    List<Pair<K1, List<V1>>> inputs = new ArrayList<Pair<K1, List<V1>>>();
    inputs.add(new Pair<K1, List<V1>>(inputKey, inputValues));

    try {
      MockReduceContextWrapper<K1, V1, K2, V2> wrapper = new MockReduceContextWrapper();
      MockReduceContextWrapper<K1, V1, K2, V2>.MockReduceContext context =
          wrapper.getMockContext(configuration, inputs, getCounters());

      myReducer.run(context);
      return context.getOutputs();
    } catch (InterruptedException ie) {
      throw new IOException(ie);
View Full Code Here


  public List<Pair<K2, V2>> run() throws IOException {
    List<Pair<K1, List<V1>>> inputs = new ArrayList<Pair<K1, List<V1>>>();
    inputs.add(new Pair<K1, List<V1>>(inputKey, inputValues));

    try {
      MockReduceContextWrapper<K1, V1, K2, V2> wrapper = new MockReduceContextWrapper();
      MockReduceContextWrapper<K1, V1, K2, V2>.MockReduceContext context =
          wrapper.getMockContext(inputs, getCounters(), getConfiguration());

      myReducer.run(context);
      return context.getOutputs();
    } catch (InterruptedException ie) {
      throw new IOException(ie);
View Full Code Here

TOP

Related Classes of org.apache.hadoop.mrunit.mapreduce.mock.MockReduceContextWrapper

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.