|
Spring for Apache Hadoop | ||||||||
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(java.lang.Class<P> protocolClazz,
org.apache.hadoop.conf.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. |
|
org.apache.hadoop.conf.Configuration |
getConfiguration()
Gets the Yarn configuration. |
|
P |
getProxy()
Gets the proxy handled by this accessor. |
|
protected abstract java.net.InetSocketAddress |
getRpcAddress(org.apache.hadoop.conf.Configuration configuration)
Gets the InetSocketAddress where this accessor should connect. |
|
protected org.apache.hadoop.security.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(java.lang.Class<P> protocolClazz, org.apache.hadoop.conf.Configuration config)
protocolClazz
- the protocol clazzconfig
- the yarn configurationMethod Detail |
---|
public void afterPropertiesSet() throws java.lang.Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
java.lang.Exception
public void destroy()
destroy
in interface org.springframework.beans.factory.DisposableBean
public P getProxy()
public <T,S extends P> T execute(YarnRpcCallback<T,S> action) throws org.springframework.dao.DataAccessException
T
- the return typeS
- the proxy typeaction
- the action
org.springframework.dao.DataAccessException
- the data access exceptionpublic org.apache.hadoop.conf.Configuration getConfiguration()
protected P createProxy()
getUser()
returns
a non null user
, that
will be used to request the proxy with
a PrivilegedAction
.
protected org.apache.hadoop.security.UserGroupInformation getUser()
user
used to
create the proxy. Default implementation returns null
which means no security is used.
createProxy()
protected abstract java.net.InetSocketAddress getRpcAddress(org.apache.hadoop.conf.Configuration configuration)
InetSocketAddress
where this accessor should connect.
configuration
- the yarn configuration
|
Spring for Apache Hadoop | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |