-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #153 from aodn/bugs/5916-fix-bug-non-noded
Bugs/5916 fix bug non noded
- Loading branch information
Showing
22 changed files
with
5,877 additions
and
972 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
indexer/src/main/java/au/org/aodn/esindexer/configuration/ForkJoinConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package au.org.aodn.esindexer.configuration; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
public class ForkJoinConfig { | ||
|
||
protected static Logger logger = LoggerFactory.getLogger(ForkJoinConfig.class); | ||
|
||
static { | ||
// By default, ForkJoinPool set parallelism to core - 1, therefore 2 core still use 1 thread, we want to change | ||
// this default utilize the resource better. Affect stream().parallel() or parllelStream() | ||
String coreNum = String.valueOf(Runtime.getRuntime().availableProcessors()); | ||
System.setProperty( | ||
"java.util.concurrent.ForkJoinPool.common.parallelism", | ||
coreNum | ||
); | ||
logger.info("Set ForkJoin use number of cores = {}", coreNum); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.