public final class FindClass extends Configured implements Tool
load: load a class but do not attempt to create it
create: load and create a class, print its string value
printresource: load a resource then print it to stdout
resource: load a resource then print the URL of that resource
System.out
; errors
to System.err
.Modifier and Type | Field and Description |
---|---|
static String |
A_CREATE
create command: "create"
|
static String |
A_LOAD
Load command: "load"
|
static String |
A_PRINTRESOURCE
Command to locate and print a resource: "print"
|
static String |
A_RESOURCE
Command to locate a resource: "locate"
|
protected static int |
E_CREATE_FAILED
class creation failed 5
|
protected static int |
E_GENERIC
generic error 1
|
protected static int |
E_LOAD_FAILED
class load failed 4
|
protected static int |
E_NOT_FOUND
class or resource not found 3
|
protected static int |
E_USAGE
usage error -bad arguments or similar 2
|
static int |
SUCCESS
Exit code when the operation succeeded: 0
|
Constructor and Description |
---|
FindClass()
Empty constructor; passes a new Configuration
object instance to its superclass's constructor
|
FindClass(Configuration conf)
Create a class with a specified configuration
|
Modifier and Type | Method and Description |
---|---|
static void |
main(String[] args)
Main entry point.
|
int |
run(String[] args)
Run the class/resource find or load operation
|
static void |
setOutputStreams(PrintStream out,
PrintStream err)
Change the output streams to be something other than the
System.out and System.err streams
|
getConf, setConf
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getConf, setConf
public static final String A_CREATE
public static final String A_LOAD
public static final String A_RESOURCE
public static final String A_PRINTRESOURCE
public static final int SUCCESS
protected static final int E_GENERIC
protected static final int E_USAGE
protected static final int E_NOT_FOUND
protected static final int E_LOAD_FAILED
protected static final int E_CREATE_FAILED
public FindClass()
public FindClass(Configuration conf)
conf
- configurationpublic static void setOutputStreams(PrintStream out, PrintStream err)
out
- new stdout streamerr
- new stderr streampublic static void main(String[] args)
ToolRunner
, then
exits with an appropriate exit code.args
- argument listCopyright © 2008–2022 Apache Software Foundation. All rights reserved.