Skip to content

Commit

Permalink
#151 - Fine, hack it.
Browse files Browse the repository at this point in the history
  • Loading branch information
markrmiller committed Jul 14, 2020
1 parent f51acf5 commit 68c3ffc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
25 changes: 17 additions & 8 deletions solr/core/src/java/org/apache/solr/core/CoreContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,7 @@ public CoreLoadFailure(CoreDescriptor cd, Exception loadFailure) {

private volatile UpdateShardHandler updateShardHandler;

private final static ThreadPoolExecutor solrCoreLoadExecutor = new ExecutorUtil.MDCAwareThreadPoolExecutor(0, Integer.MAX_VALUE,
3, TimeUnit.SECONDS,
new SynchronousQueue<>(),
new SolrNamedThreadFactory("SolrCoreLoader"));
private volatile static ThreadPoolExecutor solrCoreLoadExecutor;

private final OrderedExecutor replayUpdatesExecutor;

Expand Down Expand Up @@ -387,12 +384,24 @@ public CoreContainer(SolrZkClient zkClient, NodeConfig config, CoresLocator loca

work.addCollect("init");
}
if (zkClient != null) {
zkSys.initZooKeeper(this, cfg.getCloudConfig());
if (zkClient != null) {
zkSys.initZooKeeper(this, cfg.getCloudConfig());
}
coreConfigService = ConfigSetService.createConfigSetService(cfg, loader, zkSys == null ? null : zkSys.zkController);

containerProperties.putAll(cfg.getSolrProperties());

if (solrCoreLoadExecutor == null) {
synchronized (CoreContainer.class) {
if (solrCoreLoadExecutor == null) {
solrCoreLoadExecutor = new ExecutorUtil.MDCAwareThreadPoolExecutor(0, Integer.MAX_VALUE,
3, TimeUnit.SECONDS,
new SynchronousQueue<>(),
new SolrNamedThreadFactory("SolrCoreLoader"));
}
coreConfigService = ConfigSetService.createConfigSetService(cfg, loader, zkSys == null ? null : zkSys.zkController);
}
}

containerProperties.putAll(cfg.getSolrProperties());
}

@SuppressWarnings({"unchecked"})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class CustomAnalyzerStrField extends StrField {
private final Analyzer queryAnalyzer;

public CustomAnalyzerStrField() {
Random r = LuceneTestCase.random();
Random r = new Random();

// two arg constructor
Analyzer a2 = new TokenizerChain
Expand Down

0 comments on commit 68c3ffc

Please sign in to comment.