Package org.apache.hadoop.tools
Class GetGroupsBase
java.lang.Object
org.apache.hadoop.conf.Configured
org.apache.hadoop.tools.GetGroupsBase
- All Implemented Interfaces:
Configurable,Tool
Base class for the HDFS and MR implementations of tools which fetch and
display the groups that users belong to.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedGetGroupsBase(Configuration conf) Create an instance of this tool using the given configuration.protectedGetGroupsBase(Configuration conf, PrintStream out) Used exclusively for testing. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract InetSocketAddressMust be overridden by subclasses to get the address where theGetUserMappingsProtocolimplementation is running.protected GetUserMappingsProtocolGet a client of theGetUserMappingsProtocol.intGet the groups for the users given and print formatted output to thePrintStreamconfigured earlier.Methods inherited from class org.apache.hadoop.conf.Configured
getConf, setConfMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.conf.Configurable
getConf, setConf
-
Constructor Details
-
GetGroupsBase
Create an instance of this tool using the given configuration.- Parameters:
conf- configuration.
-
GetGroupsBase
Used exclusively for testing.- Parameters:
conf- The configuration to use.out- The PrintStream to write to, instead of System.out
-
-
Method Details
-
run
Get the groups for the users given and print formatted output to thePrintStreamconfigured earlier. -
getProtocolAddress
Must be overridden by subclasses to get the address where theGetUserMappingsProtocolimplementation is running.- Parameters:
conf- The configuration to use.- Returns:
- The address where the service is listening.
- Throws:
IOException- raised on errors performing I/O.
-
getUgmProtocol
Get a client of theGetUserMappingsProtocol.- Returns:
- A
GetUserMappingsProtocolclient proxy. - Throws:
IOException- raised on errors performing I/O.
-