Browse Source

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

* None of these methods are used anywhere
Armin Braun 7 years ago
parent
commit
4156cc3fae

+ 0 - 21
server/src/main/java/org/elasticsearch/cluster/service/ClusterApplierService.java

@@ -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 {

+ 0 - 26
server/src/main/java/org/elasticsearch/cluster/service/ClusterService.java

@@ -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;
     }