|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.examples.pi.Util
public class Util
Utility methods
Nested Class Summary | |
---|---|
static class |
Util.Timer
Timer |
Field Summary | |
---|---|
static PrintStream |
err
Error stream |
static PrintStream |
out
Output stream |
Constructor Summary | |
---|---|
Util()
|
Method Summary | ||
---|---|---|
static int |
accuracy(long terms,
boolean print)
Estimate accuracy. |
|
static void |
checkDirectory(File dir)
Check local directory. |
|
static
|
combine(Collection<T> items)
Combine a list of items. |
|
static PrintWriter |
createWriter(File dir,
String prefix)
Create a writer of a local file. |
|
static
|
execute(int nThreads,
List<E> callables)
Execute the callables by a number of threads |
|
static String |
long2string(long n)
Covert a long to a String in comma separated number format. |
|
static String |
millis2String(long n)
Covert milliseconds to a String. |
|
static long |
parseLongVariable(String name,
String s)
Parse a variable. |
|
static String |
parseStringVariable(String name,
String s)
Parse a variable. |
|
static String |
pi2string(double pi,
long terms)
Convert a pi value to a String. |
|
static void |
printBitSkipped(long b)
Print a "bits skipped" message. |
|
static int |
printUsage(String[] args,
String usage)
Print usage messages |
|
static long |
string2long(String s)
Covert a String to a long. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final PrintStream out
public static final PrintStream err
Constructor Detail |
---|
public Util()
Method Detail |
---|
public static String millis2String(long n)
public static long string2long(String s)
public static String long2string(long n)
public static long parseLongVariable(String name, String s)
public static String parseStringVariable(String name, String s)
public static <T,E extends Callable<T>> void execute(int nThreads, List<E> callables) throws InterruptedException, ExecutionException
InterruptedException
ExecutionException
public static int printUsage(String[] args, String usage)
public static <T extends Combinable<T>> List<T> combine(Collection<T> items)
public static void checkDirectory(File dir)
public static PrintWriter createWriter(File dir, String prefix) throws IOException
IOException
public static void printBitSkipped(long b)
public static String pi2string(double pi, long terms)
public static int accuracy(long terms, boolean print)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |