madrob commented on code in PR #965: URL: https://github.com/apache/solr/pull/965#discussion_r958487650
########## solr/core/src/java/org/apache/solr/core/CoreContainer.java: ########## @@ -2424,6 +2430,32 @@ public PlacementPluginFactory<? extends PlacementPluginConfig> getPlacementPlugi public void runAsync(Runnable r) { coreContainerAsyncTaskExecutor.submit(r); } + + public static void setWeakStringInterner() { + Interner<String> interner = Interner.newWeakInterner(); + ClusterState.setStrInternerParser( + new Function<>() { Review Comment: Let's move this function to `Utils` with the other ObjectBuilders. ########## solr/core/src/java/org/apache/solr/core/CoreContainer.java: ########## @@ -383,6 +388,7 @@ public CoreContainer(NodeConfig config, CoresLocator locator, boolean asyncSolrC if (null != this.cfg.getBooleanQueryMaxClauseCount()) { IndexSearcher.setMaxClauseCount(this.cfg.getBooleanQueryMaxClauseCount()); } + setWeakStringInterner(); Review Comment: Please add a property to enable/disable this feature. Default on is fine, but ability to easily switch off for cases where it introduces issues would be nice. ########## versions.props: ########## @@ -4,7 +4,7 @@ com.carrotsearch:hppc=0.9.1 com.cybozu.labs:langdetect=1.1-20120112 com.fasterxml.jackson:jackson-bom=2.13.3 com.fasterxml.woodstox:woodstox-core=6.2.8 -com.github.ben-manes.caffeine:caffeine=3.0.5 Review Comment: Also need to update versions.lock and the license files. `./gradlew helpDeps` has the commands you need. ########## solr/solrj/src/java/org/apache/solr/common/cloud/ClusterState.java: ########## @@ -477,4 +484,16 @@ public PerReplicaStates getStates() { return perReplicaStates; } } + + private static volatile Function<JSONParser, ObjectBuilder> STR_INTERNER_OBJ_BUILDER = + STANDARDOBJBUILDER; + + public static void setStrInternerParser(Function<JSONParser, ObjectBuilder> fun) { + if (fun == null) return; + STR_INTERNER_OBJ_BUILDER = fun; + } + + public static Function<JSONParser, ObjectBuilder> getStringInterner() { Review Comment: This appears unused. ########## solr/solrj/src/java/org/apache/solr/common/util/Utils.java: ########## @@ -303,6 +303,11 @@ public static Object fromJSON(byte[] utf8) { } public static Object fromJSON(byte[] utf8, int offset, int length) { + return fromJSON(utf8, offset, length, STANDARDOBJBUILDER); + } + + public static Object fromJSON( Review Comment: This looks like it is only called with the customized object builder from `ClusterState.createFromJSON` which is only called from BackupManager. That feels like we're missing some usages. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org