|
23 | 23 | import org.elasticsearch.action.ActionRequest;
|
24 | 24 | import org.elasticsearch.action.ActionResponse;
|
25 | 25 | import org.elasticsearch.action.ActionType;
|
26 |
| -import org.elasticsearch.action.search.SearchAction; |
27 |
| -import org.elasticsearch.action.search.SearchRequest; |
28 |
| -import org.elasticsearch.action.search.SearchResponse; |
29 |
| -import org.elasticsearch.action.search.SearchTask; |
30 |
| -import org.elasticsearch.action.search.SearchProgressActionListener; |
31 |
| -import org.elasticsearch.action.search.TransportSearchAction; |
32 | 26 | import org.elasticsearch.action.support.TransportAction;
|
33 | 27 | import org.elasticsearch.client.Client;
|
34 | 28 | import org.elasticsearch.client.support.AbstractClient;
|
@@ -108,38 +102,6 @@ > Task executeLocally(ActionType<Response> action, Request request, TaskListener
|
108 | 102 | listener::onResponse, listener::onFailure);
|
109 | 103 | }
|
110 | 104 |
|
111 |
| - /** |
112 |
| - * Execute a {@link SearchRequest} locally and track the progress of the request through |
113 |
| - * a {@link SearchProgressActionListener}. |
114 |
| - */ |
115 |
| - public SearchTask executeSearchLocally(SearchRequest request, SearchProgressActionListener listener) { |
116 |
| - // we cannot track the progress if remote cluster requests are splitted. |
117 |
| - request.setCcsMinimizeRoundtrips(false); |
118 |
| - TransportSearchAction action = (TransportSearchAction) actions.get(SearchAction.INSTANCE); |
119 |
| - SearchTask task = (SearchTask) taskManager.register("transport", action.actionName, request); |
120 |
| - task.setProgressListener(listener); |
121 |
| - action.execute(task, request, new ActionListener<>() { |
122 |
| - @Override |
123 |
| - public void onResponse(SearchResponse response) { |
124 |
| - try { |
125 |
| - taskManager.unregister(task); |
126 |
| - } finally { |
127 |
| - listener.onResponse(response); |
128 |
| - } |
129 |
| - } |
130 |
| - |
131 |
| - @Override |
132 |
| - public void onFailure(Exception e) { |
133 |
| - try { |
134 |
| - taskManager.unregister(task); |
135 |
| - } finally { |
136 |
| - listener.onFailure(e); |
137 |
| - } |
138 |
| - } |
139 |
| - }); |
140 |
| - return task; |
141 |
| - } |
142 |
| - |
143 | 105 | /**
|
144 | 106 | * The id of the local {@link DiscoveryNode}. Useful for generating task ids from tasks returned by
|
145 | 107 | * {@link #executeLocally(ActionType, ActionRequest, TaskListener)}.
|
|
0 commit comments