|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.yarn.rpc.YarnRpcAccessor<P>
P - Type of the protocol buffer implementationpublic abstract class YarnRpcAccessor<P>
Base implementation for accessing yarn components over protocol buffer rpc system.
| Constructor Summary | |
|---|---|
YarnRpcAccessor(Class<P> protocolClazz,
Configuration config)
Instantiates a new yarn rpc accessor with a protocol class and Yarn configuration. |
|
| Method Summary | ||
|---|---|---|
void |
afterPropertiesSet()
|
|
protected P |
createProxy()
Creates the proxy. |
|
void |
destroy()
|
|
|
execute(YarnRpcCallback<T,S> action)
Execute given action callback on the rpc proxy. |
|
Configuration |
getConfiguration()
Gets the Yarn configuration. |
|
P |
getProxy()
Gets the proxy handled by this accessor. |
|
protected abstract InetSocketAddress |
getRpcAddress(Configuration configuration)
Gets the InetSocketAddress where this accessor should connect. |
|
protected UserGroupInformation |
getUser()
Gets the user used to
create the proxy. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public YarnRpcAccessor(Class<P> protocolClazz,
Configuration config)
protocolClazz - the protocol clazzconfig - the yarn configuration| Method Detail |
|---|
public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface InitializingBeanExceptionpublic void destroy()
destroy in interface DisposableBeanpublic P getProxy()
public <T,S extends P> T execute(YarnRpcCallback<T,S> action)
throws DataAccessException
T - the return typeS - the proxy typeaction - the action
DataAccessException - the data access exceptionpublic Configuration getConfiguration()
protected P createProxy()
throws IOException
getUser() returns
a non null user, that
will be used to request the proxy with
a PrivilegedAction.
IOException
protected UserGroupInformation getUser()
throws IOException
user used to
create the proxy. Default implementation delegates into
UserGroupInformation.getCurrentUser().
IOException - if login failscreateProxy()protected abstract InetSocketAddress getRpcAddress(Configuration configuration)
InetSocketAddress where this accessor should connect.
configuration - the yarn configuration
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||