From 93c123a482a5b5ed6533cc746a6bca79698ddb30 Mon Sep 17 00:00:00 2001 From: TessaIO Date: Fri, 6 Dec 2024 09:09:37 +0100 Subject: [PATCH] docs: fix cached lookup module documentation (#17527) * docs: fix loading lookup documentation Signed-off-by: TessaIO * docs: fix indentation and punctuation Signed-off-by: TessaIO --------- Signed-off-by: TessaIO --- .../extensions-core/druid-lookups.md | 89 +++++++++++++++---- 1 file changed, 74 insertions(+), 15 deletions(-) diff --git a/docs/development/extensions-core/druid-lookups.md b/docs/development/extensions-core/druid-lookups.md index 06283ec4d72..e3514a0d0c2 100644 --- a/docs/development/extensions-core/druid-lookups.md +++ b/docs/development/extensions-core/druid-lookups.md @@ -81,10 +81,22 @@ This example demonstrates a polling cache that will update its on-heap cache eve ```json { - "type":"pollingLookup", - "pollPeriod":"PT10M", - "dataFetcher":{ "type":"jdbcDataFetcher", "connectorConfig":"jdbc://mysql://localhost:3306/my_data_base", "table":"lookup_table_name", "keyColumn":"key_column_name", "valueColumn": "value_column_name"}, - "cacheFactory":{"type":"onHeapPolling"} + "type": "pollingLookup", + "pollPeriod": "PT10M", + "dataFetcher": { + "type": "jdbcDataFetcher", + "connectorConfig": { + "connectURI": "jdbc://mysql://localhost:3306/my_data_base", + "user": "druid", + "password": "druid" + }, + "table": "lookup_table_name", + "keyColumn": "key_column_name", + "valueColumn": "value_column_name" + }, + "cacheFactory": { + "type": "onHeapPolling" + } } ``` @@ -94,9 +106,21 @@ This example demonstrates an off-heap lookup that will be cached once and never ```json { - "type":"pollingLookup", - "dataFetcher":{ "type":"jdbcDataFetcher", "connectorConfig":"jdbc://mysql://localhost:3306/my_data_base", "table":"lookup_table_name", "keyColumn":"key_column_name", "valueColumn": "value_column_name"}, - "cacheFactory":{"type":"offHeapPolling"} + "type": "pollingLookup", + "dataFetcher": { + "type": "jdbcDataFetcher", + "connectorConfig": { + "connectURI": "jdbc://mysql://localhost:3306/my_data_base", + "user": "druid", + "password": "druid" + }, + "table": "lookup_table_name", + "keyColumn": "key_column_name", + "valueColumn": "value_column_name" + }, + "cacheFactory": { + "type": "offHeapPolling" + } } ``` @@ -125,10 +149,27 @@ Guava cache configuration spec. ```json { - "type":"loadingLookup", - "dataFetcher":{ "type":"jdbcDataFetcher", "connectorConfig":"jdbc://mysql://localhost:3306/my_data_base", "table":"lookup_table_name", "keyColumn":"key_column_name", "valueColumn": "value_column_name"}, - "loadingCacheSpec":{"type":"guava"}, - "reverseLoadingCacheSpec":{"type":"guava", "maximumSize":500000, "expireAfterAccess":100000, "expireAfterWrite":10000} + "type": "loadingLookup", + "dataFetcher": { + "type": "jdbcDataFetcher", + "connectorConfig": { + "connectURI": "jdbc://mysql://localhost:3306/my_data_base", + "user": "druid", + "password": "druid" + }, + "table": "lookup_table_name", + "keyColumn": "key_column_name", + "valueColumn": "value_column_name" + }, + "loadingCacheSpec": { + "type": "guava" + }, + "reverseLoadingCacheSpec": { + "type": "guava", + "maximumSize": 500000, + "expireAfterAccess": 100000, + "expireAfterWrite": 10000 + } } ``` @@ -146,10 +187,28 @@ Off heap cache is backed by [MapDB](http://www.mapdb.org/) implementation. MapDB ```json { - "type":"loadingLookup", - "dataFetcher":{ "type":"jdbcDataFetcher", "connectorConfig":"jdbc://mysql://localhost:3306/my_data_base", "table":"lookup_table_name", "keyColumn":"key_column_name", "valueColumn": "value_column_name"}, - "loadingCacheSpec":{"type":"mapDb", "maxEntriesSize":100000}, - "reverseLoadingCacheSpec":{"type":"mapDb", "maxStoreSize":5, "expireAfterAccess":100000, "expireAfterWrite":10000} + "type": "loadingLookup", + "dataFetcher": { + "type": "jdbcDataFetcher", + "connectorConfig": { + "connectURI": "jdbc://mysql://localhost:3306/my_data_base", + "user": "druid", + "password": "druid" + }, + "table": "lookup_table_name", + "keyColumn": "key_column_name", + "valueColumn": "value_column_name" + }, + "loadingCacheSpec": { + "type": "mapDb", + "maxEntriesSize": 100000 + }, + "reverseLoadingCacheSpec": { + "type": "mapDb", + "maxStoreSize": 5, + "expireAfterAccess": 100000, + "expireAfterWrite": 10000 + } } ```