Package org.apache.hadoop.util
Class FindClass
java.lang.Object
org.apache.hadoop.conf.Configured
org.apache.hadoop.util.FindClass
- All Implemented Interfaces:
Configurable,Tool
This entry point exists for diagnosing classloader problems:
is a class or resource present -and if so, where?
Actions
load
: load a class but do not attempt to create itcreate
: load and create a class, print its string valueprintresource
: load a resource then print it to stdoutresource
: load a resource then print the URL of that resource
System.out; errors
to System.err.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringcreate command: "create"static final StringLoad command: "load"static final StringCommand to locate and print a resource: "print"static final StringCommand to locate a resource: "locate"protected static final intclass creation failed 5protected static final intgeneric error 1protected static final intclass load failed 4protected static final intclass or resource not found 3protected static final intusage error -bad arguments or similar 2static final intExit code when the operation succeeded: 0 -
Constructor Summary
ConstructorsConstructorDescriptionEmpty constructor; passes a new Configuration object instance to its superclass's constructorFindClass(Configuration conf) Create a class with a specified configuration -
Method Summary
Modifier and TypeMethodDescriptionstatic voidMain entry point.intRun the class/resource find or load operationstatic voidsetOutputStreams(PrintStream out, PrintStream err) Change the output streams to be something other than the System.out and System.err streamsMethods 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
-
Field Details
-
A_CREATE
create command: "create"- See Also:
-
A_LOAD
Load command: "load"- See Also:
-
A_RESOURCE
Command to locate a resource: "locate"- See Also:
-
A_PRINTRESOURCE
Command to locate and print a resource: "print"- See Also:
-
SUCCESS
public static final int SUCCESSExit code when the operation succeeded: 0- See Also:
-
E_GENERIC
protected static final int E_GENERICgeneric error 1- See Also:
-
E_USAGE
protected static final int E_USAGEusage error -bad arguments or similar 2- See Also:
-
E_NOT_FOUND
protected static final int E_NOT_FOUNDclass or resource not found 3- See Also:
-
E_LOAD_FAILED
protected static final int E_LOAD_FAILEDclass load failed 4- See Also:
-
E_CREATE_FAILED
protected static final int E_CREATE_FAILEDclass creation failed 5- See Also:
-
-
Constructor Details
-
FindClass
public FindClass()Empty constructor; passes a new Configuration object instance to its superclass's constructor -
FindClass
Create a class with a specified configuration- Parameters:
conf- configuration
-
-
Method Details
-
setOutputStreams
Change the output streams to be something other than the System.out and System.err streams- Parameters:
out- new stdout streamerr- new stderr stream
-
run
Run the class/resource find or load operation -
main
Main entry point. Runs the class via theToolRunner, then exits with an appropriate exit code.- Parameters:
args- argument list
-