本文整理汇总了Java中org.apache.ignite.configuration.IgniteConfiguration.setRebalanceThreadPoolSize方法的典型用法代码示例。如果您正苦于以下问题:Java IgniteConfiguration.setRebalanceThreadPoolSize方法的具体用法?Java IgniteConfiguration.setRebalanceThreadPoolSize怎么用?Java IgniteConfiguration.setRebalanceThreadPoolSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.ignite.configuration.IgniteConfiguration
的用法示例。
在下文中一共展示了IgniteConfiguration.setRebalanceThreadPoolSize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: apply
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
@Override
public Ignite apply(ExtendedActorSystem system) {
final IgniteProperties properties = igniteConfigProvider.apply(system);
final IgniteConfiguration igniteConfiguration = new IgniteConfiguration();
igniteConfiguration.setClientMode(properties.isClientNode());
// durable file memory persistence
if (properties.isEnableFilePersistence()) {
DataStorageConfiguration persistentStoreConfiguration = new DataStorageConfiguration();
persistentStoreConfiguration.setStoragePath(properties.getIgnitePersistenceFilePath() + "/data/store");
persistentStoreConfiguration.setWalArchivePath(properties.getIgnitePersistenceFilePath() + "./data/walArchive");
igniteConfiguration.setDataStorageConfiguration(persistentStoreConfiguration);
}
// connector configuration
final ConnectorConfiguration connectorConfiguration = new ConnectorConfiguration();
connectorConfiguration.setPort(properties.getIgniteConnectorPort());
// common ignite configuration
igniteConfiguration.setMetricsLogFrequency(properties.getMetricsLogFrequency());
igniteConfiguration.setQueryThreadPoolSize(properties.getQueryThreadPoolSize());
igniteConfiguration.setDataStreamerThreadPoolSize(properties.getDataStreamerThreadPoolSize());
igniteConfiguration.setManagementThreadPoolSize(properties.getManagementThreadPoolSize());
igniteConfiguration.setPublicThreadPoolSize(properties.getPublicThreadPoolSize());
igniteConfiguration.setSystemThreadPoolSize(properties.getSystemThreadPoolSize());
igniteConfiguration.setRebalanceThreadPoolSize(properties.getRebalanceThreadPoolSize());
igniteConfiguration.setAsyncCallbackPoolSize(properties.getAsyncCallbackPoolSize());
igniteConfiguration.setPeerClassLoadingEnabled(properties.isPeerClassLoadingEnabled());
final BinaryConfiguration binaryConfiguration = new BinaryConfiguration();
binaryConfiguration.setCompactFooter(false);
igniteConfiguration.setBinaryConfiguration(binaryConfiguration);
// cluster tcp configuration
final TcpDiscoverySpi tcpDiscoverySpi = new TcpDiscoverySpi();
final TcpDiscoveryVmIpFinder tcpDiscoveryVmIpFinder = new TcpDiscoveryVmIpFinder();
// need to be changed when it come to real cluster configuration
tcpDiscoveryVmIpFinder.setAddresses(Arrays.asList(properties.getTcpDiscoveryAddresses() + properties.getIgniteServerPortRange()));
tcpDiscoverySpi.setIpFinder(tcpDiscoveryVmIpFinder);
igniteConfiguration.setDiscoverySpi(new TcpDiscoverySpi());
final Ignite ignite = Ignition.start(igniteConfiguration);
Runtime.getRuntime().addShutdownHook(new Thread(ignite::close));
return ignite;
}
示例2: config
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/**
* Create node configuration.
*
* @param name Node name.
* @param ipFinder IpFinder.
* @return Configuration.
* @throws Exception If failed.
*/
private IgniteConfiguration config(String name, TcpDiscoveryVmIpFinder ipFinder) throws Exception {
// Data cache configuration.
CacheConfiguration dataCcfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
dataCcfg.setCacheMode(CacheMode.REPLICATED);
dataCcfg.setAtomicityMode(TRANSACTIONAL);
dataCcfg.setWriteSynchronizationMode(FULL_SYNC);
dataCcfg.setAffinityMapper(new DummyAffinityMapper(1));
dataCcfg.setMaxConcurrentAsyncOperations(1);
// Meta cache configuration.
CacheConfiguration metaCcfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
metaCcfg.setCacheMode(CacheMode.REPLICATED);
metaCcfg.setAtomicityMode(TRANSACTIONAL);
metaCcfg.setWriteSynchronizationMode(FULL_SYNC);
// File system configuration.
FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
igfsCfg.setDefaultMode(IgfsMode.PRIMARY);
igfsCfg.setFragmentizerEnabled(false);
igfsCfg.setBlockSize(1024);
igfsCfg.setDataCacheConfiguration(dataCcfg);
igfsCfg.setMetaCacheConfiguration(metaCcfg);
igfsCfg.setName(IGFS_NAME);
// Ignite configuration.
IgniteConfiguration cfg = getConfiguration(name);
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(ipFinder);
cfg.setDiscoverySpi(discoSpi);
cfg.setFileSystemConfiguration(igfsCfg);
cfg.setLocalHost("127.0.0.1");
cfg.setConnectorConfiguration(null);
cfg.setStripedPoolSize(2);
cfg.setSystemThreadPoolSize(2);
cfg.setRebalanceThreadPoolSize(1);
cfg.setPublicThreadPoolSize(1);
return cfg;
}
示例3: getConfiguration
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration iCfg = super.getConfiguration(igniteInstanceName);
((TcpDiscoverySpi)iCfg.getDiscoverySpi()).setIpFinder(ipFinder);
((TcpDiscoverySpi)iCfg.getDiscoverySpi()).setForceServerMode(true);
TcpCommunicationSpi commSpi = new CountingCommunicationSpi();
commSpi.setLocalPort(GridTestUtils.getNextCommPort(getClass()));
commSpi.setTcpNoDelay(true);
iCfg.setCommunicationSpi(commSpi);
if (getTestIgniteInstanceName(10).equals(igniteInstanceName))
iCfg.setClientMode(true);
CacheConfiguration<Integer, Integer> cachePCfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME);
cachePCfg.setName(CACHE_NAME_DHT_PARTITIONED);
cachePCfg.setCacheMode(CacheMode.PARTITIONED);
cachePCfg.setRebalanceMode(CacheRebalanceMode.SYNC);
cachePCfg.setBackups(1);
cachePCfg.setRebalanceBatchSize(1);
cachePCfg.setRebalanceBatchesPrefetchCount(1);
cachePCfg.setRebalanceOrder(2);
CacheConfiguration<Integer, Integer> cachePCfg2 = new CacheConfiguration<>(DEFAULT_CACHE_NAME);
cachePCfg2.setName(CACHE_NAME_DHT_PARTITIONED_2);
cachePCfg2.setCacheMode(CacheMode.PARTITIONED);
cachePCfg2.setRebalanceMode(CacheRebalanceMode.SYNC);
cachePCfg2.setBackups(1);
cachePCfg2.setRebalanceOrder(2);
//cachePCfg2.setRebalanceDelay(5000);//Known issue, possible deadlock in case of low priority cache rebalancing delayed.
CacheConfiguration<Integer, Integer> cacheRCfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME);
cacheRCfg.setName(CACHE_NAME_DHT_REPLICATED);
cacheRCfg.setCacheMode(CacheMode.REPLICATED);
cacheRCfg.setRebalanceMode(CacheRebalanceMode.SYNC);
cacheRCfg.setRebalanceBatchSize(1);
cacheRCfg.setRebalanceBatchesPrefetchCount(Integer.MAX_VALUE);
((TcpCommunicationSpi)iCfg.getCommunicationSpi()).setSharedMemoryPort(-1);//Shmem fail fix for Integer.MAX_VALUE.
CacheConfiguration<Integer, Integer> cacheRCfg2 = new CacheConfiguration<>(DEFAULT_CACHE_NAME);
cacheRCfg2.setName(CACHE_NAME_DHT_REPLICATED_2);
cacheRCfg2.setCacheMode(CacheMode.REPLICATED);
cacheRCfg2.setRebalanceMode(CacheRebalanceMode.SYNC);
cacheRCfg2.setRebalanceOrder(4);
iCfg.setCacheConfiguration(cachePCfg, cachePCfg2, cacheRCfg, cacheRCfg2);
iCfg.setRebalanceThreadPoolSize(2);
return iCfg;
}