public class RpcBinder extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
log |
| Constructor and Description |
|---|
RpcBinder() |
| Modifier and Type | Method and Description |
|---|---|
static SliderClusterProtocol |
connectToServer(InetSocketAddress addr,
org.apache.hadoop.security.UserGroupInformation currentUser,
org.apache.hadoop.conf.Configuration conf,
int rpcTimeout)
Connect to a server.
|
static org.apache.hadoop.ipc.Server |
createProtobufServer(InetSocketAddress addr,
org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.security.token.SecretManager<? extends org.apache.hadoop.security.token.TokenIdentifier> secretManager,
int numHandlers,
com.google.protobuf.BlockingService blockingService,
String portRangeConfig)
Create a protobuf server bonded to the specific socket address
|
static SliderClusterProtocol |
createProxy(org.apache.hadoop.conf.Configuration conf,
String host,
int port,
org.apache.hadoop.yarn.api.records.Token clientToAMToken,
int rpcTimeout) |
static SliderClusterProtocol |
getProxy(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.yarn.api.ApplicationClientProtocol rmClient,
org.apache.hadoop.yarn.api.records.ApplicationReport application,
int connectTimeout,
int rpcTimeout)
This loops for a limited period trying to get the Proxy -
by doing so it handles AM failover
|
static SliderClusterProtocol |
getProxy(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.yarn.api.records.ApplicationReport application,
int rpcTimeout)
Get a proxy from the application report
|
static Class<SliderClusterProtocolPB> |
registerSliderAPI(org.apache.hadoop.conf.Configuration conf)
Add the protobuf engine to the configuration.
|
static boolean |
verifyBondedToProtobuf(org.apache.hadoop.conf.Configuration conf,
Class<SliderClusterProtocolPB> sliderClusterAPIClass)
Verify that the conf is set up for protobuf transport of Slider RPC
|
public static org.apache.hadoop.ipc.Server createProtobufServer(InetSocketAddress addr, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.security.token.SecretManager<? extends org.apache.hadoop.security.token.TokenIdentifier> secretManager, int numHandlers, com.google.protobuf.BlockingService blockingService, String portRangeConfig) throws IOException
addr - address to listen to; 0.0.0.0 as hostname acceptableconf - configsecretManager - token secret handlernumHandlers - threads to service requestsblockingService - service to handleportRangeConfig - range of portsIOExceptionpublic static Class<SliderClusterProtocolPB> registerSliderAPI(org.apache.hadoop.conf.Configuration conf)
conf - configuration to patchpublic static boolean verifyBondedToProtobuf(org.apache.hadoop.conf.Configuration conf,
Class<SliderClusterProtocolPB> sliderClusterAPIClass)
conf - configurationsliderClusterAPIClass - class for the APIpublic static SliderClusterProtocol connectToServer(InetSocketAddress addr, org.apache.hadoop.security.UserGroupInformation currentUser, org.apache.hadoop.conf.Configuration conf, int rpcTimeout) throws IOException
addr - currentUser - conf - rpcTimeout - IOExceptionpublic static SliderClusterProtocol getProxy(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.yarn.api.ApplicationClientProtocol rmClient, org.apache.hadoop.yarn.api.records.ApplicationReport application, int connectTimeout, int rpcTimeout) throws IOException, org.apache.hadoop.yarn.exceptions.YarnException, InterruptedException
conf - configuration to patch and usermClient - client of the resource managerapplication - application to work withconnectTimeout - timeout for the whole proxy operation to timeout
(milliseconds). Use 0 to indicate "do not attempt to wait" -fail fast.rpcTimeout - timeout for RPCs to block during communicationsIOException - IO problemsorg.apache.hadoop.yarn.exceptions.YarnException - Slider-generated exceptions related to the binding
failing. This can include the application finishing or timeoutsInterruptedException - if a sleep operation waiting for
the cluster to respond is interrupted.public static SliderClusterProtocol getProxy(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.yarn.api.records.ApplicationReport application, int rpcTimeout) throws IOException, SliderException, InterruptedException
conf - config to useapplication - app reportrpcTimeout - timeout in RPC operationsIOExceptionSliderExceptionInterruptedExceptionpublic static SliderClusterProtocol createProxy(org.apache.hadoop.conf.Configuration conf, String host, int port, org.apache.hadoop.yarn.api.records.Token clientToAMToken, int rpcTimeout) throws SliderException, IOException, InterruptedException
conf - config to usehost - hosnameport - portclientToAMToken - auth token: only used in a secure cluster.
converted via ConverterUtils.convertFromYarn(org.apache.hadoop.yarn.api.records.Token, InetSocketAddress)rpcTimeout - timeout in RPC operationsSliderExceptionIOExceptionInterruptedExceptionCopyright © 2014–2015 The Apache Software Foundation. All rights reserved.