本文整理汇总了Java中org.apache.ignite.configuration.IgniteConfiguration.setConsistentId方法的典型用法代码示例。如果您正苦于以下问题:Java IgniteConfiguration.setConsistentId方法的具体用法?Java IgniteConfiguration.setConsistentId怎么用?Java IgniteConfiguration.setConsistentId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.ignite.configuration.IgniteConfiguration
的用法示例。
在下文中一共展示了IgniteConfiguration.setConsistentId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getConfiguration
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
TcpDiscoverySpi discoverySpi = (TcpDiscoverySpi)cfg.getDiscoverySpi();
discoverySpi.setIpFinder(ipFinder);
DataStorageConfiguration memCfg = new DataStorageConfiguration().setDefaultDataRegionConfiguration(
new DataRegionConfiguration().setMaxSize(200 * 1024 * 1024));
cfg.setDataStorageConfiguration(memCfg);
if (gridName.contains(DUMMY_GRID_NAME))
cfg.setUserAttributes(F.asMap(TEST_ATTRIBUTE, false));
else
cfg.setUserAttributes(F.asMap(TEST_ATTRIBUTE, true));
cfg.setConsistentId(gridName);
if (gridName.contains("client"))
cfg.setClientMode(true);
return cfg;
}
示例2: getConfiguration
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
if (consId != null)
cfg.setConsistentId(consId);
cfg.setDataStorageConfiguration(
new DataStorageConfiguration().setDefaultDataRegionConfiguration(
new DataRegionConfiguration()
.setPersistenceEnabled(true).setMaxSize(10 * 1024 * 1024)
).setWalMode(WALMode.LOG_ONLY)
);
return cfg;
}
示例3: startBackUpClientNodes
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/**
* @param cnt Count.
* @throws Exception If failed.
*/
private void startBackUpClientNodes(int cnt) throws Exception {
for (int i = 0; i < cnt; i++) {
String node = "node" + i;
String name = node + backUpSuffix + clientSuffix;
IgniteConfiguration cfg = getConfiguration(name);
cfg.setConsistentId(node);
cfg.setActiveOnStart(false);
cfg.setClientMode(true);
((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(backUpIpFinder);
Ignite ig = startGrid(name, cfg);
nodes.put(name, ig);
}
}
示例4: getConfiguration
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
@Override protected IgniteConfiguration getConfiguration(String name) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(name);
cfg.setAutoActivationEnabled(false);
if (!nodeClient.equals(name))
cfg.setDiscoverySpi(new TcpDiscoverySpi().setIpFinder(vmIpFinder));
else {
clientIpFinder.setAddresses(Collections.singletonList("127.0.0.1:47501"));
cfg.setDiscoverySpi(new TcpDiscoverySpi().setIpFinder(clientIpFinder));
}
cfg.setDataStorageConfiguration(new DataStorageConfiguration()
.setDefaultDataRegionConfiguration(new DataRegionConfiguration()
.setMaxSize(100 * 1024 * 1024)
.setPersistenceEnabled(true)));
cfg.setConsistentId(name);
return cfg;
}
示例5: getConfiguration
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(IP_FINDER);
cfg.setConsistentId(gridName);
DataStorageConfiguration memCfg = new DataStorageConfiguration()
.setDefaultDataRegionConfiguration(
new DataRegionConfiguration().setMaxSize(100 * 1024 * 1024).setPersistenceEnabled(true))
.setPageSize(1024)
.setWalMode(WALMode.LOG_ONLY);
cfg.setDataStorageConfiguration(memCfg);
CacheConfiguration<Object, Object> ccfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME);
ccfg.setWriteSynchronizationMode(FULL_SYNC);
ccfg.setAtomicityMode(TRANSACTIONAL);
ccfg.setAffinity(new RendezvousAffinityFunction(false, 32));
ccfg.setRebalanceMode(ASYNC);
ccfg.setCacheMode(REPLICATED);
cfg.setCacheConfiguration(ccfg);
cfg.setIndexingSpi(new ErrorOnRebalanceIndexingSpi());
return cfg;
}
示例6: startPrimary
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/**
* @param idx Index.
* @throws Exception If failed.
*/
private void startPrimary(int idx) throws Exception {
String node = "node" + idx;
String name = node + primarySuffix;
IgniteConfiguration cfg = getConfiguration(name);
cfg.setConsistentId(node);
((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(primaryIpFinder);
Ignite ig = startGrid(name, cfg);
nodes.put(name, ig);
}
示例7: getConfiguration
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/**
*
*/
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
cfg.setDiscoverySpi(new TcpDiscoverySpi().setIpFinder(vmIpFinder));
cfg.setDataStorageConfiguration(new DataStorageConfiguration()
.setDefaultDataRegionConfiguration(new DataRegionConfiguration()
.setMaxSize(100 * 1024 * 1024)
.setPersistenceEnabled(true)));
cfg.setConsistentId(igniteInstanceName);
return cfg;
}
示例8: getConfiguration
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
final IgniteConfiguration cfg = super.getConfiguration(gridName);
if (configuredConsistentId != null)
cfg.setConsistentId(configuredConsistentId);
final DataStorageConfiguration dsCfg = new DataStorageConfiguration();
if (placeStorageInTemp) {
final File tempDir = new File(System.getProperty("java.io.tmpdir"));
pstStoreCustomPath = new File(tempDir, "Store");
pstWalStoreCustomPath = new File(tempDir, "WalStore");
pstWalArchCustomPath = new File(tempDir, "WalArchive");
dsCfg.setStoragePath(pstStoreCustomPath.getAbsolutePath());
dsCfg.setWalPath(pstWalStoreCustomPath.getAbsolutePath());
dsCfg.setWalArchivePath(pstWalArchCustomPath.getAbsolutePath());
}
dsCfg.setDefaultDataRegionConfiguration(new DataRegionConfiguration()
.setMaxSize(32 * 1024 * 1024)
.setPersistenceEnabled(true));
cfg.setDataStorageConfiguration(dsCfg);
if (strLog != null)
cfg.setGridLogger(strLog);
return cfg;
}
示例9: getConfiguration
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String name) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(name);
cfg.setDiscoverySpi(new TcpDiscoverySpi().setIpFinder(IP_FINDER));
cfg.setDataStorageConfiguration(new DataStorageConfiguration()
.setDefaultDataRegionConfiguration(new DataRegionConfiguration()
.setPersistenceEnabled(true)
.setMaxSize(200 * 1024 * 1024))
.setWalMode(WALMode.LOG_ONLY)
.setWalSegmentSize(WAL_SEGMENT_SIZE)
.setWalHistorySize(500)
.setWalCompactionEnabled(true));
CacheConfiguration ccfg = new CacheConfiguration();
ccfg.setName("cache");
ccfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
ccfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
ccfg.setAffinity(new RendezvousAffinityFunction(false, 16));
ccfg.setBackups(0);
cfg.setCacheConfiguration(ccfg);
cfg.setConsistentId(name);
return cfg;
}
示例10: getConfiguration
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
DataStorageConfiguration memCfg = new DataStorageConfiguration()
.setDefaultDataRegionConfiguration(
new DataRegionConfiguration().setMaxSize(100 * 1024 * 1024).setPersistenceEnabled(true))
.setWalMode(WALMode.LOG_ONLY);
cfg.setDataStorageConfiguration(memCfg);
CacheConfiguration ccfg1 = new CacheConfiguration();
ccfg1.setName(CACHE_NAME);
ccfg1.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
ccfg1.setRebalanceMode(CacheRebalanceMode.SYNC);
ccfg1.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
ccfg1.setAffinity(new RendezvousAffinityFunction(false, 32));
ccfg1.setBackups(2);
cfg.setActiveOnStart(false);
// To avoid hostname lookup on start.
cfg.setCheckpointSpi(new NoopCheckpointSpi());
cfg.setCacheConfiguration(ccfg1);
cfg.setConsistentId(gridName);
return cfg;
}
示例11: getConfiguration
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
cfg.setConsistentId(gridName);
DataStorageConfiguration memCfg = new DataStorageConfiguration()
.setDefaultDataRegionConfiguration(new DataRegionConfiguration()
.setMaxSize(10 * 1024 * 1024)
.setPersistenceEnabled(true)
.setMetricsEnabled(true)
.setName("dflt-plc"))
.setDataRegionConfigurations(new DataRegionConfiguration()
.setMaxSize(10 * 1024 * 1024)
.setPersistenceEnabled(false)
.setMetricsEnabled(true)
.setName("no-persistence"))
.setWalMode(WALMode.LOG_ONLY)
.setPageSize(1024)
.setMetricsEnabled(true);
cfg.setDataStorageConfiguration(memCfg);
cfg.setBinaryConfiguration(new BinaryConfiguration().setCompactFooter(false));
((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(IP_FINDER);
cfg.setCacheConfiguration(cacheConfiguration(GROUP1, "cache", PARTITIONED, ATOMIC, 1, null),
cacheConfiguration(null, "cache-np", PARTITIONED, ATOMIC, 1, "no-persistence"));
return cfg;
}
示例12: getConfiguration
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
cfg.setConsistentId(gridName);
((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(ipFinder);
TestRecordingCommunicationSpi commSpi = new TestRecordingCommunicationSpi();
cfg.setCommunicationSpi(commSpi);
cfg.setClientMode(client);
return cfg;
}
示例13: startBackUp
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/**
* @param idx Index.
* @throws Exception If failed.
*/
void startBackUp(int idx) throws Exception {
String node = "node" + idx;
String name = node + backUpSuffix;
IgniteConfiguration cfg = getConfiguration(name);
cfg.setConsistentId(node);
cfg.setAutoActivationEnabled(false);
((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(backUpIpFinder);
Ignite ig = startGrid(name, cfg);
nodes.put(name, ig);
}
示例14: startPrimaryClientNodes
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/**
* @param cnt Count.
* @throws Exception If failed.
*/
void startPrimaryClientNodes(int cnt) throws Exception {
for (int i = 0; i < cnt; i++) {
String node = "node" + i;
String name = node + primarySuffix + clientSuffix;
IgniteConfiguration cfg = getConfiguration(name);
cfg.setConsistentId(node);
cfg.setClientMode(true);
((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(primaryIpFinder);
Ignite ig = startGrid(name, cfg);
nodes.put(name, ig);
}
}
示例15: getConfiguration
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
cfg.setConsistentId("ConsId" + (condId++));
((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(primaryIpFinder);
DataStorageConfiguration pCfg = new DataStorageConfiguration();
pCfg.setStoragePath(testName + "/db");
pCfg.setWalArchivePath(testName + "/db/wal/archive");
pCfg.setWalPath(testName + "/db/wal");
pCfg.setDefaultDataRegionConfiguration(
new DataRegionConfiguration().setMaxSize(200 * 1024 * 1024).setPersistenceEnabled(true));
pCfg.setWalMode(WALMode.LOG_ONLY);
pCfg.setPageSize(1024);
pCfg.setConcurrencyLevel(64);
cfg.setDataStorageConfiguration(pCfg);
return cfg;
}