timuralp commented on this pull request.


> +      SwiftObject object1s = getApi().getObjectApi(regionId, 
> containerName).get(name);
+      assertThat(object1s.getETag().equals(etag1s));
+      
assertThat(object1s.getPayload().getContentMetadata().getContentLength().equals(Long.valueOf(1024
 * 1024)));
+   }
+
+   protected void deleteAllObjectsInContainerDLO(String regionId, final String 
containerName) {
+       ObjectList objects = getApi().getObjectApi(regionId, 
containerName).list(new ListContainerOptions());
+      if (objects == null) {
+         return;
+      }
+      List<String> pathsToDelete = Lists.transform(objects, new 
Function<SwiftObject, String>() {
+         public String apply(SwiftObject input) {
+            return containerName + "/" + input.getName();
+         }
+      });
+      if (!pathsToDelete.isEmpty()) {

@archupsg03 can you remove this `if` clause? It's not a useful check. If the 
list is empty, the loop is a NOOP.

> @@ -37,7 +37,7 @@
    @Named("size_bytes")
    private final long sizeBytes;
 
-   private Segment(String path, String etag, long sizeBytes) {
+   public Segment(String path, String etag, long sizeBytes) {

@archupsg03 I think we can remove this change?

> +    * @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,

Sorry -- I called the method wrong. It's put() in ObjectApi or putBlob() in the 
RegionScopedSwiftBlobStore class. I suspect consumers should call putBlob() and 
then upload the manifest through the API you're adding. You can probably call 
either one in the tests.

> +      
> assertThat(object1s.getPayload().getContentMetadata().getContentLength()).isEqualTo(Long.valueOf(1024L
>  * 1024L));
+   }
+
+   protected void deleteAllObjectsInContainerDLO(String regionId, final String 
containerName) {
+       ObjectList objects = getApi().getObjectApi(regionId, 
containerName).list(new ListContainerOptions());
+      if (objects == null) {
+         return;
+      }
+      List<String> pathsToDelete = Lists.transform(objects, new 
Function<SwiftObject, String>() {
+         public String apply(SwiftObject input) {
+            return containerName + "/" + input.getName();
+         }
+      });
+      if (!pathsToDelete.isEmpty()) {
+         for (String name : pathsToDelete)
+            getApi().getObjectApi(regionId, containerName).delete(name);

The object API takes in the containerName. Does the containerName still need to 
be in the object Name, as well? In the above List transformation, we prepend 
containerName to every object -- that seems wrong or I'm missing something.

-- 
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-42796224

Reply via email to