//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: public Void call() throws Exception public override Void Call() { Runner = Thread.CurrentThread; StartLatch.await(); Delegate.apply(); return(null); }
/// <summary> /// The cluster binding process tries to establish a common cluster ID. If there is no common cluster ID /// then a single instance will eventually create one and publish it through the underlying topology service. /// </summary> /// <exception cref="IOException"> If there is an issue with I/O. </exception> /// <exception cref="InterruptedException"> If the process gets interrupted. </exception> /// <exception cref="TimeoutException"> If the process times out. </exception> //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: public BoundState bindToCluster() throws Throwable public virtual BoundState BindToCluster() { DatabaseName newName = new DatabaseName(_dbName); _dbNameStorage.writeOrVerify(newName, existing => { if (!newName.Equals(existing)) { throw new System.InvalidOperationException(format("Your configured database name has changed. Found %s but expected %s in %s.", _dbName, existing.name(), CausalClusteringSettings.database.name())); } }); long endTime = _clock.millis() + _timeout.toMillis(); bool shouldRetryPublish = false; if (_clusterIdStorage.exists()) { _clusterId = _clusterIdStorage.readState(); do { shouldRetryPublish = PublishClusterId(_clusterId); } while (shouldRetryPublish && _clock.millis() < endTime); _monitor.boundToCluster(_clusterId); return(new BoundState(_clusterId)); } CoreSnapshot snapshot = null; CoreTopology topology; do { topology = _topologyService.localCoreServers(); if (topology.ClusterId() != null) { _clusterId = topology.ClusterId(); _monitor.boundToCluster(_clusterId); } else if (HostShouldBootstrapCluster(topology)) { _clusterId = new ClusterId(System.Guid.randomUUID()); snapshot = _coreBootstrapper.bootstrap(topology.Members().Keys); _monitor.bootstrapped(snapshot, _clusterId); shouldRetryPublish = PublishClusterId(_clusterId); } _retryWaiter.apply(); } while ((_clusterId == null || shouldRetryPublish) && _clock.millis() < endTime); if (_clusterId == null || shouldRetryPublish) { throw new TimeoutException(format("Failed to join a cluster with members %s. Another member should have published " + "a clusterId but none was detected. Please restart the cluster.", topology)); } _clusterIdStorage.writeState(_clusterId); return(new BoundState(_clusterId, snapshot)); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: public void shutdown() throws Exception public override void shutdown() { _action.apply(); }