From 995657c6ce3cdcca5d08629982f3161294257da9 Mon Sep 17 00:00:00 2001 From: Viktor Lofgren Date: Fri, 21 Jul 2023 19:50:35 +0200 Subject: [PATCH] (big-string) Make big-string disable:able --- .../src/main/java/nu/marginalia/bigstring/BigString.java | 5 ++++- doc/system-properties.md | 6 ++++++ run/env/service.env | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/code/libraries/big-string/src/main/java/nu/marginalia/bigstring/BigString.java b/code/libraries/big-string/src/main/java/nu/marginalia/bigstring/BigString.java index f1533977..55a26cd7 100644 --- a/code/libraries/big-string/src/main/java/nu/marginalia/bigstring/BigString.java +++ b/code/libraries/big-string/src/main/java/nu/marginalia/bigstring/BigString.java @@ -1,8 +1,11 @@ package nu.marginalia.bigstring; public interface BigString { + + boolean disableBigString = Boolean.getBoolean("bigstring.disabled"); + static BigString encode(String stringValue) { - if (stringValue.length() > 64) { + if (!disableBigString && stringValue.length() > 64) { return new CompressedBigString(stringValue); } else { diff --git a/doc/system-properties.md b/doc/system-properties.md index f28eaca3..e79228bd 100644 --- a/doc/system-properties.md +++ b/doc/system-properties.md @@ -29,3 +29,9 @@ These are JVM system properties used by each service |lexiconSizeHint| 800000000 | The default size of the lexicon | |local-index-path| /some/path | Selects the location the loader will write index data | |crawl.rootDirRewrite|/some/path|Sets the base directory of a crawl plan | + +## Other + +|flag| values | description | +|---|------------|---------------------------------------------| +|bigstring.disabled| true/false | Disables transparent big string compression | \ No newline at end of file diff --git a/run/env/service.env b/run/env/service.env index ac745577..5553f603 100644 --- a/run/env/service.env +++ b/run/env/service.env @@ -1,4 +1,4 @@ WMSA_HOME=run/ CONTROL_SERVICE_OPTS="-DdistPath=/dist" CONVERTER_OPTS="-ea -Xmx16G -XX:-CompactStrings -XX:+UseParallelGC -XX:GCTimeRatio=14 -XX:ParallelGCThreads=15" -CRAWLER_OPTS="-Xmx16G -XX:+UseParallelGC -XX:GCTimeRatio=14 -XX:ParallelGCThreads=15" \ No newline at end of file +CRAWLER_OPTS="-Dbigstring.disabled=true -Xmx16G -XX:+UseParallelGC -XX:GCTimeRatio=14 -XX:ParallelGCThreads=15" \ No newline at end of file