MINOR+CORE: Remove Dead Methods ClusterService (#33346)

* None of these methods are used anywhere
This commit is contained in:
Armin Braun 2018-09-05 12:08:28 +02:00 committed by GitHub
parent d7965ba681
commit 4156cc3fae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 47 deletions

View File

@ -255,13 +255,6 @@ public class ClusterApplierService extends AbstractLifecycleComponent implements
localNodeMasterListeners.add(listener);
}
/**
* Remove the given listener for on/off local master events
*/
public void removeLocalNodeMasterListener(LocalNodeMasterListener listener) {
localNodeMasterListeners.remove(listener);
}
/**
* Adds a cluster state listener that is expected to be removed during a short period of time.
* If provided, the listener will be notified once a specific time has elapsed.
@ -349,13 +342,6 @@ public class ClusterApplierService extends AbstractLifecycleComponent implements
}
}
/** asserts that the current thread is the cluster state update thread */
public static boolean assertClusterStateUpdateThread() {
assert Thread.currentThread().getName().contains(ClusterApplierService.CLUSTER_UPDATE_THREAD_NAME) :
"not called from the cluster state update thread";
return true;
}
/** asserts that the current thread is <b>NOT</b> the cluster state update thread */
public static boolean assertNotClusterStateUpdateThread(String reason) {
assert Thread.currentThread().getName().contains(CLUSTER_UPDATE_THREAD_NAME) == false :
@ -607,13 +593,6 @@ public class ClusterApplierService extends AbstractLifecycleComponent implements
listeners.add(listener);
}
private void remove(LocalNodeMasterListener listener) {
listeners.remove(listener);
}
private void clear() {
listeners.clear();
}
}
private static class OnMasterRunnable implements Runnable {

View File

@ -28,10 +28,8 @@ import org.elasticsearch.cluster.ClusterStateTaskExecutor;
import org.elasticsearch.cluster.ClusterStateTaskListener;
import org.elasticsearch.cluster.LocalNodeMasterListener;
import org.elasticsearch.cluster.NodeConnectionsService;
import org.elasticsearch.cluster.TimeoutClusterStateListener;
import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.cluster.routing.OperationRouting;
import org.elasticsearch.common.Nullable;
import org.elasticsearch.common.component.AbstractLifecycleComponent;
import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.Setting;
@ -167,13 +165,6 @@ public class ClusterService extends AbstractLifecycleComponent {
clusterApplierService.removeListener(listener);
}
/**
* Removes a timeout listener for updated cluster states.
*/
public void removeTimeoutListener(TimeoutClusterStateListener listener) {
clusterApplierService.removeTimeoutListener(listener);
}
/**
* Add a listener for on/off local node master events
*/
@ -181,23 +172,6 @@ public class ClusterService extends AbstractLifecycleComponent {
clusterApplierService.addLocalNodeMasterListener(listener);
}
/**
* Remove the given listener for on/off local master events
*/
public void removeLocalNodeMasterListener(LocalNodeMasterListener listener) {
clusterApplierService.removeLocalNodeMasterListener(listener);
}
/**
* Adds a cluster state listener that is expected to be removed during a short period of time.
* If provided, the listener will be notified once a specific time has elapsed.
*
* NOTE: the listener is not removed on timeout. This is the responsibility of the caller.
*/
public void addTimeoutListener(@Nullable final TimeValue timeout, final TimeoutClusterStateListener listener) {
clusterApplierService.addTimeoutListener(timeout, listener);
}
public MasterService getMasterService() {
return masterService;
}