Skip to content

Commit

Permalink
MINOR+CORE: Remove Dead Methods ClusterService (elastic#33346)
Browse files Browse the repository at this point in the history
* None of these methods are used anywhere
  • Loading branch information
original-brownbear authored Sep 5, 2018
1 parent d7965ba commit 4156cc3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,6 @@ public void addLocalNodeMasterListener(LocalNodeMasterListener listener) {
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.
Expand Down Expand Up @@ -349,13 +342,6 @@ private void submitStateUpdateTask(final String source, final ClusterStateTaskCo
}
}

/** 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 :
Expand Down Expand Up @@ -607,13 +593,6 @@ private void add(LocalNodeMasterListener listener) {
listeners.add(listener);
}

private void remove(LocalNodeMasterListener listener) {
listeners.remove(listener);
}

private void clear() {
listeners.clear();
}
}

private static class OnMasterRunnable implements Runnable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@
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;
Expand Down Expand Up @@ -167,37 +165,13 @@ public void removeListener(ClusterStateListener listener) {
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
*/
public void addLocalNodeMasterListener(LocalNodeMasterListener listener) {
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;
}
Expand Down

0 comments on commit 4156cc3

Please sign in to comment.