|
@@ -104,13 +104,13 @@ import static org.apache.hadoop.fs.impl.PathCapabilitiesSupport.validatePathCapa
|
|
* All user code that may potentially use the Hadoop Distributed
|
|
* All user code that may potentially use the Hadoop Distributed
|
|
* File System should be written to use a FileSystem object or its
|
|
* File System should be written to use a FileSystem object or its
|
|
* successor, {@link FileContext}.
|
|
* successor, {@link FileContext}.
|
|
- *
|
|
|
|
|
|
+ * </p>
|
|
* <p>
|
|
* <p>
|
|
* The local implementation is {@link LocalFileSystem} and distributed
|
|
* The local implementation is {@link LocalFileSystem} and distributed
|
|
* implementation is DistributedFileSystem. There are other implementations
|
|
* implementation is DistributedFileSystem. There are other implementations
|
|
* for object stores and (outside the Apache Hadoop codebase),
|
|
* for object stores and (outside the Apache Hadoop codebase),
|
|
* third party filesystems.
|
|
* third party filesystems.
|
|
- * <p>
|
|
|
|
|
|
+ * </p>
|
|
* Notes
|
|
* Notes
|
|
* <ol>
|
|
* <ol>
|
|
* <li>The behaviour of the filesystem is
|
|
* <li>The behaviour of the filesystem is
|
|
@@ -133,13 +133,12 @@ import static org.apache.hadoop.fs.impl.PathCapabilitiesSupport.validatePathCapa
|
|
* New methods may be marked as Unstable or Evolving for their initial release,
|
|
* New methods may be marked as Unstable or Evolving for their initial release,
|
|
* as a warning that they are new and may change based on the
|
|
* as a warning that they are new and may change based on the
|
|
* experience of use in applications.
|
|
* experience of use in applications.
|
|
- * <p></p>
|
|
|
|
|
|
+ * <p>
|
|
* <b>Important note for developers</b>
|
|
* <b>Important note for developers</b>
|
|
- * <p></p>
|
|
|
|
|
|
+ * </p>
|
|
* If you are making changes here to the public API or protected methods,
|
|
* If you are making changes here to the public API or protected methods,
|
|
* you must review the following subclasses and make sure that
|
|
* you must review the following subclasses and make sure that
|
|
* they are filtering/passing through new methods as appropriate.
|
|
* they are filtering/passing through new methods as appropriate.
|
|
- * <p></p>
|
|
|
|
*
|
|
*
|
|
* {@link FilterFileSystem}: methods are passed through. If not,
|
|
* {@link FilterFileSystem}: methods are passed through. If not,
|
|
* then {@code TestFilterFileSystem.MustNotImplement} must be
|
|
* then {@code TestFilterFileSystem.MustNotImplement} must be
|
|
@@ -148,21 +147,22 @@ import static org.apache.hadoop.fs.impl.PathCapabilitiesSupport.validatePathCapa
|
|
* {@link #hasPathCapability(Path, String)} then
|
|
* {@link #hasPathCapability(Path, String)} then
|
|
* {@link FilterFileSystem#hasPathCapability(Path, String)}
|
|
* {@link FilterFileSystem#hasPathCapability(Path, String)}
|
|
* must return false, always.
|
|
* must return false, always.
|
|
- * <p></p>
|
|
|
|
|
|
+ * <p>
|
|
* {@link ChecksumFileSystem}: checksums are created and
|
|
* {@link ChecksumFileSystem}: checksums are created and
|
|
* verified.
|
|
* verified.
|
|
- * <p></p>
|
|
|
|
|
|
+ * </p>
|
|
* {@code TestHarFileSystem} will need its {@code MustNotImplement}
|
|
* {@code TestHarFileSystem} will need its {@code MustNotImplement}
|
|
* interface updated.
|
|
* interface updated.
|
|
- * <p></p>
|
|
|
|
*
|
|
*
|
|
|
|
+ * <p>
|
|
* There are some external places your changes will break things.
|
|
* There are some external places your changes will break things.
|
|
* Do co-ordinate changes here.
|
|
* Do co-ordinate changes here.
|
|
- * <p></p>
|
|
|
|
|
|
+ * </p>
|
|
*
|
|
*
|
|
* HBase: HBoss
|
|
* HBase: HBoss
|
|
- * <p></p>
|
|
|
|
|
|
+ * <p>
|
|
* Hive: HiveShim23
|
|
* Hive: HiveShim23
|
|
|
|
+ * </p>
|
|
* {@code shims/0.23/src/main/java/org/apache/hadoop/hive/shims/Hadoop23Shims.java}
|
|
* {@code shims/0.23/src/main/java/org/apache/hadoop/hive/shims/Hadoop23Shims.java}
|
|
*
|
|
*
|
|
*****************************************************************/
|
|
*****************************************************************/
|
|
@@ -281,6 +281,8 @@ public abstract class FileSystem extends Configured
|
|
/**
|
|
/**
|
|
* Returns the configured FileSystem implementation.
|
|
* Returns the configured FileSystem implementation.
|
|
* @param conf the configuration to use
|
|
* @param conf the configuration to use
|
|
|
|
+ * @return FileSystem.
|
|
|
|
+ * @throws IOException If an I/O error occurred.
|
|
*/
|
|
*/
|
|
public static FileSystem get(Configuration conf) throws IOException {
|
|
public static FileSystem get(Configuration conf) throws IOException {
|
|
return get(getDefaultUri(conf), conf);
|
|
return get(getDefaultUri(conf), conf);
|
|
@@ -375,6 +377,7 @@ public abstract class FileSystem extends Configured
|
|
* implement that method.
|
|
* implement that method.
|
|
*
|
|
*
|
|
* @see #canonicalizeUri(URI)
|
|
* @see #canonicalizeUri(URI)
|
|
|
|
+ * @return the URI of this filesystem.
|
|
*/
|
|
*/
|
|
protected URI getCanonicalUri() {
|
|
protected URI getCanonicalUri() {
|
|
return canonicalizeUri(getUri());
|
|
return canonicalizeUri(getUri());
|
|
@@ -391,6 +394,7 @@ public abstract class FileSystem extends Configured
|
|
* not specified and if {@link #getDefaultPort()} returns a
|
|
* not specified and if {@link #getDefaultPort()} returns a
|
|
* default port.
|
|
* default port.
|
|
*
|
|
*
|
|
|
|
+ * @param uri url.
|
|
* @return URI
|
|
* @return URI
|
|
* @see NetUtils#getCanonicalUri(URI, int)
|
|
* @see NetUtils#getCanonicalUri(URI, int)
|
|
*/
|
|
*/
|
|
@@ -454,11 +458,21 @@ public abstract class FileSystem extends Configured
|
|
: null;
|
|
: null;
|
|
}
|
|
}
|
|
|
|
|
|
- /** @deprecated call {@link #getUri()} instead.*/
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @return uri to string.
|
|
|
|
+ * @deprecated call {@link #getUri()} instead.
|
|
|
|
+ */
|
|
@Deprecated
|
|
@Deprecated
|
|
public String getName() { return getUri().toString(); }
|
|
public String getName() { return getUri().toString(); }
|
|
|
|
|
|
- /** @deprecated call {@link #get(URI, Configuration)} instead. */
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @deprecated call {@link #get(URI, Configuration)} instead.
|
|
|
|
+ *
|
|
|
|
+ * @param name name.
|
|
|
|
+ * @param conf configuration.
|
|
|
|
+ * @return file system.
|
|
|
|
+ * @throws IOException If an I/O error occurred.
|
|
|
|
+ */
|
|
@Deprecated
|
|
@Deprecated
|
|
public static FileSystem getNamed(String name, Configuration conf)
|
|
public static FileSystem getNamed(String name, Configuration conf)
|
|
throws IOException {
|
|
throws IOException {
|
|
@@ -513,6 +527,9 @@ public abstract class FileSystem extends Configured
|
|
* configuration and URI, cached and returned to the caller.
|
|
* configuration and URI, cached and returned to the caller.
|
|
* </li>
|
|
* </li>
|
|
* </ol>
|
|
* </ol>
|
|
|
|
+ * @param uri uri of the filesystem.
|
|
|
|
+ * @param conf configrution.
|
|
|
|
+ * @return filesystem instance.
|
|
* @throws IOException if the FileSystem cannot be instantiated.
|
|
* @throws IOException if the FileSystem cannot be instantiated.
|
|
*/
|
|
*/
|
|
public static FileSystem get(URI uri, Configuration conf) throws IOException {
|
|
public static FileSystem get(URI uri, Configuration conf) throws IOException {
|
|
@@ -542,7 +559,7 @@ public abstract class FileSystem extends Configured
|
|
/**
|
|
/**
|
|
* Returns the FileSystem for this URI's scheme and authority and the
|
|
* Returns the FileSystem for this URI's scheme and authority and the
|
|
* given user. Internally invokes {@link #newInstance(URI, Configuration)}
|
|
* given user. Internally invokes {@link #newInstance(URI, Configuration)}
|
|
- * @param uri of the filesystem
|
|
|
|
|
|
+ * @param uri uri of the filesystem.
|
|
* @param conf the configuration to use
|
|
* @param conf the configuration to use
|
|
* @param user to perform the get as
|
|
* @param user to perform the get as
|
|
* @return filesystem instance
|
|
* @return filesystem instance
|
|
@@ -860,6 +877,7 @@ public abstract class FileSystem extends Configured
|
|
* @param start offset into the given file
|
|
* @param start offset into the given file
|
|
* @param len length for which to get locations for
|
|
* @param len length for which to get locations for
|
|
* @throws IOException IO failure
|
|
* @throws IOException IO failure
|
|
|
|
+ * @return block location array.
|
|
*/
|
|
*/
|
|
public BlockLocation[] getFileBlockLocations(FileStatus file,
|
|
public BlockLocation[] getFileBlockLocations(FileStatus file,
|
|
long start, long len) throws IOException {
|
|
long start, long len) throws IOException {
|
|
@@ -900,6 +918,7 @@ public abstract class FileSystem extends Configured
|
|
* @param len length for which to get locations for
|
|
* @param len length for which to get locations for
|
|
* @throws FileNotFoundException when the path does not exist
|
|
* @throws FileNotFoundException when the path does not exist
|
|
* @throws IOException IO failure
|
|
* @throws IOException IO failure
|
|
|
|
+ * @return block location array.
|
|
*/
|
|
*/
|
|
public BlockLocation[] getFileBlockLocations(Path p,
|
|
public BlockLocation[] getFileBlockLocations(Path p,
|
|
long start, long len) throws IOException {
|
|
long start, long len) throws IOException {
|
|
@@ -962,6 +981,7 @@ public abstract class FileSystem extends Configured
|
|
* @param f the file name to open
|
|
* @param f the file name to open
|
|
* @param bufferSize the size of the buffer to be used.
|
|
* @param bufferSize the size of the buffer to be used.
|
|
* @throws IOException IO failure
|
|
* @throws IOException IO failure
|
|
|
|
+ * @return input stream.
|
|
*/
|
|
*/
|
|
public abstract FSDataInputStream open(Path f, int bufferSize)
|
|
public abstract FSDataInputStream open(Path f, int bufferSize)
|
|
throws IOException;
|
|
throws IOException;
|
|
@@ -970,6 +990,7 @@ public abstract class FileSystem extends Configured
|
|
* Opens an FSDataInputStream at the indicated Path.
|
|
* Opens an FSDataInputStream at the indicated Path.
|
|
* @param f the file to open
|
|
* @param f the file to open
|
|
* @throws IOException IO failure
|
|
* @throws IOException IO failure
|
|
|
|
+ * @return input stream.
|
|
*/
|
|
*/
|
|
public FSDataInputStream open(Path f) throws IOException {
|
|
public FSDataInputStream open(Path f) throws IOException {
|
|
return open(f, getConf().getInt(IO_FILE_BUFFER_SIZE_KEY,
|
|
return open(f, getConf().getInt(IO_FILE_BUFFER_SIZE_KEY,
|
|
@@ -987,6 +1008,7 @@ public abstract class FileSystem extends Configured
|
|
* @throws IOException IO failure
|
|
* @throws IOException IO failure
|
|
* @throws UnsupportedOperationException If {@link #open(PathHandle, int)}
|
|
* @throws UnsupportedOperationException If {@link #open(PathHandle, int)}
|
|
* not overridden by subclass
|
|
* not overridden by subclass
|
|
|
|
+ * @return input stream.
|
|
*/
|
|
*/
|
|
public FSDataInputStream open(PathHandle fd) throws IOException {
|
|
public FSDataInputStream open(PathHandle fd) throws IOException {
|
|
return open(fd, getConf().getInt(IO_FILE_BUFFER_SIZE_KEY,
|
|
return open(fd, getConf().getInt(IO_FILE_BUFFER_SIZE_KEY,
|
|
@@ -1004,6 +1026,7 @@ public abstract class FileSystem extends Configured
|
|
* not satisfied
|
|
* not satisfied
|
|
* @throws IOException IO failure
|
|
* @throws IOException IO failure
|
|
* @throws UnsupportedOperationException If not overridden by subclass
|
|
* @throws UnsupportedOperationException If not overridden by subclass
|
|
|
|
+ * @return input stream.
|
|
*/
|
|
*/
|
|
public FSDataInputStream open(PathHandle fd, int bufferSize)
|
|
public FSDataInputStream open(PathHandle fd, int bufferSize)
|
|
throws IOException {
|
|
throws IOException {
|
|
@@ -1021,6 +1044,7 @@ public abstract class FileSystem extends Configured
|
|
* not overridden by subclass.
|
|
* not overridden by subclass.
|
|
* @throws UnsupportedOperationException If this FileSystem cannot enforce
|
|
* @throws UnsupportedOperationException If this FileSystem cannot enforce
|
|
* the specified constraints.
|
|
* the specified constraints.
|
|
|
|
+ * @return path handle.
|
|
*/
|
|
*/
|
|
public final PathHandle getPathHandle(FileStatus stat, HandleOpt... opt) {
|
|
public final PathHandle getPathHandle(FileStatus stat, HandleOpt... opt) {
|
|
// method is final with a default so clients calling getPathHandle(stat)
|
|
// method is final with a default so clients calling getPathHandle(stat)
|
|
@@ -1036,6 +1060,7 @@ public abstract class FileSystem extends Configured
|
|
* @param stat Referent in the target FileSystem
|
|
* @param stat Referent in the target FileSystem
|
|
* @param opt Constraints that determine the validity of the
|
|
* @param opt Constraints that determine the validity of the
|
|
* {@link PathHandle} reference.
|
|
* {@link PathHandle} reference.
|
|
|
|
+ * @return path handle.
|
|
*/
|
|
*/
|
|
protected PathHandle createPathHandle(FileStatus stat, HandleOpt... opt) {
|
|
protected PathHandle createPathHandle(FileStatus stat, HandleOpt... opt) {
|
|
throw new UnsupportedOperationException();
|
|
throw new UnsupportedOperationException();
|
|
@@ -1046,6 +1071,7 @@ public abstract class FileSystem extends Configured
|
|
* Files are overwritten by default.
|
|
* Files are overwritten by default.
|
|
* @param f the file to create
|
|
* @param f the file to create
|
|
* @throws IOException IO failure
|
|
* @throws IOException IO failure
|
|
|
|
+ * @return output stream.
|
|
*/
|
|
*/
|
|
public FSDataOutputStream create(Path f) throws IOException {
|
|
public FSDataOutputStream create(Path f) throws IOException {
|
|
return create(f, true);
|
|
return create(f, true);
|
|
@@ -1057,6 +1083,7 @@ public abstract class FileSystem extends Configured
|
|
* @param overwrite if a file with this name already exists, then if true,
|
|
* @param overwrite if a file with this name already exists, then if true,
|
|
* the file will be overwritten, and if false an exception will be thrown.
|
|
* the file will be overwritten, and if false an exception will be thrown.
|
|
* @throws IOException IO failure
|
|
* @throws IOException IO failure
|
|
|
|
+ * @return output stream.
|
|
*/
|
|
*/
|
|
public FSDataOutputStream create(Path f, boolean overwrite)
|
|
public FSDataOutputStream create(Path f, boolean overwrite)
|
|
throws IOException {
|
|
throws IOException {
|
|
@@ -1074,6 +1101,7 @@ public abstract class FileSystem extends Configured
|
|
* @param f the file to create
|
|
* @param f the file to create
|
|
* @param progress to report progress
|
|
* @param progress to report progress
|
|
* @throws IOException IO failure
|
|
* @throws IOException IO failure
|
|
|
|
+ * @return output stream.
|
|
*/
|
|
*/
|
|
public FSDataOutputStream create(Path f, Progressable progress)
|
|
public FSDataOutputStream create(Path f, Progressable progress)
|
|
throws IOException {
|
|
throws IOException {
|
|
@@ -1090,6 +1118,7 @@ public abstract class FileSystem extends Configured
|
|
* @param f the file to create
|
|
* @param f the file to create
|
|
* @param replication the replication factor
|
|
* @param replication the replication factor
|
|
* @throws IOException IO failure
|
|
* @throws IOException IO failure
|
|
|
|
+ * @return output stream1
|
|
*/
|
|
*/
|
|
public FSDataOutputStream create(Path f, short replication)
|
|
public FSDataOutputStream create(Path f, short replication)
|
|
throws IOException {
|
|
throws IOException {
|
|
@@ -1108,6 +1137,7 @@ public abstract class FileSystem extends Configured
|
|
* @param replication the replication factor
|
|
* @param replication the replication factor
|
|
* @param progress to report progress
|
|
* @param progress to report progress
|
|
* @throws IOException IO failure
|
|
* @throws IOException IO failure
|
|
|
|
+ * @return output stream.
|
|
*/
|
|
*/
|
|
public FSDataOutputStream create(Path f, short replication,
|
|
public FSDataOutputStream create(Path f, short replication,
|
|
Progressable progress) throws IOException {
|
|
Progressable progress) throws IOException {
|
|
@@ -1125,6 +1155,7 @@ public abstract class FileSystem extends Configured
|
|
* the file will be overwritten, and if false an error will be thrown.
|
|
* the file will be overwritten, and if false an error will be thrown.
|
|
* @param bufferSize the size of the buffer to be used.
|
|
* @param bufferSize the size of the buffer to be used.
|
|
* @throws IOException IO failure
|
|
* @throws IOException IO failure
|
|
|
|
+ * @return output stream.
|
|
*/
|
|
*/
|
|
public FSDataOutputStream create(Path f,
|
|
public FSDataOutputStream create(Path f,
|
|
boolean overwrite,
|
|
boolean overwrite,
|
|
@@ -1144,7 +1175,9 @@ public abstract class FileSystem extends Configured
|
|
* @param overwrite if a file with this name already exists, then if true,
|
|
* @param overwrite if a file with this name already exists, then if true,
|
|
* the file will be overwritten, and if false an error will be thrown.
|
|
* the file will be overwritten, and if false an error will be thrown.
|
|
* @param bufferSize the size of the buffer to be used.
|
|
* @param bufferSize the size of the buffer to be used.
|
|
|
|
+ * @param progress to report progress.
|
|
* @throws IOException IO failure
|
|
* @throws IOException IO failure
|
|
|
|
+ * @return output stream.
|
|
*/
|
|
*/
|
|
public FSDataOutputStream create(Path f,
|
|
public FSDataOutputStream create(Path f,
|
|
boolean overwrite,
|
|
boolean overwrite,
|
|
@@ -1164,7 +1197,9 @@ public abstract class FileSystem extends Configured
|
|
* the file will be overwritten, and if false an error will be thrown.
|
|
* the file will be overwritten, and if false an error will be thrown.
|
|
* @param bufferSize the size of the buffer to be used.
|
|
* @param bufferSize the size of the buffer to be used.
|
|
* @param replication required block replication for the file.
|
|
* @param replication required block replication for the file.
|
|
|
|
+ * @param blockSize the size of the buffer to be used.
|
|
* @throws IOException IO failure
|
|
* @throws IOException IO failure
|
|
|
|
+ * @return output stream.
|
|
*/
|
|
*/
|
|
public FSDataOutputStream create(Path f,
|
|
public FSDataOutputStream create(Path f,
|
|
boolean overwrite,
|
|
boolean overwrite,
|
|
@@ -1182,7 +1217,10 @@ public abstract class FileSystem extends Configured
|
|
* the file will be overwritten, and if false an error will be thrown.
|
|
* the file will be overwritten, and if false an error will be thrown.
|
|
* @param bufferSize the size of the buffer to be used.
|
|
* @param bufferSize the size of the buffer to be used.
|
|
* @param replication required block replication for the file.
|
|
* @param replication required block replication for the file.
|
|
|
|
+ * @param blockSize the size of the buffer to be used.
|
|
|
|
+ * @param progress to report progress.
|
|
* @throws IOException IO failure
|
|
* @throws IOException IO failure
|
|
|
|
+ * @return output stream.
|
|
*/
|
|
*/
|
|
public FSDataOutputStream create(Path f,
|
|
public FSDataOutputStream create(Path f,
|
|
boolean overwrite,
|
|
boolean overwrite,
|
|
@@ -1209,6 +1247,7 @@ public abstract class FileSystem extends Configured
|
|
* @param progress the progress reporter
|
|
* @param progress the progress reporter
|
|
* @throws IOException IO failure
|
|
* @throws IOException IO failure
|
|
* @see #setPermission(Path, FsPermission)
|
|
* @see #setPermission(Path, FsPermission)
|
|
|
|
+ * @return output stream.
|
|
*/
|
|
*/
|
|
public abstract FSDataOutputStream create(Path f,
|
|
public abstract FSDataOutputStream create(Path f,
|
|
FsPermission permission,
|
|
FsPermission permission,
|
|
@@ -1230,6 +1269,7 @@ public abstract class FileSystem extends Configured
|
|
* @param progress the progress reporter
|
|
* @param progress the progress reporter
|
|
* @throws IOException IO failure
|
|
* @throws IOException IO failure
|
|
* @see #setPermission(Path, FsPermission)
|
|
* @see #setPermission(Path, FsPermission)
|
|
|
|
+ * @return output stream.
|
|
*/
|
|
*/
|
|
public FSDataOutputStream create(Path f,
|
|
public FSDataOutputStream create(Path f,
|
|
FsPermission permission,
|
|
FsPermission permission,
|
|
@@ -1256,6 +1296,7 @@ public abstract class FileSystem extends Configured
|
|
* found in conf will be used.
|
|
* found in conf will be used.
|
|
* @throws IOException IO failure
|
|
* @throws IOException IO failure
|
|
* @see #setPermission(Path, FsPermission)
|
|
* @see #setPermission(Path, FsPermission)
|
|
|
|
+ * @return output stream.
|
|
*/
|
|
*/
|
|
public FSDataOutputStream create(Path f,
|
|
public FSDataOutputStream create(Path f,
|
|
FsPermission permission,
|
|
FsPermission permission,
|
|
@@ -1277,6 +1318,16 @@ public abstract class FileSystem extends Configured
|
|
* the permission with umask before calling this method.
|
|
* the permission with umask before calling this method.
|
|
* This a temporary method added to support the transition from FileSystem
|
|
* This a temporary method added to support the transition from FileSystem
|
|
* to FileContext for user applications.
|
|
* to FileContext for user applications.
|
|
|
|
+ *
|
|
|
|
+ * @param f path.
|
|
|
|
+ * @param absolutePermission permission.
|
|
|
|
+ * @param flag create flag.
|
|
|
|
+ * @param bufferSize buffer size.
|
|
|
|
+ * @param replication replication.
|
|
|
|
+ * @param blockSize block size.
|
|
|
|
+ * @param progress progress.
|
|
|
|
+ * @param checksumOpt check sum opt.
|
|
|
|
+ * @return output stream.
|
|
* @throws IOException IO failure
|
|
* @throws IOException IO failure
|
|
*/
|
|
*/
|
|
@Deprecated
|
|
@Deprecated
|
|
@@ -1331,6 +1382,11 @@ public abstract class FileSystem extends Configured
|
|
* with umask before calling this method.
|
|
* with umask before calling this method.
|
|
* This a temporary method added to support the transition from FileSystem
|
|
* This a temporary method added to support the transition from FileSystem
|
|
* to FileContext for user applications.
|
|
* to FileContext for user applications.
|
|
|
|
+ *
|
|
|
|
+ * @param f the path.
|
|
|
|
+ * @param absolutePermission permission.
|
|
|
|
+ * @param createParent create parent.
|
|
|
|
+ * @throws IOException IO failure.
|
|
*/
|
|
*/
|
|
@Deprecated
|
|
@Deprecated
|
|
protected void primitiveMkdir(Path f, FsPermission absolutePermission,
|
|
protected void primitiveMkdir(Path f, FsPermission absolutePermission,
|
|
@@ -1370,6 +1426,7 @@ public abstract class FileSystem extends Configured
|
|
* @param progress the progress reporter
|
|
* @param progress the progress reporter
|
|
* @throws IOException IO failure
|
|
* @throws IOException IO failure
|
|
* @see #setPermission(Path, FsPermission)
|
|
* @see #setPermission(Path, FsPermission)
|
|
|
|
+ * @return output stream.
|
|
*/
|
|
*/
|
|
public FSDataOutputStream createNonRecursive(Path f,
|
|
public FSDataOutputStream createNonRecursive(Path f,
|
|
boolean overwrite,
|
|
boolean overwrite,
|
|
@@ -1393,6 +1450,7 @@ public abstract class FileSystem extends Configured
|
|
* @param progress the progress reporter
|
|
* @param progress the progress reporter
|
|
* @throws IOException IO failure
|
|
* @throws IOException IO failure
|
|
* @see #setPermission(Path, FsPermission)
|
|
* @see #setPermission(Path, FsPermission)
|
|
|
|
+ * @return output stream.
|
|
*/
|
|
*/
|
|
public FSDataOutputStream createNonRecursive(Path f, FsPermission permission,
|
|
public FSDataOutputStream createNonRecursive(Path f, FsPermission permission,
|
|
boolean overwrite, int bufferSize, short replication, long blockSize,
|
|
boolean overwrite, int bufferSize, short replication, long blockSize,
|
|
@@ -1416,6 +1474,7 @@ public abstract class FileSystem extends Configured
|
|
* @param progress the progress reporter
|
|
* @param progress the progress reporter
|
|
* @throws IOException IO failure
|
|
* @throws IOException IO failure
|
|
* @see #setPermission(Path, FsPermission)
|
|
* @see #setPermission(Path, FsPermission)
|
|
|
|
+ * @return output stream.
|
|
*/
|
|
*/
|
|
public FSDataOutputStream createNonRecursive(Path f, FsPermission permission,
|
|
public FSDataOutputStream createNonRecursive(Path f, FsPermission permission,
|
|
EnumSet<CreateFlag> flags, int bufferSize, short replication, long blockSize,
|
|
EnumSet<CreateFlag> flags, int bufferSize, short replication, long blockSize,
|
|
@@ -1430,6 +1489,7 @@ public abstract class FileSystem extends Configured
|
|
* <i>Important: the default implementation is not atomic</i>
|
|
* <i>Important: the default implementation is not atomic</i>
|
|
* @param f path to use for create
|
|
* @param f path to use for create
|
|
* @throws IOException IO failure
|
|
* @throws IOException IO failure
|
|
|
|
+ * @return if create new file success true,not false.
|
|
*/
|
|
*/
|
|
public boolean createNewFile(Path f) throws IOException {
|
|
public boolean createNewFile(Path f) throws IOException {
|
|
if (exists(f)) {
|
|
if (exists(f)) {
|
|
@@ -1450,6 +1510,7 @@ public abstract class FileSystem extends Configured
|
|
* @throws IOException IO failure
|
|
* @throws IOException IO failure
|
|
* @throws UnsupportedOperationException if the operation is unsupported
|
|
* @throws UnsupportedOperationException if the operation is unsupported
|
|
* (default).
|
|
* (default).
|
|
|
|
+ * @return output stream.
|
|
*/
|
|
*/
|
|
public FSDataOutputStream append(Path f) throws IOException {
|
|
public FSDataOutputStream append(Path f) throws IOException {
|
|
return append(f, getConf().getInt(IO_FILE_BUFFER_SIZE_KEY,
|
|
return append(f, getConf().getInt(IO_FILE_BUFFER_SIZE_KEY,
|
|
@@ -1464,6 +1525,7 @@ public abstract class FileSystem extends Configured
|
|
* @throws IOException IO failure
|
|
* @throws IOException IO failure
|
|
* @throws UnsupportedOperationException if the operation is unsupported
|
|
* @throws UnsupportedOperationException if the operation is unsupported
|
|
* (default).
|
|
* (default).
|
|
|
|
+ * @return output stream.
|
|
*/
|
|
*/
|
|
public FSDataOutputStream append(Path f, int bufferSize) throws IOException {
|
|
public FSDataOutputStream append(Path f, int bufferSize) throws IOException {
|
|
return append(f, bufferSize, null);
|
|
return append(f, bufferSize, null);
|
|
@@ -1477,6 +1539,7 @@ public abstract class FileSystem extends Configured
|
|
* @throws IOException IO failure
|
|
* @throws IOException IO failure
|
|
* @throws UnsupportedOperationException if the operation is unsupported
|
|
* @throws UnsupportedOperationException if the operation is unsupported
|
|
* (default).
|
|
* (default).
|
|
|
|
+ * @return output stream.
|
|
*/
|
|
*/
|
|
public abstract FSDataOutputStream append(Path f, int bufferSize,
|
|
public abstract FSDataOutputStream append(Path f, int bufferSize,
|
|
Progressable progress) throws IOException;
|
|
Progressable progress) throws IOException;
|
|
@@ -1515,7 +1578,7 @@ public abstract class FileSystem extends Configured
|
|
* This is the default behavior.
|
|
* This is the default behavior.
|
|
* @param src file name
|
|
* @param src file name
|
|
* @param replication new replication
|
|
* @param replication new replication
|
|
- * @throws IOException
|
|
|
|
|
|
+ * @throws IOException an IO failure.
|
|
* @return true if successful, or the feature in unsupported;
|
|
* @return true if successful, or the feature in unsupported;
|
|
* false if replication is supported but the file does not exist,
|
|
* false if replication is supported but the file does not exist,
|
|
* or is a directory
|
|
* or is a directory
|
|
@@ -1544,11 +1607,12 @@ public abstract class FileSystem extends Configured
|
|
* <p>
|
|
* <p>
|
|
* If OVERWRITE option is not passed as an argument, rename fails
|
|
* If OVERWRITE option is not passed as an argument, rename fails
|
|
* if the dst already exists.
|
|
* if the dst already exists.
|
|
|
|
+ * </p>
|
|
* <p>
|
|
* <p>
|
|
* If OVERWRITE option is passed as an argument, rename overwrites
|
|
* If OVERWRITE option is passed as an argument, rename overwrites
|
|
* the dst if it is a file or an empty directory. Rename fails if dst is
|
|
* the dst if it is a file or an empty directory. Rename fails if dst is
|
|
* a non-empty directory.
|
|
* a non-empty directory.
|
|
- * <p>
|
|
|
|
|
|
+ * </p>
|
|
* Note that atomicity of rename is dependent on the file system
|
|
* Note that atomicity of rename is dependent on the file system
|
|
* implementation. Please refer to the file system documentation for
|
|
* implementation. Please refer to the file system documentation for
|
|
* details. This default implementation is non atomic.
|
|
* details. This default implementation is non atomic.
|
|
@@ -1556,9 +1620,11 @@ public abstract class FileSystem extends Configured
|
|
* This method is deprecated since it is a temporary method added to
|
|
* This method is deprecated since it is a temporary method added to
|
|
* support the transition from FileSystem to FileContext for user
|
|
* support the transition from FileSystem to FileContext for user
|
|
* applications.
|
|
* applications.
|
|
|
|
+ * </p>
|
|
*
|
|
*
|
|
* @param src path to be renamed
|
|
* @param src path to be renamed
|
|
* @param dst new path after rename
|
|
* @param dst new path after rename
|
|
|
|
+ * @param options rename options.
|
|
* @throws FileNotFoundException src path does not exist, or the parent
|
|
* @throws FileNotFoundException src path does not exist, or the parent
|
|
* path of dst does not exist.
|
|
* path of dst does not exist.
|
|
* @throws FileAlreadyExistsException dest path exists and is a file
|
|
* @throws FileAlreadyExistsException dest path exists and is a file
|
|
@@ -1653,6 +1719,9 @@ public abstract class FileSystem extends Configured
|
|
|
|
|
|
/**
|
|
/**
|
|
* Delete a file/directory.
|
|
* Delete a file/directory.
|
|
|
|
+ * @param f the path.
|
|
|
|
+ * @throws IOException IO failure.
|
|
|
|
+ * @return if delete success true, not false.
|
|
* @deprecated Use {@link #delete(Path, boolean)} instead.
|
|
* @deprecated Use {@link #delete(Path, boolean)} instead.
|
|
*/
|
|
*/
|
|
@Deprecated
|
|
@Deprecated
|
|
@@ -1769,6 +1838,7 @@ public abstract class FileSystem extends Configured
|
|
* @param f path to check
|
|
* @param f path to check
|
|
* @throws IOException IO failure
|
|
* @throws IOException IO failure
|
|
* @deprecated Use {@link #getFileStatus(Path)} instead
|
|
* @deprecated Use {@link #getFileStatus(Path)} instead
|
|
|
|
+ * @return if f is directory true, not false.
|
|
*/
|
|
*/
|
|
@Deprecated
|
|
@Deprecated
|
|
public boolean isDirectory(Path f) throws IOException {
|
|
public boolean isDirectory(Path f) throws IOException {
|
|
@@ -1786,6 +1856,7 @@ public abstract class FileSystem extends Configured
|
|
* @param f path to check
|
|
* @param f path to check
|
|
* @throws IOException IO failure
|
|
* @throws IOException IO failure
|
|
* @deprecated Use {@link #getFileStatus(Path)} instead
|
|
* @deprecated Use {@link #getFileStatus(Path)} instead
|
|
|
|
+ * @return if f is file true, not false.
|
|
*/
|
|
*/
|
|
@Deprecated
|
|
@Deprecated
|
|
public boolean isFile(Path f) throws IOException {
|
|
public boolean isFile(Path f) throws IOException {
|
|
@@ -1798,6 +1869,7 @@ public abstract class FileSystem extends Configured
|
|
|
|
|
|
/**
|
|
/**
|
|
* The number of bytes in a file.
|
|
* The number of bytes in a file.
|
|
|
|
+ * @param f the path.
|
|
* @return the number of bytes; 0 for a directory
|
|
* @return the number of bytes; 0 for a directory
|
|
* @deprecated Use {@link #getFileStatus(Path)} instead.
|
|
* @deprecated Use {@link #getFileStatus(Path)} instead.
|
|
* @throws FileNotFoundException if the path does not resolve
|
|
* @throws FileNotFoundException if the path does not resolve
|
|
@@ -1812,6 +1884,7 @@ public abstract class FileSystem extends Configured
|
|
* @param f path to use
|
|
* @param f path to use
|
|
* @throws FileNotFoundException if the path does not resolve
|
|
* @throws FileNotFoundException if the path does not resolve
|
|
* @throws IOException IO failure
|
|
* @throws IOException IO failure
|
|
|
|
+ * @return content summary.
|
|
*/
|
|
*/
|
|
public ContentSummary getContentSummary(Path f) throws IOException {
|
|
public ContentSummary getContentSummary(Path f) throws IOException {
|
|
FileStatus status = getFileStatus(f);
|
|
FileStatus status = getFileStatus(f);
|
|
@@ -1946,9 +2019,9 @@ public abstract class FileSystem extends Configured
|
|
* @param f Path to list
|
|
* @param f Path to list
|
|
* @param token opaque iteration token returned by previous call, or null
|
|
* @param token opaque iteration token returned by previous call, or null
|
|
* if this is the first call.
|
|
* if this is the first call.
|
|
- * @return
|
|
|
|
- * @throws FileNotFoundException
|
|
|
|
- * @throws IOException
|
|
|
|
|
|
+ * @return directory entries.
|
|
|
|
+ * @throws FileNotFoundException when the path does not exist.
|
|
|
|
+ * @throws IOException If an I/O error occurred.
|
|
*/
|
|
*/
|
|
@InterfaceAudience.Private
|
|
@InterfaceAudience.Private
|
|
protected DirectoryEntries listStatusBatch(Path f, byte[] token) throws
|
|
protected DirectoryEntries listStatusBatch(Path f, byte[] token) throws
|
|
@@ -1979,6 +2052,8 @@ public abstract class FileSystem extends Configured
|
|
|
|
|
|
/**
|
|
/**
|
|
* List corrupted file blocks.
|
|
* List corrupted file blocks.
|
|
|
|
+ *
|
|
|
|
+ * @param path the path.
|
|
* @return an iterator over the corrupt files under the given path
|
|
* @return an iterator over the corrupt files under the given path
|
|
* (may contain duplicates if a file has more than one corrupt block)
|
|
* (may contain duplicates if a file has more than one corrupt block)
|
|
* @throws UnsupportedOperationException if the operation is unsupported
|
|
* @throws UnsupportedOperationException if the operation is unsupported
|
|
@@ -2072,36 +2147,29 @@ public abstract class FileSystem extends Configured
|
|
* <dt> <tt> ? </tt>
|
|
* <dt> <tt> ? </tt>
|
|
* <dd> Matches any single character.
|
|
* <dd> Matches any single character.
|
|
*
|
|
*
|
|
- * <p>
|
|
|
|
* <dt> <tt> * </tt>
|
|
* <dt> <tt> * </tt>
|
|
* <dd> Matches zero or more characters.
|
|
* <dd> Matches zero or more characters.
|
|
*
|
|
*
|
|
- * <p>
|
|
|
|
* <dt> <tt> [<i>abc</i>] </tt>
|
|
* <dt> <tt> [<i>abc</i>] </tt>
|
|
* <dd> Matches a single character from character set
|
|
* <dd> Matches a single character from character set
|
|
* <tt>{<i>a,b,c</i>}</tt>.
|
|
* <tt>{<i>a,b,c</i>}</tt>.
|
|
*
|
|
*
|
|
- * <p>
|
|
|
|
* <dt> <tt> [<i>a</i>-<i>b</i>] </tt>
|
|
* <dt> <tt> [<i>a</i>-<i>b</i>] </tt>
|
|
* <dd> Matches a single character from the character range
|
|
* <dd> Matches a single character from the character range
|
|
* <tt>{<i>a...b</i>}</tt>. Note that character <tt><i>a</i></tt> must be
|
|
* <tt>{<i>a...b</i>}</tt>. Note that character <tt><i>a</i></tt> must be
|
|
* lexicographically less than or equal to character <tt><i>b</i></tt>.
|
|
* lexicographically less than or equal to character <tt><i>b</i></tt>.
|
|
*
|
|
*
|
|
- * <p>
|
|
|
|
* <dt> <tt> [^<i>a</i>] </tt>
|
|
* <dt> <tt> [^<i>a</i>] </tt>
|
|
* <dd> Matches a single character that is not from character set or range
|
|
* <dd> Matches a single character that is not from character set or range
|
|
* <tt>{<i>a</i>}</tt>. Note that the <tt>^</tt> character must occur
|
|
* <tt>{<i>a</i>}</tt>. Note that the <tt>^</tt> character must occur
|
|
* immediately to the right of the opening bracket.
|
|
* immediately to the right of the opening bracket.
|
|
*
|
|
*
|
|
- * <p>
|
|
|
|
* <dt> <tt> \<i>c</i> </tt>
|
|
* <dt> <tt> \<i>c</i> </tt>
|
|
* <dd> Removes (escapes) any special meaning of character <i>c</i>.
|
|
* <dd> Removes (escapes) any special meaning of character <i>c</i>.
|
|
*
|
|
*
|
|
- * <p>
|
|
|
|
* <dt> <tt> {ab,cd} </tt>
|
|
* <dt> <tt> {ab,cd} </tt>
|
|
* <dd> Matches a string from the string set <tt>{<i>ab, cd</i>} </tt>
|
|
* <dd> Matches a string from the string set <tt>{<i>ab, cd</i>} </tt>
|
|
*
|
|
*
|
|
- * <p>
|
|
|
|
* <dt> <tt> {ab,c{de,fh}} </tt>
|
|
* <dt> <tt> {ab,c{de,fh}} </tt>
|
|
* <dd> Matches a string from the string set <tt>{<i>ab, cde, cfh</i>}</tt>
|
|
* <dd> Matches a string from the string set <tt>{<i>ab, cde, cfh</i>}</tt>
|
|
*
|
|
*
|
|
@@ -2332,6 +2400,7 @@ public abstract class FileSystem extends Configured
|
|
|
|
|
|
/** Return the current user's home directory in this FileSystem.
|
|
/** Return the current user's home directory in this FileSystem.
|
|
* The default implementation returns {@code "/user/$USER/"}.
|
|
* The default implementation returns {@code "/user/$USER/"}.
|
|
|
|
+ * @return the path.
|
|
*/
|
|
*/
|
|
public Path getHomeDirectory() {
|
|
public Path getHomeDirectory() {
|
|
String username;
|
|
String username;
|
|
@@ -2394,6 +2463,7 @@ public abstract class FileSystem extends Configured
|
|
* @param f path to create
|
|
* @param f path to create
|
|
* @param permission to apply to f
|
|
* @param permission to apply to f
|
|
* @throws IOException IO failure
|
|
* @throws IOException IO failure
|
|
|
|
+ * @return if mkdir success true, not false.
|
|
*/
|
|
*/
|
|
public abstract boolean mkdirs(Path f, FsPermission permission
|
|
public abstract boolean mkdirs(Path f, FsPermission permission
|
|
) throws IOException;
|
|
) throws IOException;
|
|
@@ -2441,6 +2511,7 @@ public abstract class FileSystem extends Configured
|
|
* @param delSrc whether to delete the src
|
|
* @param delSrc whether to delete the src
|
|
* @param src path
|
|
* @param src path
|
|
* @param dst path
|
|
* @param dst path
|
|
|
|
+ * @throws IOException IO failure.
|
|
*/
|
|
*/
|
|
public void copyFromLocalFile(boolean delSrc, Path src, Path dst)
|
|
public void copyFromLocalFile(boolean delSrc, Path src, Path dst)
|
|
throws IOException {
|
|
throws IOException {
|
|
@@ -2555,6 +2626,7 @@ public abstract class FileSystem extends Configured
|
|
* @param fsOutputFile path of output file
|
|
* @param fsOutputFile path of output file
|
|
* @param tmpLocalFile path of local tmp file
|
|
* @param tmpLocalFile path of local tmp file
|
|
* @throws IOException IO failure
|
|
* @throws IOException IO failure
|
|
|
|
+ * @return the path.
|
|
*/
|
|
*/
|
|
public Path startLocalOutput(Path fsOutputFile, Path tmpLocalFile)
|
|
public Path startLocalOutput(Path fsOutputFile, Path tmpLocalFile)
|
|
throws IOException {
|
|
throws IOException {
|
|
@@ -2602,6 +2674,7 @@ public abstract class FileSystem extends Configured
|
|
/**
|
|
/**
|
|
* Return the total size of all files in the filesystem.
|
|
* Return the total size of all files in the filesystem.
|
|
* @throws IOException IO failure
|
|
* @throws IOException IO failure
|
|
|
|
+ * @return the number of path used.
|
|
*/
|
|
*/
|
|
public long getUsed() throws IOException {
|
|
public long getUsed() throws IOException {
|
|
Path path = new Path("/");
|
|
Path path = new Path("/");
|
|
@@ -2610,7 +2683,9 @@ public abstract class FileSystem extends Configured
|
|
|
|
|
|
/**
|
|
/**
|
|
* Return the total size of all files from a specified path.
|
|
* Return the total size of all files from a specified path.
|
|
|
|
+ * @param path the path.
|
|
* @throws IOException IO failure
|
|
* @throws IOException IO failure
|
|
|
|
+ * @return the number of path content summary.
|
|
*/
|
|
*/
|
|
public long getUsed(Path path) throws IOException {
|
|
public long getUsed(Path path) throws IOException {
|
|
return getContentSummary(path).getLength();
|
|
return getContentSummary(path).getLength();
|
|
@@ -2633,6 +2708,7 @@ public abstract class FileSystem extends Configured
|
|
* Return the number of bytes that large input files should be optimally
|
|
* Return the number of bytes that large input files should be optimally
|
|
* be split into to minimize I/O time.
|
|
* be split into to minimize I/O time.
|
|
* @deprecated use {@link #getDefaultBlockSize(Path)} instead
|
|
* @deprecated use {@link #getDefaultBlockSize(Path)} instead
|
|
|
|
+ * @return default block size.
|
|
*/
|
|
*/
|
|
@Deprecated
|
|
@Deprecated
|
|
public long getDefaultBlockSize() {
|
|
public long getDefaultBlockSize() {
|
|
@@ -2685,8 +2761,8 @@ public abstract class FileSystem extends Configured
|
|
* In some FileSystem implementations such as HDFS metadata
|
|
* In some FileSystem implementations such as HDFS metadata
|
|
* synchronization is essential to guarantee consistency of read requests
|
|
* synchronization is essential to guarantee consistency of read requests
|
|
* particularly in HA setting.
|
|
* particularly in HA setting.
|
|
- * @throws IOException
|
|
|
|
- * @throws UnsupportedOperationException
|
|
|
|
|
|
+ * @throws IOException If an I/O error occurred.
|
|
|
|
+ * @throws UnsupportedOperationException if the operation is unsupported.
|
|
*/
|
|
*/
|
|
public void msync() throws IOException, UnsupportedOperationException {
|
|
public void msync() throws IOException, UnsupportedOperationException {
|
|
throw new UnsupportedOperationException(getClass().getCanonicalName() +
|
|
throw new UnsupportedOperationException(getClass().getCanonicalName() +
|
|
@@ -2762,6 +2838,8 @@ public abstract class FileSystem extends Configured
|
|
|
|
|
|
/**
|
|
/**
|
|
* See {@link FileContext#fixRelativePart}.
|
|
* See {@link FileContext#fixRelativePart}.
|
|
|
|
+ * @param p the path.
|
|
|
|
+ * @return relative part.
|
|
*/
|
|
*/
|
|
protected Path fixRelativePart(Path p) {
|
|
protected Path fixRelativePart(Path p) {
|
|
if (p.isUriPathAbsolute()) {
|
|
if (p.isUriPathAbsolute()) {
|
|
@@ -2773,6 +2851,18 @@ public abstract class FileSystem extends Configured
|
|
|
|
|
|
/**
|
|
/**
|
|
* See {@link FileContext#createSymlink(Path, Path, boolean)}.
|
|
* See {@link FileContext#createSymlink(Path, Path, boolean)}.
|
|
|
|
+ *
|
|
|
|
+ * @param target target path.
|
|
|
|
+ * @param link link.
|
|
|
|
+ * @param createParent create parent.
|
|
|
|
+ * @throws AccessControlException if access is denied.
|
|
|
|
+ * @throws FileAlreadyExistsException when the path does not exist.
|
|
|
|
+ * @throws FileNotFoundException when the path does not exist.
|
|
|
|
+ * @throws ParentNotDirectoryException if the parent path of dest is not
|
|
|
|
+ * a directory.
|
|
|
|
+ * @throws UnsupportedFileSystemException if there was no known implementation
|
|
|
|
+ * for the scheme.
|
|
|
|
+ * @throws IOException raised on errors performing I/O.
|
|
*/
|
|
*/
|
|
public void createSymlink(final Path target, final Path link,
|
|
public void createSymlink(final Path target, final Path link,
|
|
final boolean createParent) throws AccessControlException,
|
|
final boolean createParent) throws AccessControlException,
|
|
@@ -2786,8 +2876,14 @@ public abstract class FileSystem extends Configured
|
|
|
|
|
|
/**
|
|
/**
|
|
* See {@link FileContext#getFileLinkStatus(Path)}.
|
|
* See {@link FileContext#getFileLinkStatus(Path)}.
|
|
- * @throws FileNotFoundException when the path does not exist
|
|
|
|
- * @throws IOException see specific implementation
|
|
|
|
|
|
+ *
|
|
|
|
+ * @param f the path.
|
|
|
|
+ * @throws AccessControlException if access is denied.
|
|
|
|
+ * @throws FileNotFoundException when the path does not exist.
|
|
|
|
+ * @throws IOException raised on errors performing I/O.
|
|
|
|
+ * @throws UnsupportedFileSystemException if there was no known implementation
|
|
|
|
+ * for the scheme.
|
|
|
|
+ * @return file status
|
|
*/
|
|
*/
|
|
public FileStatus getFileLinkStatus(final Path f)
|
|
public FileStatus getFileLinkStatus(final Path f)
|
|
throws AccessControlException, FileNotFoundException,
|
|
throws AccessControlException, FileNotFoundException,
|
|
@@ -2798,6 +2894,7 @@ public abstract class FileSystem extends Configured
|
|
|
|
|
|
/**
|
|
/**
|
|
* See {@link AbstractFileSystem#supportsSymlinks()}.
|
|
* See {@link AbstractFileSystem#supportsSymlinks()}.
|
|
|
|
+ * @return if support symlinkls true, not false.
|
|
*/
|
|
*/
|
|
public boolean supportsSymlinks() {
|
|
public boolean supportsSymlinks() {
|
|
return false;
|
|
return false;
|
|
@@ -2805,8 +2902,11 @@ public abstract class FileSystem extends Configured
|
|
|
|
|
|
/**
|
|
/**
|
|
* See {@link FileContext#getLinkTarget(Path)}.
|
|
* See {@link FileContext#getLinkTarget(Path)}.
|
|
|
|
+ * @param f the path.
|
|
* @throws UnsupportedOperationException if the operation is unsupported
|
|
* @throws UnsupportedOperationException if the operation is unsupported
|
|
* (default outcome).
|
|
* (default outcome).
|
|
|
|
+ * @throws IOException IO failure.
|
|
|
|
+ * @return the path.
|
|
*/
|
|
*/
|
|
public Path getLinkTarget(Path f) throws IOException {
|
|
public Path getLinkTarget(Path f) throws IOException {
|
|
// Supporting filesystems should override this method
|
|
// Supporting filesystems should override this method
|
|
@@ -2816,8 +2916,11 @@ public abstract class FileSystem extends Configured
|
|
|
|
|
|
/**
|
|
/**
|
|
* See {@link AbstractFileSystem#getLinkTarget(Path)}.
|
|
* See {@link AbstractFileSystem#getLinkTarget(Path)}.
|
|
|
|
+ * @param f the path.
|
|
* @throws UnsupportedOperationException if the operation is unsupported
|
|
* @throws UnsupportedOperationException if the operation is unsupported
|
|
* (default outcome).
|
|
* (default outcome).
|
|
|
|
+ * @throws IOException IO failure.
|
|
|
|
+ * @return the path.
|
|
*/
|
|
*/
|
|
protected Path resolveLink(Path f) throws IOException {
|
|
protected Path resolveLink(Path f) throws IOException {
|
|
// Supporting filesystems should override this method
|
|
// Supporting filesystems should override this method
|
|
@@ -3221,7 +3324,7 @@ public abstract class FileSystem extends Configured
|
|
/**
|
|
/**
|
|
* Set the source path to satisfy storage policy.
|
|
* Set the source path to satisfy storage policy.
|
|
* @param path The source path referring to either a directory or a file.
|
|
* @param path The source path referring to either a directory or a file.
|
|
- * @throws IOException
|
|
|
|
|
|
+ * @throws IOException If an I/O error occurred.
|
|
*/
|
|
*/
|
|
public void satisfyStoragePolicy(final Path path) throws IOException {
|
|
public void satisfyStoragePolicy(final Path path) throws IOException {
|
|
throw new UnsupportedOperationException(
|
|
throw new UnsupportedOperationException(
|
|
@@ -3529,7 +3632,7 @@ public abstract class FileSystem extends Configured
|
|
* @param conf configuration
|
|
* @param conf configuration
|
|
* @param key key to store/retrieve this FileSystem in the cache
|
|
* @param key key to store/retrieve this FileSystem in the cache
|
|
* @return a cached or newly instantiated FileSystem.
|
|
* @return a cached or newly instantiated FileSystem.
|
|
- * @throws IOException
|
|
|
|
|
|
+ * @throws IOException If an I/O error occurred.
|
|
*/
|
|
*/
|
|
private FileSystem getInternal(URI uri, Configuration conf, Key key)
|
|
private FileSystem getInternal(URI uri, Configuration conf, Key key)
|
|
throws IOException{
|
|
throws IOException{
|
|
@@ -4024,6 +4127,7 @@ public abstract class FileSystem extends Configured
|
|
|
|
|
|
/**
|
|
/**
|
|
* Get or create the thread-local data associated with the current thread.
|
|
* Get or create the thread-local data associated with the current thread.
|
|
|
|
+ * @return statistics data.
|
|
*/
|
|
*/
|
|
public StatisticsData getThreadStatistics() {
|
|
public StatisticsData getThreadStatistics() {
|
|
StatisticsData data = threadData.get();
|
|
StatisticsData data = threadData.get();
|
|
@@ -4382,6 +4486,7 @@ public abstract class FileSystem extends Configured
|
|
/**
|
|
/**
|
|
* Return the FileSystem classes that have Statistics.
|
|
* Return the FileSystem classes that have Statistics.
|
|
* @deprecated use {@link #getGlobalStorageStatistics()}
|
|
* @deprecated use {@link #getGlobalStorageStatistics()}
|
|
|
|
+ * @return statistics lists.
|
|
*/
|
|
*/
|
|
@Deprecated
|
|
@Deprecated
|
|
public static synchronized List<Statistics> getAllStatistics() {
|
|
public static synchronized List<Statistics> getAllStatistics() {
|
|
@@ -4390,6 +4495,7 @@ public abstract class FileSystem extends Configured
|
|
|
|
|
|
/**
|
|
/**
|
|
* Get the statistics for a particular file system.
|
|
* Get the statistics for a particular file system.
|
|
|
|
+ * @param scheme scheme.
|
|
* @param cls the class to lookup
|
|
* @param cls the class to lookup
|
|
* @return a statistics object
|
|
* @return a statistics object
|
|
* @deprecated use {@link #getGlobalStorageStatistics()}
|
|
* @deprecated use {@link #getGlobalStorageStatistics()}
|
|
@@ -4424,6 +4530,7 @@ public abstract class FileSystem extends Configured
|
|
|
|
|
|
/**
|
|
/**
|
|
* Print all statistics for all file systems to {@code System.out}
|
|
* Print all statistics for all file systems to {@code System.out}
|
|
|
|
+ * @throws IOException If an I/O error occurred.
|
|
*/
|
|
*/
|
|
public static synchronized
|
|
public static synchronized
|
|
void printStatistics() throws IOException {
|
|
void printStatistics() throws IOException {
|
|
@@ -4464,6 +4571,7 @@ public abstract class FileSystem extends Configured
|
|
|
|
|
|
/**
|
|
/**
|
|
* Get the global storage statistics.
|
|
* Get the global storage statistics.
|
|
|
|
+ * @return global storage statistics.
|
|
*/
|
|
*/
|
|
public static GlobalStorageStatistics getGlobalStorageStatistics() {
|
|
public static GlobalStorageStatistics getGlobalStorageStatistics() {
|
|
return GlobalStorageStatistics.INSTANCE;
|
|
return GlobalStorageStatistics.INSTANCE;
|