本文整理汇总了Java中org.apache.ignite.configuration.IgniteConfiguration.setPeerClassLoadingEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java IgniteConfiguration.setPeerClassLoadingEnabled方法的具体用法?Java IgniteConfiguration.setPeerClassLoadingEnabled怎么用?Java IgniteConfiguration.setPeerClassLoadingEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.ignite.configuration.IgniteConfiguration
的用法示例。
在下文中一共展示了IgniteConfiguration.setPeerClassLoadingEnabled方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: helloworldConfiguration
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
public static IgniteConfiguration helloworldConfiguration() {
int cpus = Runtime.getRuntime().availableProcessors();
IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setIgniteInstanceName("hello-world");
cfg.setClientMode(true);
cfg.setPeerClassLoadingEnabled(true);
cfg.setDeploymentMode(DeploymentMode.CONTINUOUS);
cfg.setPeerClassLoadingMissedResourcesCacheSize(200);
cfg.setPublicThreadPoolSize(4 * cpus);
cfg.setSystemThreadPoolSize(2 * cpus);
// log frequency in ms
cfg.setMetricsLogFrequency(30000);
cfg.setGridLogger(igniteLogger());
cfg.setDiscoverySpi(multicastDiscoverySpi());
return cfg;
}
示例2: createIgnite
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
@Bean
@Scope("singleton")
@Qualifier("operationIgniteClient")
@ConditionalOnMissingBean(KafkaOperationRepository.class)
public Ignite createIgnite(ApplicationContext applicationContext) throws IgniteCheckedException {
IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setClientMode(true);
cfg.setPeerClassLoadingEnabled(false);
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();
ipFinder.setAddresses(Arrays.asList(clientAddress.split(",")));
discoSpi.setIpFinder(ipFinder);
cfg.setDiscoverySpi(discoSpi);
cfg.setMetricsLogFrequency(0);
return IgniteSpring.start(cfg,applicationContext);
}
示例3: startIgnite_send
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
public static Ignite startIgnite_send(Map<String, String> group_attrs)
{
IgniteConfiguration cfg = new IgniteConfiguration ();
cfg.setPeerClassLoadingEnabled (true);
// 设置群组
cfg.setUserAttributes(group_attrs);
//配置断点自动重连
TcpDiscoverySpi discoverySpi = new TcpDiscoverySpi();
discoverySpi.setNetworkTimeout (5000);
discoverySpi.setClientReconnectDisabled(true);
cfg.setDiscoverySpi(discoverySpi);
return Ignition.start(cfg);
}
示例4: build
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
@Override
public IgniteConfiguration build() {
IgniteConfiguration config = new IgniteConfiguration();
config.setPeerClassLoadingEnabled(true);
config.setClientMode(false);
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
TcpDiscoveryMulticastIpFinder ipFinder = new TcpDiscoveryMulticastIpFinder();
ArrayList<String> addrs = new ArrayList<>();
addrs.add("127.0.0.1:47500..47509");
ipFinder.setAddresses(addrs);
discoSpi.setIpFinder(ipFinder);
config.setDiscoverySpi(discoSpi);
CacheConfiguration accountCacheCfg = new CacheConfiguration()
.setName("BREED")
.setAtomicityMode(TRANSACTIONAL)
.setIndexedTypes(
String.class, Breed.class
);
config.setCacheConfiguration(accountCacheCfg);
return config;
}
示例5: getDefaultIgniteConfig
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
private IgniteConfiguration getDefaultIgniteConfig(IgniteResource gridResource) {
IgniteConfiguration igniteConfiguration = new IgniteConfiguration();
igniteConfiguration.setGridName(getGridName(gridResource));
igniteConfiguration.setClientMode(getClientMode(gridResource));
igniteConfiguration.setPeerClassLoadingEnabled(getPeerClassLoadingEnabled(gridResource));
TcpDiscoverySpi tcpDiscoverySpi = new TcpDiscoverySpi();
TcpDiscoveryMulticastIpFinder ipFinder = new TcpDiscoveryMulticastIpFinder();
ipFinder.setAddresses(Collections.singletonList(getIpDiscoveryRange(gridResource)));
tcpDiscoverySpi.setIpFinder(ipFinder);
tcpDiscoverySpi.setLocalAddress(getLocalAddress(gridResource));
igniteConfiguration.setDiscoverySpi(tcpDiscoverySpi);
TcpCommunicationSpi communicationSpi = new TcpCommunicationSpi();
communicationSpi.setLocalAddress(props.getLocalAddress());
igniteConfiguration.setCommunicationSpi(communicationSpi);
return igniteConfiguration;
}
示例6: apply
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void apply(IgniteConfiguration cfg) {
cfg.setLocalHost("127.0.0.1");
TcpDiscoverySpi disco = new TcpDiscoverySpi();
disco.setIpFinder(GridCacheAbstractFullApiSelfTest.LOCAL_IP_FINDER);
cfg.setDiscoverySpi(disco);
cfg.setPeerClassLoadingEnabled(false);
DataStorageConfiguration memCfg = new DataStorageConfiguration()
.setDefaultDataRegionConfiguration(
new DataRegionConfiguration().setPersistenceEnabled(true))
.setWalSegmentSize(WAL_SEGMENT_SIZE)
.setWalMode(WALMode.LOG_ONLY)
.setWalHistorySize(100);
cfg.setDataStorageConfiguration(memCfg);
}
示例7: 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;
}
示例8: startDownloadIgnite
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
public static Ignite startDownloadIgnite (Map<String,String> group_attrs,String cachename,String gridName) {
CacheConfiguration cacheCfg = new CacheConfiguration (cachename);
cacheCfg.setCacheMode (CacheMode.PARTITIONED);
IgniteConfiguration cfg = new IgniteConfiguration ();
cfg.setCacheConfiguration (cacheCfg);
cfg.setUserAttributes (group_attrs);
cfg.setPeerClassLoadingEnabled (true);
cfg.setGridName(gridName);
Ignite ignite = Ignition.start (cfg);
// Collection<UUID> node_ids = new ArrayList<> ();
//
// ClusterGroup cg = ignite.cluster ().forRemotes ();
// Collection<ClusterNode> clusterNodes = cg.nodes ();
// for (ClusterNode e : clusterNodes) {
// node_ids.add (e.id ());
// }
// String url = "https://ws1.sinaimg.cn/large/006tNc79ly1fn4o49dqcaj30sg0sgmzo.jpg
// ";
return ignite;
}
示例9: startIgnite_default
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
public static Ignite startIgnite_default(Map<String, String> group_attrs,String group_key,String group_value)
{
IgniteConfiguration cfg = new IgniteConfiguration ();
cfg.setPeerClassLoadingEnabled (true);
cfg.setUserAttributes (group_attrs);
//配置断点自动重连
TcpDiscoverySpi discoverySpi = new TcpDiscoverySpi();
discoverySpi.setNetworkTimeout (5000);
discoverySpi.setClientReconnectDisabled(true);
cfg.setDiscoverySpi(discoverySpi);
Ignite ignite = Ignition.start (cfg);
IgniteMessaging igniteMessaging = ignite.message (ignite.cluster ().forAttribute (group_key,group_value));
//监听的消息是接受方而不是发送方,监听的是接受这个动作而不是发送这个东作,所以其实这里填写local就可以了
igniteMessaging.localListen ("HelloMessageComing", (nodeID, msg) ->
{
try
{
System.out.println (msg);
}
catch (Exception e)
{
e.printStackTrace ();
}
return true;
});
return ignite;
}
示例10: KiteLaunchTool
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
public KiteLaunchTool() {
boolean peerClassLoading = true;
IgniteConfiguration config = new IgniteConfiguration();
config.setPeerClassLoadingEnabled(peerClassLoading);
cluster = Ignition.start(config);
init();
}
示例11: getIgnite
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
private Ignite getIgnite() {
if (ignite == null) {
try {
String cfgUrl = getProperty(IGNITE_CFG_URL);
if (cfgUrl != null && !cfgUrl.isEmpty()) {
ignite = Ignition.start(new URL(cfgUrl));
} else {
IgniteConfiguration conf = new IgniteConfiguration();
conf.setClientMode(Boolean.parseBoolean(getProperty(IGNITE_CLIENT_MODE)));
TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();
ipFinder.setAddresses(getAddresses());
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(ipFinder);
conf.setDiscoverySpi(discoSpi);
conf.setPeerClassLoadingEnabled(
Boolean.parseBoolean(getProperty(IGNITE_PEER_CLASS_LOADING_ENABLED)));
ignite = Ignition.start(conf);
}
initEx = null;
} catch (Exception e) {
initEx = e;
}
}
return ignite;
}
示例12: setUp
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
@Before
public void setUp() {
TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();
ipFinder.setAddresses(Collections.singletonList(HOST));
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(ipFinder);
IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setDiscoverySpi(discoSpi);
cfg.setPeerClassLoadingEnabled(true);
cfg.setMarshaller(new OptimizedMarshaller());
cfg.setGridName("test");
ignite = Ignition.start(cfg);
Properties props = new Properties();
props.setProperty(IgniteSqlInterpreter.IGNITE_JDBC_URL, "jdbc:ignite:cfg://[email protected]");
intp = new IgniteSqlInterpreter(props);
CacheConfiguration<Integer, Person> cacheConf = new CacheConfiguration<>();
cacheConf.setIndexedTypes(Integer.class, Person.class);
cacheConf.setName("person");
IgniteCache<Integer, Person> cache = ignite.createCache(cacheConf);
cache.put(1, new Person("sun", 100));
cache.put(2, new Person("moon", 50));
assertEquals("moon", cache.get(2).getName());
intp.open();
}
示例13: getConfiguration
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
cfg.setPeerClassLoadingEnabled(false);
return cfg;
}
示例14: startSecondary
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/**
* Start a grid with the secondary file system.
*
* @return Secondary file system handle.
* @throws Exception If failed.
*/
@Nullable private IgniteFileSystem startSecondary() throws Exception {
IgniteConfiguration cfg = getConfiguration("grid-secondary", getSecondaryIgfsConfiguration());
cfg.setLocalHost("127.0.0.1");
cfg.setPeerClassLoadingEnabled(false);
Ignite secG = G.start(cfg);
return secG.fileSystem("igfs-secondary");
}
示例15: getConfiguration
import org.apache.ignite.configuration.IgniteConfiguration; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration c = super.getConfiguration(igniteInstanceName);
c.setMarshalLocalJobs(locMarsh);
c.setPeerClassLoadingEnabled(false);
return c;
}