Examples of MockReporter


Examples of org.apache.hadoop.mrunit.internal.mapred.MockReporter

      preRunChecks(myMapper);
      initDistributedCache();
      final OutputCollectable<K2, V2> outputCollectable = mockOutputCreator
          .createMapredOutputCollectable(getConfiguration(),
              getOutputSerializationConfiguration());
      final MockReporter reporter = new MockReporter(
          MockReporter.ReporterType.Mapper, getCounters(),
          getMapInputPath());

      ReflectionUtils.setConf(myMapper, new JobConf(getConfiguration()));
View Full Code Here

Examples of org.apache.hadoop.mrunit.internal.mapred.MockReporter

      preRunChecks(myReducer);
      initDistributedCache();
      final OutputCollectable<K2, V2> outputCollectable = mockOutputCreator
          .createMapredOutputCollectable(getConfiguration(),
              getOutputSerializationConfiguration());
      final MockReporter reporter = new MockReporter(
          MockReporter.ReporterType.Reducer, getCounters());

      ReflectionUtils.setConf(myReducer, new JobConf(getConfiguration()));

      for (Pair<K1, List<V1>> kv : inputs) {
View Full Code Here

Examples of org.apache.hadoop.mrunit.internal.mapred.MockReporter

  public final ExpectedSuppliedException thrown = ExpectedSuppliedException
      .none();

  @Test
  public void testGetInputSplitForMapper() {
    final InputSplit split = new MockReporter(MockReporter.ReporterType.Mapper,
        null, new Path("/")).getInputSplit();
    assertTrue(null != split);
  }
View Full Code Here

Examples of org.apache.hadoop.mrunit.internal.mapred.MockReporter

  // if the reducer tries to grab the input split.
  @Test
  public void testGetInputSplitForReducer() {
    thrown.expectMessage(UnsupportedOperationException.class,
        "Reducer cannot call getInputSplit()");
    new MockReporter(MockReporter.ReporterType.Reducer, null, null).getInputSplit();
  }
View Full Code Here

Examples of org.apache.hadoop.mrunit.internal.mapred.MockReporter

      preRunChecks(myMapper);
      initDistributedCache();
      final OutputCollectable<K2, V2> outputCollectable = mockOutputCreator
          .createMapredOutputCollectable(getConfiguration(),
              getOutputSerializationConfiguration());
      final MockReporter reporter = new MockReporter(
          MockReporter.ReporterType.Mapper, getCounters(),
          getMapInputPath());

      ReflectionUtils.setConf(myMapper, new JobConf(getConfiguration()));
View Full Code Here

Examples of org.apache.hadoop.mrunit.internal.mapred.MockReporter

      preRunChecks(myReducer);
      initDistributedCache();
      final OutputCollectable<K2, V2> outputCollectable = mockOutputCreator
          .createMapredOutputCollectable(getConfiguration(),
              getOutputSerializationConfiguration());
      final MockReporter reporter = new MockReporter(
          MockReporter.ReporterType.Reducer, getCounters());

      ReflectionUtils.setConf(myReducer, new JobConf(getConfiguration()));

      for (Pair<K1, List<V1>> kv : inputs) {
View Full Code Here

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

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.Reducer, getCounters());

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

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

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

      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

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

      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
TOP
Copyright © 2018 www.massapi.com. 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.