Add cacheConfig, setter process, getter script#743
Conversation
|
A few general things you need to do when committing to TorQ:
|
|
I have reviewed the TorQ codebase and could not find an existing utility function for the setter.q and getter.q functions. There are existing save and load utilities in the TorQ codebase, however they are highly specific (e.g. loading q and k scripts, saving partitions) and not suitable for use for saving and loading with the anymap data format. I have also addressed all the other points through my latest commit "Standardising Changes and Add Default json" and by adding more detailed description to the PR. |
|
@bsofjan thanks for checking if the utility was present in TorQ and for addressing my other comments - looks good to merge |
|
@CJA18 Thank you - I think it is best to wait prior to merging as the PRs functions as checkpoints of work, and merging can be considered once the whole project comes around. |
| \d .getter | ||
|
|
||
| // Get cache from disk | ||
| getcachefromdisk:{[filePath] load hsym filePath} |
There was a problem hiding this comment.
filePath -> filepath
this also seems like a very thin wrapper around load, is it really useful to have this?
There was a problem hiding this comment.
Hello Jonathon, I understand your comments, just to give you more context, I'm following the work development phases in the Anycache proposal which I found very useful as it gives me structure to the work progress to whole Anycache system. I hope you found this helpful!
| \d .setter | ||
|
|
||
| // Save cache down to disk | ||
| savecachedowntodisk:{[data;filePath] (hsym filePath) set data }; |
There was a problem hiding this comment.
filePath -> filepath
and similar to the getter function, very thin wrapper around set, is it useful?
There was a problem hiding this comment.
Hello Jonathon, same as above, I understand your comments, just to give you more context, I'm following the work development phases in the Anycache proposal which I found very useful as it gives me structure to the work progress to whole Anycache system. I hope you found this helpful!
| @@ -0,0 +1,12 @@ | |||
| // Setter process to set cache to disk | |||
There was a problem hiding this comment.
should this be a standalone process? seems like caching would be something that multiple processes would do so perhaps this should be a lib rather than a process?
There was a problem hiding this comment.
The setter is a standalone process in the Anycache proposal so we can spin up many setter processes. Also the logic for the cachebuilder lives in the setter. The getter process is the lib where other processes can import to obtain the functionalities.
Per Phase 1.3 Setter Process and Phase 1.4 Getter Bootstrap of the Anycache Project Proposal, in this PR I am adding:
The goal of Phase 1.3 and Phase 1.4 is to put together the bare bones of a "setter" process and "getter" functionality.