YARN implies 2 pieces:
# Application specific 'master' to co-ordinate your application (mainly to get resources i.e. containers for it's application from the ResourceManager and use them)
# Application specific code which runs in the allocated Containers.
Given your use case, I'd recommend that you explore writing the AppMaster in Java (i.e. just the co-ordination piece) and implement the actual application in C, C++ etc.
In fact, we already have something called a DistributedShell which has the Java AppMaster but runs any shell script as the 'Container':
Some useful links to learn more about YARN:
Series of posts on YARN: http://hortonworks.com/blog/introducing-apache-hadoop-yarn/
Writing your own application in YARN: http://hadoop.apache.org/docs/r2.0.2-alpha/hadoop-yarn/hadoop-yarn-site/WritingYarnApplications.html
On Jan 12, 2013, at 8:44 AM, John Lilley wrote:
> Thanks for the insight! I didn't realize that YARN was more than a more-scalable MR scheduler. So if we program our application to schedule its tasks directly with YARN we should be able to do what I am describing? Is there any non-native-Java interop for YARN or should we focus on JNI for that?
> -----Original Message-----
> From: Harsh J [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, January 12, 2013 9:41 AM
> To: <[EMAIL PROTECTED]>
> Subject: Re: Scheduling non-MR processes
> On Sat, Jan 12, 2013 at 9:39 PM, John Lilley <[EMAIL PROTECTED]> wrote:
>> I am trying to understand how one can make a "side process" cooperate
>> with the Hadoop MapReduce task scheduler. Suppose that I have an
>> application that is not directly integrated with MapReduce (i.e., it
>> is not a MapReduce job at all; there are no mappers or reducers).
>> This application could access HDFS as an external client, but it would
>> be limited in its throughput. I want to run this application in
>> parallel on HDFS nodes to realize the benefits of parallel computation
>> and data locality. But I want to cooperate in resource management
>> with Hadoop. But I don't want the
>> *data* to get pushed through MapReduce, because the nature of the
>> application doesn't lend itself nicely to MR integration.
> Apache Hadoop has moved past plain MR onto YARN. YARN allows MR (called MR2) and also allows other forms of generic, distributed apps to be developed for any other purposes.
>> Perhaps if I explain why I think this is not suitable for regular MR
>> jobs it may help. Suppose that I have stored into HDFS a very large
>> file for which there is no Java library. JNI could be an option, but
>> wrapping the complex function of legacy application code into JNI may
>> be more work than it is worth. The application performs some very
>> complex processing, and this is something that we don't necessarily want to redesign to fit the MR paradigm.
>> Obviously the data file is "splittable" or this approach wouldn't work
>> at all. So perhaps it is possible to hook into MR at the Splitter
>> level, and use that to create a series of mapper tasks where the
>> mappers don't actually read the data directly, but hand off the
>> corresponding data block to the legacy application for processing?
> Yes if you're stuck on a platform that just has MR and you want to somehow leverage a map-only distribution to do this, you should tweak your job to (a) use empty splits and (b) run infinitely. For (a), take a look at the Sleep Job example  that utilizes empty splits - no data, but you can control number of mappers, etc. and have mapper logic do work. For (b), study the SleepJob's mapper to see how it periodically reports progress or status changes (can be done via a daemon thread too) such that the framework does not think it has died or gone unresponsive.
Arun C. Murthy