Flush: Add a specific thread pool for flush operations (scheduled and API), closes #1734.

This commit is contained in:
Shay Banon 2012-02-24 01:36:22 +02:00
parent 7d18304fc7
commit 7ed68a5c30
4 changed files with 6 additions and 4 deletions

View File

@ -58,7 +58,7 @@ public class TransportFlushAction extends TransportBroadcastOperationAction<Flus
@Override
protected String executor() {
return ThreadPool.Names.MANAGEMENT;
return ThreadPool.Names.FLUSH;
}
@Override

View File

@ -57,7 +57,7 @@ public class TransportGatewaySnapshotAction extends TransportBroadcastOperationA
@Override
protected String executor() {
return ThreadPool.Names.MANAGEMENT;
return ThreadPool.Names.SNAPSHOT;
}
@Override

View File

@ -184,7 +184,7 @@ public class TranslogService extends AbstractIndexShardComponent {
}
private void asyncFlushAndReschedule() {
threadPool.executor(ThreadPool.Names.MANAGEMENT).execute(new Runnable() {
threadPool.executor(ThreadPool.Names.FLUSH).execute(new Runnable() {
@Override
public void run() {
try {

View File

@ -63,6 +63,7 @@ public class ThreadPool extends AbstractComponent {
public static final String SEARCH = "search";
public static final String PERCOLATE = "percolate";
public static final String MANAGEMENT = "management";
public static final String FLUSH = "flush";
public static final String MERGE = "merge";
public static final String REFRESH = "refresh";
public static final String SNAPSHOT = "snapshot";
@ -90,7 +91,8 @@ public class ThreadPool extends AbstractComponent {
executors.put(Names.BULK, build(Names.BULK, "cached", groupSettings.get(Names.BULK), ImmutableSettings.Builder.EMPTY_SETTINGS));
executors.put(Names.SEARCH, build(Names.SEARCH, "cached", groupSettings.get(Names.SEARCH), ImmutableSettings.Builder.EMPTY_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.MANAGEMENT, build(Names.MANAGEMENT, "scaling", groupSettings.get(Names.MANAGEMENT), settingsBuilder().put("keep_alive", "5m").put("size", 5).build()));
executors.put(Names.FLUSH, build(Names.FLUSH, "scaling", groupSettings.get(Names.FLUSH), settingsBuilder().put("keep_alive", "5m").put("size", 10).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), settingsBuilder().put("keep_alive", "5m").put("size", 5).build()));