[ 
https://issues.apache.org/jira/browse/HADOOP-16005?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16727540#comment-16727540
 ] 

ASF GitHub Bot commented on HADOOP-16005:
-----------------------------------------

GitHub user c-w opened a pull request:

    https://github.com/apache/hadoop/pull/452

    HADOOP-16005: Add XAttr support to WASB and ABFS

    As discussed in 
[HADOOP-16005](https://issues.apache.org/jira/browse/HADOOP-16005), this pull 
request implements `getXAttr` and `setXAttr` on hadoop-azure's WASB and ABFS 
file-systems.
    
    The changes were tested against the following Azure storage account 
configurations:
    
    - WASB: StorageV2, RA-GRS replication in East US (primary) West US 
(secondary). [WASB test session 
screenshot](https://user-images.githubusercontent.com/1086421/50362109-699f5a00-0534-11e9-97c9-e8a7cee6e6c6.png).
 All tests pass and the ABFS tests are skipped as expected.
    
    - ABFS: StorageV2 with Data Lake Storage Gen2 preview enabled, RA-GRS 
replication in East US (primary) West US (secondary). [ABFS test session 
screenshot](https://user-images.githubusercontent.com/1086421/50361278-fea05400-0530-11e9-9cb4-cc23dec87cfc.png).
 All ABFS tests pass but the WASB tests fail since the storage account hasn't 
implemented the blob endpoints yet.
    
    The test-patch script passed: [test-patch 
output](https://user-images.githubusercontent.com/1086421/50377952-50aaad80-05f5-11e9-8ea2-b7bf99fc7509.png).

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/CatalystCode/hadoop hadoop-16005

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/hadoop/pull/452.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #452
    
----
commit 1c8303a5af1016455d23ce78508f911a10af4e77
Author: Clemens Wolff <clewolff@...>
Date:   2018-12-20T21:30:56Z

    Add setXAttr and getXAttr to WASB and ABFS

----


> NativeAzureFileSystem does not support setXAttr
> -----------------------------------------------
>
>                 Key: HADOOP-16005
>                 URL: https://issues.apache.org/jira/browse/HADOOP-16005
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs/azure
>            Reporter: Clemens Wolff
>            Priority: Major
>
> When interacting with Azure Blob Storage via the Hadoop FileSystem client, 
> it's currently (as of 
> [a8bbd81|https://github.com/apache/hadoop/commit/a8bbd818d5bc4762324bcdb7cf1fdd5c2f93891b])
>  not possible to set custom metadata attributes.
> Here is a snippet that demonstrates the missing behavior (throws an 
> UnsupportedOperationException):
> {code:java}
> val blobAccount = "SET ME"
> val blobKey = "SET ME"
> val blobContainer = "SET ME"
> val blobFile = "SET ME"
> import org.apache.hadoop.conf.Configuration
> import org.apache.hadoop.fs.{FileSystem, Path}
> val conf = new Configuration()
> conf.set("fs.wasbs.impl", "org.apache.hadoop.fs.azure.NativeAzureFileSystem")
> conf.set(s"fs.azure.account.key.$blobAccount.blob.core.windows.net", blobKey)
> val path = new 
> Path(s"wasbs://$blobContainer@$blobAccount.blob.core.windows.net/$blobFile")
> val fs = FileSystem.get(path, conf)
> fs.setXAttr(path, "somekey", "somevalue".getBytes)
> {code}
> Looking at the code in hadoop-tools/hadoop-azure, NativeAzureFileSystem 
> inherits the default setXAttr from FileSystem which throws the 
> UnsupportedOperationException.
> The underlying Azure Blob Storage service does support custom metadata 
> ([service 
> docs|https://docs.microsoft.com/en-us/azure/storage/blobs/storage-properties-metadata])
>  as does the azure-storage SDK that's being used by NativeAzureFileSystem 
> ([SDK 
> docs|http://javadox.com/com.microsoft.azure/azure-storage/2.0.0/com/microsoft/azure/storage/blob/CloudBlob.html#setMetadata(java.util.HashMap)]).
> Is there another way that I should be setting custom metadata on Azure Blob 
> Storage files? Is there a specific reason why setXAttr hasn't been 
> implemented on NativeAzureFileSystem? If not, I can take a shot at 
> implementing it.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to