You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@storm.apache.org by GitBox <gi...@apache.org> on 2021/01/05 20:16:37 UTC

[GitHub] [storm] agresch commented on a change in pull request #3363: STORM-3724 use blobstore modtime to prevent querying each remote file on update

agresch commented on a change in pull request #3363:
URL: https://github.com/apache/storm/pull/3363#discussion_r552170314



##########
File path: external/storm-hdfs-blobstore/src/main/java/org/apache/storm/hdfs/blobstore/HdfsBlobStoreImpl.java
##########
@@ -312,4 +313,54 @@ public void shutdown() {
             timer.cancel();
         }
     }
+
+    /**
+     * Get the last modification time of any blob.
+     *
+     * @return the last modification time of blobs within the blobstore.
+     * @throws IOException on any error
+     */
+    public long getLastModTime() throws IOException {
+        long modtime =  fileSystem.getFileStatus(fullPath).getModificationTime();
+        return modtime;
+    }
+
+    /**
+     * Updates the modification time of the blobstore to the current time.
+     *
+     * @throws IOException on any error
+     */
+    public void updateLastModTime() throws IOException {
+        long timestamp = Time.currentTimeMillis();
+        fileSystem.setTimes(fullPath, timestamp, timestamp);

Review comment:
       will update the PR with your suggested change.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org