@@ -203,13 +203,8 @@ static class ScrollFreeContextRequest extends TransportRequest {
203203 this .id = id ;
204204 }
205205
206- public long id () {
207- return this .id ;
208- }
209-
210- @ Override
211- public void readFrom (StreamInput in ) throws IOException {
212- super .readFrom (in );
206+ ScrollFreeContextRequest (StreamInput in ) throws IOException {
207+ super (in );
213208 id = in .readLong ();
214209 }
215210
@@ -218,6 +213,15 @@ public void writeTo(StreamOutput out) throws IOException {
218213 super .writeTo (out );
219214 out .writeLong (id );
220215 }
216+
217+ public long id () {
218+ return this .id ;
219+ }
220+
221+ @ Override
222+ public void readFrom (StreamInput in ) throws IOException {
223+ throw new UnsupportedOperationException ("usage of Streamable is to be replaced by Writeable" );
224+ }
221225 }
222226
223227 static class SearchFreeContextRequest extends ScrollFreeContextRequest implements IndicesRequest {
@@ -231,6 +235,17 @@ static class SearchFreeContextRequest extends ScrollFreeContextRequest implement
231235 this .originalIndices = originalIndices ;
232236 }
233237
238+ SearchFreeContextRequest (StreamInput in ) throws IOException {
239+ super (in );
240+ originalIndices = OriginalIndices .readOriginalIndices (in );
241+ }
242+
243+ @ Override
244+ public void writeTo (StreamOutput out ) throws IOException {
245+ super .writeTo (out );
246+ OriginalIndices .writeOriginalIndices (originalIndices , out );
247+ }
248+
234249 @ Override
235250 public String [] indices () {
236251 if (originalIndices == null ) {
@@ -249,14 +264,7 @@ public IndicesOptions indicesOptions() {
249264
250265 @ Override
251266 public void readFrom (StreamInput in ) throws IOException {
252- super .readFrom (in );
253- originalIndices = OriginalIndices .readOriginalIndices (in );
254- }
255-
256- @ Override
257- public void writeTo (StreamOutput out ) throws IOException {
258- super .writeTo (out );
259- OriginalIndices .writeOriginalIndices (originalIndices , out );
267+ throw new UnsupportedOperationException ("usage of Streamable is to be replaced by Writeable" );
260268 }
261269 }
262270
@@ -289,7 +297,7 @@ public void writeTo(StreamOutput out) throws IOException {
289297 }
290298
291299 public static void registerRequestHandler (TransportService transportService , SearchService searchService ) {
292- transportService .registerRequestHandler (FREE_CONTEXT_SCROLL_ACTION_NAME , ScrollFreeContextRequest :: new , ThreadPool .Names .SAME ,
300+ transportService .registerRequestHandler (FREE_CONTEXT_SCROLL_ACTION_NAME , ThreadPool .Names .SAME , ScrollFreeContextRequest :: new ,
293301 new TaskAwareTransportRequestHandler <ScrollFreeContextRequest >() {
294302 @ Override
295303 public void messageReceived (ScrollFreeContextRequest request , TransportChannel channel , Task task ) throws Exception {
@@ -298,7 +306,7 @@ public void messageReceived(ScrollFreeContextRequest request, TransportChannel c
298306 }
299307 });
300308 TransportActionProxy .registerProxyAction (transportService , FREE_CONTEXT_SCROLL_ACTION_NAME , SearchFreeContextResponse ::new );
301- transportService .registerRequestHandler (FREE_CONTEXT_ACTION_NAME , SearchFreeContextRequest :: new , ThreadPool .Names .SAME ,
309+ transportService .registerRequestHandler (FREE_CONTEXT_ACTION_NAME , ThreadPool .Names .SAME , SearchFreeContextRequest :: new ,
302310 new TaskAwareTransportRequestHandler <SearchFreeContextRequest >() {
303311 @ Override
304312 public void messageReceived (SearchFreeContextRequest request , TransportChannel channel , Task task ) throws Exception {
@@ -318,7 +326,7 @@ public void messageReceived(TransportRequest.Empty request, TransportChannel cha
318326 TransportActionProxy .registerProxyAction (transportService , CLEAR_SCROLL_CONTEXTS_ACTION_NAME ,
319327 () -> TransportResponse .Empty .INSTANCE );
320328
321- transportService .registerRequestHandler (DFS_ACTION_NAME , ShardSearchTransportRequest :: new , ThreadPool .Names .SAME ,
329+ transportService .registerRequestHandler (DFS_ACTION_NAME , ThreadPool .Names .SAME , ShardSearchTransportRequest :: new ,
322330 new TaskAwareTransportRequestHandler <ShardSearchTransportRequest >() {
323331 @ Override
324332 public void messageReceived (ShardSearchTransportRequest request , TransportChannel channel , Task task ) throws Exception {
@@ -346,7 +354,7 @@ public void onFailure(Exception e) {
346354 });
347355 TransportActionProxy .registerProxyAction (transportService , DFS_ACTION_NAME , DfsSearchResult ::new );
348356
349- transportService .registerRequestHandler (QUERY_ACTION_NAME , ShardSearchTransportRequest :: new , ThreadPool .Names .SAME ,
357+ transportService .registerRequestHandler (QUERY_ACTION_NAME , ThreadPool .Names .SAME , ShardSearchTransportRequest :: new ,
350358 new TaskAwareTransportRequestHandler <ShardSearchTransportRequest >() {
351359 @ Override
352360 public void messageReceived (ShardSearchTransportRequest request , TransportChannel channel , Task task ) throws Exception {
@@ -373,7 +381,7 @@ public void onFailure(Exception e) {
373381 });
374382 TransportActionProxy .registerProxyAction (transportService , QUERY_ACTION_NAME , QuerySearchResult ::new );
375383
376- transportService .registerRequestHandler (QUERY_ID_ACTION_NAME , QuerySearchRequest :: new , ThreadPool .Names .SEARCH ,
384+ transportService .registerRequestHandler (QUERY_ID_ACTION_NAME , ThreadPool .Names .SEARCH , QuerySearchRequest :: new ,
377385 new TaskAwareTransportRequestHandler <QuerySearchRequest >() {
378386 @ Override
379387 public void messageReceived (QuerySearchRequest request , TransportChannel channel , Task task ) throws Exception {
@@ -383,7 +391,7 @@ public void messageReceived(QuerySearchRequest request, TransportChannel channel
383391 });
384392 TransportActionProxy .registerProxyAction (transportService , QUERY_ID_ACTION_NAME , QuerySearchResult ::new );
385393
386- transportService .registerRequestHandler (QUERY_SCROLL_ACTION_NAME , InternalScrollSearchRequest :: new , ThreadPool .Names .SEARCH ,
394+ transportService .registerRequestHandler (QUERY_SCROLL_ACTION_NAME , ThreadPool .Names .SEARCH , InternalScrollSearchRequest :: new ,
387395 new TaskAwareTransportRequestHandler <InternalScrollSearchRequest >() {
388396 @ Override
389397 public void messageReceived (InternalScrollSearchRequest request , TransportChannel channel , Task task ) throws Exception {
@@ -393,7 +401,7 @@ public void messageReceived(InternalScrollSearchRequest request, TransportChanne
393401 });
394402 TransportActionProxy .registerProxyAction (transportService , QUERY_SCROLL_ACTION_NAME , ScrollQuerySearchResult ::new );
395403
396- transportService .registerRequestHandler (QUERY_FETCH_SCROLL_ACTION_NAME , InternalScrollSearchRequest :: new , ThreadPool .Names .SEARCH ,
404+ transportService .registerRequestHandler (QUERY_FETCH_SCROLL_ACTION_NAME , ThreadPool .Names .SEARCH , InternalScrollSearchRequest :: new ,
397405 new TaskAwareTransportRequestHandler <InternalScrollSearchRequest >() {
398406 @ Override
399407 public void messageReceived (InternalScrollSearchRequest request , TransportChannel channel , Task task ) throws Exception {
@@ -403,7 +411,7 @@ public void messageReceived(InternalScrollSearchRequest request, TransportChanne
403411 });
404412 TransportActionProxy .registerProxyAction (transportService , QUERY_FETCH_SCROLL_ACTION_NAME , ScrollQueryFetchSearchResult ::new );
405413
406- transportService .registerRequestHandler (FETCH_ID_SCROLL_ACTION_NAME , ShardFetchRequest :: new , ThreadPool .Names .SEARCH ,
414+ transportService .registerRequestHandler (FETCH_ID_SCROLL_ACTION_NAME , ThreadPool .Names .SEARCH , ShardFetchRequest :: new ,
407415 new TaskAwareTransportRequestHandler <ShardFetchRequest >() {
408416 @ Override
409417 public void messageReceived (ShardFetchRequest request , TransportChannel channel , Task task ) throws Exception {
@@ -413,7 +421,7 @@ public void messageReceived(ShardFetchRequest request, TransportChannel channel,
413421 });
414422 TransportActionProxy .registerProxyAction (transportService , FETCH_ID_SCROLL_ACTION_NAME , FetchSearchResult ::new );
415423
416- transportService .registerRequestHandler (FETCH_ID_ACTION_NAME , ShardFetchSearchRequest :: new , ThreadPool .Names .SEARCH ,
424+ transportService .registerRequestHandler (FETCH_ID_ACTION_NAME , ThreadPool .Names .SEARCH , ShardFetchSearchRequest :: new ,
417425 new TaskAwareTransportRequestHandler <ShardFetchSearchRequest >() {
418426 @ Override
419427 public void messageReceived (ShardFetchSearchRequest request , TransportChannel channel , Task task ) throws Exception {
@@ -424,7 +432,7 @@ public void messageReceived(ShardFetchSearchRequest request, TransportChannel ch
424432 TransportActionProxy .registerProxyAction (transportService , FETCH_ID_ACTION_NAME , FetchSearchResult ::new );
425433
426434 // this is super cheap and should not hit thread-pool rejections
427- transportService .registerRequestHandler (QUERY_CAN_MATCH_NAME , ShardSearchTransportRequest :: new , ThreadPool .Names .SAME ,
435+ transportService .registerRequestHandler (QUERY_CAN_MATCH_NAME , ThreadPool .Names .SAME , ShardSearchTransportRequest :: new ,
428436 new TaskAwareTransportRequestHandler <ShardSearchTransportRequest >() {
429437 @ Override
430438 public void messageReceived (ShardSearchTransportRequest request , TransportChannel channel , Task task ) throws Exception {
0 commit comments