热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

org.infinispan.configuration.global.GlobalConfiguration.isClustered()方法的使用及代码示例

本文整理了Java中org.infinispan.configuration.global.GlobalConfiguration.isClustered()方法的一些

本文整理了Java中org.infinispan.configuration.global.GlobalConfiguration.isClustered()方法的一些代码示例,展示了GlobalConfiguration.isClustered()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GlobalConfiguration.isClustered()方法的具体详情如下:
包路径:org.infinispan.configuration.global.GlobalConfiguration
类名称:GlobalConfiguration
方法名:isClustered

GlobalConfiguration.isClustered介绍

暂无

代码示例

代码示例来源:origin: apache/marmotta

/**
* Carry out any initialization tasks that might be necessary
*/
@Override
public void initialize() {
cacheManager = new DefaultCacheManager(globalConfiguration, defaultConfiguration, true);
if(entryCache == null) {
cacheManager.defineConfiguration(LDCACHE_ENTRY_CACHE, defaultConfiguration);
entryCache = cacheManager.getCache(LDCACHE_ENTRY_CACHE).getAdvancedCache().withFlags(Flag.SKIP_LOCKING, Flag.SKIP_CACHE_LOAD, Flag.SKIP_REMOTE_LOOKUP);
}
log.info("initialised cache manager ({})", globalConfiguration.isClustered() ? "cluster name: "+globalConfiguration.transport().clusterName() : "single host");
}

代码示例来源:origin: com.nimbusds/common

@CacheStarted
public void logCacheManagerStart(final CacheStartedEvent event) {
Logger log = LogManager.getLogger("MAIN");
EmbeddedCacheManager cacheManager = event.getCacheManager();
if (!cacheManager.getCacheManagerConfiguration().isClustered()) {
// Local Infinispan (no cluster)
log.info("[CM8008] Infinispan clustering: not configured");
} else if (clusterInfoLogged.compareAndSet(false, true)) {
// Clustered Infinispan, log cluster conf for the first start cache event only
// to prevent duplicate log lines with same cluster info
log.info("[CM8007] Infinispan status: {}", cacheManager.getStatus());
log.info("[CM8009] Infinispan cluster name: {}", cacheManager.getCacheManagerConfiguration().transport().clusterName());
log.info("[CM8010] Infinispan cluster local node logical address: {}", cacheManager.getAddress());
log.info("[CM8019] Infinispan cluster local node physical address(es): {}", cacheManager.getCacheManagerConfiguration().transport().transport().getPhysicalAddresses());
log.info("[CM8011] Infinispan cluster coordinator logical address: {}", cacheManager.getCoordinator());
log.info("[CM8016] Infinispan cluster local node is coordinator: {}", cacheManager.isCoordinator());
log.info("[CM8012] Infinispan cluster members: {}", cacheManager.getMembers());
log.info("[CM8013] Infinispan cluster distributed sync timeout: {}", cacheManager.getCacheManagerConfiguration().transport().distributedSyncTimeout());
log.info("[CM8014] Infinispan cluster JGroups configuration file: {}", cacheManager.getCacheManagerConfiguration().transport().properties().getProperty("configurationFile"));
}
final Date now = new Date();
log.info("[CM8006] Started Infinispan {} cache {} in {} ms",
cacheManager.getCacheConfiguration(event.getCacheName()).clustering().cacheModeString(),
event.getCacheName(),
now.getTime() - initiationTimestamp.getTime());
}
}

代码示例来源:origin: org.infinispan/infinispan-hibernate-cache-v51

private void defineDataTypeCacheConfigurations(ServiceRegistry serviceRegistry) {
String defaultResource = manager.getCacheManagerConfiguration().isClustered() ? DEF_INFINISPAN_CONFIG_RESOURCE : INFINISPAN_CONFIG_LOCAL_RESOURCE;
ConfigurationBuilderHolder defaultCOnfiguration= DefaultCacheManagerProvider.loadConfiguration(serviceRegistry, defaultResource);
for ( DataType type : DataType.values() ) {

代码示例来源:origin: org.infinispan/infinispan-server-hotrod

/**
* Creates the global transaction internal cache.
*/
private void registerGlobalTxTable(GlobalComponentRegistry globalComponentRegistry) {
InternalCacheRegistry registry = globalComponentRegistry.getComponent(InternalCacheRegistry.class);
ConfigurationBuilder builder = new ConfigurationBuilder();
//we can't lose transactions. distributed cache can lose data is num_owner nodes crash at the same time
builder.clustering().cacheMode(globalComponentRegistry.getGlobalConfiguration().isClustered() ?
CacheMode.REPL_SYNC :
CacheMode.LOCAL);
builder.transaction().transactionMode(TransactionMode.NON_TRANSACTIONAL);
//persistent? should we keep the transaction after restart?
registry.registerInternalCache(GLOBAL_TX_TABLE_CACHE_NAME, builder.build(),
EnumSet.noneOf(InternalCacheRegistry.Flag.class));
}

代码示例来源:origin: org.infinispan/infinispan-embedded-query

private Configuration getInternalCacheConfig() {
ConfigurationBuilder cOnfigurationBuilder= new ConfigurationBuilder();
// allow the registry to work for local caches as well as clustered caches
CacheMode cacheMode = cacheManager.getGlobalComponentRegistry().getGlobalConfiguration().isClustered()
? CacheMode.REPL_SYNC : CacheMode.LOCAL;
configurationBuilder.clustering().cacheMode(cacheMode);
// use invocation batching (cache-only transactions) for high consistency as writes are expected to be rare in this cache
configurationBuilder.transaction().transactionMode(TransactionMode.TRANSACTIONAL)
.transactionManagerLookup(null).invocationBatching().enable();
configurationBuilder.security().authorization().disable();
return configurationBuilder.build();
}

代码示例来源:origin: org.infinispan/infinispan-query

/**
* Create the configuration for the internal cache.
*/
private Configuration getInternalCacheConfig() {
ConfigurationBuilder cOnfigurationBuilder= new ConfigurationBuilder();
// allow the registry to work for local caches as well as clustered caches
CacheMode cacheMode = cacheManager.getGlobalComponentRegistry().getGlobalConfiguration().isClustered()
? CacheMode.REPL_SYNC : CacheMode.LOCAL;
configurationBuilder.clustering().cacheMode(cacheMode);
// use invocation batching (cache-only transactions) for high consistency as writes are expected to be rare in this cache
configurationBuilder.transaction().transactionMode(TransactionMode.TRANSACTIONAL)
.transactionManagerLookup(null).invocationBatching().enable();
configurationBuilder.security().authorization().disable();
return configurationBuilder.build();
}

代码示例来源:origin: org.infinispan/infinispan-embedded-query

log.missingIndexCacheConfiguration(metadataCacheName);
ConfigurationBuilder builder = new ConfigurationBuilder();
if (cacheManager.getCacheManagerConfiguration().isClustered()) {
log.missingIndexCacheConfiguration(dataCacheName);
ConfigurationBuilder builder = new ConfigurationBuilder();
if (cacheManager.getCacheManagerConfiguration().isClustered()) {
log.missingIndexCacheConfiguration(lockingCacheName);
ConfigurationBuilder builder = new ConfigurationBuilder();
if (cacheManager.getCacheManagerConfiguration().isClustered()) {

推荐阅读
author-avatar
手机用户2502940247
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有