Package org.apache.hadoop.mrunit.mock

Examples of org.apache.hadoop.mrunit.mock.MockReporter


  @Override
  public List<Pair<K2, V2>> run() throws IOException {
    MockOutputCollector<K2, V2> outputCollector =
        new MockOutputCollector<K2, V2>(getConfiguration());
    MockReporter reporter = new MockReporter(MockReporter.ReporterType.Mapper, getCounters());

    if (myMapper instanceof Configurable) {
      ((Configurable)myMapper).setConf(getConfiguration());
    }
View Full Code Here


  @Override
  public List<Pair<K2, V2>> run() throws IOException {
    MockOutputCollector<K2, V2> outputCollector =
        new MockOutputCollector<K2, V2>(getConfiguration());
    MockReporter reporter = new MockReporter(MockReporter.ReporterType.Reducer, getCounters());

    myReducer.reduce(inputKey, inputValues.iterator(), outputCollector,
            reporter);

    List<Pair<K2, V2>> outputs = outputCollector.getOutputs();
View Full Code Here

      throw new IllegalStateException("No Mapper class was provided");
    }

    final MockOutputCollector<K2, V2> outputCollector = new MockOutputCollector<K2, V2>(
        getConfiguration());
    final MockReporter reporter = new MockReporter(
        MockReporter.ReporterType.Mapper, getCounters());

    if (myMapper instanceof Configurable) {
      ((Configurable) myMapper).setConf(getConfiguration());
    }
View Full Code Here

      throw new IllegalStateException("No Reducer class was provided");
    }

    final MockOutputCollector<K2, V2> outputCollector = new MockOutputCollector<K2, V2>(
        getConfiguration());
    final MockReporter reporter = new MockReporter(
        MockReporter.ReporterType.Reducer, getCounters());

    myReducer.configure(new JobConf(getConfiguration()));
    myReducer.reduce(inputKey, getInputValues().iterator(), outputCollector,
        reporter);
View Full Code Here

  @Override
  public List<Pair<K2, V2>> run() throws IOException {
    MockOutputCollector<K2, V2> outputCollector =
        new MockOutputCollector<K2, V2>(getConfiguration());
    MockReporter reporter = new MockReporter(MockReporter.ReporterType.Mapper, getCounters());

    if (myMapper instanceof Configurable) {
      ((Configurable)myMapper).setConf(getConfiguration());
    }
    myMapper.configure(new JobConf(getConfiguration()));   
View Full Code Here

  @Override
  public List<Pair<K2, V2>> run() throws IOException {
    MockOutputCollector<K2, V2> outputCollector =
        new MockOutputCollector<K2, V2>(getConfiguration());
    MockReporter reporter = new MockReporter(MockReporter.ReporterType.Reducer, getCounters());

    myReducer.configure(new JobConf(getConfiguration()));   
    myReducer.reduce(inputKey, getInputValues().iterator(), outputCollector,
            reporter);
    myReducer.close();
View Full Code Here

  @Override
  public List<Pair<K2, V2>> run() throws IOException {
    MockOutputCollector<K2, V2> outputCollector =
      new MockOutputCollector<K2, V2>();
    MockReporter reporter = new MockReporter(MockReporter.ReporterType.Reducer, getCounters());

    myReducer.reduce(inputKey, inputValues.iterator(), outputCollector,
            reporter);

    List<Pair<K2, V2>> outputs = outputCollector.getOutputs();
View Full Code Here

  @Override
  public List<Pair<K2, V2>> run() throws IOException {
    MockOutputCollector<K2, V2> outputCollector =
      new MockOutputCollector<K2, V2>();
    MockReporter reporter = new MockReporter(MockReporter.ReporterType.Mapper, getCounters());

    myMapper.map(inputKey, inputVal, outputCollector, reporter);

    return outputCollector.getOutputs();
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.mrunit.mock.MockReporter

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.