Package org.apache.beam.sdk.io.fs
Class MatchResult.Metadata
java.lang.Object
org.apache.beam.sdk.io.fs.MatchResult.Metadata
- All Implemented Interfaces:
Serializable
- Enclosing class:
MatchResult
MatchResult.Metadata
of a matched file.- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MatchResult.Metadata.Builder
builder()
checksum()
An optional checksum to identify the contents of a file.abstract boolean
abstract long
Last modification timestamp in milliseconds since Unix epoch.abstract ResourceId
abstract long
-
Constructor Details
-
Metadata
public Metadata()
-
-
Method Details
-
resourceId
-
sizeBytes
public abstract long sizeBytes() -
isReadSeekEfficient
public abstract boolean isReadSeekEfficient() -
checksum
An optional checksum to identify the contents of a file. -
lastModifiedMillis
public abstract long lastModifiedMillis()Last modification timestamp in milliseconds since Unix epoch.Note that this field is not encoded with the default
MetadataCoder
due to a need for compatibility with previous versions of the Beam SDK. If you want to rely onlastModifiedMillis
values, be sure to explicitly set the coder toMetadataCoderV2
. Otherwise, all instances will have the default value of 0, consistent with the behavior ofFile.lastModified()
.The following example sets the coder explicitly and accesses
lastModifiedMillis
to set record timestamps:PCollection<Metadata> metadataWithTimestamp = p .apply(FileIO.match().filepattern("hdfs://path/to/*.gz")) .setCoder(MetadataCoderV2.of()) .apply(WithTimestamps.of(metadata -> new Instant(metadata.lastModifiedMillis())));
-
builder
-