tachyon
Class CommonUtils

java.lang.Object
  extended by tachyon.CommonUtils

public final class CommonUtils
extends Object

Common utilities shared by all components in Tachyon.


Method Summary
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 getCurrentMs()
           
static long getCurrentNs()
           
static int getFileIdFromFileName(String name)
           
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 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

cleanPath

public static String cleanPath(String path)

cloneByteBuffer

public static ByteBuffer cloneByteBuffer(ByteBuffer buf)

cloneByteBufferList

public static List<ByteBuffer> cloneByteBufferList(List<ByteBuffer> source)

convertByteArrayToString

public static String convertByteArrayToString(byte[] data)

convertMsToClockTime

public static String convertMsToClockTime(long Millis)

convertMsToShortClockTime

public static String convertMsToShortClockTime(long Millis)

convertMsToDate

public static String convertMsToDate(long Millis)

convertMsToSimpleDate

public static String convertMsToSimpleDate(long Millis)

generateNewByteBufferFromThriftRPCResults

public static ByteBuffer generateNewByteBufferFromThriftRPCResults(ByteBuffer data)

getCurrentMs

public static long getCurrentMs()

getCurrentNs

public static long getCurrentNs()

getFileIdFromFileName

public static int getFileIdFromFileName(String name)

getMB

public static int getMB(int bytes)

getSizeFromBytes

public static String getSizeFromBytes(long bytes)

illegalArgumentException

public static void illegalArgumentException(String msg)

illegalArgumentException

public static void illegalArgumentException(Exception e)

listToString

public static <T> String listToString(List<T> list)

parametersToString

public static String parametersToString(Object... objs)

parseMemorySize

public static long parseMemorySize(String memorySize)

printByteBuffer

public static void printByteBuffer(org.apache.log4j.Logger LOG,
                                   ByteBuffer buf)

printTimeTakenMs

public static void printTimeTakenMs(long startTimeMs,
                                    org.apache.log4j.Logger logger,
                                    String message)

printTimeTakenNs

public static void printTimeTakenNs(long startTimeNs,
                                    org.apache.log4j.Logger logger,
                                    String message)

runtimeException

public static void runtimeException(String msg)

runtimeException

public static void runtimeException(Exception e)

sleepMs

public static void sleepMs(org.apache.log4j.Logger logger,
                           long timeMs)

toStringArray

public static String[] toStringArray(ArrayList<String> src)

tempoaryLog

public static void tempoaryLog(String msg)

validatePath

public static void validatePath(String path)
                         throws InvalidPathException
Throws:
InvalidPathException


Copyright © 2013. All Rights Reserved.