[
https://issues.apache.org/jira/browse/BEAM-5910?focusedWorklogId=186322&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-186322
]
ASF GitHub Bot logged work on BEAM-5910:
----------------------------------------
Author: ASF GitHub Bot
Created on: 17/Jan/19 14:35
Start Date: 17/Jan/19 14:35
Worklog Time Spent: 10m
Work Description: iemejia commented on pull request #6914: [BEAM-5910]
Add lastModified field to MatchResult.Metadata
URL: https://github.com/apache/beam/pull/6914#discussion_r248686674
##########
File path:
sdks/java/core/src/main/java/org/apache/beam/sdk/io/fs/MetadataCoderV2.java
##########
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.beam.sdk.io.fs;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import org.apache.beam.sdk.annotations.Experimental;
+import org.apache.beam.sdk.coders.AtomicCoder;
+import org.apache.beam.sdk.coders.Coder;
+import org.apache.beam.sdk.coders.VarLongCoder;
+import org.apache.beam.sdk.io.fs.MatchResult.Metadata;
+import org.apache.beam.sdk.io.fs.MatchResult.Metadata.Builder;
+
+/** A {@link Coder} for {@link Metadata} that includes {@link
Metadata#lastModifiedMillis()}. */
+@Experimental
+public class MetadataCoderV2 extends AtomicCoder<Metadata> {
+ private static final MetadataCoder V1_CODER = MetadataCoder.of();
+ private static final VarLongCoder LONG_CODER = VarLongCoder.of();
+
+ /** Creates a {@link MetadataCoder}. */
+ public static MetadataCoder of() {
Review comment:
This one should return `MetadataCoderV2`. Fix comment too please.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 186322)
Time Spent: 3h 10m (was: 3h)
> FileSystems should retrieve lastModified time
> ---------------------------------------------
>
> Key: BEAM-5910
> URL: https://issues.apache.org/jira/browse/BEAM-5910
> Project: Beam
> Issue Type: Improvement
> Components: sdk-java-core
> Reporter: Jeff Klukas
> Assignee: Jeff Klukas
> Priority: Minor
> Time Spent: 3h 10m
> Remaining Estimate: 0h
>
> In the Java SDK, the Filesystems.match facilities are aimed at listing file
> names and collect very limited additional metadata from the filesystem
> (sizeBytes and isReadSeekEfficient). I propose adding a new field for
> lastModified time to MatchResult.Metadata that each FileSystem would populate
> when listing files.
> This would be a basis for a future improvement to
> FileIO.match(...).continuously(...) where we could let the user opt to poll
> not just for new file names, but also for existing file names if their
> content has been updated.
> In the near term, the addition of lastModified to Metadata would allow users
> to implement their own polling logic on top of Filesystems.match to detect
> and download new files from any of the supported filesystems.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)