/** * Starts the test application. * <p> * Loads the config from classpath hazelcast.xml, if it fails to load, will use default config. */ public static void main(String[] args) throws Exception { Config config; try { config = new FileSystemXmlConfig("hazelcast.xml"); } catch (FileNotFoundException e) { config = new Config(); } for (int i = 1; i <= LOAD_EXECUTORS_COUNT; i++) { config.addExecutorConfig(new ExecutorConfig(EXECUTOR_NAMESPACE + " " + i).setPoolSize(i)); } ConsoleApp consoleApp = new ConsoleApp(Hazelcast.newHazelcastInstance(config)); consoleApp.start(); } }
/** * Starts the test application. * <p> * Loads the config from classpath hazelcast.xml, if it fails to load, will use default config. */ public static void main(String[] args) throws Exception { Config config; try { config = new FileSystemXmlConfig("hazelcast.xml"); } catch (FileNotFoundException e) { config = new Config(); } for (int i = 1; i <= LOAD_EXECUTORS_COUNT; i++) { config.addExecutorConfig(new ExecutorConfig(EXECUTOR_NAMESPACE + " " + i).setPoolSize(i)); } ConsoleApp consoleApp = new ConsoleApp(Hazelcast.newHazelcastInstance(config)); consoleApp.start(); } }
private static Config createConfiguration() { Config config = new Config(); NetworkConfig networkCfg = createNetworkConfigs(); config.setNetworkConfig(networkCfg); ExecutorConfig executorConfig = new ExecutorConfig(); executorConfig.setPoolSize(MAX_POOL_SIZE); executorConfig.setStatisticsEnabled(false); config.addExecutorConfig(executorConfig); return config; }
.addExecutorConfig(new ExecutorConfig() .setName(taskDistributorName) .setPoolSize(1) );