@InterfaceAudience.LimitedPrivate(value="management tools") @InterfaceStability.Unstable public final class MarkerTool extends S3GuardTool
| Modifier and Type | Class and Description |
|---|---|
static class |
MarkerTool.MarkerPurgeSummary
Result of a call of
purgeMarkers(DirMarkerTracker, int);
included in MarkerTool.ScanResult so must share visibility. |
static class |
MarkerTool.ScanArgs
Arguments for the scan.
|
static class |
MarkerTool.ScanArgsBuilder
Builder of the scan arguments.
|
static class |
MarkerTool.ScanResult
Result of the scan operation.
|
S3GuardTool.BucketInfo| Modifier and Type | Field and Description |
|---|---|
static String |
AUDIT
Audit sub-command: "-audit".
|
static String |
CLEAN
Clean Sub-command: "-clean".
|
static String |
MARKERS
Name of this tool: "markers".
|
static String |
OPT_AUDIT
Audit sub-command: "audit".
|
static String |
OPT_CLEAN
Clean Sub-command: "clean".
|
static String |
OPT_LIMIT
Limit of objects to scan: "limit".
|
static String |
OPT_MAX
Max number of markers to find: "max".
|
static String |
OPT_MIN
Min number of markers to find: "min".
|
static String |
OPT_NONAUTH
Only consider markers found in non-authoritative paths
as failures: "nonauth".
|
static String |
OPT_OUT
Name of a file to save the list of markers to: "out".
|
static String |
PURPOSE
Purpose of this tool: "View and manipulate S3 directory markers".
|
static int |
UNLIMITED_LISTING
Constant to use when there is no limit on the number of
objects listed: 0.
|
static int |
UNLIMITED_MIN_MARKERS
Constant to use when there is no minimum number of
markers: -1.
|
AGE_OPTIONS_USAGE, CMK_FLAG, DAYS_FLAG, HOURS_FLAG, META_FLAG, MINUTES_FLAG, READ_FLAG, REGION_FLAG, SECONDS_FLAG, SSE_FLAG, TAG_FLAG, VERBOSE, WRITE_FLAG, WRONG_FILESYSTEM| Constructor and Description |
|---|
MarkerTool(org.apache.hadoop.conf.Configuration conf)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static MarkerTool.ScanResult |
execMarkerTool(MarkerTool.ScanArgs scanArgs)
Execute the marker tool, with no checks on return codes.
|
String |
getName()
Return sub-command name.
|
String |
getUsage() |
boolean |
isVerbose() |
void |
resetBindings()
Reset the store and filesystem bindings.
|
int |
run(String[] args,
PrintStream stream)
Run the tool, capturing the output (if the tool supports that).
|
void |
setVerbose(boolean verbose) |
addAgeOptions, badState, bindFilesystem, checkBucketNameOrDDBTableNameProvided, checkIfS3BucketIsGuarded, close, dumpFileSystemStatistics, errorln, errorln, exit, exitException, getCommandFormat, getFilesystem, getStore, initMetadataStore, initS3AFileSystem, invalidArgs, main, parseArgs, parseDynamoDBRegion, println, printStoreDiagnostics, run, run, setStore, storeNotFound, toUri, userAbortedpublic static final String MARKERS
public static final String PURPOSE
public static final String OPT_AUDIT
public static final String OPT_CLEAN
public static final String AUDIT
public static final String CLEAN
public static final String OPT_MIN
public static final String OPT_MAX
public static final String OPT_OUT
public static final String OPT_LIMIT
public static final String OPT_NONAUTH
public static final int UNLIMITED_LISTING
-limit 0.
The command line parser rejects -limit -1 as the -1
is interpreted as the (unknown) option "-1".public static final int UNLIMITED_MIN_MARKERS
public MarkerTool(org.apache.hadoop.conf.Configuration conf)
conf - configurationpublic String getUsage()
getUsage in class S3GuardToolpublic String getName()
S3GuardToolgetName in class S3GuardToolpublic void resetBindings()
S3GuardToolresetBindings in class S3GuardToolpublic int run(String[] args, PrintStream stream) throws org.apache.hadoop.util.ExitUtil.ExitException, Exception
S3GuardToolExitUtil.ExitException with 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.run in class S3GuardToolargs - argument liststream - output streamException - on any failureorg.apache.hadoop.util.ExitUtil.ExitExceptionpublic boolean isVerbose()
public void setVerbose(boolean verbose)
public static MarkerTool.ScanResult execMarkerTool(MarkerTool.ScanArgs scanArgs) throws IOException
scanArgs - set of args for the scanner.IOExceptionCopyright © 2008–2022 Apache Software Foundation. All rights reserved.