@InterfaceAudience.Private @InterfaceStability.Evolving public class PathMetadata extends ExpirableMetadata
PathMetadata models path metadata stored in the
MetadataStore. The lastUpdated field is implicitly set to 0 in the
constructors without that parameter to show that it will be initialized
with 0 if not set otherwise.| Constructor and Description |
|---|
PathMetadata(S3AFileStatus fileStatus)
Creates a new
PathMetadata containing given FileStatus. |
PathMetadata(S3AFileStatus fileStatus,
long lastUpdated)
Creates a new
PathMetadata containing given FileStatus. |
PathMetadata(S3AFileStatus fileStatus,
Tristate isEmptyDir)
Creates a new
PathMetadata. |
PathMetadata(S3AFileStatus fileStatus,
Tristate isEmptyDir,
boolean isDeleted)
Creates a new
PathMetadata. |
PathMetadata(S3AFileStatus fileStatus,
Tristate isEmptyDir,
boolean isDeleted,
long lastUpdated)
Creates a new
PathMetadata. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
S3AFileStatus |
getFileStatus() |
int |
hashCode() |
boolean |
isDeleted() |
Tristate |
isEmptyDirectory()
Query if a directory is empty.
|
String |
prettyPrint() |
void |
prettyPrint(StringBuilder sb)
Log contents to supplied StringBuilder in a pretty fashion.
|
static PathMetadata |
tombstone(org.apache.hadoop.fs.Path path,
long lastUpdated)
Create a tombstone from the current time.
|
String |
toString() |
getLastUpdated, isExpired, setLastUpdatedpublic PathMetadata(S3AFileStatus fileStatus)
PathMetadata containing given FileStatus.
lastUpdated field will be updated to 0 implicitly in this constructor.fileStatus - file status containing an absolute path.public PathMetadata(S3AFileStatus fileStatus, long lastUpdated)
PathMetadata containing given FileStatus.fileStatus - file status containing an absolute path.lastUpdated - last updated time on which expiration is based.public PathMetadata(S3AFileStatus fileStatus, Tristate isEmptyDir)
PathMetadata.
lastUpdated field will be updated to 0 implicitly in this constructor.fileStatus - file status containing an absolute path.isEmptyDir - empty directory Tristatepublic PathMetadata(S3AFileStatus fileStatus, Tristate isEmptyDir, boolean isDeleted)
PathMetadata.
lastUpdated field will be updated to 0 implicitly in this constructor.fileStatus - file status containing an absolute path.isEmptyDir - empty directory TristateisDeleted - deleted / tombstoned flagpublic PathMetadata(S3AFileStatus fileStatus, Tristate isEmptyDir, boolean isDeleted, long lastUpdated)
PathMetadata.fileStatus - file status containing an absolute path.isEmptyDir - empty directory TristateisDeleted - deleted / tombstoned flaglastUpdated - last updated time on which expiration is based.public static PathMetadata tombstone(org.apache.hadoop.fs.Path path, long lastUpdated)
path - path to tombstonelastUpdated - last updated time on which expiration is based.public final S3AFileStatus getFileStatus()
FileStatus contained in this PathMetadata.public Tristate isEmptyDirectory()
public boolean isDeleted()
public void prettyPrint(StringBuilder sb)
sb - target StringBuilderpublic String prettyPrint()
Copyright © 2008–2022 Apache Software Foundation. All rights reserved.