Package org.apache.hadoop.fs.s3a.commit
Class CommitUtils
java.lang.Object
org.apache.hadoop.fs.s3a.commit.CommitUtils
Static utility methods related to S3A commitment processing, both
staging and magic.
Do not use in any codepath intended to be used from the S3AFS
except in the committers themselves.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringextractJobID(org.apache.hadoop.conf.Configuration conf) Extract the job ID from a configuration.static S3AFileSystemgetS3AFileSystem(org.apache.hadoop.fs.Path path, org.apache.hadoop.conf.Configuration conf, boolean magicCommitRequired) Get the S3A FS of a path.static voidvalidateCollectionClass(Iterable it, Class classname) Verify that all instances in a collection are of the given class.static voidVerify that an S3A FS instance is a magic commit FS.static voidverifyIsMagicCommitPath(S3AFileSystem fs, org.apache.hadoop.fs.Path path) Verify that the path is a magic one.static S3AFileSystemverifyIsS3AFS(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path) Verify that an FS is an S3A FS.
-
Method Details
-
verifyIsMagicCommitPath
public static void verifyIsMagicCommitPath(S3AFileSystem fs, org.apache.hadoop.fs.Path path) throws PathCommitException Verify that the path is a magic one.- Parameters:
fs- filesystempath- path- Throws:
PathCommitException- if the path isn't a magic commit path
-
verifyIsMagicCommitFS
Verify that an S3A FS instance is a magic commit FS.- Parameters:
fs- filesystem- Throws:
PathCommitException- if the FS isn't a magic commit FS.
-
verifyIsS3AFS
public static S3AFileSystem verifyIsS3AFS(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path) throws PathCommitException Verify that an FS is an S3A FS.- Parameters:
fs- filesystempath- path to to use in exception- Returns:
- the typecast FS.
- Throws:
PathCommitException- if the FS is not an S3A FS.
-
getS3AFileSystem
public static S3AFileSystem getS3AFileSystem(org.apache.hadoop.fs.Path path, org.apache.hadoop.conf.Configuration conf, boolean magicCommitRequired) throws PathCommitException, IOException Get the S3A FS of a path.- Parameters:
path- path to examineconf- configmagicCommitRequired- is magic complete required in the FS?- Returns:
- the filesystem
- Throws:
PathCommitException- output path isn't to an S3A FS instance, or ifmagicCommitRequiredis set, if doesn't support these commits.IOException- failure to instantiate the FS
-
validateCollectionClass
Verify that all instances in a collection are of the given class.- Parameters:
it- iteratorclassname- classname to require- Throws:
ValidationFailure- on a failure
-
extractJobID
Extract the job ID from a configuration.- Parameters:
conf- configuration- Returns:
- a job ID or null.
-