jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Gaul (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (JCLOUDS-391) can't set user-defined metadata for Azure with multipart blobs
Date Tue, 10 Dec 2013 17:11:07 GMT

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

Andrew Gaul edited comment on JCLOUDS-391 at 12/10/13 5:10 PM:
---------------------------------------------------------------

[~klausm] You should try experimenting with smaller blobs, both with multipart and without.
 I used this test to verify the above behavior:

{code:java}
    @Test
    public void testMetadata() throws Exception {
        BlobStore blobStore = blobStoreContext.getBlobStore();
        String blobName = makeBlobName();
        Blob blob = blobStore.blobBuilder(blobName)
                .payload(new byte[0])
                .contentLength(0)
                .userMetadata(ImmutableMap.of("testmeta", "12345"))
                .build();
        blobStore.putBlob(containerName, blob, new PutOptions().multipart());

        Blob blob2 = blobStore.getBlob(containerName, blobName);
        assertThat(blob2.getMetadata().getUserMetadata().get("testmeta"))
                .isEqualTo("12345");
    }
{code}


was (Author: gaul):
[~klausm] You should try experimenting with smaller blobs, both with multipart and without.
 I used this test to verify the above behavior:

{{noformat}}
    @Test
    public void testMetadata() throws Exception {
        BlobStore blobStore = blobStoreContext.getBlobStore();
        String blobName = makeBlobName();
        Blob blob = blobStore.blobBuilder(blobName)
                .payload(new byte[0])
                .contentLength(0)
                .userMetadata(ImmutableMap.of("testmeta", "12345"))
                .build();
        blobStore.putBlob(containerName, blob, new PutOptions().multipart());

        Blob blob2 = blobStore.getBlob(containerName, blobName);
        assertThat(blob2.getMetadata().getUserMetadata().get("testmeta"))
                .isEqualTo("12345");
    }
{{noformat}}

> can't set user-defined metadata for Azure with multipart blobs
> --------------------------------------------------------------
>
>                 Key: JCLOUDS-391
>                 URL: https://issues.apache.org/jira/browse/JCLOUDS-391
>             Project: jclouds
>          Issue Type: Bug
>          Components: jclouds-blobstore
>    Affects Versions: 1.6.2
>         Environment: Windows 7, Azure and S3
>            Reporter: Klaus Müller
>            Priority: Critical
>
> Try to set user defined meta data for Azure blob storage. No error setting meta data,
but when I try to read them, they were not stored for the given blob.
> my code (small part of it):
>    ...
>    BlobStore blobStore = Context.getBlobStore();
>    BlobBuilder builder = blobStore.blobBuilder("blob001");
>    PayloadBlobBuilder  payload = builder.payload(data);       // data is InputStream
>    payload.contentLength(datalen);
>    Blob blob = payload.build();
>    Map<String, String> keyValueMap = new HashMap<String, String>();
>    keyValueMap.put("testmeta","12345");
>    blob.getMetadata().setUserMetadata(keyValueMap);
>    blobStore.putBlob("container001", blob, multipart() );
> ...
> For S3 it works.
> Is this a known problem with Azure, or something wrong with my code?



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)

Mime
View raw message