@InterfaceAudience.Private public class TransferFsImage extends Object
Modifier and Type | Class and Description |
---|---|
static class |
TransferFsImage.HttpGetFailedException |
Modifier and Type | Field and Description |
---|---|
static String |
CONTENT_LENGTH |
static String |
MD5_HEADER |
Constructor and Description |
---|
TransferFsImage() |
Modifier and Type | Method and Description |
---|---|
static MD5Hash |
doGetUrl(URL url,
List<File> localPaths,
Storage dstStorage,
boolean getChecksum) |
static MD5Hash |
downloadImageToStorage(String fsName,
long imageTxId,
Storage dstStorage,
boolean needDigest) |
static void |
downloadMostRecentImageToDirectory(String fsName,
File dir) |
static void |
getFileServer(javax.servlet.ServletResponse response,
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 void |
uploadImageFromStorage(String fsName,
InetSocketAddress imageListenAddress,
Storage storage,
long txid)
Requests that the NameNode download an image from this node.
|
public static final String CONTENT_LENGTH
public static final String MD5_HEADER
public static void downloadMostRecentImageToDirectory(String fsName, File dir) throws IOException
IOException
public static MD5Hash downloadImageToStorage(String fsName, long imageTxId, Storage dstStorage, boolean needDigest) throws IOException
IOException
public static void uploadImageFromStorage(String fsName, InetSocketAddress imageListenAddress, Storage storage, long txid) throws IOException
fsName
- the http address for the remote NNimageListenAddress
- the host/port where the local node is running an
HTTPServer hosting GetImageServletstorage
- the storage directory to transfer the image fromtxid
- the transaction ID of the image to be uploadedIOException
public static void getFileServer(javax.servlet.ServletResponse response, File localfile, FileInputStream infile, DataTransferThrottler throttler) throws IOException
IOException
public static MD5Hash doGetUrl(URL url, List<File> localPaths, Storage dstStorage, boolean getChecksum) throws IOException
IOException
Copyright © 2013 Apache Software Foundation. All rights reserved.