HADOOP-16169. ABFS: Bug fix for getPathProperties.
Author: Da Zhou <da.zhou@microsoft.com>
This commit is contained in:
parent
de15a66d78
commit
e0260417ad
|
@ -284,13 +284,13 @@ public class AzureBlobFileSystemStore implements Closeable {
|
|||
client.setFilesystemProperties(commaSeparatedProperties);
|
||||
}
|
||||
|
||||
public Hashtable<String, String> getPathProperties(final Path path) throws AzureBlobFileSystemException {
|
||||
LOG.debug("getPathProperties for filesystem: {} path: {}",
|
||||
public Hashtable<String, String> getPathStatus(final Path path) throws AzureBlobFileSystemException {
|
||||
LOG.debug("getPathStatus for filesystem: {} path: {}",
|
||||
client.getFileSystem(),
|
||||
path);
|
||||
|
||||
final Hashtable<String, String> parsedXmsProperties;
|
||||
final AbfsRestOperation op = client.getPathProperties(AbfsHttpConstants.FORWARD_SLASH + getRelativePath(path), isNamespaceEnabled);
|
||||
final AbfsRestOperation op = client.getPathStatus(AbfsHttpConstants.FORWARD_SLASH + getRelativePath(path));
|
||||
|
||||
final String xMsProperties = op.getResult().getResponseHeader(HttpHeaderConfigurations.X_MS_PROPERTIES);
|
||||
|
||||
|
@ -372,7 +372,7 @@ public class AzureBlobFileSystemStore implements Closeable {
|
|||
client.getFileSystem(),
|
||||
path);
|
||||
|
||||
final AbfsRestOperation op = client.getPathProperties(AbfsHttpConstants.FORWARD_SLASH + getRelativePath(path), isNamespaceEnabled);
|
||||
final AbfsRestOperation op = client.getPathStatus(AbfsHttpConstants.FORWARD_SLASH + getRelativePath(path));
|
||||
|
||||
final String resourceType = op.getResult().getResponseHeader(HttpHeaderConfigurations.X_MS_RESOURCE_TYPE);
|
||||
final long contentLength = Long.parseLong(op.getResult().getResponseHeader(HttpHeaderConfigurations.CONTENT_LENGTH));
|
||||
|
@ -400,7 +400,7 @@ public class AzureBlobFileSystemStore implements Closeable {
|
|||
path,
|
||||
overwrite);
|
||||
|
||||
final AbfsRestOperation op = client.getPathProperties(AbfsHttpConstants.FORWARD_SLASH + getRelativePath(path), isNamespaceEnabled);
|
||||
final AbfsRestOperation op = client.getPathStatus(AbfsHttpConstants.FORWARD_SLASH + getRelativePath(path));
|
||||
|
||||
final String resourceType = op.getResult().getResponseHeader(HttpHeaderConfigurations.X_MS_RESOURCE_TYPE);
|
||||
final Long contentLength = Long.valueOf(op.getResult().getResponseHeader(HttpHeaderConfigurations.CONTENT_LENGTH));
|
||||
|
@ -476,7 +476,7 @@ public class AzureBlobFileSystemStore implements Closeable {
|
|||
? client.getAclStatus(AbfsHttpConstants.FORWARD_SLASH + AbfsHttpConstants.ROOT_PATH)
|
||||
: client.getFilesystemProperties();
|
||||
} else {
|
||||
op = client.getPathProperties(AbfsHttpConstants.FORWARD_SLASH + getRelativePath(path), isNamespaceEnabled);
|
||||
op = client.getPathStatus(AbfsHttpConstants.FORWARD_SLASH + getRelativePath(path));
|
||||
}
|
||||
|
||||
final long blockSize = abfsConfiguration.getAzureBlockSize();
|
||||
|
|
|
@ -348,7 +348,7 @@ public class AbfsClient implements Closeable {
|
|||
return op;
|
||||
}
|
||||
|
||||
public AbfsRestOperation getPathProperties(final String path, boolean isNameSpaceEnabled) throws AzureBlobFileSystemException {
|
||||
public AbfsRestOperation getPathStatus(final String path) throws AzureBlobFileSystemException {
|
||||
final List<AbfsHttpHeader> requestHeaders = createDefaultHeaders();
|
||||
|
||||
final AbfsUriQueryBuilder abfsUriQueryBuilder = createDefaultUriQueryBuilder();
|
||||
|
@ -356,7 +356,7 @@ public class AbfsClient implements Closeable {
|
|||
|
||||
final URL url = createRequestUrl(path, abfsUriQueryBuilder.toString());
|
||||
final AbfsRestOperation op = new AbfsRestOperation(
|
||||
isNameSpaceEnabled ? AbfsRestOperationType.GetPathProperties : AbfsRestOperationType.GetPathStatus,
|
||||
AbfsRestOperationType.GetPathStatus,
|
||||
this,
|
||||
HTTP_METHOD_HEAD,
|
||||
url,
|
||||
|
|
|
@ -78,7 +78,7 @@ public class ITestFileSystemProperties extends AbstractAbfsIntegrationTest {
|
|||
touch(TEST_PATH);
|
||||
fs.getAbfsStore().setPathProperties(TEST_PATH, properties);
|
||||
Hashtable<String, String> fetchedProperties =
|
||||
fs.getAbfsStore().getPathProperties(TEST_PATH);
|
||||
fs.getAbfsStore().getPathStatus(TEST_PATH);
|
||||
|
||||
assertEquals(properties, fetchedProperties);
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ public class ITestFileSystemProperties extends AbstractAbfsIntegrationTest {
|
|||
properties.put("key", "{ value: valueTest兩 }");
|
||||
touch(TEST_PATH);
|
||||
fs.getAbfsStore().setPathProperties(TEST_PATH, properties);
|
||||
Hashtable<String, String> fetchedProperties = fs.getAbfsStore().getPathProperties(TEST_PATH);
|
||||
Hashtable<String, String> fetchedProperties = fs.getAbfsStore().getPathStatus(TEST_PATH);
|
||||
|
||||
assertEquals(properties, fetchedProperties);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue