public class S3GuardFsck extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
S3GuardFsck.ComparePair
A compare pair with the pair of metadata and the list of violations.
|
static class |
S3GuardFsck.DDBTree
DDBTree is the tree that represents the structure of items in the DynamoDB.
|
static class |
S3GuardFsck.Violation
Violation with severity and the handler.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
ROOT_PATH_STRING |
| Constructor and Description |
|---|
S3GuardFsck(S3AFileSystem fs,
MetadataStore ms)
Creates an S3GuardFsck.
|
| Modifier and Type | Method and Description |
|---|---|
List<S3GuardFsck.ComparePair> |
checkDdbInternalConsistency(org.apache.hadoop.fs.Path basePath)
Check the DynamoDB metadatastore internally for consistency.
|
protected S3GuardFsck.ComparePair |
compareFileStatusToPathMetadata(S3AFileStatus s3FileStatus,
PathMetadata msPathMetadata)
Compares a
S3AFileStatus from S3 to a PathMetadata
from the metadata store. |
protected List<S3GuardFsck.ComparePair> |
compareS3DirContentToMs(S3AFileStatus s3CurrentDir,
List<S3AFileStatus> children)
Compares S3 directory content to the metadata store.
|
List<S3GuardFsck.ComparePair> |
compareS3ToMs(org.apache.hadoop.fs.Path p)
Compares S3 to MS.
|
void |
fixViolations(List<S3GuardFsck.ComparePair> violations)
Fix violations found during check.
|
public static final String ROOT_PATH_STRING
public S3GuardFsck(S3AFileSystem fs, MetadataStore ms) throws InvalidParameterException
fs - the filesystem to compare toms - metadatastore the metadatastore to compare with (dynamo)InvalidParameterExceptionpublic List<S3GuardFsck.ComparePair> compareS3ToMs(org.apache.hadoop.fs.Path p) throws IOException
S3GuardFsckViolationHandler to handle violations.
The violations are listed in Enums: S3GuardFsck.Violationp - the root path to start the traversalS3GuardFsck.ComparePairIOExceptionprotected List<S3GuardFsck.ComparePair> compareS3DirContentToMs(S3AFileStatus s3CurrentDir, List<S3AFileStatus> children) throws IOException
s3CurrentDir - file status of the current directorychildren - the contents of the directoryIOExceptionprotected S3GuardFsck.ComparePair compareFileStatusToPathMetadata(S3AFileStatus s3FileStatus, PathMetadata msPathMetadata) throws IOException
S3AFileStatus from S3 to a PathMetadata
from the metadata store. Finds violated invariants and consistency
issues.s3FileStatus - the file status from S3msPathMetadata - the path metadata from metadatastoreS3GuardFsck.ComparePair with the found issuesIOExceptionpublic void fixViolations(List<S3GuardFsck.ComparePair> violations) throws IOException
violations - to be handledIOException - throws the error if there's any during handlingpublic List<S3GuardFsck.ComparePair> checkDdbInternalConsistency(org.apache.hadoop.fs.Path basePath) throws IOException
Tasks to do here: - find orphan entries (entries without a parent). - find if a file's parent is not a directory (so the parent is a file). - find entries where the parent is a tombstone. - warn: no lastUpdated field.
IOExceptionCopyright © 2008–2022 Apache Software Foundation. All rights reserved.