@Private
public final class Util
extends java.lang.Object
| Modifier and Type | Field | Description |
|---|---|---|
static org.apache.hadoop.hdfs.web.URLConnectionFactory |
connectionFactory |
|
static java.lang.String |
CONTENT_LENGTH |
|
static java.lang.String |
CONTENT_TRANSFER_ENCODING |
|
static java.lang.String |
CONTENT_TYPE |
|
static java.lang.String |
FILE_LENGTH |
|
static int |
IO_FILE_BUFFER_SIZE |
|
static java.lang.String |
MD5_HEADER |
| Constructor | Description |
|---|---|
Util() |
| Modifier and Type | Method | Description |
|---|---|---|
static org.apache.hadoop.io.MD5Hash |
doGetUrl(java.net.URL url,
java.util.List<java.io.File> localPaths,
Storage dstStorage,
boolean getChecksum,
int timeout,
DataTransferThrottler throttler) |
Downloads the files at the specified url location into destination
storage.
|
static java.net.URI |
fileAsURI(java.io.File f) |
Converts the passed File to a URI.
|
static java.util.List<java.net.InetSocketAddress> |
getAddressesList(java.net.URI uri,
org.apache.hadoop.conf.Configuration conf) |
|
static float |
getBlockPoolUsedPercentStdDev(org.apache.hadoop.hdfs.server.protocol.StorageReport[] storageReports) |
Return the standard deviation of storage block pool usage.
|
static java.util.List<java.net.InetSocketAddress> |
getLoggerAddresses(java.net.URI uri,
java.util.Set<java.net.InetSocketAddress> addrsToExclude,
org.apache.hadoop.conf.Configuration conf) |
|
static boolean |
isDiskStatsEnabled(int fileIOSamplingPercentage) |
|
static org.apache.hadoop.io.MD5Hash |
receiveFile(java.lang.String url,
java.util.List<java.io.File> localPaths,
Storage dstStorage,
boolean getChecksum,
long advertisedSize,
org.apache.hadoop.io.MD5Hash advertisedDigest,
java.lang.String fsImageName,
java.io.InputStream stream,
DataTransferThrottler throttler) |
Receives file at the url location from the input stream and puts them in
the specified destination storage location.
|
static void |
setTimeout(java.net.HttpURLConnection connection,
int timeout) |
Sets a timeout value in millisecods for the Http connection.
|
static java.util.List<java.net.URI> |
stringCollectionAsURIs(java.util.Collection<java.lang.String> names) |
Converts a collection of strings into a collection of URIs.
|
public static final java.lang.String FILE_LENGTH
public static final java.lang.String CONTENT_LENGTH
public static final java.lang.String MD5_HEADER
public static final java.lang.String CONTENT_TYPE
public static final java.lang.String CONTENT_TRANSFER_ENCODING
public static final int IO_FILE_BUFFER_SIZE
public static final org.apache.hadoop.hdfs.web.URLConnectionFactory connectionFactory
public static java.net.URI fileAsURI(java.io.File f)
throws java.io.IOException
f - the file to convertjava.io.IOExceptionpublic static java.util.List<java.net.URI> stringCollectionAsURIs(java.util.Collection<java.lang.String> names)
names - collection of strings to convert to URIspublic static org.apache.hadoop.io.MD5Hash doGetUrl(java.net.URL url,
java.util.List<java.io.File> localPaths,
Storage dstStorage,
boolean getChecksum,
int timeout,
DataTransferThrottler throttler)
throws java.io.IOException
java.io.IOExceptionpublic static org.apache.hadoop.io.MD5Hash receiveFile(java.lang.String url,
java.util.List<java.io.File> localPaths,
Storage dstStorage,
boolean getChecksum,
long advertisedSize,
org.apache.hadoop.io.MD5Hash advertisedDigest,
java.lang.String fsImageName,
java.io.InputStream stream,
DataTransferThrottler throttler)
throws java.io.IOException
java.io.IOExceptionpublic static void setTimeout(java.net.HttpURLConnection connection,
int timeout)
connection - the Http connection for which timeout needs to be settimeout - value to be set as timeout in millisecondspublic static java.util.List<java.net.InetSocketAddress> getAddressesList(java.net.URI uri,
org.apache.hadoop.conf.Configuration conf)
throws java.io.IOException
java.io.IOExceptionpublic static java.util.List<java.net.InetSocketAddress> getLoggerAddresses(java.net.URI uri,
java.util.Set<java.net.InetSocketAddress> addrsToExclude,
org.apache.hadoop.conf.Configuration conf)
throws java.io.IOException
java.io.IOExceptionpublic static boolean isDiskStatsEnabled(int fileIOSamplingPercentage)
public static float getBlockPoolUsedPercentStdDev(org.apache.hadoop.hdfs.server.protocol.StorageReport[] storageReports)
Copyright © 2008–2025 Apache Software Foundation. All rights reserved.