HADOOP-10135 writes to swift fs over partition size leave temp files and empty output file

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1546959 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Steve Loughran 2013-12-02 11:03:00 +00:00
parent 61b6ed73f8
commit 7b60e94c09
3 changed files with 20 additions and 1 deletions

View File

@ -452,6 +452,9 @@ Release 2.3.0 - UNRELEASED
HADOOP-10107. Server.getNumOpenConnections may throw NPE. (Kihwal Lee via
jing9)
HADOOP-10135 writes to swift fs over partition size leave temp files and
empty output file (David Dobbins via stevel)
Release 2.2.1 - UNRELEASED
INCOMPATIBLE CHANGES

View File

@ -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();
}

View File

@ -71,6 +71,18 @@ public void testParseUrlPath() throws Exception {
assertEquals(expected, actual);
}
@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";