gnodet-bot commented on code in PR #31081:
URL: https://github.com/apache/camel/pull/31081#discussion_r4732833620


##########
components/camel-alibaba/camel-alibaba-oss/src/main/java/org/apache/camel/component/alibaba/oss/OSSProducer.java:
##########
@@ -52,6 +55,10 @@
 
 public class OSSProducer extends DefaultProducer {
     private static final Logger LOG = 
LoggerFactory.getLogger(OSSProducer.class);
+    // the ListBuckets API reference and the Javadoc of 
ListBucketsRequest.maxKeys give 1 to 1000
+    private static final long MAX_KEYS_PER_LIST_BUCKETS = 1000L;
+    // the ListObjectsV2 API reference gives 1 to 1000, and the Javadoc of 
ListObjectsV2Request.maxKeys 1 to 999

Review Comment:
   📝 **Nit:** The comment documents the SDK Javadoc discrepancy (1–999 vs the 
API reference's 1–1000) but the constant is named after what it represents 
(`MAX_KEYS_PER_LIST_OBJECTS = 999L`). If the SDK Javadoc is incorrect and 1000 
actually works, every listing of exactly 1000 or more objects pays one 
unnecessary extra round-trip. Worth a quick empirical check — if 1000 works, 
switch to 1000 and update the comment.



##########
components/camel-alibaba/camel-alibaba-oss/src/main/docs/alibaba-oss-component.adoc:
##########
@@ -54,6 +54,10 @@ include::partial$component-endpoint-headers.adoc[]
 - copyObject - source and destination bucket/object names are *required*
 - headObject - `bucketName` and `objectName` parameters are *required*
 
+=== Listing buckets and objects
+
+`listBuckets` returns every bucket, and `listObjects` every matching object, 
or at most `maxKeys` of them. When more objects match, `listObjects` sets the 
`CamelAlibabaOssNextContinuationToken` header. Set its value as the 
`CamelAlibabaOssContinuationToken` header of the next `listObjects` to list the 
next objects.

Review Comment:
   📝 **Nit:** Missing verb — `listObjects every matching object` should be 
`listObjects` **returns** (or **lists**) `every matching object`.
   
   ```suggestion
   `listBuckets` returns every bucket, and `listObjects` returns every matching 
object, or at most `maxKeys` of them. When more objects match, `listObjects` 
sets the `CamelAlibabaOssNextContinuationToken` header. Set its value as the 
`CamelAlibabaOssContinuationToken` header of the next `listObjects` to list the 
next objects.
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to