java.lang.Object
org.apache.hadoop.hdfs.server.datanode.fsdataset.impl.FsDatasetUtil

@Private public class FsDatasetUtil extends Object
Utility methods.
  • Constructor Details

    • FsDatasetUtil

      public FsDatasetUtil()
  • Method Details

    • createNullChecksumByteArray

      public static byte[] createNullChecksumByteArray()
    • findMetaFile

      public static File findMetaFile(File blockFile) throws IOException
      Find the corresponding meta data file from a given block file
      Throws:
      IOException
    • openAndSeek

      public static FileDescriptor openAndSeek(File file, long offset) throws IOException
      Throws:
      IOException
    • getInputStreamAndSeek

      public static InputStream getInputStreamAndSeek(File file, long offset) throws IOException
      Throws:
      IOException
    • getDirectInputStream

      public static InputStream getDirectInputStream(long addr, long length) throws IOException
      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

      public static void deleteMappedFile(String filePath) throws IOException
      Throws:
      IOException