HADOOP-6475. Adding some javadoc to Server.RpcMetrics, UGI. Contributed by Jitendra Pandey and borya.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@979919 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
fa49f7349d
commit
5c5c163aa3
@ -85,6 +85,9 @@ Trunk (unreleased changes)
|
||||
|
||||
HADOOP-6877. Common part of HDFS-1178 (NameNode servlets should communicate
|
||||
with NameNode directrly). (Kan Zhang via jghoman)
|
||||
|
||||
HADOOP-6475. Adding some javadoc to Server.RpcMetrics, UGI.
|
||||
(Jitendra Pandey and borya via jghoman)
|
||||
|
||||
OPTIMIZATIONS
|
||||
|
||||
|
@ -231,7 +231,10 @@ public static void bind(ServerSocket socket, InetSocketAddress address,
|
||||
}
|
||||
}
|
||||
|
||||
/*Returns a handle to the rpcMetrics (required in tests)*/
|
||||
/**
|
||||
* Returns a handle to the rpcMetrics (required in tests)
|
||||
* @return rpc metrics
|
||||
*/
|
||||
public RpcMetrics getRpcMetrics() {
|
||||
return rpcMetrics;
|
||||
}
|
||||
|
@ -76,26 +76,57 @@ public RpcMetrics(final String hostName, final String port,
|
||||
* -they can also be read directly - e.g. JMX does this.
|
||||
*/
|
||||
|
||||
/**
|
||||
* metrics - number of bytes received
|
||||
*/
|
||||
public final MetricsTimeVaryingLong receivedBytes =
|
||||
new MetricsTimeVaryingLong("ReceivedBytes", registry);
|
||||
/**
|
||||
* metrics - number of bytes sent
|
||||
*/
|
||||
public final MetricsTimeVaryingLong sentBytes =
|
||||
new MetricsTimeVaryingLong("SentBytes", registry);
|
||||
/**
|
||||
* metrics - rpc queue time
|
||||
*/
|
||||
public final MetricsTimeVaryingRate rpcQueueTime =
|
||||
new MetricsTimeVaryingRate("RpcQueueTime", registry);
|
||||
public MetricsTimeVaryingRate rpcProcessingTime =
|
||||
/**
|
||||
* metrics - rpc processing time
|
||||
*/
|
||||
public final MetricsTimeVaryingRate rpcProcessingTime =
|
||||
new MetricsTimeVaryingRate("RpcProcessingTime", registry);
|
||||
/**
|
||||
* metrics - number of open connections
|
||||
*/
|
||||
public final MetricsIntValue numOpenConnections =
|
||||
new MetricsIntValue("NumOpenConnections", registry);
|
||||
/**
|
||||
* metrics - length of the queue
|
||||
*/
|
||||
public final MetricsIntValue callQueueLen =
|
||||
new MetricsIntValue("callQueueLen", registry);
|
||||
/**
|
||||
* metrics - number of failed authentications
|
||||
*/
|
||||
public final MetricsTimeVaryingInt authenticationFailures =
|
||||
new MetricsTimeVaryingInt("rpcAuthenticationFailures", registry);
|
||||
/**
|
||||
* metrics - number of successful authentications
|
||||
*/
|
||||
public final MetricsTimeVaryingInt authenticationSuccesses =
|
||||
new MetricsTimeVaryingInt("rpcAuthenticationSuccesses", registry);
|
||||
/**
|
||||
* metrics - number of failed authorizations
|
||||
*/
|
||||
public final MetricsTimeVaryingInt authorizationFailures =
|
||||
new MetricsTimeVaryingInt("rpcAuthorizationFailures", registry);
|
||||
/**
|
||||
* metrics - number of successful authorizations
|
||||
*/
|
||||
public final MetricsTimeVaryingInt authorizationSuccesses =
|
||||
new MetricsTimeVaryingInt("rpcAuthorizationSuccesses", registry);
|
||||
|
||||
/**
|
||||
* Push the metrics to the monitoring subsystem on doUpdate() call.
|
||||
*/
|
||||
@ -113,6 +144,9 @@ public void doUpdates(final MetricsContext context) {
|
||||
metricsRecord.update();
|
||||
}
|
||||
|
||||
/**
|
||||
* shutdown the metrics
|
||||
*/
|
||||
public void shutdown() {
|
||||
if (rpcMBean != null)
|
||||
rpcMBean.shutdown();
|
||||
|
@ -556,6 +556,9 @@ public static UserGroupInformation createRemoteUser(String user) {
|
||||
return new UserGroupInformation(subject);
|
||||
}
|
||||
|
||||
/**
|
||||
* existing types of authentications' methods
|
||||
*/
|
||||
@InterfaceStability.Evolving
|
||||
public static enum AuthenticationMethod {
|
||||
SIMPLE,
|
||||
@ -566,7 +569,8 @@ public static enum AuthenticationMethod {
|
||||
PROXY;
|
||||
}
|
||||
|
||||
/* Create a proxy user using username of the effective user and the ugi of the
|
||||
/**
|
||||
* Create a proxy user using username of the effective user and the ugi of the
|
||||
* real user.
|
||||
*
|
||||
* @param effective
|
||||
@ -587,6 +591,10 @@ public static UserGroupInformation createProxyUser(String user,
|
||||
return new UserGroupInformation(subject);
|
||||
}
|
||||
|
||||
/**
|
||||
* get RealUser (vs. EffectiveUser)
|
||||
* @return realUser running over proxy user
|
||||
*/
|
||||
public UserGroupInformation getRealUser() {
|
||||
for (RealUser p: subject.getPrincipals(RealUser.class)) {
|
||||
return p.getRealUser();
|
||||
|
Loading…
Reference in New Issue
Block a user