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] [Resolved] (JCLOUDS-1543) list() results are not in order when using withDetails
Date Fri, 17 Apr 2020 10:26:00 GMT

     [ https://issues.apache.org/jira/browse/JCLOUDS-1543?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Andrew Gaul resolved JCLOUDS-1543.
----------------------------------
    Fix Version/s: 2.2.1
                   2.3.0
         Assignee: Andrew Gaul
       Resolution: Fixed

> list() results are not in order when using withDetails
> ------------------------------------------------------
>
>                 Key: JCLOUDS-1543
>                 URL: https://issues.apache.org/jira/browse/JCLOUDS-1543
>             Project: jclouds
>          Issue Type: Bug
>          Components: jclouds-blobstore
>    Affects Versions: 2.2.0
>            Reporter: Roded Bahat
>            Assignee: Andrew Gaul
>            Priority: Major
>             Fix For: 2.3.0, 2.2.1
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> When listing blobs using the withDetails ListContainerOption, the returned page set's
blobs do not return in the original order (as without the withDetails option). I suspect that
FetchBlobMetadata should try a bit harder to keep to page set as it was received.
> {code:java}
>     @Test
>     public void withDetailsOrdering() {
>         BlobStoreContext blobStoreContext = ContextBuilder.newBuilder("s3")
>             .endpoint("...")
>             .credentials("...", "...")
>             .buildView(BlobStoreContext.class);
>         BlobStore blobStore = blobStoreContext.getBlobStore();
>         String container = "roded-data";
>         String blobNamePrefix = "test/blob-";
>         for (int blobIndex = 0; blobIndex < 100; blobIndex++) {
>             Blob newBlob = blobStore.blobBuilder(blobNamePrefix + blobIndex).payload("").build();
>             blobStore.putBlob(container, newBlob);
>         }
>         final PageSet<? extends StorageMetadata> withOutDetails =
>             blobStore.list(container, ListContainerOptions.Builder.prefix(blobNamePrefix));
>         final PageSet<? extends StorageMetadata> withDetails = blobStore
>             .list(container, ListContainerOptions.Builder.prefix(blobNamePrefix).withDetails());
>         assertTrue(Ordering.from(Comparator.comparing(StorageMetadata::getName)).isOrdered(withOutDetails));
>         // Fails.
>         assertTrue(Ordering.from(Comparator.comparing(StorageMetadata::getName)).isOrdered(withDetails));
>     }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message