3 Replies Latest reply on Jun 27, 2014 11:52 AM by Vladimir Blagojevic

    MapReduceTask#executeAsynchronously() isn't asynchronous?

    Rich DiCroce Novice

      I happened to be looking at the source code of MapReduceTask (for 6.0.2.Final, although the relevant parts don't look any different in current master), and as far as I can tell, MapReduceTask#executeAsynchronously() doesn't actually do anything asynchronously. It just returns a MapReduceTaskFuture containing a Callable that calls execute(). The only place I see that Callable being called is in MapReduceTaskFuture#get().

       

      In other words, the task isn't actually started until you call Future#get(), which isn't asynchronous at all! On top of that, MapReduceTaskFuture extends AbstractInProcessFuture, which "implements" the get(long, TimeUnit) method by just calling get(). Which means that MapReduceTaskFuture doesn't respect the timeout parameters and will just run until it completes.

       

      Am I missing something here? I was going to file a bug report but wanted to make sure first...