Package org.apache.beam.sdk.io.fs
Class MatchResult.Metadata
- java.lang.Object
-
- org.apache.beam.sdk.io.fs.MatchResult.Metadata
-
- All Implemented Interfaces:
java.io.Serializable
- Enclosing class:
- MatchResult
public abstract static class MatchResult.Metadata extends java.lang.Object implements java.io.Serializable
MatchResult.Metadata
of a matched file.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MatchResult.Metadata.Builder
Builder class forMatchResult.Metadata
.
-
Constructor Summary
Constructors Constructor Description Metadata()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static MatchResult.Metadata.Builder
builder()
abstract @Nullable java.lang.String
checksum()
An optional checksum to identify the contents of a file.abstract boolean
isReadSeekEfficient()
abstract long
lastModifiedMillis()
Last modification timestamp in milliseconds since Unix epoch.abstract ResourceId
resourceId()
abstract long
sizeBytes()
-
-
-
Method Detail
-
resourceId
public abstract ResourceId resourceId()
-
sizeBytes
public abstract long sizeBytes()
-
isReadSeekEfficient
public abstract boolean isReadSeekEfficient()
-
checksum
public abstract @Nullable java.lang.String checksum()
An optional checksum to identify the contents of a file.
-
lastModifiedMillis
@Experimental(FILESYSTEM) 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
public static MatchResult.Metadata.Builder builder()
-
-