Example usage for org.apache.hadoop.yarn.client RMProxy createRMProxy

List of usage examples for org.apache.hadoop.yarn.client RMProxy createRMProxy

Introduction

In this page you can find the example usage for org.apache.hadoop.yarn.client RMProxy createRMProxy.

Prototype

@Private
protected static <T> T createRMProxy(final Configuration configuration, final Class<T> protocol,
        RMProxy<T> instance) throws IOException 

Source Link

Document

Currently, used by Client and AM only Create a proxy for the specified protocol.

Usage

From source file:com.github.hdl.tensorflow.yarn.app.TFApplicationRpcClient.java

License:Apache License

public TFApplicationRpc getRpc() {
    InetSocketAddress address = new InetSocketAddress(serverAddress, serverPort);
    Configuration conf = new Configuration();
    RetryPolicy retryPolicy = RMProxy.createRetryPolicy(conf, false);
    try {//from ww w. j ava  2 s .c  o m
        TensorFlowCluster proxy = RMProxy.createRMProxy(conf, TensorFlowCluster.class, address);
        this.tensorflow = (TensorFlowCluster) RetryProxy.create(TensorFlowCluster.class, proxy, retryPolicy);
        return this;
    } catch (IOException e) {
        return null;
    }
}

From source file:org.hdl.caffe.yarn.app.CaffeApplicationRpcClient.java

License:Apache License

public CaffeApplicationRpc getRpc() {
    InetSocketAddress address = new InetSocketAddress(serverAddress, serverPort);
    Configuration conf = new Configuration();
    RetryPolicy retryPolicy = RMProxy.createRetryPolicy(conf, false);
    try {//from   ww w . ja  va 2s . co  m
        CaffeCluster proxy = RMProxy.createRMProxy(conf, CaffeCluster.class, address);
        this.caffeCluster = (CaffeCluster) RetryProxy.create(CaffeCluster.class, proxy, retryPolicy);
        return this;
    } catch (IOException e) {
        return null;
    }
}

From source file:org.hdl.tensorflow.yarn.rpc.impl.TFApplicationRpcClient.java

License:Apache License

private TFApplicationRpcClient(String serverAddress, int serverPort) throws IOException {
    InetSocketAddress address = new InetSocketAddress(serverAddress, serverPort);
    Configuration conf = new Configuration();
    RetryPolicy retryPolicy = RMProxy.createRetryPolicy(conf, false);
    TensorFlowCluster proxy = RMProxy.createRMProxy(conf, TensorFlowCluster.class, address);
    this.tensorflow = (TensorFlowCluster) RetryProxy.create(TensorFlowCluster.class, proxy, retryPolicy);
}