Search in sources :

Example 1 with GroupExecutor

use of org.apache.servicecomb.core.executor.GroupExecutor in project java-chassis by ServiceComb.

the class ThreadPoolMetersInitializer method createThreadPoolMeters.

protected void createThreadPoolMeters(String threadPoolName, GroupExecutor groupExecutor) {
    for (int idx = 0; idx < groupExecutor.getExecutorList().size(); idx++) {
        Executor executor = groupExecutor.getExecutorList().get(idx);
        createThreadPoolMeters(threadPoolName + "-group" + idx, executor);
    }
}
Also used : GroupExecutor(org.apache.servicecomb.core.executor.GroupExecutor) Executor(java.util.concurrent.Executor) ThreadPoolExecutor(java.util.concurrent.ThreadPoolExecutor)

Example 2 with GroupExecutor

use of org.apache.servicecomb.core.executor.GroupExecutor in project java-chassis by ServiceComb.

the class ThreadPoolMetersInitializer method createThreadPoolMeters.

public void createThreadPoolMeters() {
    Map<Executor, Executor> operationExecutors = collectionOperationExecutors();
    // currently, all operation executors come from bean
    Map<String, Executor> beanExecutors = BeanUtils.getContext().getBeansOfType(Executor.class);
    for (Entry<String, Executor> entry : beanExecutors.entrySet()) {
        Executor executor = entry.getValue();
        if (!operationExecutors.containsKey(executor)) {
            continue;
        }
        if (GroupExecutor.class.isInstance(executor)) {
            createThreadPoolMeters(entry.getKey(), (GroupExecutor) executor);
            continue;
        }
        createThreadPoolMeters(entry.getKey(), executor);
    }
}
Also used : GroupExecutor(org.apache.servicecomb.core.executor.GroupExecutor) Executor(java.util.concurrent.Executor) ThreadPoolExecutor(java.util.concurrent.ThreadPoolExecutor)

Aggregations

Executor (java.util.concurrent.Executor)2 ThreadPoolExecutor (java.util.concurrent.ThreadPoolExecutor)2 GroupExecutor (org.apache.servicecomb.core.executor.GroupExecutor)2