Skip to content

Commit

Permalink
Thread Pool: Add a dedicated thread pool for refresh, closes #1624.
Browse files Browse the repository at this point in the history
  • Loading branch information
kimchy committed Jan 18, 2012
1 parent d95783b commit 2eeb609
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public TransportRefreshAction(Settings settings, ThreadPool threadPool, ClusterS

@Override
protected String executor() {
return ThreadPool.Names.MANAGEMENT;
return ThreadPool.Names.REFRESH;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ public void run() {
}
return;
}
threadPool.cached().execute(new Runnable() {
threadPool.executor(ThreadPool.Names.REFRESH).execute(new Runnable() {
@Override
public void run() {
try {
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/elasticsearch/threadpool/ThreadPool.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public static class Names {
public static final String PERCOLATE = "percolate";
public static final String MANAGEMENT = "management";
public static final String MERGE = "merge";
public static final String REFRESH = "refresh";
public static final String SNAPSHOT = "snapshot";
}

Expand All @@ -88,6 +89,7 @@ public ThreadPool(Settings settings) {
executors.put(Names.PERCOLATE, build(Names.PERCOLATE, "cached", groupSettings.get(Names.PERCOLATE), ImmutableSettings.Builder.EMPTY_SETTINGS));
executors.put(Names.MANAGEMENT, build(Names.MANAGEMENT, "scaling", groupSettings.get(Names.MANAGEMENT), settingsBuilder().put("keep_alive", "5m").put("size", 20).build()));
executors.put(Names.MERGE, build(Names.MERGE, "scaling", groupSettings.get(Names.MERGE), settingsBuilder().put("keep_alive", "5m").put("size", 20).build()));
executors.put(Names.REFRESH, build(Names.REFRESH, "cached", groupSettings.get(Names.REFRESH), settingsBuilder().put("keep_alive", "1m").build()));
executors.put(Names.SNAPSHOT, build(Names.SNAPSHOT, "scaling", groupSettings.get(Names.SNAPSHOT), ImmutableSettings.Builder.EMPTY_SETTINGS));
executors.put(Names.SAME, new ExecutorHolder(MoreExecutors.sameThreadExecutor(), new Info(Names.SAME, "same")));
this.executors = ImmutableMap.copyOf(executors);
Expand Down

0 comments on commit 2eeb609

Please sign in to comment.