Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions code/common/getter.q
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}

Copy link
Copy Markdown
Member

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?


\d .
12 changes: 12 additions & 0 deletions code/processes/setter.q
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Setter process to set cache to disk

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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?


\d .setter

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this namespace is unclear, without having additional context it isn't apparent what "setter" is or is for


// Save cache down to disk
savecachedowntodisk:{[data;filePath] (hsym filePath) set data };

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filePath -> filepath

and similar to the getter function, very thin wrapper around set, is it useful?


// Get location of cache config and load it in.
cacheconfiglocation:.proc.getconfigfile["cacheconfig.json"];
cacheconfig:.j.k raze read0 hsym first cacheconfiglocation;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think .proc.getconfigfile should only return one file, do we need the first here?


\d .
21 changes: 21 additions & 0 deletions config/cacheconfig.json
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"
}
}