public class DFSUtil extends Object
限定符和类型 | 类和说明 |
---|---|
static class |
DFSUtil.StaleComparator
Comparator for sorting DataNodeInfo[] based on stale states.
|
构造器和说明 |
---|
DFSUtil() |
限定符和类型 | 方法和说明 |
---|---|
static String |
bytes2String(byte[] bytes)
Converts a byte array to a string using UTF8 encoding.
|
static URI |
createUri(String scheme,
InetSocketAddress address)
Create a URI from the scheme and address
|
static float |
getInvalidateWorkPctPerIteration(Configuration conf)
Get DFS_NAMENODE_INVALIDATE_WORK_PCT_PER_ITERATION from configuration.
|
static int |
getReplWorkMultiplier(Configuration conf)
Get DFS_NAMENODE_REPLICATION_WORK_MULTIPLIER_PER_ITERATION
from configuration.
|
static boolean |
isValidName(String src)
Whether the pathname is valid.
|
static BlockLocation[] |
locatedBlocks2Locations(LocatedBlocks blocks)
Convert a LocatedBlocks to BlockLocations[]
|
static byte[] |
string2Bytes(String str)
Converts a string to a byte array using UTF8 encoding.
|
public static boolean isValidName(String src)
public static String bytes2String(byte[] bytes)
public static byte[] string2Bytes(String str)
public static BlockLocation[] locatedBlocks2Locations(LocatedBlocks blocks)
blocks
- a LocatedBlockspublic static URI createUri(String scheme, InetSocketAddress address)
public static float getInvalidateWorkPctPerIteration(Configuration conf)
conf
- ConfigurationIllegalArgumentException
- If the value is not positivepublic static int getReplWorkMultiplier(Configuration conf)
conf
- ConfigurationIllegalArgumentException
- If the value is not positiveCopyright © 2009 The Apache Software Foundation