Class TransferFsImage
java.lang.Object
org.apache.hadoop.hdfs.server.namenode.TransferFsImage
This class provides fetching a specified file from the NameNode.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcopyFileToStream(OutputStream out, File localfile, FileInputStream infile, DataTransferThrottler throttler) A server-side method to respond to a getfile http request Copies the contents of the local file into the output stream.static org.apache.hadoop.io.MD5Hashstatic voiddownloadAliasMap(URL fsName, File aliasMap, boolean isBootstrapStandby) Download the InMemoryAliasMap from the remote NN.static org.apache.hadoop.io.MD5HashdownloadImageToStorage(URL fsName, long imageTxId, Storage dstStorage, boolean needDigest, boolean isBootstrapStandby) static voiddownloadMostRecentImageToDirectory(URL infoServer, File dir) uploadImageFromStorage(URL fsName, org.apache.hadoop.conf.Configuration conf, NNStorage storage, NNStorage.NameNodeFile nnf, long txid, Canceler canceler) Requests that the NameNode download an image from this node.
-
Constructor Details
-
TransferFsImage
public TransferFsImage()
-
-
Method Details
-
downloadMostRecentImageToDirectory
- 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 NNconf- Configurationstorage- the storage directory to transfer the image fromnnf- the NameNodeFile type of the imagetxid- the transaction ID of the image to be uploadedcanceler- 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
-