Skip to content

Commit 71c0ee5

Browse files
MINOR+CORE: Remove Dead Methods ClusterService (#33346) (#33416)
* None of these methods are used anywhere
1 parent 9e2a699 commit 71c0ee5

File tree

2 files changed

+0
-47
lines changed

2 files changed

+0
-47
lines changed

server/src/main/java/org/elasticsearch/cluster/service/ClusterApplierService.java

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -258,13 +258,6 @@ public void addLocalNodeMasterListener(LocalNodeMasterListener listener) {
258258
localNodeMasterListeners.add(listener);
259259
}
260260

261-
/**
262-
* Remove the given listener for on/off local master events
263-
*/
264-
public void removeLocalNodeMasterListener(LocalNodeMasterListener listener) {
265-
localNodeMasterListeners.remove(listener);
266-
}
267-
268261
/**
269262
* Adds a cluster state listener that is expected to be removed during a short period of time.
270263
* If provided, the listener will be notified once a specific time has elapsed.
@@ -352,13 +345,6 @@ private void submitStateUpdateTask(final String source, final ClusterStateTaskCo
352345
}
353346
}
354347

355-
/** asserts that the current thread is the cluster state update thread */
356-
public static boolean assertClusterStateUpdateThread() {
357-
assert Thread.currentThread().getName().contains(ClusterApplierService.CLUSTER_UPDATE_THREAD_NAME) :
358-
"not called from the cluster state update thread";
359-
return true;
360-
}
361-
362348
/** asserts that the current thread is <b>NOT</b> the cluster state update thread */
363349
public static boolean assertNotClusterStateUpdateThread(String reason) {
364350
assert Thread.currentThread().getName().contains(CLUSTER_UPDATE_THREAD_NAME) == false :
@@ -610,13 +596,6 @@ private void add(LocalNodeMasterListener listener) {
610596
listeners.add(listener);
611597
}
612598

613-
private void remove(LocalNodeMasterListener listener) {
614-
listeners.remove(listener);
615-
}
616-
617-
private void clear() {
618-
listeners.clear();
619-
}
620599
}
621600

622601
private static class OnMasterRunnable implements Runnable {

server/src/main/java/org/elasticsearch/cluster/service/ClusterService.java

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,8 @@
2828
import org.elasticsearch.cluster.ClusterStateTaskListener;
2929
import org.elasticsearch.cluster.LocalNodeMasterListener;
3030
import org.elasticsearch.cluster.NodeConnectionsService;
31-
import org.elasticsearch.cluster.TimeoutClusterStateListener;
3231
import org.elasticsearch.cluster.node.DiscoveryNode;
3332
import org.elasticsearch.cluster.routing.OperationRouting;
34-
import org.elasticsearch.common.Nullable;
3533
import org.elasticsearch.common.component.AbstractLifecycleComponent;
3634
import org.elasticsearch.common.settings.ClusterSettings;
3735
import org.elasticsearch.common.settings.Setting;
@@ -177,37 +175,13 @@ public void removeListener(ClusterStateListener listener) {
177175
clusterApplierService.removeListener(listener);
178176
}
179177

180-
/**
181-
* Removes a timeout listener for updated cluster states.
182-
*/
183-
public void removeTimeoutListener(TimeoutClusterStateListener listener) {
184-
clusterApplierService.removeTimeoutListener(listener);
185-
}
186-
187178
/**
188179
* Add a listener for on/off local node master events
189180
*/
190181
public void addLocalNodeMasterListener(LocalNodeMasterListener listener) {
191182
clusterApplierService.addLocalNodeMasterListener(listener);
192183
}
193184

194-
/**
195-
* Remove the given listener for on/off local master events
196-
*/
197-
public void removeLocalNodeMasterListener(LocalNodeMasterListener listener) {
198-
clusterApplierService.removeLocalNodeMasterListener(listener);
199-
}
200-
201-
/**
202-
* Adds a cluster state listener that is expected to be removed during a short period of time.
203-
* If provided, the listener will be notified once a specific time has elapsed.
204-
*
205-
* NOTE: the listener is not removed on timeout. This is the responsibility of the caller.
206-
*/
207-
public void addTimeoutListener(@Nullable final TimeValue timeout, final TimeoutClusterStateListener listener) {
208-
clusterApplierService.addTimeoutListener(timeout, listener);
209-
}
210-
211185
public MasterService getMasterService() {
212186
return masterService;
213187
}

0 commit comments

Comments
 (0)