Mapper<String, String, String, Integer> mapper, Reducer<String, Integer> reducer, boolean useCombiner)
throws Exception {
Cache cache1 = cache(0, cacheName());
Cache cache2 = cache(1, cacheName());
CacheStore c1 = getStore(cache1);
CacheStore c2 = getStore(cache2);
//store each entry into each cache store directly
c1.store(toEntry("1", "Hello world here I am"));
c2.store(toEntry("1", "Hello world here I am"));
c1.store(toEntry("2", "Infinispan rules the world"));
c2.store(toEntry("2", "Infinispan rules the world"));
c1.store(toEntry("3", "JUDCon is in Boston"));
c2.store(toEntry("3", "JUDCon is in Boston"));
c1.store(toEntry("4", "JBoss World is in Boston as well"));
c2.store(toEntry("4", "JBoss World is in Boston as well"));
c1.store(toEntry("12","JBoss Application Server"));
c2.store(toEntry("12","JBoss Application Server"));
c1.store(toEntry("15", "Hello world"));
c2.store(toEntry("15", "Hello world"));
c1.store(toEntry("14", "Infinispan community"));
c2.store(toEntry("14", "Infinispan community"));
c1.store(toEntry("111", "Infinispan open source"));
c2.store(toEntry("111", "Infinispan open source"));
c1.store(toEntry("112", "Boston is close to Toronto"));
c2.store(toEntry("112", "Boston is close to Toronto"));
c1.store(toEntry("113", "Toronto is a capital of Ontario"));
c2.store(toEntry("113", "Toronto is a capital of Ontario"));
c1.store(toEntry("114", "JUDCon is cool"));
c2.store(toEntry("114", "JUDCon is cool"));
c1.store(toEntry("211", "JBoss World is awesome"));
c2.store(toEntry("211", "JBoss World is awesome"));
c1.store(toEntry("212", "JBoss rules"));
c2.store(toEntry("212", "JBoss rules"));
c1.store(toEntry("213", "JBoss division of RedHat "));
c2.store(toEntry("213", "JBoss division of RedHat "));
c1.store(toEntry("214", "RedHat community"));
c2.store(toEntry("214", "RedHat community"));
MapReduceTask<String, String, String, Integer> task = createMapReduceTask(cache1);
task.mappedWith(mapper).reducedWith(reducer);
if(useCombiner)
task.combinedWith(reducer);