You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by lc...@apache.org on 2016/07/13 19:57:10 UTC

[1/4] incubator-beam git commit: fix javadoc issue

Repository: incubator-beam
Updated Branches:
  refs/heads/master 8f5ce28dc -> 2596d136d


fix javadoc issue


Project: http://git-wip-us.apache.org/repos/asf/incubator-beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-beam/commit/1acfe33c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-beam/tree/1acfe33c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-beam/diff/1acfe33c

Branch: refs/heads/master
Commit: 1acfe33c95b0c63c34421234bb28a241e4ec2d9a
Parents: 7ff15aa
Author: Mark Liu <ma...@markliu0.mtv.corp.google.com>
Authored: Wed Jul 13 12:08:19 2016 -0700
Committer: Luke Cwik <lc...@google.com>
Committed: Wed Jul 13 12:42:07 2016 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/beam/sdk/util/IOChannelUtils.java | 2 +-
 .../test/java/org/apache/beam/sdk/util/IOChannelUtilsTest.java | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/1acfe33c/sdks/java/core/src/main/java/org/apache/beam/sdk/util/IOChannelUtils.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/util/IOChannelUtils.java b/sdks/java/core/src/main/java/org/apache/beam/sdk/util/IOChannelUtils.java
index 2994bf3..efb0ff6 100644
--- a/sdks/java/core/src/main/java/org/apache/beam/sdk/util/IOChannelUtils.java
+++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/util/IOChannelUtils.java
@@ -190,7 +190,7 @@ public class IOChannelUtils {
   /**
    * Resolve multiple {@code others} against the {@code path} sequentially.
    *
-   * Empty paths in {@code others} are ignored. If {@code others} contains one or more
+   * <p>Empty paths in {@code others} are ignored. If {@code others} contains one or more
    * absolute paths, then this method returns a path that starts with the last absolute path
    * in {@code others} joined with the remaining paths. Resolution of paths is highly
    * implementation dependent and therefore unspecified.

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/1acfe33c/sdks/java/core/src/test/java/org/apache/beam/sdk/util/IOChannelUtilsTest.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/test/java/org/apache/beam/sdk/util/IOChannelUtilsTest.java b/sdks/java/core/src/test/java/org/apache/beam/sdk/util/IOChannelUtilsTest.java
index eb35cbe..8db2f75 100644
--- a/sdks/java/core/src/test/java/org/apache/beam/sdk/util/IOChannelUtilsTest.java
+++ b/sdks/java/core/src/test/java/org/apache/beam/sdk/util/IOChannelUtilsTest.java
@@ -95,10 +95,10 @@ public class IOChannelUtilsTest {
   }
 
   @Test
-  public void testResolveMultiplePaths() throws IOException {
+  public void testResolveMultiplePaths() throws Exception {
     String expected =
-            tmpFolder.getRoot().toPath().resolve("aa").resolve("bb").resolve("cc").toString();
+        tmpFolder.getRoot().toPath().resolve("aa").resolve("bb").resolve("cc").toString();
     assertEquals(expected,
-            IOChannelUtils.resolve(tmpFolder.getRoot().getPath(), "aa", "bb", "cc"));
+        IOChannelUtils.resolve(tmpFolder.getRoot().getPath(), "aa", "bb", "cc"));
   }
 }


[4/4] incubator-beam git commit: [BEAM-446] Improve IOChannelUtils.resolve to accept multiple paths

Posted by lc...@apache.org.
[BEAM-446] Improve IOChannelUtils.resolve to accept multiple paths

This closes #646


Project: http://git-wip-us.apache.org/repos/asf/incubator-beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-beam/commit/2596d136
Tree: http://git-wip-us.apache.org/repos/asf/incubator-beam/tree/2596d136
Diff: http://git-wip-us.apache.org/repos/asf/incubator-beam/diff/2596d136

Branch: refs/heads/master
Commit: 2596d136da61e112b587758b51f0f97ee8025c8a
Parents: 8f5ce28 1acfe33
Author: Luke Cwik <lc...@google.com>
Authored: Wed Jul 13 12:42:25 2016 -0700
Committer: Luke Cwik <lc...@google.com>
Committed: Wed Jul 13 12:42:25 2016 -0700

----------------------------------------------------------------------
 .../apache/beam/sdk/util/IOChannelUtils.java    | 25 +++++++++++---------
 .../beam/sdk/util/IOChannelUtilsTest.java       | 11 ++++++++-
 2 files changed, 24 insertions(+), 12 deletions(-)
----------------------------------------------------------------------



[3/4] incubator-beam git commit: [BEAM-446] Improve IOChannelUtils.resolve to accept multiple paths

Posted by lc...@apache.org.
[BEAM-446] Improve IOChannelUtils.resolve to accept multiple paths


Project: http://git-wip-us.apache.org/repos/asf/incubator-beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-beam/commit/72c2c4a3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-beam/tree/72c2c4a3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-beam/diff/72c2c4a3

Branch: refs/heads/master
Commit: 72c2c4a3dbee08e636da7f8882432d6b35b1ae25
Parents: 8f5ce28
Author: Mark Liu <ma...@markliu0.mtv.corp.google.com>
Authored: Wed Jul 13 11:08:18 2016 -0700
Committer: Luke Cwik <lc...@google.com>
Committed: Wed Jul 13 12:42:07 2016 -0700

----------------------------------------------------------------------
 .../apache/beam/sdk/util/IOChannelUtils.java    | 21 ++++++++++++++++++++
 .../beam/sdk/util/IOChannelUtilsTest.java       | 11 +++++++++-
 2 files changed, 31 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/72c2c4a3/sdks/java/core/src/main/java/org/apache/beam/sdk/util/IOChannelUtils.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/util/IOChannelUtils.java b/sdks/java/core/src/main/java/org/apache/beam/sdk/util/IOChannelUtils.java
index 05443fb..1042b61 100644
--- a/sdks/java/core/src/main/java/org/apache/beam/sdk/util/IOChannelUtils.java
+++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/util/IOChannelUtils.java
@@ -202,4 +202,25 @@ public class IOChannelUtils {
   public static String resolve(String path, String other) throws IOException {
     return getFactory(path).resolve(path, other);
   }
+
+  /**
+   * Resolve given multiple {@code others} against the {@code path}.
+   *
+   * <p>If the {@code others} parameter contains empty paths then empty paths are ignored. If the
+   * {@code others} contains one or more absolute paths then this method returns a resulting path
+   * that starts with the last absolute path in {@code others} joining with rest paths.
+   * Otherwise this method considers the given {@code path} to be a base directory and resolves
+   * {@code others} paths against this path sequentially. Where the {@code others} paths have
+   * root components then resolution is highly implementation dependent and therefore unspecified.
+   */
+  public static String resolve(String path, String... others) throws IOException {
+    IOChannelFactory ioFactory = getFactory(path);
+    String fullPath = path;
+
+    for (String other : others) {
+      fullPath = ioFactory.resolve(fullPath, other);
+    }
+
+    return fullPath;
+  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/72c2c4a3/sdks/java/core/src/test/java/org/apache/beam/sdk/util/IOChannelUtilsTest.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/test/java/org/apache/beam/sdk/util/IOChannelUtilsTest.java b/sdks/java/core/src/test/java/org/apache/beam/sdk/util/IOChannelUtilsTest.java
index c79f1a1..eb35cbe 100644
--- a/sdks/java/core/src/test/java/org/apache/beam/sdk/util/IOChannelUtilsTest.java
+++ b/sdks/java/core/src/test/java/org/apache/beam/sdk/util/IOChannelUtilsTest.java
@@ -30,6 +30,7 @@ import org.junit.runner.RunWith;
 import org.junit.runners.JUnit4;
 
 import java.io.File;
+import java.io.IOException;
 import java.nio.charset.StandardCharsets;
 
 /**
@@ -88,8 +89,16 @@ public class IOChannelUtilsTest {
   }
 
   @Test
-  public void testResolve() throws Exception {
+  public void testResolveSinglePath() throws Exception {
     String expected = tmpFolder.getRoot().toPath().resolve("aa").toString();
     assertEquals(expected, IOChannelUtils.resolve(tmpFolder.getRoot().toString(), "aa"));
   }
+
+  @Test
+  public void testResolveMultiplePaths() throws IOException {
+    String expected =
+            tmpFolder.getRoot().toPath().resolve("aa").resolve("bb").resolve("cc").toString();
+    assertEquals(expected,
+            IOChannelUtils.resolve(tmpFolder.getRoot().getPath(), "aa", "bb", "cc"));
+  }
 }


[2/4] incubator-beam git commit: remove old method and fix javadoc

Posted by lc...@apache.org.
remove old method and fix javadoc


Project: http://git-wip-us.apache.org/repos/asf/incubator-beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-beam/commit/7ff15aa9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-beam/tree/7ff15aa9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-beam/diff/7ff15aa9

Branch: refs/heads/master
Commit: 7ff15aa90876996cf35a5bdffff5d21a6249f3e3
Parents: 72c2c4a
Author: Mark Liu <ma...@markliu0.mtv.corp.google.com>
Authored: Wed Jul 13 12:00:48 2016 -0700
Committer: Luke Cwik <lc...@google.com>
Committed: Wed Jul 13 12:42:07 2016 -0700

----------------------------------------------------------------------
 .../apache/beam/sdk/util/IOChannelUtils.java    | 28 ++++----------------
 1 file changed, 5 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/7ff15aa9/sdks/java/core/src/main/java/org/apache/beam/sdk/util/IOChannelUtils.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/util/IOChannelUtils.java b/sdks/java/core/src/main/java/org/apache/beam/sdk/util/IOChannelUtils.java
index 1042b61..2994bf3 100644
--- a/sdks/java/core/src/main/java/org/apache/beam/sdk/util/IOChannelUtils.java
+++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/util/IOChannelUtils.java
@@ -188,30 +188,12 @@ public class IOChannelUtils {
   }
 
   /**
-   * Resolve the given {@code other} against the {@code path}.
+   * Resolve multiple {@code others} against the {@code path} sequentially.
    *
-   * <p>If the {@code other} parameter is an absolute path then this method trivially returns
-   * other. If {@code other} is an empty path then this method trivially returns the given
-   * {@code path}. Otherwise this method considers the given {@code path} to be a directory and
-   * resolves the {@code other} path against this path. In the simplest case, the {@code other}
-   * path does not have a root component, in which case this method joins the {@code other} path
-   * to the given {@code path} and returns a resulting path that ends with the {@code other} path.
-   * Where the {@code other} path has a root component then resolution is highly implementation
-   * dependent and therefore unspecified.
-   */
-  public static String resolve(String path, String other) throws IOException {
-    return getFactory(path).resolve(path, other);
-  }
-
-  /**
-   * Resolve given multiple {@code others} against the {@code path}.
-   *
-   * <p>If the {@code others} parameter contains empty paths then empty paths are ignored. If the
-   * {@code others} contains one or more absolute paths then this method returns a resulting path
-   * that starts with the last absolute path in {@code others} joining with rest paths.
-   * Otherwise this method considers the given {@code path} to be a base directory and resolves
-   * {@code others} paths against this path sequentially. Where the {@code others} paths have
-   * root components then resolution is highly implementation dependent and therefore unspecified.
+   * Empty paths in {@code others} are ignored. If {@code others} contains one or more
+   * absolute paths, then this method returns a path that starts with the last absolute path
+   * in {@code others} joined with the remaining paths. Resolution of paths is highly
+   * implementation dependent and therefore unspecified.
    */
   public static String resolve(String path, String... others) throws IOException {
     IOChannelFactory ioFactory = getFactory(path);