public final class CommonUtils extends Object
Modifier and Type | Method and Description |
---|---|
static String |
cleanPath(String path) |
static ByteBuffer |
cloneByteBuffer(ByteBuffer buf) |
static List<ByteBuffer> |
cloneByteBufferList(List<ByteBuffer> source) |
static String |
convertByteArrayToString(byte[] data) |
static String |
convertMsToClockTime(long Millis) |
static String |
convertMsToDate(long Millis) |
static String |
convertMsToShortClockTime(long Millis) |
static String |
convertMsToSimpleDate(long Millis) |
static ByteBuffer |
generateNewByteBufferFromThriftRPCResults(ByteBuffer data) |
static long |
getBlockIdFromFileName(String name) |
static long |
getCurrentMs() |
static long |
getCurrentNs() |
static int |
getMB(int bytes) |
static String |
getSizeFromBytes(long bytes) |
static void |
illegalArgumentException(Exception e) |
static void |
illegalArgumentException(String msg) |
static <T> String |
listToString(List<T> list) |
static String |
parametersToString(Object... objs) |
static InetSocketAddress |
parseInetSocketAddress(String address)
Parse InetSocketAddress from a String
|
static long |
parseMemorySize(String memorySize) |
static void |
printByteBuffer(org.apache.log4j.Logger LOG,
ByteBuffer buf) |
static void |
printTimeTakenMs(long startTimeMs,
org.apache.log4j.Logger logger,
String message) |
static void |
printTimeTakenNs(long startTimeNs,
org.apache.log4j.Logger logger,
String message) |
static void |
runtimeException(Exception e) |
static void |
runtimeException(String msg) |
static void |
sleepMs(org.apache.log4j.Logger logger,
long timeMs) |
static void |
tempoaryLog(String msg) |
static String[] |
toStringArray(ArrayList<String> src) |
static void |
validatePath(String path) |
public static String cleanPath(String path) throws IOException
IOException
public static ByteBuffer cloneByteBuffer(ByteBuffer buf)
public static List<ByteBuffer> cloneByteBufferList(List<ByteBuffer> source)
public static String convertByteArrayToString(byte[] data)
public static String convertMsToClockTime(long Millis)
public static String convertMsToShortClockTime(long Millis)
public static String convertMsToDate(long Millis)
public static String convertMsToSimpleDate(long Millis)
public static ByteBuffer generateNewByteBufferFromThriftRPCResults(ByteBuffer data)
public static long getCurrentMs()
public static long getCurrentNs()
public static long getBlockIdFromFileName(String name)
public static int getMB(int bytes)
public static String getSizeFromBytes(long bytes)
public static void illegalArgumentException(String msg)
public static void illegalArgumentException(Exception e)
public static long parseMemorySize(String memorySize)
public static void printByteBuffer(org.apache.log4j.Logger LOG, ByteBuffer buf)
public static void printTimeTakenMs(long startTimeMs, org.apache.log4j.Logger logger, String message)
public static void printTimeTakenNs(long startTimeNs, org.apache.log4j.Logger logger, String message)
public static void runtimeException(String msg)
public static void runtimeException(Exception e)
public static void sleepMs(org.apache.log4j.Logger logger, long timeMs)
public static void tempoaryLog(String msg)
public static void validatePath(String path) throws InvalidPathException
InvalidPathException
public static InetSocketAddress parseInetSocketAddress(String address) throws IOException
address
- IOException
Copyright © 2013. All rights reserved.