Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce CopyOnReadInputStream with CachedBlobContainer #59872

Closed
wants to merge 2 commits into from

Conversation

tlrx
Copy link
Member

@tlrx tlrx commented Jul 20, 2020

This pull request introduces a new CachedBlobContainer along with a CopyOnReadInputStream inner class.

The CachedBlobContainer is aimed to become a new cache layer on top of SearchableSnapshotDirectory's blob containers. In the future, its readBlob() method should be able to poll a cache in order to retrieve cached blobs to read. In the case a blob is not in cache CachedBlobContainer should read the blob from the remote blob store repository and then adds the blob to the cache.

This is where CopyOnReadInputStream plays a role: while reading the InputStream from the remote repository this class copies the first N bytes to an internal byte array (recycled through BigArrays). The copied bytes are then provided back to a closeInternal() method when the original InputStream is closed. In the future, this is where the copied bytes should be added to the blob store cache (as newly indexed documents).

@tlrx tlrx added >enhancement :Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs v8.0.0 labels Jul 20, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (:Distributed/Snapshot/Restore)

@elasticmachine elasticmachine added the Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. label Jul 20, 2020
@tlrx
Copy link
Member Author

tlrx commented Jul 20, 2020

@DaveCTurner I'm taking baby steps here to avoid any "big" pull request, I hope this is OK.

@tlrx tlrx requested review from DaveCTurner and ywelsch July 20, 2020 14:36
@tlrx
Copy link
Member Author

tlrx commented Jul 21, 2020

Thanks for your early feedback @ywelsch. I've updated this pull request to handle failures, let me know what you think. Thanks!

@tlrx tlrx removed request for ywelsch and DaveCTurner July 22, 2020 07:52
@tlrx tlrx added the WIP label Jul 22, 2020
@tlrx
Copy link
Member Author

tlrx commented Jul 22, 2020

I'm removing reviews requests for this as we decided to go with a full working prototype before moving forward and integrating changes in master.

@tlrx
Copy link
Member Author

tlrx commented Aug 27, 2020

This has been implemented as part of #60522, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs >enhancement Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. v8.0.0-alpha1 WIP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants