Skip to content

Commit

Permalink
Revert "ISPN-10040 Embedded and server thread pool defaults should be…
Browse files Browse the repository at this point in the history
… the same"

This reverts commit 932be47.
  • Loading branch information
danberindei committed Apr 2, 2019
1 parent 3470ff7 commit 494d96f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 39 deletions.
Expand Up @@ -15,7 +15,6 @@
* @author Galder Zamarreño
*/
public class BlockingThreadPoolExecutorFactory implements ThreadPoolExecutorFactory<ExecutorService> {
public static final int DEFAULT_KEEP_ALIVE_MILLIS = 60000;

private static final Log log = LogFactory.getLog(BlockingThreadPoolExecutorFactory.class);

Expand Down Expand Up @@ -91,7 +90,7 @@ public String toString() {
public static BlockingThreadPoolExecutorFactory create(int maxThreads, int queueSize) {
int coreThreads = queueSize == 0 ? 1 : maxThreads;
return new BlockingThreadPoolExecutorFactory(
maxThreads, coreThreads, queueSize, DEFAULT_KEEP_ALIVE_MILLIS);
maxThreads, coreThreads, queueSize, 60000);
}

}
Expand Up @@ -5,7 +5,6 @@
import java.util.HashMap;
import java.util.Map;

import org.infinispan.commons.executors.BlockingThreadPoolExecutorFactory;
import org.infinispan.commons.util.ProcessorInfo;

/**
Expand Down Expand Up @@ -87,18 +86,6 @@ public static int getDefaultQueueSize(String componentName) {
return DEFAULT_QUEUE_SIZE.get(componentName);
}

public static int getDefaultMinThreads(String componentName) {
if (getDefaultQueueSize(componentName) == 0) {
return 1;
} else {
return getDefaultThreads(componentName);
}
}

public static long getDefaultKeepaliveMillis() {
return BlockingThreadPoolExecutorFactory.DEFAULT_KEEP_ALIVE_MILLIS;
}

public static String shortened(String cn) {
int dotIndex = cn.lastIndexOf(".");
int dotIndexPlusOne = dotIndex + 1;
Expand Down
Expand Up @@ -22,16 +22,6 @@

package org.jboss.as.clustering.infinispan.subsystem;

import static org.infinispan.factories.KnownComponentNames.ASYNC_NOTIFICATION_EXECUTOR;
import static org.infinispan.factories.KnownComponentNames.ASYNC_OPERATIONS_EXECUTOR;
import static org.infinispan.factories.KnownComponentNames.ASYNC_TRANSPORT_EXECUTOR;
import static org.infinispan.factories.KnownComponentNames.REMOTE_COMMAND_EXECUTOR;
import static org.infinispan.factories.KnownComponentNames.STATE_TRANSFER_EXECUTOR;
import static org.infinispan.factories.KnownComponentNames.getDefaultKeepaliveMillis;
import static org.infinispan.factories.KnownComponentNames.getDefaultMinThreads;
import static org.infinispan.factories.KnownComponentNames.getDefaultQueueSize;
import static org.infinispan.factories.KnownComponentNames.getDefaultThreads;

import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
Expand Down Expand Up @@ -74,20 +64,11 @@
*/
public enum ThreadPoolResource implements ResourceDefinition, ThreadPoolDefinition {

ASYNC_OPERATIONS("async-operations", getDefaultMinThreads(ASYNC_OPERATIONS_EXECUTOR),
getDefaultThreads(ASYNC_OPERATIONS_EXECUTOR), getDefaultQueueSize(ASYNC_OPERATIONS_EXECUTOR),
getDefaultKeepaliveMillis()),
LISTENER("listener", getDefaultMinThreads(ASYNC_NOTIFICATION_EXECUTOR),
getDefaultThreads(ASYNC_NOTIFICATION_EXECUTOR), getDefaultQueueSize(ASYNC_NOTIFICATION_EXECUTOR),
getDefaultKeepaliveMillis()),
REMOTE_COMMAND("remote-command", getDefaultMinThreads(REMOTE_COMMAND_EXECUTOR),
getDefaultThreads(REMOTE_COMMAND_EXECUTOR), getDefaultQueueSize(REMOTE_COMMAND_EXECUTOR),
getDefaultKeepaliveMillis()),
STATE_TRANSFER("state-transfer", getDefaultMinThreads(STATE_TRANSFER_EXECUTOR),
getDefaultThreads(STATE_TRANSFER_EXECUTOR), getDefaultQueueSize(STATE_TRANSFER_EXECUTOR),
getDefaultKeepaliveMillis()),
TRANSPORT("transport", getDefaultMinThreads(ASYNC_TRANSPORT_EXECUTOR), getDefaultThreads(ASYNC_TRANSPORT_EXECUTOR),
getDefaultQueueSize(ASYNC_TRANSPORT_EXECUTOR), getDefaultKeepaliveMillis()),
ASYNC_OPERATIONS("async-operations", 25, 25, 1000, 60000),
LISTENER("listener", 1, 1, 100000, 60000),
REMOTE_COMMAND("remote-command", 25, 25, 100000, 60000),
STATE_TRANSFER("state-transfer", 1, 60, 0, 60000),
TRANSPORT("transport", 25, 25, 100000, 60000),
;

static final PathElement WILDCARD_PATH = pathElement(PathElement.WILDCARD_VALUE);
Expand Down

0 comments on commit 494d96f

Please sign in to comment.