Class TransferFsImage

java.lang.Object
org.apache.hadoop.hdfs.server.namenode.TransferFsImage

@Private public class TransferFsImage extends Object
This class provides fetching a specified file from the NameNode.
  • Constructor Details

    • TransferFsImage

      public TransferFsImage()
  • Method Details

    • downloadMostRecentImageToDirectory

      public static void downloadMostRecentImageToDirectory(URL infoServer, File dir) throws IOException
      Throws:
      IOException
    • downloadImageToStorage

      public static org.apache.hadoop.io.MD5Hash downloadImageToStorage(URL fsName, long imageTxId, Storage dstStorage, boolean needDigest, boolean isBootstrapStandby) throws IOException
      Throws:
      IOException
    • downloadAliasMap

      public static void downloadAliasMap(URL fsName, File aliasMap, boolean isBootstrapStandby) throws IOException
      Download the InMemoryAliasMap from the remote NN.
      Parameters:
      fsName - http address of remote NN.
      aliasMap - location of the alias map.
      isBootstrapStandby - flag to indicate if for bootstrap of standby.
      Throws:
      IOException
    • uploadImageFromStorage

      public static TransferFsImage.TransferResult uploadImageFromStorage(URL fsName, org.apache.hadoop.conf.Configuration conf, NNStorage storage, NNStorage.NameNodeFile nnf, long txid, Canceler canceler) throws IOException
      Requests that the NameNode download an image from this node. Allows for optional external cancelation.
      Parameters:
      fsName - the http address for the remote NN
      conf - Configuration
      storage - the storage directory to transfer the image from
      nnf - the NameNodeFile type of the image
      txid - the transaction ID of the image to be uploaded
      canceler - optional canceler to check for abort of upload
      Throws:
      IOException - if there is an I/O error or cancellation
    • copyFileToStream

      public static void copyFileToStream(OutputStream out, File localfile, FileInputStream infile, DataTransferThrottler throttler) throws IOException
      A server-side method to respond to a getfile http request Copies the contents of the local file into the output stream.
      Throws:
      IOException
    • doGetUrl

      public static org.apache.hadoop.io.MD5Hash doGetUrl(URL url, List<File> localPaths, Storage dstStorage, boolean getChecksum) throws IOException
      Throws:
      IOException