Configurable, Toolpublic final class FindClass extends Configured implements Tool
Actions
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 | Description |
|---|---|---|
static java.lang.String |
A_CREATE |
create command: "create"
|
static java.lang.String |
A_LOAD |
Load command: "load"
|
static java.lang.String |
A_PRINTRESOURCE |
Command to locate and print a resource: "print"
|
static java.lang.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 | 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 | Description |
|---|---|---|
static void |
main(java.lang.String[] args) |
Main entry point.
|
int |
run(java.lang.String[] args) |
Run the class/resource find or load operation
|
static void |
setOutputStreams(java.io.PrintStream out,
java.io.PrintStream err) |
Change the output streams to be something other than the
System.out and System.err streams
|
getConf, setConfclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetConf, setConfpublic static final java.lang.String A_CREATE
public static final java.lang.String A_LOAD
public static final java.lang.String A_RESOURCE
public static final java.lang.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 - configuration@VisibleForTesting
public static void setOutputStreams(java.io.PrintStream out,
java.io.PrintStream err)
out - new stdout streamerr - new stderr streampublic int run(java.lang.String[] args)
throws java.lang.Exception
public static void main(java.lang.String[] args)
ToolRunner, then
exits with an appropriate exit code.args - argument listCopyright © 2008–2025 Apache Software Foundation. All rights reserved.