-
Notifications
You must be signed in to change notification settings - Fork 89
Add cacheConfig, setter process, getter script #743
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| // Bootstrap script that will enable an existing process to load in cache getter functionalities. | ||
|
|
||
| \d .getter | ||
|
|
||
| // Get cache from disk | ||
| getcachefromdisk:{[filePath] load hsym filePath} | ||
|
|
||
| \d . | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| // Setter process to set cache to disk | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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. |
||
|
|
||
| \d .anycache.setter | ||
|
|
||
| // Save cache down to disk | ||
| savecachedowntodisk:{[data;filePath] (hsym filePath) set data }; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. filePath -> filepath and similar to the getter function, very thin wrapper around
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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! |
||
|
|
||
| // Get location of cache config and load it in. | ||
| cacheconfiglocation:.proc.getconfigfile["cacheconfig.json"]; | ||
| cacheconfig:.j.k raze read0 hsym first cacheconfiglocation; | ||
|
bsofjan marked this conversation as resolved.
|
||
|
|
||
| \d . | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| { | ||
| "cacheRootDir": "/opt/anycache/", | ||
| "componentCaches":{ | ||
| "cache1": { | ||
| "analytic": "analytic1", | ||
| "dataSource": "connection1" | ||
| }, | ||
| "cache2": { | ||
| "analytic": "analytic2", | ||
| "dataSource": "connection2" | ||
| } | ||
| }, | ||
| "getter":{ | ||
| "interval": "0D00:05" | ||
| }, | ||
| "setter":{ | ||
| "mode": "timer", | ||
| "interval": "0D00:30", | ||
| "compression": "16 3 0" | ||
| } | ||
| } |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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!