|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hadoop.util.ReflectionUtils
@InterfaceAudience.Public @InterfaceStability.Evolving public class ReflectionUtils
General reflection utils
Constructor Summary | |
---|---|
ReflectionUtils()
|
Method Summary | ||
---|---|---|
static void |
cloneWritableInto(Writable dst,
Writable src)
Deprecated. |
|
static
|
copy(Configuration conf,
T src,
T dst)
Make a copy of the writable object using serialization to a buffer |
|
static
|
getClass(T o)
Return the correctly-typed Class of the given object. |
|
static List<Field> |
getDeclaredFieldsIncludingInherited(Class<?> clazz)
Gets all the declared fields of a class including fields declared in superclasses. |
|
static List<Method> |
getDeclaredMethodsIncludingInherited(Class<?> clazz)
Gets all the declared methods of a class including methods declared in superclasses. |
|
static void |
logThreadInfo(org.apache.commons.logging.Log log,
String title,
long minInterval)
Log the current thread stacks at INFO level. |
|
static
|
newInstance(Class<T> theClass,
Configuration conf)
Create an object for the given class and initialize it from conf |
|
static void |
printThreadInfo(PrintWriter stream,
String title)
Print all of the thread's information and stack traces. |
|
static void |
setConf(Object theObject,
Configuration conf)
Check and set 'configuration' if necessary. |
|
static void |
setContentionTracing(boolean val)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReflectionUtils()
Method Detail |
---|
public static void setConf(Object theObject, Configuration conf)
theObject
- object for which to set configurationconf
- Configurationpublic static <T> T newInstance(Class<T> theClass, Configuration conf)
theClass
- class of which an object is createdconf
- Configuration
public static void setContentionTracing(boolean val)
public static void printThreadInfo(PrintWriter stream, String title)
stream
- the stream totitle
- a string title for the stack tracepublic static void logThreadInfo(org.apache.commons.logging.Log log, String title, long minInterval)
log
- the logger that logs the stack tracetitle
- a descriptive title for the call stacksminInterval
- the minimum time from the lastpublic static <T> Class<T> getClass(T o)
Class
of the given object.
o
- object whose correctly-typed Class
is to be obtained
Class
of the given object.public static <T> T copy(Configuration conf, T src, T dst) throws IOException
src
- the object to copy fromdst
- the object to copy into, which is destroyed
IOException
@Deprecated public static void cloneWritableInto(Writable dst, Writable src) throws IOException
IOException
public static List<Field> getDeclaredFieldsIncludingInherited(Class<?> clazz)
public static List<Method> getDeclaredMethodsIncludingInherited(Class<?> clazz)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |