Uploaded image for project: 'jclouds'
  1. jclouds
  2. JCLOUDS-1543

list() results are not in order when using withDetails

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.0
    • Fix Version/s: 2.3.0, 2.2.1
    • Component/s: jclouds-blobstore
    • Labels:
      None

      Description

      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.

          @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));
          }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                gaul Andrew Gaul
                Reporter:
                roded Roded Bahat
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m