@Override public TransportConfiguration get() { ChannelFactory factory = this.factory.get(); ProtocolStackConfiguration stack = factory.getProtocolStackConfiguration(); org.wildfly.clustering.jgroups.spi.TransportConfiguration.Topology topology = stack.getTransport().getTopology(); TransportConfigurationBuilder builder = new GlobalConfigurationBuilder().transport() .clusterName(this.cluster.get()) .distributedSyncTimeout(this.lockTimeout) .transport(new ChannelFactoryTransport(factory)) ; if (topology != null) { builder.siteId(topology.getSite()).rackId(topology.getRack()).machineId(topology.getMachine()); } return builder.create(); }
.distributedSyncTimeout(transport.distributedSyncTimeout()) .clusterName(transport.clusterName()) .machineId(transport.machineId())
@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(); }
@Override protected EmbeddedCacheManager addClusterEnabledCacheManager(ConfigurationBuilder builder, TransportFlags flags) { // The default global RPC timeout is 4 minutes, and if GET_STATUS returns SuspectException, we wait 1/20 of // this timeout before retrying. This is 12 seconds, which is longer than default eventually() timeout. // Therefore it is possible that if a partitioned node installs view with more members, and new view // fails the GET_STATUS, we don't become DEGRADED before the timeout expires. // Update: sometimes JGroups starts installing a non-MERGE view which triggers GET_STATUS which is called // with ClusterTopologyManagerImpl.clusterManagerLock locked. The request will be dropped/delayed, and // we have to wait until timeout to release the lock. The MERGE view won't be handled until this returns // due to the lock. Therefore setting to 5 seconds. GlobalConfigurationBuilder gcb = GlobalConfigurationBuilder.defaultClusteredBuilder(); // gcb.transport().distributedSyncTimeout(1, TimeUnit.MINUTES); gcb.transport().distributedSyncTimeout(5, TimeUnit.SECONDS); return addClusterEnabledCacheManager(gcb, builder, flags); }
.machineId("instance-" + config.getDatacenterId()) .addProperty("configurationXml", jgroupsXml) .distributedSyncTimeout(config.getClusterTimeout()) .globalJmxStatistics() .jmxDomain("org.apache.marmotta.kiwi")
builder.transport().distributedSyncTimeout(Long.parseLong(value)); break;
.machineId("instance-" + config.getDatacenterId()) .addProperty("configurationXml", jgroupsXml) .distributedSyncTimeout(config.getClusterTimeout()) .globalJmxStatistics() .jmxDomain("org.apache.marmotta.kiwi")
@Override public TransportConfiguration get() { ChannelFactory factory = this.factory.get(); ProtocolStackConfiguration stack = factory.getProtocolStackConfiguration(); org.wildfly.clustering.jgroups.spi.TransportConfiguration.Topology topology = stack.getTransport().getTopology(); TransportConfigurationBuilder builder = new GlobalConfigurationBuilder().transport() .clusterName(this.cluster.get()) .distributedSyncTimeout(this.lockTimeout) .transport(new ChannelFactoryTransport(factory)) ; if (topology != null) { builder.siteId(topology.getSite()).rackId(topology.getRack()).machineId(topology.getMachine()); } return builder.create(); }
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder c = new ConfigurationBuilder(); c .locking() .isolationLevel(IsolationLevel.READ_COMMITTED) .lockAcquisitionTimeout(60000) .useLockStriping(false) .clustering() .cacheMode(CacheMode.DIST_SYNC) .remoteTimeout(30000) .l1().disable() .transaction() .lockingMode(LockingMode.PESSIMISTIC) .transactionManagerLookup(new EmbeddedTransactionManagerLookup()); GlobalConfigurationBuilder gc = GlobalConfigurationBuilder.defaultClusteredBuilder(); gc.transport().distributedSyncTimeout(60000); List<EmbeddedCacheManager> cacheManagers = new LinkedList<>(); for (int i = 0; i < NUM_NODES; i++) cacheManagers.add(createClusteredCacheManager(gc, c)); registerCacheManager(cacheManagers.toArray(new EmbeddedCacheManager[NUM_NODES])); }
.distributedSyncTimeout(transport.distributedSyncTimeout()) .clusterName(transport.clusterName()) .machineId(transport.machineId())
.clusterName(this.name) .transport(new ChannelTransport(transport.getChannel(), transport.getChannelFactory())) .distributedSyncTimeout(transport.getLockTimeout())
private EmbeddedCacheManager createCacheManager(String name1, JChannel ch1) { GlobalConfigurationBuilder gcb1 = new GlobalConfigurationBuilder(); gcb1.transport().nodeName(ch1.getName()).distributedSyncTimeout(10, SECONDS); CustomChannelLookup.registerChannel(gcb1, ch1, name1, false); ConfigurationBuilder replCfg = new ConfigurationBuilder(); replCfg.clustering().cacheMode(CacheMode.REPL_SYNC); replCfg.clustering().stateTransfer().timeout(10, SECONDS); EmbeddedCacheManager cm1 = new DefaultCacheManager(gcb1.build(), replCfg.build(), false); registerCacheManager(cm1); cm1.defineConfiguration(CACHE_NAME, replCfg.build()); return cm1; }
@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(); }
GlobalConfigurationBuilder gcb = new GlobalConfigurationBuilder(); gcb.transport().nodeName(channel.getName()); gcb.transport().distributedSyncTimeout(30, TimeUnit.SECONDS);