Claus Ibsen created CAMEL-27190:
-----------------------------------

             Summary: camel-google-storage - set the storage class of uploaded 
objects
                 Key: CAMEL-27190
                 URL: https://issues.apache.org/jira/browse/CAMEL-27190
             Project: Camel
          Issue Type: Improvement
          Components: camel-google-storage
            Reporter: Claus Ibsen


h3. What happens

{{storageClass}} is only used by 
{{GoogleCloudStorageEndpoint.createNewBucket}}, i.e. for a bucket that 
{{autoCreateBucket}} creates. The upload in 
{{GoogleCloudStorageProducer.processFile}} builds the {{BlobInfo}} with content 
type, content disposition and metadata, but no storage class, so every object 
gets the default class of its bucket. Captured requests: the bucket create 
request has {{"storageClass":"STANDARD"}}, the upload request has none.

There is no way to write, for example, an archive file as {{COLDLINE}} into a 
{{STANDARD}} bucket. {{CamelGoogleCloudStorageStorageClass}} exists only as an 
output header (set from the {{Blob}} after the upload).

h3. Where

* 
{{components/camel-google/camel-google-storage/src/main/java/org/apache/camel/component/google/storage/GoogleCloudStorageEndpoint.java}}:
 {{createNewBucket}} is the only use of {{getStorageClass()}}.
* 
{{components/camel-google/camel-google-storage/src/main/java/org/apache/camel/component/google/storage/GoogleCloudStorageProducer.java}}:
 {{processFile}}, {{BlobInfo.newBuilder(blobId)}} never calls 
{{setStorageClass}}.

h3. Suggested improvement

Let the producer set the object's storage class with 
{{BlobInfo.Builder.setStorageClass}}: from the 
{{CamelGoogleCloudStorageStorageClass}} header when present (as an input 
header), or from a producer option (for example a separate 
{{objectStorageClass}}, so that the bucket option keeps its meaning). Update 
the option description, which today says "when creating the new buckets". 
Depends on the String to {{StorageClass}} type converter (separate issue) for 
the URI form.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to