@Override public String getName() { GlobalConfiguration global = this.cache.getCacheManager().getCacheManagerConfiguration(); TransportConfiguration transport = global.transport(); return transport.transport() != null ? transport.clusterName() : global.globalJmxStatistics().cacheManagerName(); }
assertEquals("ExpirationThread", evictionThreadFactory.threadNamePattern()); assertTrue(gc.transport().transport() instanceof JGroupsTransport); assertEquals("infinispan-cluster", gc.transport().clusterName()); assertEquals("Jalapeno", gc.transport().nodeName());
builder.transport().transport(transport.transport()) .distributedSyncTimeout(transport.distributedSyncTimeout()) .clusterName(transport.clusterName())
@Override public void start() { GlobalConfigurationBuilder builder = new GlobalConfigurationBuilder(); // WFLY-6685 Prevent Infinispan from registering channel mbeans // The JGroups subsystem already does this builder.globalJmxStatistics().read(this.configuration.globalJmxStatistics()).disable(); // ISPN-4755 workaround TransportConfiguration transport = this.configuration.transport(); builder.transport() .clusterName(transport.clusterName()) .distributedSyncTimeout(transport.distributedSyncTimeout()) .initialClusterSize(transport.initialClusterSize()) .initialClusterTimeout(transport.initialClusterTimeout(), TimeUnit.MILLISECONDS) .machineId(transport.machineId()) .nodeName(transport.nodeName()) .rackId(transport.rackId()) .siteId(transport.siteId()) .transport(transport.transport()) .withProperties(transport.properties()) ; this.configuration = builder.build(); super.start(); }
@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()); } }
@Override public String getName() { GlobalConfiguration global = this.cache.getCacheManager().getCacheManagerConfiguration(); TransportConfiguration transport = global.transport(); return transport.transport() != null ? transport.clusterName() : global.globalJmxStatistics().cacheManagerName(); }
public static EmbeddedCacheManager createCacheManager(GlobalConfigurationBuilder globalBuilder, ConfigurationBuilder builder, boolean keepJmxDomain) { if (globalBuilder.transport().build().transport().transport() != null) { throw new IllegalArgumentException("Use TestCacheManagerFactory.createClusteredCacheManager(...) for clustered cache managers"); } return newDefaultCacheManager(true, globalBuilder, builder, keepJmxDomain); }
public static EmbeddedCacheManager createCacheManager(GlobalConfigurationBuilder globalBuilder, ConfigurationBuilder builder) { if (globalBuilder.transport().build().transport().transport() != null) { throw new IllegalArgumentException("Use TestCacheManagerFactory.createClusteredCacheManager(...) for clustered cache managers"); } amendTransport(globalBuilder); return newDefaultCacheManager(true, globalBuilder, builder, false); }
private static void amendTransport(GlobalConfigurationBuilder builder, TransportFlags flags) { String testName = TestResourceTracker.getCurrentTestName(); GlobalConfiguration gc = builder.build(); if (gc.transport().transport() != null) { // Remove any configuration file that might have been set. builder.transport().removeProperty(JGroupsTransport.CONFIGURATION_FILE); builder.transport().addProperty(JGroupsTransport.CONFIGURATION_STRING, getJGroupsConfig(testName, flags)); } }
@Override public void call() { GlobalConfiguration globalCfg = cm.getCacheManagerConfiguration(); assertTrue(globalCfg.transport().transport() instanceof JGroupsTransport); assertEquals("demoCluster", globalCfg.transport().clusterName()); Configuration cfg = cm.getDefaultCacheConfiguration(); assertEquals(CacheMode.REPL_SYNC, cfg.clustering().cacheMode()); }
builder.transport().transport(transport.transport()) .distributedSyncTimeout(transport.distributedSyncTimeout()) .clusterName(transport.clusterName())
Configuration defaultCfg = cm.getCache().getCacheConfiguration(); assert gc.transport().transport() != null; assert defaultCfg.clustering().cacheMode() == CacheMode.REPL_SYNC;
@Override public void start() { GlobalConfigurationBuilder builder = new GlobalConfigurationBuilder(); // WFLY-6685 Prevent Infinispan from registering channel mbeans // The JGroups subsystem already does this builder.globalJmxStatistics().read(this.configuration.globalJmxStatistics()).disable(); // ISPN-4755 workaround TransportConfiguration transport = this.configuration.transport(); builder.transport() .clusterName(transport.clusterName()) .distributedSyncTimeout(transport.distributedSyncTimeout()) .initialClusterSize(transport.initialClusterSize()) .initialClusterTimeout(transport.initialClusterTimeout(), TimeUnit.MILLISECONDS) .machineId(transport.machineId()) .nodeName(transport.nodeName()) .rackId(transport.rackId()) .siteId(transport.siteId()) .transport(transport.transport()) .withProperties(transport.properties()) ; this.configuration = builder.build(); super.start(); }