예제 #1
0
  /** {@inheritDoc} */
  @Override
  protected void setup(Context ctx) throws IOException, InterruptedException {
    super.setup(ctx);

    wasSetUp = true;

    HadoopErrorSimulator.instance().onMapSetup();
  }
예제 #2
0
  /** {@inheritDoc} */
  @Override
  public void map(Object key, Text val, Context ctx) throws IOException, InterruptedException {
    assert wasConfigured : "Mapper should be configured";
    assert wasSetUp : "Mapper should be set up";

    StringTokenizer wordList = new StringTokenizer(val.toString());

    while (wordList.hasMoreTokens()) {
      word.set(wordList.nextToken());

      ctx.write(word, one);
    }

    HadoopErrorSimulator.instance().onMap();
  }
예제 #3
0
  /** {@inheritDoc} */
  @Override
  public void setConf(Configuration conf) {
    wasConfigured = true;

    HadoopErrorSimulator.instance().onMapConfigure();
  }
예제 #4
0
  /** {@inheritDoc} */
  @Override
  protected void cleanup(Context ctx) throws IOException, InterruptedException {
    super.cleanup(ctx);

    HadoopErrorSimulator.instance().onMapCleanup();
  }