|
39 | 39 | import org.elasticsearch.core.RefCounted;
|
40 | 40 | import org.elasticsearch.core.Strings;
|
41 | 41 | import org.elasticsearch.core.TimeValue;
|
42 |
| -import org.elasticsearch.core.UpdateForV9; |
43 | 42 | import org.elasticsearch.indices.breaker.NoneCircuitBreakerService;
|
44 | 43 | import org.elasticsearch.node.Node;
|
45 | 44 | import org.elasticsearch.plugins.Plugin;
|
|
50 | 49 | import org.elasticsearch.test.ESTestCase;
|
51 | 50 | import org.elasticsearch.test.tasks.MockTaskManager;
|
52 | 51 | import org.elasticsearch.threadpool.ThreadPool;
|
53 |
| -import org.elasticsearch.transport.BytesTransportRequest; |
54 | 52 | import org.elasticsearch.transport.ClusterConnectionManager;
|
55 | 53 | import org.elasticsearch.transport.ConnectTransportException;
|
56 | 54 | import org.elasticsearch.transport.ConnectionProfile;
|
@@ -586,13 +584,8 @@ public void sendRequest(
|
586 | 584 | // poor mans request cloning...
|
587 | 585 | BytesStreamOutput bStream = new BytesStreamOutput();
|
588 | 586 | request.writeTo(bStream);
|
589 |
| - final TransportRequest clonedRequest; |
590 |
| - if (request instanceof BytesTransportRequest) { |
591 |
| - clonedRequest = copyRawBytesForBwC(bStream); |
592 |
| - } else { |
593 |
| - RequestHandlerRegistry<?> reg = MockTransportService.this.getRequestHandler(action); |
594 |
| - clonedRequest = reg.newRequest(bStream.bytes().streamInput()); |
595 |
| - } |
| 587 | + RequestHandlerRegistry<?> reg = MockTransportService.this.getRequestHandler(action); |
| 588 | + final TransportRequest clonedRequest = reg.newRequest(bStream.bytes().streamInput()); |
596 | 589 | assert clonedRequest.getClass().equals(MasterNodeRequestHelper.unwrapTermOverride(request).getClass())
|
597 | 590 | : clonedRequest + " vs " + request;
|
598 | 591 |
|
@@ -640,15 +633,6 @@ protected void doRun() throws IOException {
|
640 | 633 | }
|
641 | 634 | }
|
642 | 635 |
|
643 |
| - // Some request handlers read back a BytesTransportRequest |
644 |
| - // into a different class that cannot be re-serialized (i.e. JOIN_VALIDATE_ACTION_NAME), |
645 |
| - // in those cases we just copy the raw bytes back to a BytesTransportRequest. |
646 |
| - // This is only needed for the BwC for JOIN_VALIDATE_ACTION_NAME and can be removed in the next major |
647 |
| - @UpdateForV9(owner = UpdateForV9.Owner.DISTRIBUTED_COORDINATION) |
648 |
| - private static TransportRequest copyRawBytesForBwC(BytesStreamOutput bStream) throws IOException { |
649 |
| - return new BytesTransportRequest(bStream.bytes().streamInput()); |
650 |
| - } |
651 |
| - |
652 | 636 | @Override
|
653 | 637 | public void clearCallback() {
|
654 | 638 | synchronized (this) {
|
|
0 commit comments