title: Condition on map reduce counters to control the map output
body: <p>Is there any chance to put a condition on user defined java counters at mapper level control the mapper output ??</p>
  
  <pre><code>       Long l = context.getCounter(Counters.COUNT).getValue();
  
          if(5L &gt;= l) {
              context.getCounter(Counters.COUNT).increment(1);
              context.write((LongWritable)key, value);
          } else {
              System.out.println("MAP ELSE");
              return;
          }
  </code></pre>
  
  <p>getting more then five records input to the reducer.
  Is there any chance to control this.???</p>