diff --git a/code/common/getter.q b/code/common/getter.q new file mode 100644 index 000000000..77e8bd6d4 --- /dev/null +++ b/code/common/getter.q @@ -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 . diff --git a/code/processes/setter.q b/code/processes/setter.q new file mode 100644 index 000000000..261993c7c --- /dev/null +++ b/code/processes/setter.q @@ -0,0 +1,12 @@ +// Setter process to set cache to disk + +\d .setter + +// Save cache down to disk +savecachedowntodisk:{[data;filePath] (hsym filePath) set data }; + +// Get location of cache config and load it in. +cacheconfiglocation:.proc.getconfigfile["cacheconfig.json"]; +cacheconfig:.j.k raze read0 hsym first cacheconfiglocation; + +\d . diff --git a/config/cacheconfig.json b/config/cacheconfig.json new file mode 100644 index 000000000..1eba4dcd4 --- /dev/null +++ b/config/cacheconfig.json @@ -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" + } +} \ No newline at end of file