Class FsDatasetUtil
java.lang.Object
org.apache.hadoop.hdfs.server.datanode.fsdataset.impl.FsDatasetUtil
Utility methods.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcomputeChecksum(File srcMeta, File dstMeta, File blockFile, int smallBufferSize, org.apache.hadoop.conf.Configuration conf) Compute the checksum for a block file that does not already have its checksum computed, and save it to dstMeta file.static byte[]static voiddeleteMappedFile(String filePath) static FilefindMetaFile(File blockFile) Find the corresponding meta data file from a given block filestatic InputStreamgetDirectInputStream(long addr, long length) static InputStreamgetInputStreamAndSeek(File file, long offset) static FileDescriptoropenAndSeek(File file, long offset)
-
Constructor Details
-
FsDatasetUtil
public FsDatasetUtil()
-
-
Method Details
-
createNullChecksumByteArray
public static byte[] createNullChecksumByteArray() -
findMetaFile
Find the corresponding meta data file from a given block file- Throws:
IOException
-
openAndSeek
- Throws:
IOException
-
getInputStreamAndSeek
- Throws:
IOException
-
getDirectInputStream
- Throws:
IOException
-
computeChecksum
public static void computeChecksum(File srcMeta, File dstMeta, File blockFile, int smallBufferSize, org.apache.hadoop.conf.Configuration conf) throws IOException Compute the checksum for a block file that does not already have its checksum computed, and save it to dstMeta file.- Throws:
IOException
-
deleteMappedFile
- Throws:
IOException
-