Skip to content

Commit dc607a8

Browse files
Vladimir Kotalahornace
authored andcommitted
finish rename of executor for individual files
1 parent 383c498 commit dc607a8

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

opengrok-indexer/src/main/java/org/opengrok/indexer/configuration/Configuration.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ public final class Configuration {
193193
private boolean indexVersionedFilesOnly;
194194
private int indexingParallelism;
195195
private int historyParallelism;
196-
private int historyRenamedParallelism;
196+
private int historyFileParallelism;
197197
private boolean tagsEnabled;
198198
private int hitsPerPage;
199199
private int cachePages;
@@ -1154,12 +1154,12 @@ public void setHistoryParallelism(int value) {
11541154
this.historyParallelism = Math.max(value, 0);
11551155
}
11561156

1157-
public int getHistoryRenamedParallelism() {
1158-
return historyRenamedParallelism;
1157+
public int getHistoryFileParallelism() {
1158+
return historyFileParallelism;
11591159
}
11601160

1161-
public void setHistoryRenamedParallelism(int value) {
1162-
this.historyRenamedParallelism = Math.max(value, 0);
1161+
public void setHistoryFileParallelism(int value) {
1162+
this.historyFileParallelism = Math.max(value, 0);
11631163
}
11641164

11651165
public boolean isTagsEnabled() {

opengrok-indexer/src/main/java/org/opengrok/indexer/configuration/RuntimeEnvironment.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,12 +1118,12 @@ public int getHistoryParallelism() {
11181118
}
11191119

11201120
/**
1121-
* Gets the value of {@link Configuration#getHistoryRenamedParallelism()} -- or
1121+
* Gets the value of {@link Configuration#getHistoryFileParallelism()} -- or
11221122
* if zero, then as a default gets the number of available processors.
11231123
* @return a natural number >= 1
11241124
*/
1125-
public int getHistoryRenamedParallelism() {
1126-
int parallelism = syncReadConfiguration(Configuration::getHistoryRenamedParallelism);
1125+
public int getHistoryFileParallelism() {
1126+
int parallelism = syncReadConfiguration(Configuration::getHistoryFileParallelism);
11271127
return parallelism < 1 ? Runtime.getRuntime().availableProcessors() :
11281128
parallelism;
11291129
}

opengrok-indexer/src/main/java/org/opengrok/indexer/index/Indexer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -570,11 +570,11 @@ public static String[] parseOptions(String[] argv) throws ParseException {
570570
"of threads will be set to the number of available CPUs. Assumes -H/--history.").execute(threadCount ->
571571
cfg.setHistoryParallelism((Integer) threadCount));
572572

573-
parser.on("--historyRenamedThreads", "=number", Integer.class,
574-
"The number of threads to use for history cache generation when dealing with renamed files.",
573+
parser.on("--historyFileThreads", "=number", Integer.class,
574+
"The number of threads to use for history cache generation when dealing with files.",
575575
"By default the number of threads will be set to the number of available CPUs.",
576576
"Assumes --renamedHistory=on").execute(threadCount ->
577-
cfg.setHistoryRenamedParallelism((Integer) threadCount));
577+
cfg.setHistoryFileParallelism((Integer) threadCount));
578578

579579
parser.on("-I", "--include", "=pattern",
580580
"Only files matching this pattern will be examined. Pattern supports",

opengrok-indexer/src/main/java/org/opengrok/indexer/index/IndexerParallelizer.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public IndexerParallelizer(RuntimeEnvironment env) {
8282
createLazyCtagsPool();
8383
createLazyFixedExecutor();
8484
createLazyHistoryExecutor();
85-
createLazyHistoryRenamedExecutor();
85+
createLazyHistoryFileExecutor();
8686
createLazyCtagsWatcherExecutor();
8787
}
8888

@@ -197,7 +197,7 @@ private void bounceHistoryExecutor() {
197197
private void bounceHistoryRenamedExecutor() {
198198
if (lzHistoryFileExecutor.isActive()) {
199199
ExecutorService formerHistoryRenamedExecutor = lzHistoryFileExecutor.get();
200-
createLazyHistoryRenamedExecutor();
200+
createLazyHistoryFileExecutor();
201201
formerHistoryRenamedExecutor.shutdown();
202202
}
203203
}
@@ -240,9 +240,9 @@ private void createLazyHistoryExecutor() {
240240
Executors.newFixedThreadPool(env.getHistoryParallelism()));
241241
}
242242

243-
private void createLazyHistoryRenamedExecutor() {
243+
private void createLazyHistoryFileExecutor() {
244244
lzHistoryFileExecutor = LazilyInstantiate.using(() ->
245-
Executors.newFixedThreadPool(env.getHistoryRenamedParallelism()));
245+
Executors.newFixedThreadPool(env.getHistoryFileParallelism()));
246246
}
247247

248248
private class CtagsObjectFactory implements ObjectFactory<Ctags> {

0 commit comments

Comments
 (0)