/** {@inheritDoc} */ @Override protected void setup(Context ctx) throws IOException, InterruptedException { super.setup(ctx); wasSetUp = true; HadoopErrorSimulator.instance().onMapSetup(); }
/** {@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(); }
/** {@inheritDoc} */ @Override public void setConf(Configuration conf) { wasConfigured = true; HadoopErrorSimulator.instance().onMapConfigure(); }
/** {@inheritDoc} */ @Override protected void cleanup(Context ctx) throws IOException, InterruptedException { super.cleanup(ctx); HadoopErrorSimulator.instance().onMapCleanup(); }