org.apache.hadoop.mr1tools
Class GetGroupsBase

java.lang.Object
  extended by org.apache.hadoop.conf.Configured
      extended by org.apache.hadoop.mr1tools.GetGroupsBase
All Implemented Interfaces:
org.apache.hadoop.conf.Configurable, org.apache.hadoop.util.Tool
Direct Known Subclasses:
GetGroups

public abstract class GetGroupsBase
extends org.apache.hadoop.conf.Configured
implements org.apache.hadoop.util.Tool

Base class for the HDFS and MR implementations of tools which fetch and display the groups that users belong to.


Constructor Summary
protected GetGroupsBase(org.apache.hadoop.conf.Configuration conf)
          Create an instance of this tool using the given configuration.
protected GetGroupsBase(org.apache.hadoop.conf.Configuration conf, java.io.PrintStream out)
          Used exclusively for testing.
 
Method Summary
protected abstract  java.net.InetSocketAddress getProtocolAddress(org.apache.hadoop.conf.Configuration conf)
          Must be overridden by subclasses to get the address where the GetUserMappingsProtocol implementation is running.
protected  GetUserMappingsProtocol getUgmProtocol()
          Get a client of the GetUserMappingsProtocol.
 int run(java.lang.String[] args)
          Get the groups for the users given and print formatted output to the PrintStream configured earlier.
 
Methods inherited from class org.apache.hadoop.conf.Configured
getConf, setConf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.hadoop.conf.Configurable
getConf, setConf
 

Constructor Detail

GetGroupsBase

protected GetGroupsBase(org.apache.hadoop.conf.Configuration conf)
Create an instance of this tool using the given configuration.

Parameters:
conf -

GetGroupsBase

protected GetGroupsBase(org.apache.hadoop.conf.Configuration conf,
                        java.io.PrintStream out)
Used exclusively for testing.

Parameters:
conf - The configuration to use.
out - The PrintStream to write to, instead of System.out
Method Detail

run

public int run(java.lang.String[] args)
        throws java.lang.Exception
Get the groups for the users given and print formatted output to the PrintStream configured earlier.

Specified by:
run in interface org.apache.hadoop.util.Tool
Throws:
java.lang.Exception

getProtocolAddress

protected abstract java.net.InetSocketAddress getProtocolAddress(org.apache.hadoop.conf.Configuration conf)
                                                          throws java.io.IOException
Must be overridden by subclasses to get the address where the GetUserMappingsProtocol implementation is running.

Parameters:
conf - The configuration to use.
Returns:
The address where the service is listening.
Throws:
java.io.IOException

getUgmProtocol

protected GetUserMappingsProtocol getUgmProtocol()
                                          throws java.io.IOException
Get a client of the GetUserMappingsProtocol.

Returns:
A GetUserMappingsProtocol client proxy.
Throws:
java.io.IOException


Copyright © 2009 The Apache Software Foundation