[
https://issues.apache.org/jira/browse/HADOOP-19089?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17822382#comment-17822382
]
ASF GitHub Bot commented on HADOOP-19089:
-----------------------------------------
saxenapranav commented on code in PR #6592:
URL: https://github.com/apache/hadoop/pull/6592#discussion_r1508488832
##########
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAzureBlobFileSystemAttributes.java:
##########
@@ -154,4 +149,24 @@ private void testGetSetXAttrHelper(final
AzureBlobFileSystem fs,
.describedAs("Retrieved Attribute Does not Matches in Decoded Form")
.isEqualTo(decodedAttributeValue2);
}
+
+ @Test
+ public void testGetSetXAttrOnRoot() throws Exception {
+ AzureBlobFileSystem fs = getFileSystem();
+ String attributeName = "user.attribute1";
+ byte[] attributeValue = fs.getAbfsStore().encodeAttribute("hi");
+ final Path testPath = new Path(ROOT_PATH);
+
+ try {
+ fs.getXAttr(testPath, attributeName);
+ } catch (AbfsRestOperationException e) {
+ Assertions.assertThat(e.getStatusCode()).isEqualTo(HTTP_BAD_REQUEST);
Review Comment:
Assert will happen only if exception is thrown. We should make sure that
exception does happen.. Lets use `LambdaTestUtils.intercept`. Similarly for the
other setXAttr intercept
> [ABFS] Reverting Back Support of setXAttr() and getXAttr() on root path
> -----------------------------------------------------------------------
>
> Key: HADOOP-19089
> URL: https://issues.apache.org/jira/browse/HADOOP-19089
> Project: Hadoop Common
> Issue Type: Sub-task
> Components: fs/azure
> Affects Versions: 3.4.0, 3.4.1
> Reporter: Anuj Modi
> Assignee: Anuj Modi
> Priority: Major
> Labels: pull-request-available
> Fix For: 3.4.0, 3.4.1
>
>
> A while back changes were made to support HDFS.setXAttr() and HDFS.getXAttr()
> on root path for ABFS Driver.
> For these, filesystem level APIs were introduced and used to set/get metadata
> of container.
> Refer to Jira: [HADOOP-18869] ABFS: Fixing Behavior of a File System APIs on
> root path - ASF JIRA (apache.org)
> Ideally, same set of APIs should be used, and root should be treated as a
> path like any other path.
> This change is to avoid calling container APIs for these HDFS calls.
> As a result of this these APIs will fail on root path (as earlier) because
> service does not support get/set of user properties on root path.
> This change will also update the documentation to reflect that these
> operations are not supported on root path.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]