@@ -87,11 +87,12 @@ public Stream<BetweennessCentrality.Result> betweennessStream(
8787 .withDirection (configuration .getDirection (DEFAULT_DIRECTION ))
8888 .load (configuration .getGraphImpl ());
8989
90- if (configuration .getConcurrency (-1 ) > 0 ) {
91- final ParallelBetweennessCentrality algo = new ParallelBetweennessCentrality (graph ,
92- configuration .getNumber ("scaleFactor" , 100_000 ).intValue (),
93- Pools .DEFAULT ,
94- configuration .getConcurrency ())
90+ int concurrency = configuration .getConcurrency ();
91+ if (concurrency > 1 ) {
92+ int scaleFactor = configuration
93+ .getNumber ("scaleFactor" , 100_000 )
94+ .intValue ();
95+ final ParallelBetweennessCentrality algo = new ParallelBetweennessCentrality (graph , scaleFactor , Pools .DEFAULT , concurrency )
9596 .withProgressLogger (ProgressLogger .wrap (log , "BetweennessCentrality" ))
9697 .withTerminationFlag (TerminationFlag .wrap (transaction ))
9798 .withDirection (configuration .getDirection (DEFAULT_DIRECTION ))
@@ -181,7 +182,7 @@ public Stream<BetweennessCentralityProcResult> betweenness(
181182
182183 ProcedureConfiguration configuration = ProcedureConfiguration .create (config );
183184
184- if (configuration .getConcurrency (- 1 ) > 1 ) {
185+ if (configuration .getConcurrency () > 1 ) {
185186 return computeBetweennessParallel (label , relationship , configuration );
186187 } else {
187188 return computeBetweenness (label , relationship , configuration );
0 commit comments