hudi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vin...@apache.org
Subject [incubator-hudi] branch master updated: Add constructor to HoodieROTablePathFilter (#1413)
Date Mon, 16 Mar 2020 22:19:28 GMT
This is an automated email from the ASF dual-hosted git repository.

vinoth pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-hudi.git


The following commit(s) were added to refs/heads/master by this push:
     new 418f9bb  Add constructor to HoodieROTablePathFilter (#1413)
418f9bb is described below

commit 418f9bb2e91ed6c02077d36e49a47f0c8d08303a
Author: bschell <bdscheller@gmail.com>
AuthorDate: Mon Mar 16 15:19:16 2020 -0700

    Add constructor to HoodieROTablePathFilter (#1413)
    
    Allows HoodieROTablePathFilter to accept a configuration for
    initializing the filesystem. This fixes a bug with Presto's use of this
    pathfilter.
    
    Co-authored-by: Brandon Scheller <bschelle@amazon.com>
---
 .../org/apache/hudi/hadoop/HoodieROTablePathFilter.java   | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/hudi-hadoop-mr/src/main/java/org/apache/hudi/hadoop/HoodieROTablePathFilter.java
b/hudi-hadoop-mr/src/main/java/org/apache/hudi/hadoop/HoodieROTablePathFilter.java
index 66ec864..d879a2f 100644
--- a/hudi-hadoop-mr/src/main/java/org/apache/hudi/hadoop/HoodieROTablePathFilter.java
+++ b/hudi-hadoop-mr/src/main/java/org/apache/hudi/hadoop/HoodieROTablePathFilter.java
@@ -63,12 +63,21 @@ public class HoodieROTablePathFilter implements PathFilter, Serializable
{
    */
   private HashSet<String> nonHoodiePathCache;
 
+  /**
+   * Hadoop configurations for the FileSystem.
+   */
+  private Configuration conf;
 
   private transient FileSystem fs;
 
   public HoodieROTablePathFilter() {
-    hoodiePathCache = new HashMap<>();
-    nonHoodiePathCache = new HashSet<>();
+    this(new Configuration());
+  }
+
+  public HoodieROTablePathFilter(Configuration conf) {
+    this.hoodiePathCache = new HashMap<>();
+    this.nonHoodiePathCache = new HashSet<>();
+    this.conf = conf;
   }
 
   /**
@@ -93,7 +102,7 @@ public class HoodieROTablePathFilter implements PathFilter, Serializable
{
     Path folder = null;
     try {
       if (fs == null) {
-        fs = path.getFileSystem(new Configuration());
+        fs = path.getFileSystem(conf);
       }
 
       // Assumes path is a file


Mime
View raw message