beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aromane...@apache.org
Subject [beam] 01/01: Revert "[release-2.18.0][BEAM-9123] HadoopResourceId returns wrong directoryName bugfix"
Date Wed, 22 Jan 2020 15:40:05 GMT
This is an automated email from the ASF dual-hosted git repository.

aromanenko pushed a commit to branch revert-10625-BEAM-9123-backport-2.18
in repository https://gitbox.apache.org/repos/asf/beam.git

commit 79ed0b6835508e2adb990d90a806b61318bcd2b3
Author: Alexey Romanenko <33895511+aromanenko-dev@users.noreply.github.com>
AuthorDate: Wed Jan 22 16:39:42 2020 +0100

    Revert "[release-2.18.0][BEAM-9123] HadoopResourceId returns wrong directoryName bugfix"
---
 .../org/apache/beam/sdk/io/hdfs/HadoopResourceId.java     |  4 ----
 .../org/apache/beam/sdk/io/hdfs/HadoopResourceIdTest.java | 15 ---------------
 2 files changed, 19 deletions(-)

diff --git a/sdks/java/io/hadoop-file-system/src/main/java/org/apache/beam/sdk/io/hdfs/HadoopResourceId.java
b/sdks/java/io/hadoop-file-system/src/main/java/org/apache/beam/sdk/io/hdfs/HadoopResourceId.java
index b68839b..4e5f6e2 100644
--- a/sdks/java/io/hadoop-file-system/src/main/java/org/apache/beam/sdk/io/hdfs/HadoopResourceId.java
+++ b/sdks/java/io/hadoop-file-system/src/main/java/org/apache/beam/sdk/io/hdfs/HadoopResourceId.java
@@ -65,10 +65,6 @@ class HadoopResourceId implements ResourceId {
 
   @Override
   public String getFilename() {
-    if (isDirectory()) {
-      Path parentPath = new Path(uri).getParent();
-      return parentPath == null ? null : parentPath.getName();
-    }
     return new Path(uri).getName();
   }
 
diff --git a/sdks/java/io/hadoop-file-system/src/test/java/org/apache/beam/sdk/io/hdfs/HadoopResourceIdTest.java
b/sdks/java/io/hadoop-file-system/src/test/java/org/apache/beam/sdk/io/hdfs/HadoopResourceIdTest.java
index 1726a3e..4d7fb8d 100644
--- a/sdks/java/io/hadoop-file-system/src/test/java/org/apache/beam/sdk/io/hdfs/HadoopResourceIdTest.java
+++ b/sdks/java/io/hadoop-file-system/src/test/java/org/apache/beam/sdk/io/hdfs/HadoopResourceIdTest.java
@@ -17,9 +17,6 @@
  */
 package org.apache.beam.sdk.io.hdfs;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-
 import java.net.URI;
 import java.util.Collections;
 import org.apache.beam.sdk.io.FileSystems;
@@ -68,16 +65,4 @@ public class HadoopResourceIdTest {
             "hdfs://" + hdfsClusterBaseUri.getPath(), true /* isDirectory */);
     ResourceIdTester.runResourceIdBattery(baseDirectory);
   }
-
-  @Test
-  public void testGetFilename() {
-    assertNull(toResourceIdentifier("").getFilename());
-    assertEquals("abc", toResourceIdentifier("/dirA/abc").getFilename());
-    assertEquals("abc", toResourceIdentifier("/dirA/abc/").getFilename());
-    assertEquals("xyz.txt", toResourceIdentifier("/dirA/abc/xyz.txt").getFilename());
-  }
-
-  private ResourceId toResourceIdentifier(String path) {
-    return new HadoopResourceId(hdfsClusterBaseUri.resolve(path));
-  }
 }


Mime
View raw message