Package org.apache.hadoop.fs.s3a.tools
Class BucketTool
java.lang.Object
org.apache.hadoop.conf.Configured
org.apache.hadoop.fs.s3a.s3guard.S3GuardTool
org.apache.hadoop.fs.s3a.tools.BucketTool
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.hadoop.conf.Configurable,org.apache.hadoop.util.Tool
Bucket operations, e.g. create/delete/probe.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.fs.s3a.s3guard.S3GuardTool
S3GuardTool.BucketInfo -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringcreate command.static final StringName of this tool: "bucket".static final Stringendpoint "endpoint".static final Stringregion "region".static final StringZone for a store.static final StringError Message logged/thrown when the tool could not start as the bucket probe was not disabled and the probe (inevitably) failed.static final StringPurpose of this tool: "View and manipulate S3 buckets".Fields inherited from class org.apache.hadoop.fs.s3a.s3guard.S3GuardTool
AGE_OPTIONS_USAGE, DAYS_FLAG, HOURS_FLAG, META_FLAG, MINUTES_FLAG, SECONDS_FLAG, VERBOSE, WRONG_FILESYSTEM -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetName()Return sub-command name.getUsage()static voidremoveBucketOverrides(String bucket, org.apache.hadoop.conf.Configuration conf, String... options) Remove any values from a bucket.intrun(String[] args, PrintStream out) Run the tool, capturing the output (if the tool supports that).Methods inherited from class org.apache.hadoop.fs.s3a.s3guard.S3GuardTool
addAgeOptions, badState, bindFilesystem, close, dumpFileSystemStatistics, errorln, errorln, exit, exitException, getCommandFormat, getFilesystem, initS3AFileSystem, invalidArgs, main, notFound, parseArgs, parseArgsWithErrorReporting, println, resetBindings, run, run, s3guardUnsupported, toUri, userAbortedMethods inherited from class org.apache.hadoop.conf.Configured
getConf, setConfMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.conf.Configurable
getConf, setConf
-
Field Details
-
NAME
Name of this tool: "bucket".- See Also:
-
PURPOSE
Purpose of this tool: "View and manipulate S3 buckets".- See Also:
-
CREATE
create command.- See Also:
-
OPT_REGION
region "region".- See Also:
-
OPT_ENDPOINT
endpoint "endpoint".- See Also:
-
OPT_ZONE
Zone for a store.- See Also:
-
PROBE_FAILURE
Error Message logged/thrown when the tool could not start as the bucket probe was not disabled and the probe (inevitably) failed.- See Also:
-
-
Constructor Details
-
BucketTool
public BucketTool(org.apache.hadoop.conf.Configuration conf)
-
-
Method Details
-
getUsage
- Specified by:
getUsagein classS3GuardTool
-
getName
Description copied from class:S3GuardToolReturn sub-command name.- Specified by:
getNamein classS3GuardTool- Returns:
- sub-command name.
-
run
public int run(String[] args, PrintStream out) throws Exception, org.apache.hadoop.util.ExitUtil.ExitException Description copied from class:S3GuardToolRun the tool, capturing the output (if the tool supports that). As well as returning an exit code, the implementations can choose to throw an instance ofExitUtil.ExitExceptionwith their exit code set to the desired exit value. The exit code of such an exception is used for the tool's exit code, and the stack trace only logged at debug.- Specified by:
runin classS3GuardTool- Parameters:
args- argument listout- output stream- Returns:
- the exit code to return.
- Throws:
Exception- on any failureorg.apache.hadoop.util.ExitUtil.ExitException
-
removeBucketOverrides
public static void removeBucketOverrides(String bucket, org.apache.hadoop.conf.Configuration conf, String... options) Remove any values from a bucket.- Parameters:
bucket- bucket whose overrides are to be removed. Can be null/emptyconf- configoptions- list of fs.s3a options to remove
-