[ 
https://issues.apache.org/jira/browse/OAK-7091?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16313415#comment-16313415
 ] 

Matt Ryan commented on OAK-7091:
--------------------------------

The first scenario I'm developing for the composite data store supports a 
single read-only delegate and a single writable delegate, so this capability is 
technically not needed until the composite data store supports multiple 
writable delegates.  Instead for now the composite data store can just pass the 
stream along to the only writable delegate.

If/when this capability is added to the composite data store, we could also add 
a method to the delegate handler to ask how many writable delegates exist.  If 
there is only one, the composite data store can optimize and avoid computing 
the blob ID, and simply pass the stream along to the only writable delegate.

> Avoid streaming data twice in composite data store
> --------------------------------------------------
>
>                 Key: OAK-7091
>                 URL: https://issues.apache.org/jira/browse/OAK-7091
>             Project: Jackrabbit Oak
>          Issue Type: Technical task
>          Components: blob, blob-cloud, blob-cloud-azure, blob-plugins
>            Reporter: Matt Ryan
>            Assignee: Matt Ryan
>
> When adding a new record to an Oak instance that is using composite data 
> store, the blob stream will be read twice before it is stored - once by the 
> composite data store (to determine the blob ID) and again by the delegate.  
> We could add a method to the CompositeDataStoreAware interface wherein the 
> data store can be told which blob ID to use (from the composite) so that it 
> doesn't have to process the stream again.  Then the composite data store, 
> after having read the stream to a temporary file, can pass an input stream 
> from the temporary file to the delegate along with the computed blob ID, to 
> avoid reading the stream twice.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to