title: Global variable or property in MapReduce?
body: <p>I want to be able to set some sort of variable or flag in the map phase of my MR job that I can check <strong>after</strong> the job has completed. I think the best way to demonstrate what I want with some code: p.s I am using Hadoop 2.2.0</p>
  
  <pre><code>public class MRJob {
  
    public static class MapperTest 
         extends Mapper&lt;Object, Text, Text, IntWritable&gt;{
  
  
      public void map(Object key, Text value, Context context
                      ) throws IOException, InterruptedException {
          //Do some computation to get new value and key
          ...
          //Check if new value equal to some condition e.g if(value &lt; 1) set global variable to true
  
          context.write(newKey, newValue);
      }
    }
  
    public static void main(String[] args) throws Exception {
      Configuration conf = new Configuration();
  
      Job job = Job.getInstance(new Configuration(), "word_count");
     //set job configs
  
      job.waitForCompletion(true);
  
      //Here I want to be able to check if my global variable has been set to true by any one of the mappers
  
    }
  }
  </code></pre>