@Private
public class DatanodeUtil
extends java.lang.Object
| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.String |
DISK_ERROR |
|
static java.lang.String |
UNLINK_BLOCK_SUFFIX |
| Constructor | Description |
|---|---|
DatanodeUtil() |
| Modifier and Type | Method | Description |
|---|---|---|
static java.io.File |
createFileWithExistsCheck(FsVolumeSpi volume,
org.apache.hadoop.hdfs.protocol.Block b,
java.io.File f,
FileIoProvider fileIoProvider) |
Create a new file.
|
static boolean |
dirNoFilesRecursive(FsVolumeSpi volume,
java.io.File dir,
FileIoProvider fileIoProvider) |
Checks whether there are any files anywhere in the directory tree rooted
at dir (directories don't count as files).
|
static java.io.FileInputStream |
getMetaDataInputStream(org.apache.hadoop.hdfs.protocol.ExtendedBlock b,
FsDatasetSpi<?> data) |
|
static java.lang.String |
getMetaName(java.lang.String blockName,
long generationStamp) |
|
static java.io.File |
getUnlinkTmpFile(java.io.File f) |
|
static java.io.File |
idToBlockDir(java.io.File root,
long blockId) |
Get the directory where a finalized block with this ID should be stored.
|
public static final java.lang.String UNLINK_BLOCK_SUFFIX
public static final java.lang.String DISK_ERROR
public static java.io.File createFileWithExistsCheck(FsVolumeSpi volume, org.apache.hadoop.hdfs.protocol.Block b, java.io.File f, FileIoProvider fileIoProvider) throws java.io.IOException
java.io.IOException - if the file already exists or if the file cannot be created.public static java.lang.String getMetaName(java.lang.String blockName,
long generationStamp)
public static java.io.File getUnlinkTmpFile(java.io.File f)
public static boolean dirNoFilesRecursive(FsVolumeSpi volume, java.io.File dir, FileIoProvider fileIoProvider) throws java.io.IOException
java.io.IOException - if unable to list subdirectoriespublic static java.io.File idToBlockDir(java.io.File root,
long blockId)
root - the root directory where finalized blocks are storedblockId - public static java.io.FileInputStream getMetaDataInputStream(org.apache.hadoop.hdfs.protocol.ExtendedBlock b,
FsDatasetSpi<?> data)
throws java.io.IOException
java.io.FileNotFoundException - if the file not found.java.lang.ClassCastException - if the underlying input stream is not a FileInputStream.java.io.IOExceptionCopyright © 2008–2025 Apache Software Foundation. All rights reserved.