hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r1546957 - in /hadoop/common/branches/branch-2/hadoop-tools/hadoop-openstack/src: main/java/org/apache/hadoop/fs/swift/util/SwiftObjectPath.java test/java/org/apache/hadoop/fs/swift/TestSwiftObjectPath.java
Date Mon, 02 Dec 2013 11:00:01 GMT
Author: stevel
Date: Mon Dec  2 11:00:00 2013
New Revision: 1546957

URL: http://svn.apache.org/r1546957
Log:
HADOOP-10135 writes to swift fs over partition size leave temp files and empty output file

Modified:
    hadoop/common/branches/branch-2/hadoop-tools/hadoop-openstack/src/main/java/org/apache/hadoop/fs/swift/util/SwiftObjectPath.java
    hadoop/common/branches/branch-2/hadoop-tools/hadoop-openstack/src/test/java/org/apache/hadoop/fs/swift/TestSwiftObjectPath.java

Modified: hadoop/common/branches/branch-2/hadoop-tools/hadoop-openstack/src/main/java/org/apache/hadoop/fs/swift/util/SwiftObjectPath.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-tools/hadoop-openstack/src/main/java/org/apache/hadoop/fs/swift/util/SwiftObjectPath.java?rev=1546957&r1=1546956&r2=1546957&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-tools/hadoop-openstack/src/main/java/org/apache/hadoop/fs/swift/util/SwiftObjectPath.java
(original)
+++ hadoop/common/branches/branch-2/hadoop-tools/hadoop-openstack/src/main/java/org/apache/hadoop/fs/swift/util/SwiftObjectPath.java
Mon Dec  2 11:00:00 2013
@@ -51,8 +51,12 @@ public final class SwiftObjectPath {
    */
   public SwiftObjectPath(String container, String object) {
 
+    if (object == null) {
+      throw new IllegalArgumentException("object name can't be null");
+    }
+
     this.container = container;
-    this.object = object;
+    this.object = URI.create(object).getPath();
     uriPath = buildUriPath();
   }
 

Modified: hadoop/common/branches/branch-2/hadoop-tools/hadoop-openstack/src/test/java/org/apache/hadoop/fs/swift/TestSwiftObjectPath.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-tools/hadoop-openstack/src/test/java/org/apache/hadoop/fs/swift/TestSwiftObjectPath.java?rev=1546957&r1=1546956&r2=1546957&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-tools/hadoop-openstack/src/test/java/org/apache/hadoop/fs/swift/TestSwiftObjectPath.java
(original)
+++ hadoop/common/branches/branch-2/hadoop-tools/hadoop-openstack/src/test/java/org/apache/hadoop/fs/swift/TestSwiftObjectPath.java
Mon Dec  2 11:00:00 2013
@@ -72,6 +72,18 @@ public class TestSwiftObjectPath impleme
   }
 
   @Test(timeout = SWIFT_TEST_TIMEOUT)
+  public void testHandleUrlAsPath() throws Exception {
+    final String hostPart = "swift://container.service1";
+    final String pathPart = "/home/user/files/file1";
+    final String uriString = hostPart + pathPart;
+
+    final SwiftObjectPath expected = new SwiftObjectPath(uriString, pathPart);
+    final SwiftObjectPath actual = new SwiftObjectPath(uriString, uriString);
+
+    assertEquals(expected, actual);
+  }
+
+  @Test(timeout = SWIFT_TEST_TIMEOUT)
   public void testParseAuthenticatedUrl() throws Exception {
     final String pathString = "swift://container.service1/v2/AUTH_00345h34l93459y4/home/tom/documents/finance.docx";
     final URI uri = new URI(pathString);



Mime
View raw message