private int handleExecutorService(MemberStateImpl memberState, int count, Config config, Map<String, LocalExecutorStats> executorServices) { for (Map.Entry<String, LocalExecutorStats> entry : executorServices.entrySet()) { String name = entry.getKey(); if (config.findExecutorConfig(name).isStatisticsEnabled()) { LocalExecutorStats stats = entry.getValue(); memberState.putLocalExecutorStats(name, stats); ++count; } } return count; }
private int handleExecutorService(MemberStateImpl memberState, int count, Config config, Map<String, LocalExecutorStats> executorServices) { for (Map.Entry<String, LocalExecutorStats> entry : executorServices.entrySet()) { String name = entry.getKey(); if (config.findExecutorConfig(name).isStatisticsEnabled()) { LocalExecutorStats stats = entry.getValue(); memberState.putLocalExecutorStats(name, stats); ++count; } } return count; }
public void execute(String name, String uuid, Callable callable, Operation op) { ExecutorConfig cfg = getOrFindExecutorConfig(name); if (cfg.isStatisticsEnabled()) { startPending(name); } CallableProcessor processor = new CallableProcessor(name, uuid, callable, op, cfg.isStatisticsEnabled()); if (uuid != null) { submittedTasks.put(uuid, processor); } try { executionService.execute(name, processor); } catch (RejectedExecutionException e) { if (cfg.isStatisticsEnabled()) { rejectExecution(name); } logger.warning("While executing " + callable + " on Executor[" + name + "]", e); if (uuid != null) { submittedTasks.remove(uuid); } processor.sendResponse(e); } }
public void execute(String name, String uuid, Callable callable, Operation op) { ExecutorConfig cfg = getOrFindExecutorConfig(name); if (cfg.isStatisticsEnabled()) { startPending(name); } CallableProcessor processor = new CallableProcessor(name, uuid, callable, op, cfg.isStatisticsEnabled()); if (uuid != null) { submittedTasks.put(uuid, processor); } try { executionService.execute(name, processor); } catch (RejectedExecutionException e) { if (cfg.isStatisticsEnabled()) { rejectExecution(name); } logger.warning("While executing " + callable + " on Executor[" + name + "]", e); if (uuid != null) { submittedTasks.remove(uuid); } processor.sendResponse(e); } }
@Override public Config addExecutorConfig(ExecutorConfig executorConfig) { ClientMessage request = DynamicConfigAddExecutorConfigCodec.encodeRequest( executorConfig.getName(), executorConfig.getPoolSize(), executorConfig.getQueueCapacity(), executorConfig.isStatisticsEnabled(), executorConfig.getQuorumName()); invoke(request); return this; }
@Override public Config addExecutorConfig(ExecutorConfig executorConfig) { ClientMessage request = DynamicConfigAddExecutorConfigCodec.encodeRequest( executorConfig.getName(), executorConfig.getPoolSize(), executorConfig.getQueueCapacity(), executorConfig.isStatisticsEnabled(), executorConfig.getQuorumName()); invoke(request); return this; }
private static void executorXmlGenerator(XmlGenerator gen, Config config) { for (ExecutorConfig ex : config.getExecutorConfigs().values()) { gen.open("executor-service", "name", ex.getName()) .node("statistics-enabled", ex.isStatisticsEnabled()) .node("pool-size", ex.getPoolSize()) .node("queue-capacity", ex.getQueueCapacity()) .node("quorum-ref", ex.getQuorumName()) .close(); } }
private static void executorXmlGenerator(XmlGenerator gen, Config config) { for (ExecutorConfig ex : config.getExecutorConfigs().values()) { gen.open("executor-service", "name", ex.getName()) .node("statistics-enabled", ex.isStatisticsEnabled()) .node("pool-size", ex.getPoolSize()) .node("queue-capacity", ex.getQueueCapacity()) .node("quorum-ref", ex.getQuorumName()) .close(); } }