- 
                Notifications
    
You must be signed in to change notification settings  - Fork 15.1k
 
[CAS] Add UnifiedOnDiskCache and OnDiskCAS #114103
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
[CAS] Add UnifiedOnDiskCache and OnDiskCAS #114103
Conversation
Add OnDiskCAS abstraction, that implements ObjectStore and ActionCache interface using OnDiskGraphDB and OnDiskKeyValueDB. Reviewers: Pull Request: #114103
94172a6    to
    4b951ef      
    Compare
  
    Created using spr 1.3.7
Created using spr 1.3.7
| Error validate() const final; | ||
| 
               | 
          ||
| private: | ||
| std::shared_ptr<ondisk::UnifiedOnDiskCache> UniDB; | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I'm missing it, but why does this need to be a shared_ptr? I don't see obvious uses where we're really relying on the refcount here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just extending the lifetime of the wrapped UnifiedOnDiskCache to make sure it is not deleted when ActionCache is still in use.
Alternatively, we can leave this as a raw pointer and left the life-time management to user, but since this is not really a ref-count that is being updated often, this safe guard is pretty safe to keep.
Created using spr 1.3.7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I appreciate how well-documented the interface is!
Created using spr 1.3.7
Add a new abstraction layer UnifiedOnDiskCache that adds new functions
of disk space management and data validation that builds on top of
OnDiskGraphDB and OnDiskKeyValueDB.
Build upon UnifiedOnDiskCache, it is OnDiskCAS that implements
ObjectStore and ActionCache interface for LLVM tools to interact with
CAS storage.