Example usage for org.apache.hadoop.mapred ClientServiceDelegate ClientServiceDelegate

List of usage examples for org.apache.hadoop.mapred ClientServiceDelegate ClientServiceDelegate

Introduction

In this page you can find the example usage for org.apache.hadoop.mapred ClientServiceDelegate ClientServiceDelegate.

Prototype

public ClientServiceDelegate(Configuration conf, ResourceMgrDelegate rm, JobID jobId,
            MRClientProtocol historyServerProxy) 

Source Link

Usage

From source file:com.twitter.hraven.hadoopJobMonitor.rpc.ClientCache.java

License:Apache License

public synchronized ClientServiceDelegate getClient(JobID jobId) throws YarnException {
    if (hsProxy == null) {
        try {/*from  w  ww  .  j  a v  a2  s  . co m*/
            hsProxy = instantiateHistoryProxy();
        } catch (IOException e) {
            LOG.warn("Could not connect to History server.", e);
            throw new YarnException("Could not connect to History server.", e);
        }
    }
    ClientServiceDelegate client = cache.get(jobId);
    if (client == null) {
        client = new ClientServiceDelegate(conf, rm, jobId, hsProxy);
        cache.put(jobId, client);
    }
    return client;
}