You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by Roman Coedo <no...@github.com> on 2014/06/22 20:17:03 UTC
[jclouds-labs-aws] JCLOUDS-457: Added listParts and
listMultipartUploads operations to the ... (#22)
...Glacier client.
You can merge this Pull Request by running:
git pull https://github.com/rcoedo/jclouds-labs-aws listmultipart
Or you can view, comment on it, or merge it online at:
https://github.com/jclouds/jclouds-labs-aws/pull/22
-- Commit Summary --
* JCLOUDS-457: Added listParts and listMultipartUploads operations to the Glacier client.
-- File Changes --
M glacier/src/main/java/org/jclouds/glacier/GlacierAsyncClient.java (48)
M glacier/src/main/java/org/jclouds/glacier/GlacierClient.java (38)
A glacier/src/main/java/org/jclouds/glacier/domain/MultipartUploadMetadata.java (141)
A glacier/src/main/java/org/jclouds/glacier/domain/PaginatedMultipartUploadCollection.java (60)
A glacier/src/main/java/org/jclouds/glacier/domain/PartMetadata.java (52)
A glacier/src/main/java/org/jclouds/glacier/functions/ParseMultipartUploadListFromHttpContent.java (35)
A glacier/src/main/java/org/jclouds/glacier/functions/ParseMultipartUploadPartListFromHttpContent.java (35)
M glacier/src/test/java/org/jclouds/glacier/GlacierClientLiveTest.java (9)
M glacier/src/test/java/org/jclouds/glacier/GlacierClientMockTest.java (58)
A glacier/src/test/resources/json/listMultipartUploadsResponseBody.json (12)
A glacier/src/test/resources/json/listMultipartUploadsWithEmptyListResponseBody.json (4)
A glacier/src/test/resources/json/listPartsResponseBody.json (13)
-- Patch Links --
https://github.com/jclouds/jclouds-labs-aws/pull/22.patch
https://github.com/jclouds/jclouds-labs-aws/pull/22.diff
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/22
Re: [jclouds-labs-aws] JCLOUDS-457: Added listParts and
listMultipartUploads operations to the ... (#22)
Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-labs-aws-pull-requests #49](https://jclouds.ci.cloudbees.com/job/jclouds-labs-aws-pull-requests/49/) SUCCESS
This pull request looks good
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/22#issuecomment-46797260
Re: [jclouds-labs-aws] JCLOUDS-457: Added listParts and
listMultipartUploads operations to the ... (#22)
Posted by BuildHive <no...@github.com>.
[jclouds » jclouds-labs-aws #1020](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-labs-aws/1020/) SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/22#issuecomment-46797795
Re: [jclouds-labs-aws] JCLOUDS-457: Added listParts and
listMultipartUploads operations to the ... (#22)
Posted by Roman Coedo <no...@github.com>.
> +public class MultipartUploadMetadata extends IterableWithMarker<PartMetadata> implements Comparable<MultipartUploadMetadata> {
> +
> + @SerializedName("ArchiveDescription")
> + private final String archiveDescription;
> + @SerializedName("CreationDate")
> + private final Date creationDate;
> + @SerializedName("MultipartUploadId")
> + private final String multipartUploadId;
> + @SerializedName("PartSizeInBytes")
> + private final long partSizeInBytes;
> + @SerializedName("VaultARN")
> + private final String vaultARN;
> + @SerializedName("Parts")
> + private final Iterable<PartMetadata> parts;
> + @SerializedName("Marker")
> + private final String marker;
If we change marker to Optional<String> we won't be able to cast it to Optional<Object> on the method nextMarker() without getting a warning.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/22/files#r14057550
Re: [jclouds-labs-aws] JCLOUDS-457: Added listParts and
listMultipartUploads operations to the ... (#22)
Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-labs-aws-pull-requests #50](https://jclouds.ci.cloudbees.com/job/jclouds-labs-aws-pull-requests/50/) SUCCESS
This pull request looks good
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/22#issuecomment-46797523
Re: [jclouds-labs-aws] JCLOUDS-457: Added listParts and
listMultipartUploads operations to the ... (#22)
Posted by BuildHive <no...@github.com>.
[jclouds » jclouds-labs-aws #1017](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-labs-aws/1017/) SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/22#issuecomment-46797239
Re: [jclouds-labs-aws] JCLOUDS-457: Added listParts and
listMultipartUploads operations to the ... (#22)
Posted by Andrew Gaul <no...@github.com>.
Made some whitespace changes to JSON test inputs, tested locally, and pushed to master.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/22#issuecomment-46797677
Re: [jclouds-labs-aws] JCLOUDS-457: Added listParts and
listMultipartUploads operations to the ... (#22)
Posted by Andrew Gaul <no...@github.com>.
> @@ -68,7 +69,13 @@ public void testListAndDescribeVaults() throws Exception {
> assertTrue(vaults.contains(api.describeVault(VAULT_NAME3)));
> }
>
> - @Test(groups = { "integration", "live" }, dependsOnMethods = { "testListAndDescribeVaults" })
> + @Test(groups = { "integration", "live" }, dependsOnMethods = { "testCreateVault" })
> + public void testListMultipartUploadsWithEmptyList() throws Exception {
> + assertEquals(api.listMultipartUploads(VAULT_NAME1).size(), 0);
> + }
Can we add a live test for an incomplete and a complete MPU or does this require job control? If the latter can you add a TODO comment?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/22/files#r14057279
Re: [jclouds-labs-aws] JCLOUDS-457: Added listParts and
listMultipartUploads operations to the ... (#22)
Posted by Andrew Gaul <no...@github.com>.
Please address nits and answer the live test question. Also can you ensure the first line of your commit message is <= 50 characters as per: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html ? This ensures that `git shortlog` output fits on an 80-line terminal.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/22#issuecomment-46795719
Re: [jclouds-labs-aws] JCLOUDS-457: Added listParts and
listMultipartUploads operations to the ... (#22)
Posted by BuildHive <no...@github.com>.
[jclouds » jclouds-labs-aws #1019](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-labs-aws/1019/) SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/22#issuecomment-46797631
Re: [jclouds-labs-aws] JCLOUDS-457: Added listParts and
listMultipartUploads operations to the ... (#22)
Posted by Roman Coedo <no...@github.com>.
> @@ -68,7 +69,13 @@ public void testListAndDescribeVaults() throws Exception {
> assertTrue(vaults.contains(api.describeVault(VAULT_NAME3)));
> }
>
> - @Test(groups = { "integration", "live" }, dependsOnMethods = { "testListAndDescribeVaults" })
> + @Test(groups = { "integration", "live" }, dependsOnMethods = { "testCreateVault" })
> + public void testListMultipartUploadsWithEmptyList() throws Exception {
> + assertEquals(api.listMultipartUploads(VAULT_NAME1).size(), 0);
> + }
According to Glacier documentation I think we can add a test for initiate, list and abort MPU. Complete MPU would require job operations to properly clean the vault.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/22/files#r14057350
Re: [jclouds-labs-aws] JCLOUDS-457: Added listParts and
listMultipartUploads operations to the ... (#22)
Posted by Andrew Gaul <no...@github.com>.
> @@ -0,0 +1,4 @@
> +{
> +"Marker": "qt-RBst_7yO8gVIonIBsAxr2t-db0pE4s8MNeGjKjGdNpuU-cdSAcqG62guwV9r5jh5mLyFPzFEitTpNE7iQfHiu1XoV",
Should this indent like all the other json?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/22/files#r14057264
Re: [jclouds-labs-aws] JCLOUDS-457: Added listParts and
listMultipartUploads operations to the ... (#22)
Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-labs-aws-pull-requests #51](https://jclouds.ci.cloudbees.com/job/jclouds-labs-aws-pull-requests/51/) SUCCESS
This pull request looks good
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/22#issuecomment-46797552
Re: [jclouds-labs-aws] JCLOUDS-457: Added listParts and
listMultipartUploads operations to the ... (#22)
Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-labs-aws-pull-requests #47](https://jclouds.ci.cloudbees.com/job/jclouds-labs-aws-pull-requests/47/) SUCCESS
This pull request looks good
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/22#issuecomment-46788444
Re: [jclouds-labs-aws] JCLOUDS-457: Added listParts and
listMultipartUploads operations to the ... (#22)
Posted by Andrew Gaul <no...@github.com>.
> + @SerializedName("PartSizeInBytes")
> + private final long partSizeInBytes;
> + @SerializedName("VaultARN")
> + private final String vaultARN;
> + @SerializedName("Parts")
> + private final Iterable<PartMetadata> parts;
> + @SerializedName("Marker")
> + private final String marker;
> +
> + @ConstructorProperties({ "ArchiveDescription", "CreationDate", "MultipartUploadId", "PartSizeInBytes", "VaultARN",
> + "Parts", "Marker" })
> + public MultipartUploadMetadata(@Nullable String archiveDescription, Date creationDate, String multipartUploadId,
> + long partSizeInBytes, String vaultARN, @Nullable Iterable<PartMetadata> parts, @Nullable String marker) {
> + super();
> + this.archiveDescription = archiveDescription;
> + this.creationDate = checkNotNull(creationDate, "creationDate");
Call `creationDate.clone` here as well.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/22/files#r14057242
Re: [jclouds-labs-aws] JCLOUDS-457: Added listParts and
listMultipartUploads operations to the ... (#22)
Posted by Andrew Gaul <no...@github.com>.
> +public class MultipartUploadMetadata extends IterableWithMarker<PartMetadata> implements Comparable<MultipartUploadMetadata> {
> +
> + @SerializedName("ArchiveDescription")
> + private final String archiveDescription;
> + @SerializedName("CreationDate")
> + private final Date creationDate;
> + @SerializedName("MultipartUploadId")
> + private final String multipartUploadId;
> + @SerializedName("PartSizeInBytes")
> + private final long partSizeInBytes;
> + @SerializedName("VaultARN")
> + private final String vaultARN;
> + @SerializedName("Parts")
> + private final Iterable<PartMetadata> parts;
> + @SerializedName("Marker")
> + private final String marker;
Should this be `Optional<String>`?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/22/files#r14057286
Re: [jclouds-labs-aws] JCLOUDS-457: Added listParts and
listMultipartUploads operations to the ... (#22)
Posted by Andrew Gaul <no...@github.com>.
> + @Test(groups = { "integration", "live" }, dependsOnMethods = { "testListMultipartUploadsWithEmptyList" })
> + public void testInitiateAndAbortMultipartUpload() throws Exception {
> + String uploadId = api.initiateMultipartUpload(VAULT_NAME1, 8);
> + try {
> + assertNotNull(uploadId);
> + } finally {
> + api.abortMultipartUpload(VAULT_NAME1, uploadId);
> + }
> + }
> +
> + @Test(groups = { "integration", "live" }, dependsOnMethods = { "testInitiateAndAbortMultipartUpload" })
> + public void testListMultipartUploads() throws Exception {
> + String uploadId = api.initiateMultipartUpload(VAULT_NAME1, 8);
> + try {
> + PaginatedMultipartUploadCollection uploads = api.listMultipartUploads(VAULT_NAME1);
> + ImmutableList.Builder<String> list = ImmutableList.<String>builder();
Can you let Java infer the type with:
```
ImmutableList.Builder<String> list = ImmutableList.builder();
```
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/22/files#r14057706
Re: [jclouds-labs-aws] JCLOUDS-457: Added listParts and
listMultipartUploads operations to the ... (#22)
Posted by Andrew Gaul <no...@github.com>.
Closed #22.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/22#event-133918707
Re: [jclouds-labs-aws] JCLOUDS-457: Added listParts and
listMultipartUploads operations to the ... (#22)
Posted by BuildHive <no...@github.com>.
[jclouds » jclouds-labs-aws #1018](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-labs-aws/1018/) SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/22#issuecomment-46797497
Re: [jclouds-labs-aws] JCLOUDS-457: Added listParts and
listMultipartUploads operations to the ... (#22)
Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-labs-aws-pull-requests #52](https://jclouds.ci.cloudbees.com/job/jclouds-labs-aws-pull-requests/52/) SUCCESS
This pull request looks good
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/22#issuecomment-46797765
Re: [jclouds-labs-aws] JCLOUDS-457: Added listParts and
listMultipartUploads operations to the ... (#22)
Posted by Andrew Gaul <no...@github.com>.
> + super();
> + this.archiveDescription = archiveDescription;
> + this.creationDate = checkNotNull(creationDate, "creationDate");
> + this.multipartUploadId = checkNotNull(multipartUploadId, "multipartUploadId");
> + this.partSizeInBytes = partSizeInBytes;
> + this.vaultARN = checkNotNull(vaultARN, "vaultARN");
> + this.parts = parts;
> + this.marker = marker;
> + }
> +
> + public String getArchiveDescription() {
> + return archiveDescription;
> + }
> +
> + public Date getCreationDate() {
> + return creationDate;
Can you return `creationDate.clone` since `Date` is mutable?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/22/files#r14057239
Re: [jclouds-labs-aws] JCLOUDS-457: Added listParts and
listMultipartUploads operations to the ... (#22)
Posted by BuildHive <no...@github.com>.
[jclouds » jclouds-labs-aws #1014](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-labs-aws/1014/) SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/22#issuecomment-46788516