You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by ar...@apache.org on 2020/01/22 15:40:04 UTC

[beam] branch revert-10625-BEAM-9123-backport-2.18 created (now 79ed0b6)

This is an automated email from the ASF dual-hosted git repository.

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


      at 79ed0b6  Revert "[release-2.18.0][BEAM-9123] HadoopResourceId returns wrong directoryName bugfix"

This branch includes the following new commits:

     new 79ed0b6  Revert "[release-2.18.0][BEAM-9123] HadoopResourceId returns wrong directoryName bugfix"

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[beam] 01/01: Revert "[release-2.18.0][BEAM-9123] HadoopResourceId returns wrong directoryName bugfix"

Posted by ar...@apache.org.
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 <33...@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));
-  }
 }