timuralp commented on this pull request.

It's a little difficult for me to review this in isolation, without the DLO 
abstraction that is using this PR. I would expect very few new methods added 
here -- specifically, only replaceManifest (as you have it, or putManifest that 
I suggested), which has the DLO header. Outside of that, the other methods 
don't make sense to me as-is (e.g. uploadPart is the same putObject, as far as 
I can tell).

> +    * @param metadata
+    *           corresponds to {@link SwiftObject#getMetadata()}.
+    * @param headers
+    *           Binds the map to headers, without prefixing/escaping the header
+    *           name/key.
+    *
+    * @return {@link SwiftObject#getEtag()} of the object, which is the MD5
+    *         checksum of the concatenated ETag values of the {@code segments}.
+    */
+   @Deprecated
+   @Named("dynamicLargeObject:replaceManifest")
+   @PUT
+   @ResponseParser(ETagHeader.class)
+   @Headers(keys = "X-Object-Manifest", values = 
"{containerName}/{objectName}/")
+   String replaceManifest(@PathParam("objectName") String objectName,
+         @BinderParam(BindToJsonPayload.class) Collection<Segment> segments,

With DLO, manifest header specifies a segment prefix. How does the segments 
collection get used? This seems like a copy of the SLO API, but I don't think 
it actually makes sense here -- in the SLO case, the actual JSON manifest 
object is constructed from the segments.

> +    *           ordered parts which will be concatenated upon download.
+    * @param metadata
+    *           corresponds to {@link SwiftObject#getMetadata()}.
+    * @param headers
+    *           Binds the map to headers, without prefixing/escaping the header
+    *           name/key.
+    *
+    * @return {@link SwiftObject#getEtag()} of the object, which is the MD5
+    *         checksum of the concatenated ETag values of the {@code segments}.
+    */
+   @Deprecated
+   @Named("dynamicLargeObject:replaceManifest")
+   @PUT
+   @ResponseParser(ETagHeader.class)
+   @Headers(keys = "X-Object-Manifest", values = 
"{containerName}/{objectName}/")
+   String replaceManifest(@PathParam("objectName") String objectName,

I understand that this is the same as the SLO API, but the replaceManifest name 
seems like a misnomer. Maybe `putManifest` would make more sense? Don't have a 
strong preference on this, though.

> + * use it and give us feedback. Based on that feedback, minor changes to the
+ * interfaces may happen. This code will replace
+ * org.jclouds.openstack.swift.SwiftClient in jclouds 2.0 and it is recommended
+ * you adopt it sooner than later.
+ */
+@Beta
+@RequestFilters(AuthenticateRequest.class)
+@Consumes(APPLICATION_JSON)
+@Path("/{objectName}")
+public interface DynamicLargeObjectApi {
+   /**
+    * Creates or updates a dynamic large object's manifest.
+    *
+    * @param objectName
+    *           corresponds to {@link SwiftObject#getName()}.
+    * @param segments

This comment does not make sense in the DLO context. See a comment below about 
the segments parameter.

> +    * @param metadata
+    *           corresponds to {@link SwiftObject#getMetadata()}.
+    * @param headers
+    *           Binds the map to headers, without prefixing/escaping the header
+    *           name/key.
+    *
+    * @return {@link SwiftObject#getEtag()} of the object, which is the MD5
+    *         checksum of the concatenated ETag values of the {@code segments}.
+    */
+   
+   @Deprecated
+   @Named("dynamicLargeObject:uploadLargeFile")
+   @PUT
+   @Headers(keys = EXPECT, values = "100-continue")
+   @ResponseParser(ETagHeader.class)
+   String uploadPart(@PathParam("containerName") String container, 
@PathParam("objectName") String objectName,

Is this any different from `PutObject`? I think a higher level wrapper is 
required to make DLO operations make sense, but I don't think this API method 
is required. Maybe you could explain how you envision `uploadPart` to fit with 
the higher level primitives.

> +   @Deprecated
+   @Named("dynamicLargeObject:replaceManifest")
+   @PUT
+   @ResponseParser(ETagHeader.class)
+   @Headers(keys = "X-Object-Manifest", values = 
"{containerName}/{objectName}/")
+   String replaceManifest(@PathParam("objectName") String objectName,
+         @BinderParam(BindToJsonPayload.class) Collection<Segment> segments,
+         @BinderParam(BindObjectMetadataToHeaders.class) Map<String, String> 
metadata,
+         @BinderParam(BindToHeaders.class) Map<String, String> headers);
+   
+   /**
+    * Creates object segments.
+    *
+    * @param objectName
+    *           corresponds to {@link SwiftObject#getName()}.
+    * @param segments

Copy/paste comment error? I don't see a segments parameter.

> +    *         checksum of the concatenated ETag values of the {@code 
> segments}.
+    */
+   @Deprecated
+   @Named("dynamicLargeObject:replaceManifest")
+   @PUT
+   @ResponseParser(ETagHeader.class)
+   @Headers(keys = "X-Object-Manifest", values = 
"{containerName}/{objectName}/")
+   String replaceManifest(@PathParam("objectName") String objectName,
+         @BinderParam(BindToJsonPayload.class) Collection<Segment> segments,
+         @BinderParam(BindObjectMetadataToHeaders.class) Map<String, String> 
metadata,
+         @BinderParam(BindToHeaders.class) Map<String, String> headers);
+   
+   /**
+    * Creates object segments.
+    *
+    * @param objectName

I don't see an objectName parameter. However, containerName and blob are not 
documented.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/1105#pullrequestreview-40093201

Reply via email to