1
0
Эх сурвалжийг харах

Convert AcknowledgedRequest to Writeable.Reader (#44412)

This commit adds constructors to AcknolwedgedRequest subclasses to
implement Writeable.Reader, and ensures all future subclasses implement
the same.

relates #34389
Ryan Ernst 6 жил өмнө
parent
commit
c639cfece5
100 өөрчлөгдсөн 420 нэмэгдсэн , 470 устгасан
  1. 5 6
      server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/delete/DeleteRepositoryRequest.java
  2. 1 1
      server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/delete/TransportDeleteRepositoryAction.java
  3. 8 9
      server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/put/PutRepositoryRequest.java
  4. 1 1
      server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/put/TransportPutRepositoryAction.java
  5. 1 1
      server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/verify/TransportVerifyRepositoryAction.java
  6. 5 6
      server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/verify/VerifyRepositoryRequest.java
  7. 8 9
      server/src/main/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteRequest.java
  8. 1 1
      server/src/main/java/org/elasticsearch/action/admin/cluster/reroute/TransportClusterRerouteAction.java
  9. 6 7
      server/src/main/java/org/elasticsearch/action/admin/cluster/settings/ClusterUpdateSettingsRequest.java
  10. 1 1
      server/src/main/java/org/elasticsearch/action/admin/cluster/settings/TransportClusterUpdateSettingsAction.java
  11. 5 6
      server/src/main/java/org/elasticsearch/action/admin/cluster/storedscripts/DeleteStoredScriptRequest.java
  12. 9 10
      server/src/main/java/org/elasticsearch/action/admin/cluster/storedscripts/PutStoredScriptRequest.java
  13. 1 1
      server/src/main/java/org/elasticsearch/action/admin/cluster/storedscripts/TransportDeleteStoredScriptAction.java
  14. 1 1
      server/src/main/java/org/elasticsearch/action/admin/cluster/storedscripts/TransportPutStoredScriptAction.java
  15. 10 11
      server/src/main/java/org/elasticsearch/action/admin/indices/alias/IndicesAliasesRequest.java
  16. 2 2
      server/src/main/java/org/elasticsearch/action/admin/indices/alias/TransportIndicesAliasesAction.java
  17. 11 12
      server/src/main/java/org/elasticsearch/action/admin/indices/close/CloseIndexRequest.java
  18. 2 2
      server/src/main/java/org/elasticsearch/action/admin/indices/close/TransportCloseIndexAction.java
  19. 18 20
      server/src/main/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequest.java
  20. 2 2
      server/src/main/java/org/elasticsearch/action/admin/indices/create/TransportCreateIndexAction.java
  21. 6 7
      server/src/main/java/org/elasticsearch/action/admin/indices/delete/DeleteIndexRequest.java
  22. 2 2
      server/src/main/java/org/elasticsearch/action/admin/indices/delete/TransportDeleteIndexAction.java
  23. 10 11
      server/src/main/java/org/elasticsearch/action/admin/indices/mapping/put/PutMappingRequest.java
  24. 2 2
      server/src/main/java/org/elasticsearch/action/admin/indices/mapping/put/TransportPutMappingAction.java
  25. 7 8
      server/src/main/java/org/elasticsearch/action/admin/indices/open/OpenIndexRequest.java
  26. 2 2
      server/src/main/java/org/elasticsearch/action/admin/indices/open/TransportOpenIndexAction.java
  27. 13 15
      server/src/main/java/org/elasticsearch/action/admin/indices/rollover/RolloverRequest.java
  28. 2 2
      server/src/main/java/org/elasticsearch/action/admin/indices/rollover/TransportRolloverAction.java
  29. 2 2
      server/src/main/java/org/elasticsearch/action/admin/indices/settings/put/TransportUpdateSettingsAction.java
  30. 8 9
      server/src/main/java/org/elasticsearch/action/admin/indices/settings/put/UpdateSettingsRequest.java
  31. 8 10
      server/src/main/java/org/elasticsearch/action/admin/indices/shrink/ResizeRequest.java
  32. 1 2
      server/src/main/java/org/elasticsearch/action/admin/indices/shrink/TransportResizeAction.java
  33. 1 1
      server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/post/TransportUpgradeSettingsAction.java
  34. 12 14
      server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/post/UpgradeSettingsRequest.java
  35. 5 6
      server/src/main/java/org/elasticsearch/action/ingest/DeletePipelineRequest.java
  36. 1 1
      server/src/main/java/org/elasticsearch/action/ingest/DeletePipelineTransportAction.java
  37. 7 8
      server/src/main/java/org/elasticsearch/action/ingest/PutPipelineRequest.java
  38. 1 1
      server/src/main/java/org/elasticsearch/action/ingest/PutPipelineTransportAction.java
  39. 2 3
      server/src/main/java/org/elasticsearch/action/support/master/AcknowledgedRequest.java
  40. 1 3
      server/src/test/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteRequestTests.java
  41. 1 2
      server/src/test/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteTests.java
  42. 1 2
      server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/PutStoredScriptRequestTests.java
  43. 4 4
      server/src/test/java/org/elasticsearch/action/admin/indices/close/CloseIndexRequestTests.java
  44. 1 2
      server/src/test/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequestTests.java
  45. 1 2
      server/src/test/java/org/elasticsearch/action/admin/indices/rollover/RolloverRequestTests.java
  46. 5 4
      server/src/test/java/org/elasticsearch/action/admin/indices/settings/put/UpdateSettingsRequestSerializationTests.java
  47. 1 1
      server/src/test/java/org/elasticsearch/action/admin/indices/settings/put/UpdateSettingsRequestTests.java
  48. 1 2
      server/src/test/java/org/elasticsearch/action/ingest/PutPipelineRequestTests.java
  49. 7 6
      x-pack/plugin/core/src/main/java/org/elasticsearch/license/PostStartBasicRequest.java
  50. 6 7
      x-pack/plugin/core/src/main/java/org/elasticsearch/license/PutLicenseRequest.java
  51. 1 1
      x-pack/plugin/core/src/main/java/org/elasticsearch/license/TransportDeleteLicenseAction.java
  52. 1 1
      x-pack/plugin/core/src/main/java/org/elasticsearch/license/TransportPostStartBasicAction.java
  53. 2 2
      x-pack/plugin/core/src/main/java/org/elasticsearch/license/TransportPutLicenseAction.java
  54. 9 0
      x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/license/DeleteLicenseRequest.java
  55. 8 0
      x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/license/PutLicenseRequest.java
  56. 12 11
      x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/TransportFreezeIndexAction.java
  57. 8 0
      x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/indexlifecycle/StartILMRequest.java
  58. 8 0
      x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/indexlifecycle/StopILMRequest.java
  59. 5 6
      x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/indexlifecycle/action/DeleteLifecycleAction.java
  60. 5 6
      x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/indexlifecycle/action/GetLifecycleAction.java
  61. 4 5
      x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/indexlifecycle/action/GetStatusAction.java
  62. 7 8
      x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/indexlifecycle/action/MoveToStepAction.java
  63. 5 6
      x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/indexlifecycle/action/PutLifecycleAction.java
  64. 6 7
      x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/indexlifecycle/action/RemoveIndexLifecyclePolicyAction.java
  65. 6 7
      x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/indexlifecycle/action/RetryAction.java
  66. 5 6
      x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteCalendarAction.java
  67. 6 7
      x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteCalendarEventAction.java
  68. 0 5
      x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteDatafeedAction.java
  69. 5 6
      x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteFilterAction.java
  70. 7 8
      x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteForecastAction.java
  71. 0 5
      x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteJobAction.java
  72. 0 5
      x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutDataFrameAnalyticsAction.java
  73. 0 5
      x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutDatafeedAction.java
  74. 0 5
      x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutJobAction.java
  75. 0 5
      x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/RevertModelSnapshotAction.java
  76. 2 7
      x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/SetUpgradeModeAction.java
  77. 0 5
      x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateDatafeedAction.java
  78. 0 5
      x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateJobAction.java
  79. 5 6
      x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/PutRollupJobAction.java
  80. 5 6
      x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/snapshotlifecycle/action/DeleteSnapshotLifecycleAction.java
  81. 5 6
      x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/snapshotlifecycle/action/ExecuteSnapshotLifecycleAction.java
  82. 5 6
      x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/snapshotlifecycle/action/GetSnapshotLifecycleAction.java
  83. 6 7
      x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/snapshotlifecycle/action/PutSnapshotLifecycleAction.java
  84. 6 5
      x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/indexlifecycle/StartILMRequestTests.java
  85. 6 5
      x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/indexlifecycle/StopILMRequestTests.java
  86. 5 4
      x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/indexlifecycle/action/DeleteLifecycleRequestTests.java
  87. 5 4
      x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/indexlifecycle/action/GetLifecycleRequestTests.java
  88. 5 4
      x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/indexlifecycle/action/MoveToStepRequestTests.java
  89. 5 4
      x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/indexlifecycle/action/PutLifecycleRequestTests.java
  90. 6 5
      x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/indexlifecycle/action/RemoveIndexLifecyclePolicyRequestTests.java
  91. 8 7
      x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/indexlifecycle/action/RetryRequestTests.java
  92. 5 4
      x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/DeleteCalendarEventActionRequestTests.java
  93. 1 1
      x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/indexlifecycle/action/TransportDeleteLifecycleAction.java
  94. 2 2
      x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/indexlifecycle/action/TransportGetLifecycleAction.java
  95. 1 1
      x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/indexlifecycle/action/TransportGetStatusAction.java
  96. 2 2
      x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/indexlifecycle/action/TransportMoveToStepAction.java
  97. 2 2
      x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/indexlifecycle/action/TransportPutLifecycleAction.java
  98. 1 1
      x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/indexlifecycle/action/TransportRemoveIndexLifecyclePolicyAction.java
  99. 1 2
      x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/indexlifecycle/action/TransportRetryAction.java
  100. 2 2
      x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/indexlifecycle/action/TransportStartILMAction.java

+ 5 - 6
server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/delete/DeleteRepositoryRequest.java

@@ -37,6 +37,11 @@ public class DeleteRepositoryRequest extends AcknowledgedRequest<DeleteRepositor
 
     private String name;
 
+    public DeleteRepositoryRequest(StreamInput in) throws IOException {
+        super(in);
+        name = in.readString();
+    }
+
     public DeleteRepositoryRequest() {
     }
 
@@ -77,12 +82,6 @@ public class DeleteRepositoryRequest extends AcknowledgedRequest<DeleteRepositor
         return this.name;
     }
 
-    @Override
-    public void readFrom(StreamInput in) throws IOException {
-        super.readFrom(in);
-        name = in.readString();
-    }
-
     @Override
     public void writeTo(StreamOutput out) throws IOException {
         super.writeTo(out);

+ 1 - 1
server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/delete/TransportDeleteRepositoryAction.java

@@ -49,7 +49,7 @@ public class TransportDeleteRepositoryAction extends TransportMasterNodeAction<D
                                            RepositoriesService repositoriesService, ThreadPool threadPool, ActionFilters actionFilters,
                                            IndexNameExpressionResolver indexNameExpressionResolver) {
         super(DeleteRepositoryAction.NAME, transportService, clusterService, threadPool, actionFilters,
-              indexNameExpressionResolver, DeleteRepositoryRequest::new);
+              DeleteRepositoryRequest::new, indexNameExpressionResolver);
         this.repositoriesService = repositoriesService;
     }
 

+ 8 - 9
server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/put/PutRepositoryRequest.java

@@ -55,6 +55,14 @@ public class PutRepositoryRequest extends AcknowledgedRequest<PutRepositoryReque
 
     private Settings settings = EMPTY_SETTINGS;
 
+    public PutRepositoryRequest(StreamInput in) throws IOException {
+        super(in);
+        name = in.readString();
+        type = in.readString();
+        settings = readSettingsFromStream(in);
+        verify = in.readBoolean();
+    }
+
     public PutRepositoryRequest() {
     }
 
@@ -216,15 +224,6 @@ public class PutRepositoryRequest extends AcknowledgedRequest<PutRepositoryReque
         return this;
     }
 
-    @Override
-    public void readFrom(StreamInput in) throws IOException {
-        super.readFrom(in);
-        name = in.readString();
-        type = in.readString();
-        settings = readSettingsFromStream(in);
-        verify = in.readBoolean();
-    }
-
     @Override
     public void writeTo(StreamOutput out) throws IOException {
         super.writeTo(out);

+ 1 - 1
server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/put/TransportPutRepositoryAction.java

@@ -49,7 +49,7 @@ public class TransportPutRepositoryAction extends TransportMasterNodeAction<PutR
                                         RepositoriesService repositoriesService, ThreadPool threadPool, ActionFilters actionFilters,
                                         IndexNameExpressionResolver indexNameExpressionResolver) {
         super(PutRepositoryAction.NAME, transportService, clusterService, threadPool, actionFilters,
-              indexNameExpressionResolver, PutRepositoryRequest::new);
+              PutRepositoryRequest::new, indexNameExpressionResolver);
         this.repositoriesService = repositoriesService;
     }
 

+ 1 - 1
server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/verify/TransportVerifyRepositoryAction.java

@@ -48,7 +48,7 @@ public class TransportVerifyRepositoryAction extends
                                            RepositoriesService repositoriesService, ThreadPool threadPool, ActionFilters actionFilters,
                                            IndexNameExpressionResolver indexNameExpressionResolver) {
         super(VerifyRepositoryAction.NAME, transportService, clusterService, threadPool, actionFilters,
-              indexNameExpressionResolver, VerifyRepositoryRequest::new);
+              VerifyRepositoryRequest::new, indexNameExpressionResolver);
         this.repositoriesService = repositoriesService;
     }
 

+ 5 - 6
server/src/main/java/org/elasticsearch/action/admin/cluster/repositories/verify/VerifyRepositoryRequest.java

@@ -37,6 +37,11 @@ public class VerifyRepositoryRequest extends AcknowledgedRequest<VerifyRepositor
 
     private String name;
 
+    public VerifyRepositoryRequest(StreamInput in) throws IOException {
+        super(in);
+        name = in.readString();
+    }
+
     public VerifyRepositoryRequest() {
     }
 
@@ -77,12 +82,6 @@ public class VerifyRepositoryRequest extends AcknowledgedRequest<VerifyRepositor
         return this.name;
     }
 
-    @Override
-    public void readFrom(StreamInput in) throws IOException {
-        super.readFrom(in);
-        name = in.readString();
-    }
-
     @Override
     public void writeTo(StreamOutput out) throws IOException {
         super.writeTo(out);

+ 8 - 9
server/src/main/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteRequest.java

@@ -38,6 +38,14 @@ public class ClusterRerouteRequest extends AcknowledgedRequest<ClusterRerouteReq
     private boolean explain;
     private boolean retryFailed;
 
+    public ClusterRerouteRequest(StreamInput in) throws IOException {
+        super(in);
+        commands = AllocationCommands.readFrom(in);
+        dryRun = in.readBoolean();
+        explain = in.readBoolean();
+        retryFailed = in.readBoolean();
+    }
+
     public ClusterRerouteRequest() {
     }
 
@@ -121,15 +129,6 @@ public class ClusterRerouteRequest extends AcknowledgedRequest<ClusterRerouteReq
         return null;
     }
 
-    @Override
-    public void readFrom(StreamInput in) throws IOException {
-        super.readFrom(in);
-        commands = AllocationCommands.readFrom(in);
-        dryRun = in.readBoolean();
-        explain = in.readBoolean();
-        retryFailed = in.readBoolean();
-    }
-
     @Override
     public void writeTo(StreamOutput out) throws IOException {
         super.writeTo(out);

+ 1 - 1
server/src/main/java/org/elasticsearch/action/admin/cluster/reroute/TransportClusterRerouteAction.java

@@ -66,7 +66,7 @@ public class TransportClusterRerouteAction extends TransportMasterNodeAction<Clu
                                          ThreadPool threadPool, AllocationService allocationService, ActionFilters actionFilters,
                                          IndexNameExpressionResolver indexNameExpressionResolver) {
         super(ClusterRerouteAction.NAME, transportService, clusterService, threadPool, actionFilters,
-              indexNameExpressionResolver, ClusterRerouteRequest::new);
+              ClusterRerouteRequest::new, indexNameExpressionResolver);
         this.allocationService = allocationService;
     }
 

+ 6 - 7
server/src/main/java/org/elasticsearch/action/admin/cluster/settings/ClusterUpdateSettingsRequest.java

@@ -61,6 +61,12 @@ public class ClusterUpdateSettingsRequest extends AcknowledgedRequest<ClusterUpd
     private Settings transientSettings = EMPTY_SETTINGS;
     private Settings persistentSettings = EMPTY_SETTINGS;
 
+    public ClusterUpdateSettingsRequest(StreamInput in) throws IOException {
+        super(in);
+        transientSettings = readSettingsFromStream(in);
+        persistentSettings = readSettingsFromStream(in);
+    }
+
     public ClusterUpdateSettingsRequest() {
     }
 
@@ -157,13 +163,6 @@ public class ClusterUpdateSettingsRequest extends AcknowledgedRequest<ClusterUpd
         return this;
     }
 
-    @Override
-    public void readFrom(StreamInput in) throws IOException {
-        super.readFrom(in);
-        transientSettings = readSettingsFromStream(in);
-        persistentSettings = readSettingsFromStream(in);
-    }
-
     @Override
     public void writeTo(StreamOutput out) throws IOException {
         super.writeTo(out);

+ 1 - 1
server/src/main/java/org/elasticsearch/action/admin/cluster/settings/TransportClusterUpdateSettingsAction.java

@@ -56,7 +56,7 @@ public class TransportClusterUpdateSettingsAction extends
                                                 ThreadPool threadPool, AllocationService allocationService, ActionFilters actionFilters,
                                                 IndexNameExpressionResolver indexNameExpressionResolver, ClusterSettings clusterSettings) {
         super(ClusterUpdateSettingsAction.NAME, false, transportService, clusterService, threadPool, actionFilters,
-            indexNameExpressionResolver, ClusterUpdateSettingsRequest::new);
+            ClusterUpdateSettingsRequest::new, indexNameExpressionResolver);
         this.allocationService = allocationService;
         this.clusterSettings = clusterSettings;
     }

+ 5 - 6
server/src/main/java/org/elasticsearch/action/admin/cluster/storedscripts/DeleteStoredScriptRequest.java

@@ -32,6 +32,11 @@ public class DeleteStoredScriptRequest extends AcknowledgedRequest<DeleteStoredS
 
     private String id;
 
+    public DeleteStoredScriptRequest(StreamInput in) throws IOException {
+        super(in);
+        id = in.readString();
+    }
+
     DeleteStoredScriptRequest() {
         super();
     }
@@ -65,12 +70,6 @@ public class DeleteStoredScriptRequest extends AcknowledgedRequest<DeleteStoredS
         return this;
     }
 
-    @Override
-    public void readFrom(StreamInput in) throws IOException {
-        super.readFrom(in);
-        id = in.readString();
-    }
-
     @Override
     public void writeTo(StreamOutput out) throws IOException {
         super.writeTo(out);

+ 9 - 10
server/src/main/java/org/elasticsearch/action/admin/cluster/storedscripts/PutStoredScriptRequest.java

@@ -43,6 +43,15 @@ public class PutStoredScriptRequest extends AcknowledgedRequest<PutStoredScriptR
     private XContentType xContentType;
     private StoredScriptSource source;
 
+    public PutStoredScriptRequest(StreamInput in) throws IOException {
+        super(in);
+        id = in.readOptionalString();
+        content = in.readBytesReference();
+        xContentType = in.readEnum(XContentType.class);
+        context = in.readOptionalString();
+        source = new StoredScriptSource(in);
+    }
+
     public PutStoredScriptRequest() {
         super();
     }
@@ -113,16 +122,6 @@ public class PutStoredScriptRequest extends AcknowledgedRequest<PutStoredScriptR
         return this;
     }
 
-    @Override
-    public void readFrom(StreamInput in) throws IOException {
-        super.readFrom(in);
-        id = in.readOptionalString();
-        content = in.readBytesReference();
-        xContentType = in.readEnum(XContentType.class);
-        context = in.readOptionalString();
-        source = new StoredScriptSource(in);
-    }
-
     @Override
     public void writeTo(StreamOutput out) throws IOException {
         super.writeTo(out);

+ 1 - 1
server/src/main/java/org/elasticsearch/action/admin/cluster/storedscripts/TransportDeleteStoredScriptAction.java

@@ -46,7 +46,7 @@ public class TransportDeleteStoredScriptAction extends TransportMasterNodeAction
                                              ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
                                              ScriptService scriptService) {
         super(DeleteStoredScriptAction.NAME, transportService, clusterService, threadPool, actionFilters,
-                indexNameExpressionResolver, DeleteStoredScriptRequest::new);
+                DeleteStoredScriptRequest::new, indexNameExpressionResolver);
         this.scriptService = scriptService;
     }
 

+ 1 - 1
server/src/main/java/org/elasticsearch/action/admin/cluster/storedscripts/TransportPutStoredScriptAction.java

@@ -46,7 +46,7 @@ public class TransportPutStoredScriptAction extends TransportMasterNodeAction<Pu
                                           ThreadPool threadPool, ActionFilters actionFilters,
                                           IndexNameExpressionResolver indexNameExpressionResolver, ScriptService scriptService) {
         super(PutStoredScriptAction.NAME, transportService, clusterService, threadPool, actionFilters,
-                indexNameExpressionResolver, PutStoredScriptRequest::new);
+                PutStoredScriptRequest::new, indexNameExpressionResolver);
         this.scriptService = scriptService;
     }
 

+ 10 - 11
server/src/main/java/org/elasticsearch/action/admin/indices/alias/IndicesAliasesRequest.java

@@ -70,6 +70,16 @@ public class IndicesAliasesRequest extends AcknowledgedRequest<IndicesAliasesReq
     // expressions only against indices
     private static final IndicesOptions INDICES_OPTIONS = IndicesOptions.fromOptions(false, false, true, false, true, false, true, false);
 
+    public IndicesAliasesRequest(StreamInput in) throws IOException {
+        super(in);
+        allAliasActions = in.readList(AliasActions::new);
+        if (in.getVersion().onOrAfter(Version.V_7_3_0)) {
+            origin = in.readOptionalString();
+        } else {
+            origin = null;
+        }
+    }
+
     public IndicesAliasesRequest() {
     }
 
@@ -563,17 +573,6 @@ public class IndicesAliasesRequest extends AcknowledgedRequest<IndicesAliasesReq
         return validationException;
     }
 
-    @Override
-    public void readFrom(StreamInput in) throws IOException {
-        super.readFrom(in);
-        allAliasActions = in.readList(AliasActions::new);
-        if (in.getVersion().onOrAfter(Version.V_7_3_0)) {
-            origin = in.readOptionalString();
-        } else {
-            origin = null;
-        }
-    }
-
     @Override
     public void writeTo(StreamOutput out) throws IOException {
         super.writeTo(out);

+ 2 - 2
server/src/main/java/org/elasticsearch/action/admin/indices/alias/TransportIndicesAliasesAction.java

@@ -73,8 +73,8 @@ public class TransportIndicesAliasesAction extends TransportMasterNodeAction<Ind
             final ActionFilters actionFilters,
             final IndexNameExpressionResolver indexNameExpressionResolver,
             final RequestValidators<IndicesAliasesRequest> requestValidators) {
-        super(IndicesAliasesAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver,
-            IndicesAliasesRequest::new);
+        super(IndicesAliasesAction.NAME, transportService, clusterService, threadPool, actionFilters, IndicesAliasesRequest::new,
+            indexNameExpressionResolver);
         this.indexAliasesService = indexAliasesService;
         this.requestValidators = Objects.requireNonNull(requestValidators);
     }

+ 11 - 12
server/src/main/java/org/elasticsearch/action/admin/indices/close/CloseIndexRequest.java

@@ -42,6 +42,17 @@ public class CloseIndexRequest extends AcknowledgedRequest<CloseIndexRequest> im
     private IndicesOptions indicesOptions = IndicesOptions.strictExpandOpen();
     private ActiveShardCount waitForActiveShards = ActiveShardCount.DEFAULT;
 
+    public CloseIndexRequest(StreamInput in) throws IOException {
+        super(in);
+        indices = in.readStringArray();
+        indicesOptions = IndicesOptions.readIndicesOptions(in);
+        if (in.getVersion().onOrAfter(Version.V_7_2_0)) {
+            waitForActiveShards = ActiveShardCount.readFrom(in);
+        } else {
+            waitForActiveShards = ActiveShardCount.NONE;
+        }
+    }
+
     public CloseIndexRequest() {
     }
 
@@ -113,18 +124,6 @@ public class CloseIndexRequest extends AcknowledgedRequest<CloseIndexRequest> im
         return this;
     }
 
-    @Override
-    public void readFrom(StreamInput in) throws IOException {
-        super.readFrom(in);
-        indices = in.readStringArray();
-        indicesOptions = IndicesOptions.readIndicesOptions(in);
-        if (in.getVersion().onOrAfter(Version.V_7_2_0)) {
-            waitForActiveShards = ActiveShardCount.readFrom(in);
-        } else {
-            waitForActiveShards = ActiveShardCount.NONE;
-        }
-    }
-
     @Override
     public void writeTo(StreamOutput out) throws IOException {
         super.writeTo(out);

+ 2 - 2
server/src/main/java/org/elasticsearch/action/admin/indices/close/TransportCloseIndexAction.java

@@ -60,8 +60,8 @@ public class TransportCloseIndexAction extends TransportMasterNodeAction<CloseIn
                                      ThreadPool threadPool, MetaDataIndexStateService indexStateService,
                                      ClusterSettings clusterSettings, ActionFilters actionFilters,
                                      IndexNameExpressionResolver indexNameExpressionResolver, DestructiveOperations destructiveOperations) {
-        super(CloseIndexAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver,
-            CloseIndexRequest::new);
+        super(CloseIndexAction.NAME, transportService, clusterService, threadPool, actionFilters, CloseIndexRequest::new,
+            indexNameExpressionResolver);
         this.indexStateService = indexStateService;
         this.destructiveOperations = destructiveOperations;
         this.closeIndexEnabled = CLUSTER_INDICES_CLOSE_ENABLE_SETTING.get(settings);

+ 18 - 20
server/src/main/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequest.java

@@ -87,6 +87,24 @@ public class CreateIndexRequest extends AcknowledgedRequest<CreateIndexRequest>
 
     private ActiveShardCount waitForActiveShards = ActiveShardCount.DEFAULT;
 
+    public CreateIndexRequest(StreamInput in) throws IOException {
+        super(in);
+        cause = in.readString();
+        index = in.readString();
+        settings = readSettingsFromStream(in);
+        int size = in.readVInt();
+        for (int i = 0; i < size; i++) {
+            final String type = in.readString();
+            String source = in.readString();
+            mappings.put(type, source);
+        }
+        int aliasesSize = in.readVInt();
+        for (int i = 0; i < aliasesSize; i++) {
+            aliases.add(Alias.read(in));
+        }
+        waitForActiveShards = ActiveShardCount.readFrom(in);
+    }
+
     public CreateIndexRequest() {
     }
 
@@ -430,26 +448,6 @@ public class CreateIndexRequest extends AcknowledgedRequest<CreateIndexRequest>
         return waitForActiveShards(ActiveShardCount.from(waitForActiveShards));
     }
 
-
-    @Override
-    public void readFrom(StreamInput in) throws IOException {
-        super.readFrom(in);
-        cause = in.readString();
-        index = in.readString();
-        settings = readSettingsFromStream(in);
-        int size = in.readVInt();
-        for (int i = 0; i < size; i++) {
-            final String type = in.readString();
-            String source = in.readString();
-            mappings.put(type, source);
-        }
-        int aliasesSize = in.readVInt();
-        for (int i = 0; i < aliasesSize; i++) {
-            aliases.add(Alias.read(in));
-        }
-        waitForActiveShards = ActiveShardCount.readFrom(in);
-    }
-
     @Override
     public void writeTo(StreamOutput out) throws IOException {
         super.writeTo(out);

+ 2 - 2
server/src/main/java/org/elasticsearch/action/admin/indices/create/TransportCreateIndexAction.java

@@ -47,8 +47,8 @@ public class TransportCreateIndexAction extends TransportMasterNodeAction<Create
     public TransportCreateIndexAction(TransportService transportService, ClusterService clusterService,
                                       ThreadPool threadPool, MetaDataCreateIndexService createIndexService,
                                       ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
-        super(CreateIndexAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver,
-            CreateIndexRequest::new);
+        super(CreateIndexAction.NAME, transportService, clusterService, threadPool, actionFilters, CreateIndexRequest::new,
+            indexNameExpressionResolver);
         this.createIndexService = createIndexService;
     }
 

+ 6 - 7
server/src/main/java/org/elasticsearch/action/admin/indices/delete/DeleteIndexRequest.java

@@ -40,6 +40,12 @@ public class DeleteIndexRequest extends AcknowledgedRequest<DeleteIndexRequest>
     // Delete index should work by default on both open and closed indices.
     private IndicesOptions indicesOptions = IndicesOptions.fromOptions(false, true, true, true, false, false, true, false);
 
+    public DeleteIndexRequest(StreamInput in) throws IOException {
+        super(in);
+        indices = in.readStringArray();
+        indicesOptions = IndicesOptions.readIndicesOptions(in);
+    }
+
     public DeleteIndexRequest() {
     }
 
@@ -94,13 +100,6 @@ public class DeleteIndexRequest extends AcknowledgedRequest<DeleteIndexRequest>
         return indices;
     }
 
-    @Override
-    public void readFrom(StreamInput in) throws IOException {
-        super.readFrom(in);
-        indices = in.readStringArray();
-        indicesOptions = IndicesOptions.readIndicesOptions(in);
-    }
-
     @Override
     public void writeTo(StreamOutput out) throws IOException {
         super.writeTo(out);

+ 2 - 2
server/src/main/java/org/elasticsearch/action/admin/indices/delete/TransportDeleteIndexAction.java

@@ -56,8 +56,8 @@ public class TransportDeleteIndexAction extends TransportMasterNodeAction<Delete
                                       MetaDataDeleteIndexService deleteIndexService, ActionFilters actionFilters,
                                       IndexNameExpressionResolver indexNameExpressionResolver,
                                       DestructiveOperations destructiveOperations) {
-        super(DeleteIndexAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver,
-            DeleteIndexRequest::new);
+        super(DeleteIndexAction.NAME, transportService, clusterService, threadPool, actionFilters, DeleteIndexRequest::new,
+            indexNameExpressionResolver );
         this.deleteIndexService = deleteIndexService;
         this.destructiveOperations = destructiveOperations;
     }

+ 10 - 11
server/src/main/java/org/elasticsearch/action/admin/indices/mapping/put/PutMappingRequest.java

@@ -76,6 +76,16 @@ public class PutMappingRequest extends AcknowledgedRequest<PutMappingRequest> im
 
     private Index concreteIndex;
 
+    public PutMappingRequest(StreamInput in) throws IOException {
+        super(in);
+        indices = in.readStringArray();
+        indicesOptions = IndicesOptions.readIndicesOptions(in);
+        type = in.readOptionalString();
+        source = in.readString();
+        concreteIndex = in.readOptionalWriteable(Index::new);
+        origin = in.readOptionalString();
+    }
+
     public PutMappingRequest() {
     }
 
@@ -299,17 +309,6 @@ public class PutMappingRequest extends AcknowledgedRequest<PutMappingRequest> im
         }
     }
 
-    @Override
-    public void readFrom(StreamInput in) throws IOException {
-        super.readFrom(in);
-        indices = in.readStringArray();
-        indicesOptions = IndicesOptions.readIndicesOptions(in);
-        type = in.readOptionalString();
-        source = in.readString();
-        concreteIndex = in.readOptionalWriteable(Index::new);
-        origin = in.readOptionalString();
-    }
-
     @Override
     public void writeTo(StreamOutput out) throws IOException {
         super.writeTo(out);

+ 2 - 2
server/src/main/java/org/elasticsearch/action/admin/indices/mapping/put/TransportPutMappingAction.java

@@ -61,8 +61,8 @@ public class TransportPutMappingAction extends TransportMasterNodeAction<PutMapp
             final ActionFilters actionFilters,
             final IndexNameExpressionResolver indexNameExpressionResolver,
             final RequestValidators<PutMappingRequest> requestValidators) {
-        super(PutMappingAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver,
-            PutMappingRequest::new);
+        super(PutMappingAction.NAME, transportService, clusterService, threadPool, actionFilters, PutMappingRequest::new,
+            indexNameExpressionResolver);
         this.metaDataMappingService = metaDataMappingService;
         this.requestValidators = Objects.requireNonNull(requestValidators);
     }

+ 7 - 8
server/src/main/java/org/elasticsearch/action/admin/indices/open/OpenIndexRequest.java

@@ -41,6 +41,13 @@ public class OpenIndexRequest extends AcknowledgedRequest<OpenIndexRequest> impl
     private IndicesOptions indicesOptions = IndicesOptions.fromOptions(false, true, false, true);
     private ActiveShardCount waitForActiveShards = ActiveShardCount.DEFAULT;
 
+    public OpenIndexRequest(StreamInput in) throws IOException {
+        super(in);
+        indices = in.readStringArray();
+        indicesOptions = IndicesOptions.readIndicesOptions(in);
+        waitForActiveShards = ActiveShardCount.readFrom(in);
+    }
+
     public OpenIndexRequest() {
     }
 
@@ -135,14 +142,6 @@ public class OpenIndexRequest extends AcknowledgedRequest<OpenIndexRequest> impl
         return waitForActiveShards(ActiveShardCount.from(waitForActiveShards));
     }
 
-    @Override
-    public void readFrom(StreamInput in) throws IOException {
-        super.readFrom(in);
-        indices = in.readStringArray();
-        indicesOptions = IndicesOptions.readIndicesOptions(in);
-        waitForActiveShards = ActiveShardCount.readFrom(in);
-    }
-
     @Override
     public void writeTo(StreamOutput out) throws IOException {
         super.writeTo(out);

+ 2 - 2
server/src/main/java/org/elasticsearch/action/admin/indices/open/TransportOpenIndexAction.java

@@ -53,8 +53,8 @@ public class TransportOpenIndexAction extends TransportMasterNodeAction<OpenInde
                                     ThreadPool threadPool, MetaDataIndexStateService indexStateService,
                                     ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
                                     DestructiveOperations destructiveOperations) {
-        super(OpenIndexAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver,
-            OpenIndexRequest::new);
+        super(OpenIndexAction.NAME, transportService, clusterService, threadPool, actionFilters, OpenIndexRequest::new,
+            indexNameExpressionResolver);
         this.indexStateService = indexStateService;
         this.destructiveOperations = destructiveOperations;
     }

+ 13 - 15
server/src/main/java/org/elasticsearch/action/admin/indices/rollover/RolloverRequest.java

@@ -96,6 +96,19 @@ public class RolloverRequest extends AcknowledgedRequest<RolloverRequest> implem
     //the index name "_na_" is never read back, what matters are settings, mappings and aliases
     private CreateIndexRequest createIndexRequest = new CreateIndexRequest("_na_");
 
+    public RolloverRequest(StreamInput in) throws IOException {
+        super(in);
+        alias = in.readString();
+        newIndexName = in.readOptionalString();
+        dryRun = in.readBoolean();
+        int size = in.readVInt();
+        for (int i = 0; i < size; i++) {
+            Condition<?> condition = in.readNamedWriteable(Condition.class);
+            this.conditions.put(condition.name, condition);
+        }
+        createIndexRequest = new CreateIndexRequest(in);
+    }
+
     RolloverRequest() {}
 
     public RolloverRequest(String alias, String newIndexName) {
@@ -112,21 +125,6 @@ public class RolloverRequest extends AcknowledgedRequest<RolloverRequest> implem
         return validationException;
     }
 
-    @Override
-    public void readFrom(StreamInput in) throws IOException {
-        super.readFrom(in);
-        alias = in.readString();
-        newIndexName = in.readOptionalString();
-        dryRun = in.readBoolean();
-        int size = in.readVInt();
-        for (int i = 0; i < size; i++) {
-            Condition<?> condition = in.readNamedWriteable(Condition.class);
-            this.conditions.put(condition.name, condition);
-        }
-        createIndexRequest = new CreateIndexRequest();
-        createIndexRequest.readFrom(in);
-    }
-
     @Override
     public void writeTo(StreamOutput out) throws IOException {
         super.writeTo(out);

+ 2 - 2
server/src/main/java/org/elasticsearch/action/admin/indices/rollover/TransportRolloverAction.java

@@ -80,8 +80,8 @@ public class TransportRolloverAction extends TransportMasterNodeAction<RolloverR
                                    ThreadPool threadPool, MetaDataCreateIndexService createIndexService,
                                    ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
                                    MetaDataIndexAliasesService indexAliasesService, Client client) {
-        super(RolloverAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver,
-            RolloverRequest::new);
+        super(RolloverAction.NAME, transportService, clusterService, threadPool, actionFilters, RolloverRequest::new,
+            indexNameExpressionResolver);
         this.createIndexService = createIndexService;
         this.indexAliasesService = indexAliasesService;
         this.client = client;

+ 2 - 2
server/src/main/java/org/elasticsearch/action/admin/indices/settings/put/TransportUpdateSettingsAction.java

@@ -49,8 +49,8 @@ public class TransportUpdateSettingsAction extends TransportMasterNodeAction<Upd
     public TransportUpdateSettingsAction(TransportService transportService, ClusterService clusterService,
                                          ThreadPool threadPool, MetaDataUpdateSettingsService updateSettingsService,
                                          ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
-        super(UpdateSettingsAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver,
-            UpdateSettingsRequest::new);
+        super(UpdateSettingsAction.NAME, transportService, clusterService, threadPool, actionFilters, UpdateSettingsRequest::new,
+            indexNameExpressionResolver);
         this.updateSettingsService = updateSettingsService;
     }
 

+ 8 - 9
server/src/main/java/org/elasticsearch/action/admin/indices/settings/put/UpdateSettingsRequest.java

@@ -56,6 +56,14 @@ public class UpdateSettingsRequest extends AcknowledgedRequest<UpdateSettingsReq
     private Settings settings = EMPTY_SETTINGS;
     private boolean preserveExisting = false;
 
+    public UpdateSettingsRequest(StreamInput in) throws IOException {
+        super(in);
+        indices = in.readStringArray();
+        indicesOptions = IndicesOptions.readIndicesOptions(in);
+        settings = readSettingsFromStream(in);
+        preserveExisting = in.readBoolean();
+    }
+
     public UpdateSettingsRequest() {
     }
 
@@ -166,15 +174,6 @@ public class UpdateSettingsRequest extends AcknowledgedRequest<UpdateSettingsReq
         return this;
     }
 
-    @Override
-    public void readFrom(StreamInput in) throws IOException {
-        super.readFrom(in);
-        indices = in.readStringArray();
-        indicesOptions = IndicesOptions.readIndicesOptions(in);
-        settings = readSettingsFromStream(in);
-        preserveExisting = in.readBoolean();
-    }
-
     @Override
     public void writeTo(StreamOutput out) throws IOException {
         super.writeTo(out);

+ 8 - 10
server/src/main/java/org/elasticsearch/action/admin/indices/shrink/ResizeRequest.java

@@ -57,6 +57,14 @@ public class ResizeRequest extends AcknowledgedRequest<ResizeRequest> implements
     private ResizeType type = ResizeType.SHRINK;
     private Boolean copySettings = true;
 
+    public ResizeRequest(StreamInput in) throws IOException {
+        super(in);
+        targetIndexRequest = new CreateIndexRequest(in);
+        sourceIndex = in.readString();
+        type = in.readEnum(ResizeType.class);
+        copySettings = in.readOptionalBoolean();
+    }
+
     ResizeRequest() {}
 
     public ResizeRequest(String targetIndex, String sourceIndex) {
@@ -87,16 +95,6 @@ public class ResizeRequest extends AcknowledgedRequest<ResizeRequest> implements
         this.sourceIndex = index;
     }
 
-    @Override
-    public void readFrom(StreamInput in) throws IOException {
-        super.readFrom(in);
-        targetIndexRequest = new CreateIndexRequest();
-        targetIndexRequest.readFrom(in);
-        sourceIndex = in.readString();
-        type = in.readEnum(ResizeType.class);
-        copySettings = in.readOptionalBoolean();
-    }
-
     @Override
     public void writeTo(StreamOutput out) throws IOException {
         super.writeTo(out);

+ 1 - 2
server/src/main/java/org/elasticsearch/action/admin/indices/shrink/TransportResizeAction.java

@@ -72,8 +72,7 @@ public class TransportResizeAction extends TransportMasterNodeAction<ResizeReque
     protected TransportResizeAction(String actionName, TransportService transportService, ClusterService clusterService,
                                  ThreadPool threadPool, MetaDataCreateIndexService createIndexService,
                                  ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, Client client) {
-        super(actionName, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver,
-            ResizeRequest::new);
+        super(actionName, transportService, clusterService, threadPool, actionFilters, ResizeRequest::new, indexNameExpressionResolver);
         this.createIndexService = createIndexService;
         this.client = client;
     }

+ 1 - 1
server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/post/TransportUpgradeSettingsAction.java

@@ -48,7 +48,7 @@ public class TransportUpgradeSettingsAction extends TransportMasterNodeAction<Up
                                           ThreadPool threadPool, MetaDataUpdateSettingsService updateSettingsService,
                                           IndexNameExpressionResolver indexNameExpressionResolver, ActionFilters actionFilters) {
         super(UpgradeSettingsAction.NAME, transportService, clusterService, threadPool, actionFilters,
-            indexNameExpressionResolver, UpgradeSettingsRequest::new);
+            UpgradeSettingsRequest::new, indexNameExpressionResolver);
         this.updateSettingsService = updateSettingsService;
     }
 

+ 12 - 14
server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/post/UpgradeSettingsRequest.java

@@ -39,6 +39,18 @@ public class UpgradeSettingsRequest extends AcknowledgedRequest<UpgradeSettingsR
 
     private Map<String, Tuple<Version, String>> versions;
 
+    public UpgradeSettingsRequest(StreamInput in) throws IOException {
+        super(in);
+        int size = in.readVInt();
+        versions = new HashMap<>();
+        for (int i=0; i<size; i++) {
+            String index = in.readString();
+            Version upgradeVersion = Version.readVersion(in);
+            String oldestLuceneSegment = in.readString();
+            versions.put(index, new Tuple<>(upgradeVersion, oldestLuceneSegment));
+        }
+    }
+
     public UpgradeSettingsRequest() {
     }
 
@@ -74,20 +86,6 @@ public class UpgradeSettingsRequest extends AcknowledgedRequest<UpgradeSettingsR
         return this;
     }
 
-
-    @Override
-    public void readFrom(StreamInput in) throws IOException {
-        super.readFrom(in);
-        int size = in.readVInt();
-        versions = new HashMap<>();
-        for (int i=0; i<size; i++) {
-            String index = in.readString();
-            Version upgradeVersion = Version.readVersion(in);
-            String oldestLuceneSegment = in.readString();
-            versions.put(index, new Tuple<>(upgradeVersion, oldestLuceneSegment));
-        }
-    }
-
     @Override
     public void writeTo(StreamOutput out) throws IOException {
         super.writeTo(out);

+ 5 - 6
server/src/main/java/org/elasticsearch/action/ingest/DeletePipelineRequest.java

@@ -39,6 +39,11 @@ public class DeletePipelineRequest extends AcknowledgedRequest<DeletePipelineReq
         this.id = id;
     }
 
+    public DeletePipelineRequest(StreamInput in) throws IOException {
+        super(in);
+        id = in.readString();
+    }
+
     DeletePipelineRequest() {
     }
 
@@ -55,12 +60,6 @@ public class DeletePipelineRequest extends AcknowledgedRequest<DeletePipelineReq
         return null;
     }
 
-    @Override
-    public void readFrom(StreamInput in) throws IOException {
-        super.readFrom(in);
-        id = in.readString();
-    }
-
     @Override
     public void writeTo(StreamOutput out) throws IOException {
         super.writeTo(out);

+ 1 - 1
server/src/main/java/org/elasticsearch/action/ingest/DeletePipelineTransportAction.java

@@ -44,7 +44,7 @@ public class DeletePipelineTransportAction extends TransportMasterNodeAction<Del
     public DeletePipelineTransportAction(ThreadPool threadPool, IngestService ingestService, TransportService transportService,
                                          ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
         super(DeletePipelineAction.NAME, transportService, ingestService.getClusterService(),
-            threadPool, actionFilters, indexNameExpressionResolver, DeletePipelineRequest::new);
+            threadPool, actionFilters, DeletePipelineRequest::new, indexNameExpressionResolver);
         this.ingestService = ingestService;
     }
 

+ 7 - 8
server/src/main/java/org/elasticsearch/action/ingest/PutPipelineRequest.java

@@ -46,6 +46,13 @@ public class PutPipelineRequest extends AcknowledgedRequest<PutPipelineRequest>
         this.xContentType = Objects.requireNonNull(xContentType);
     }
 
+    public PutPipelineRequest(StreamInput in) throws IOException {
+        super(in);
+        id = in.readString();
+        source = in.readBytesReference();
+        xContentType = in.readEnum(XContentType.class);
+    }
+
     PutPipelineRequest() {
     }
 
@@ -66,14 +73,6 @@ public class PutPipelineRequest extends AcknowledgedRequest<PutPipelineRequest>
         return xContentType;
     }
 
-    @Override
-    public void readFrom(StreamInput in) throws IOException {
-        super.readFrom(in);
-        id = in.readString();
-        source = in.readBytesReference();
-        xContentType = in.readEnum(XContentType.class);
-    }
-
     @Override
     public void writeTo(StreamOutput out) throws IOException {
         super.writeTo(out);

+ 1 - 1
server/src/main/java/org/elasticsearch/action/ingest/PutPipelineTransportAction.java

@@ -54,7 +54,7 @@ public class PutPipelineTransportAction extends TransportMasterNodeAction<PutPip
         IngestService ingestService, NodeClient client) {
         super(
             PutPipelineAction.NAME, transportService, ingestService.getClusterService(),
-            threadPool, actionFilters, indexNameExpressionResolver, PutPipelineRequest::new
+            threadPool, actionFilters, PutPipelineRequest::new, indexNameExpressionResolver
         );
         this.client = client;
         this.ingestService = ingestService;

+ 2 - 3
server/src/main/java/org/elasticsearch/action/support/master/AcknowledgedRequest.java

@@ -82,9 +82,8 @@ public abstract class AcknowledgedRequest<Request extends MasterNodeRequest<Requ
     }
 
     @Override
-    public void readFrom(StreamInput in) throws IOException {
-        super.readFrom(in);
-        timeout = in.readTimeValue();
+    public final void readFrom(StreamInput in) throws IOException {
+        throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
     }
 
     @Override

+ 1 - 3
server/src/test/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteRequestTests.java

@@ -165,9 +165,7 @@ public class ClusterRerouteRequestTests extends ESTestCase {
         try (BytesStreamOutput output = new BytesStreamOutput()) {
             original.writeTo(output);
             try (StreamInput in = new NamedWriteableAwareStreamInput(output.bytes().streamInput(), namedWriteableRegistry)) {
-                ClusterRerouteRequest copy = new ClusterRerouteRequest();
-                copy.readFrom(in);
-                return copy;
+                return new ClusterRerouteRequest(in);
             }
         }
     }

+ 1 - 2
server/src/test/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteTests.java

@@ -68,8 +68,7 @@ public class ClusterRerouteTests extends ESAllocationTestCase {
         NamedWriteableRegistry namedWriteableRegistry = new NamedWriteableRegistry(NetworkModule.getNamedWriteables());
         StreamInput wrap = new NamedWriteableAwareStreamInput(bytes.streamInput(),
             namedWriteableRegistry);
-        ClusterRerouteRequest deserializedReq = new ClusterRerouteRequest();
-        deserializedReq.readFrom(wrap);
+        ClusterRerouteRequest deserializedReq = new ClusterRerouteRequest(wrap);
 
         assertEquals(req.isRetryFailed(), deserializedReq.isRetryFailed());
         assertEquals(req.dryRun(), deserializedReq.dryRun());

+ 1 - 2
server/src/test/java/org/elasticsearch/action/admin/cluster/storedscripts/PutStoredScriptRequestTests.java

@@ -43,8 +43,7 @@ public class PutStoredScriptRequestTests extends ESTestCase {
             storedScriptRequest.writeTo(output);
 
             try (StreamInput in = output.bytes().streamInput()) {
-                PutStoredScriptRequest serialized = new PutStoredScriptRequest();
-                serialized.readFrom(in);
+                PutStoredScriptRequest serialized = new PutStoredScriptRequest(in);
                 assertEquals(XContentType.JSON, serialized.xContentType());
                 assertEquals(storedScriptRequest.id(), serialized.id());
                 assertEquals(storedScriptRequest.context(), serialized.context());

+ 4 - 4
server/src/test/java/org/elasticsearch/action/admin/indices/close/CloseIndexRequestTests.java

@@ -35,9 +35,9 @@ public class CloseIndexRequestTests extends ESTestCase {
         try (BytesStreamOutput out = new BytesStreamOutput()) {
             request.writeTo(out);
 
-            final CloseIndexRequest deserializedRequest = new CloseIndexRequest();
+            final CloseIndexRequest deserializedRequest;
             try (StreamInput in = out.bytes().streamInput()) {
-                deserializedRequest.readFrom(in);
+                deserializedRequest = new CloseIndexRequest(in);
             }
             assertEquals(request.timeout(), deserializedRequest.timeout());
             assertEquals(request.masterNodeTimeout(), deserializedRequest.masterNodeTimeout());
@@ -74,11 +74,11 @@ public class CloseIndexRequestTests extends ESTestCase {
                 out.writeStringArray(sample.indices());
                 sample.indicesOptions().writeIndicesOptions(out);
 
-                final CloseIndexRequest deserializedRequest = new CloseIndexRequest();
+                final CloseIndexRequest deserializedRequest;
                 try (StreamInput in = out.bytes().streamInput()) {
                     in.setVersion(VersionUtils.randomVersionBetween(random(), VersionUtils.getFirstVersion(),
                         VersionUtils.getPreviousVersion(Version.V_7_2_0)));
-                    deserializedRequest.readFrom(in);
+                    deserializedRequest = new CloseIndexRequest(in);
                 }
                 assertEquals(sample.getParentTask(), deserializedRequest.getParentTask());
                 assertEquals(sample.masterNodeTimeout(), deserializedRequest.masterNodeTimeout());

+ 1 - 2
server/src/test/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequestTests.java

@@ -53,8 +53,7 @@ public class CreateIndexRequestTests extends ESTestCase {
             request.writeTo(output);
 
             try (StreamInput in = output.bytes().streamInput()) {
-                CreateIndexRequest serialized = new CreateIndexRequest();
-                serialized.readFrom(in);
+                CreateIndexRequest serialized = new CreateIndexRequest(in);
                 assertEquals(request.index(), serialized.index());
                 assertEquals(mapping, serialized.mappings().get("my_type"));
             }

+ 1 - 2
server/src/test/java/org/elasticsearch/action/admin/indices/rollover/RolloverRequestTests.java

@@ -124,8 +124,7 @@ public class RolloverRequestTests extends ESTestCase {
             originalRequest.writeTo(out);
             BytesReference bytes = out.bytes();
             try (StreamInput in = new NamedWriteableAwareStreamInput(bytes.streamInput(), writeableRegistry)) {
-                RolloverRequest cloneRequest = new RolloverRequest();
-                cloneRequest.readFrom(in);
+                RolloverRequest cloneRequest = new RolloverRequest(in);
                 assertThat(cloneRequest.getNewIndexName(), equalTo(originalRequest.getNewIndexName()));
                 assertThat(cloneRequest.getAlias(), equalTo(originalRequest.getAlias()));
                 for (Map.Entry<String, Condition<?>> entry : cloneRequest.getConditions().entrySet()) {

+ 5 - 4
server/src/test/java/org/elasticsearch/action/admin/indices/settings/put/UpdateSettingsRequestStreamableTests.java → server/src/test/java/org/elasticsearch/action/admin/indices/settings/put/UpdateSettingsRequestSerializationTests.java

@@ -20,11 +20,12 @@
 package org.elasticsearch.action.admin.indices.settings.put;
 
 import org.elasticsearch.action.support.IndicesOptions;
+import org.elasticsearch.common.io.stream.Writeable;
 import org.elasticsearch.common.settings.Settings;
 import org.elasticsearch.common.settings.Settings.Builder;
 import org.elasticsearch.common.unit.TimeValue;
 import org.elasticsearch.common.util.CollectionUtils;
-import org.elasticsearch.test.AbstractStreamableTestCase;
+import org.elasticsearch.test.AbstractWireSerializingTestCase;
 import org.elasticsearch.test.ESTestCase;
 
 import java.util.ArrayList;
@@ -35,7 +36,7 @@ import java.util.Set;
 import java.util.StringJoiner;
 import java.util.function.Supplier;
 
-public class UpdateSettingsRequestStreamableTests extends AbstractStreamableTestCase<UpdateSettingsRequest> {
+public class UpdateSettingsRequestSerializationTests extends AbstractWireSerializingTestCase<UpdateSettingsRequest> {
 
     @Override
     protected UpdateSettingsRequest mutateInstance(UpdateSettingsRequest request) {
@@ -60,8 +61,8 @@ public class UpdateSettingsRequestStreamableTests extends AbstractStreamableTest
     }
 
     @Override
-    protected UpdateSettingsRequest createBlankInstance() {
-        return new UpdateSettingsRequest();
+    protected Writeable.Reader<UpdateSettingsRequest> instanceReader() {
+        return UpdateSettingsRequest::new;
     }
 
     public static UpdateSettingsRequest createTestItem() {

+ 1 - 1
server/src/test/java/org/elasticsearch/action/admin/indices/settings/put/UpdateSettingsRequestTests.java

@@ -32,7 +32,7 @@ public class UpdateSettingsRequestTests extends AbstractXContentTestCase<UpdateS
 
     @Override
     protected UpdateSettingsRequest createTestInstance() {
-        UpdateSettingsRequest testRequest = UpdateSettingsRequestStreamableTests.createTestItem();
+        UpdateSettingsRequest testRequest = UpdateSettingsRequestSerializationTests.createTestItem();
         if (enclosedSettings) {
             UpdateSettingsRequest requestWithEnclosingSettings = new UpdateSettingsRequest(testRequest.settings()) {
                 public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {

+ 1 - 2
server/src/test/java/org/elasticsearch/action/ingest/PutPipelineRequestTests.java

@@ -42,8 +42,7 @@ public class PutPipelineRequestTests extends ESTestCase {
         request.writeTo(output);
         StreamInput in = StreamInput.wrap(output.bytes().toBytesRef().bytes);
 
-        PutPipelineRequest serialized = new PutPipelineRequest();
-        serialized.readFrom(in);
+        PutPipelineRequest serialized = new PutPipelineRequest(in);
         assertEquals(XContentType.JSON, serialized.getXContentType());
         assertEquals("{}", serialized.getSource().utf8ToString());
     }

+ 7 - 6
x-pack/plugin/core/src/main/java/org/elasticsearch/license/PostStartBasicRequest.java

@@ -16,6 +16,13 @@ public class PostStartBasicRequest extends AcknowledgedRequest<PostStartBasicReq
 
     private boolean acknowledge = false;
 
+    public PostStartBasicRequest() {}
+
+    public PostStartBasicRequest(StreamInput in) throws IOException {
+        super(in);
+        acknowledge = in.readBoolean();
+    }
+
     @Override
     public ActionRequestValidationException validate() {
         return null;
@@ -30,12 +37,6 @@ public class PostStartBasicRequest extends AcknowledgedRequest<PostStartBasicReq
         return acknowledge;
     }
 
-    @Override
-    public void readFrom(StreamInput in) throws IOException {
-        super.readFrom(in);
-        acknowledge = in.readBoolean();
-    }
-
     @Override
     public void writeTo(StreamOutput out) throws IOException {
         super.writeTo(out);

+ 6 - 7
x-pack/plugin/core/src/main/java/org/elasticsearch/license/PutLicenseRequest.java

@@ -21,6 +21,12 @@ public class PutLicenseRequest extends AcknowledgedRequest<PutLicenseRequest> {
     private License license;
     private boolean acknowledge = false;
 
+    public PutLicenseRequest(StreamInput in) throws IOException {
+        super(in);
+        license = License.readLicense(in);
+        acknowledge = in.readBoolean();
+    }
+
     public PutLicenseRequest() {
     }
 
@@ -61,13 +67,6 @@ public class PutLicenseRequest extends AcknowledgedRequest<PutLicenseRequest> {
         return acknowledge;
     }
 
-    @Override
-    public void readFrom(StreamInput in) throws IOException {
-        super.readFrom(in);
-        license = License.readLicense(in);
-        acknowledge = in.readBoolean();
-    }
-
     @Override
     public void writeTo(StreamOutput out) throws IOException {
         super.writeTo(out);

+ 1 - 1
x-pack/plugin/core/src/main/java/org/elasticsearch/license/TransportDeleteLicenseAction.java

@@ -34,7 +34,7 @@ public class TransportDeleteLicenseAction extends TransportMasterNodeAction<Dele
                                         LicenseService licenseService, ThreadPool threadPool, ActionFilters actionFilters,
                                         IndexNameExpressionResolver indexNameExpressionResolver) {
         super(DeleteLicenseAction.NAME, transportService, clusterService, threadPool, actionFilters,
-                indexNameExpressionResolver, DeleteLicenseRequest::new);
+                DeleteLicenseRequest::new, indexNameExpressionResolver);
         this.licenseService = licenseService;
     }
 

+ 1 - 1
x-pack/plugin/core/src/main/java/org/elasticsearch/license/TransportPostStartBasicAction.java

@@ -30,7 +30,7 @@ public class TransportPostStartBasicAction extends TransportMasterNodeAction<Pos
                                          LicenseService licenseService, ThreadPool threadPool, ActionFilters actionFilters,
                                          IndexNameExpressionResolver indexNameExpressionResolver) {
         super(PostStartBasicAction.NAME, transportService, clusterService, threadPool, actionFilters,
-                indexNameExpressionResolver, PostStartBasicRequest::new);
+                PostStartBasicRequest::new, indexNameExpressionResolver);
         this.licenseService = licenseService;
     }
 

+ 2 - 2
x-pack/plugin/core/src/main/java/org/elasticsearch/license/TransportPutLicenseAction.java

@@ -31,8 +31,8 @@ public class TransportPutLicenseAction extends TransportMasterNodeAction<PutLice
     public TransportPutLicenseAction(TransportService transportService, ClusterService clusterService,
                                      LicenseService licenseService, ThreadPool threadPool, ActionFilters actionFilters,
                                      IndexNameExpressionResolver indexNameExpressionResolver) {
-        super(PutLicenseAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver,
-                PutLicenseRequest::new);
+        super(PutLicenseAction.NAME, transportService, clusterService, threadPool, actionFilters, PutLicenseRequest::new,
+            indexNameExpressionResolver);
         this.licenseService = licenseService;
     }
 

+ 9 - 0
x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/license/DeleteLicenseRequest.java

@@ -7,10 +7,19 @@ package org.elasticsearch.protocol.xpack.license;
 
 import org.elasticsearch.action.ActionRequestValidationException;
 import org.elasticsearch.action.support.master.AcknowledgedRequest;
+import org.elasticsearch.common.io.stream.StreamInput;
+
+import java.io.IOException;
 
 
 public class DeleteLicenseRequest extends AcknowledgedRequest<DeleteLicenseRequest> {
 
+    public DeleteLicenseRequest() {}
+
+    public DeleteLicenseRequest(StreamInput in) throws IOException {
+        super(in);
+    }
+
     @Override
     public ActionRequestValidationException validate() {
         return null;

+ 8 - 0
x-pack/plugin/core/src/main/java/org/elasticsearch/protocol/xpack/license/PutLicenseRequest.java

@@ -7,12 +7,20 @@ package org.elasticsearch.protocol.xpack.license;
 
 import org.elasticsearch.action.ActionRequestValidationException;
 import org.elasticsearch.action.support.master.AcknowledgedRequest;
+import org.elasticsearch.common.io.stream.StreamInput;
+
+import java.io.IOException;
 
 public class PutLicenseRequest extends AcknowledgedRequest<PutLicenseRequest> {
 
     private String licenseDefinition;
     private boolean acknowledge = false;
 
+    public PutLicenseRequest(StreamInput in) throws IOException {
+        super(in);
+
+    }
+
     public PutLicenseRequest() {
 
     }

+ 12 - 11
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/TransportFreezeIndexAction.java

@@ -68,8 +68,8 @@ public final class TransportFreezeIndexAction extends
                                       IndexNameExpressionResolver indexNameExpressionResolver,
                                       DestructiveOperations destructiveOperations,
                                       TransportCloseIndexAction transportCloseIndexAction) {
-        super(FreezeIndexAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver,
-            FreezeRequest::new);
+        super(FreezeIndexAction.NAME, transportService, clusterService, threadPool, actionFilters, FreezeRequest::new,
+            indexNameExpressionResolver);
         this.destructiveOperations = destructiveOperations;
         this.indexStateService = indexStateService;
         this.transportCloseIndexAction = transportCloseIndexAction;
@@ -244,6 +244,16 @@ public final class TransportFreezeIndexAction extends
         private IndicesOptions indicesOptions = IndicesOptions.strictExpandOpen();
         private ActiveShardCount waitForActiveShards = ActiveShardCount.DEFAULT;
 
+        public FreezeRequest() {}
+
+        public FreezeRequest(StreamInput in) throws IOException {
+            super(in);
+            indicesOptions = IndicesOptions.readIndicesOptions(in);
+            indices = in.readStringArray();
+            freeze = in.readBoolean();
+            waitForActiveShards = ActiveShardCount.readFrom(in);
+        }
+
         public FreezeRequest(String... indices) {
             this.indices = indices;
         }
@@ -266,15 +276,6 @@ public final class TransportFreezeIndexAction extends
             return freeze;
         }
 
-        @Override
-        public void readFrom(StreamInput in) throws IOException {
-            super.readFrom(in);
-            indicesOptions = IndicesOptions.readIndicesOptions(in);
-            indices = in.readStringArray();
-            freeze = in.readBoolean();
-            waitForActiveShards = ActiveShardCount.readFrom(in);
-        }
-
         @Override
         public void writeTo(StreamOutput out) throws IOException {
             super.writeTo(out);

+ 8 - 0
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/indexlifecycle/StartILMRequest.java

@@ -8,9 +8,17 @@ package org.elasticsearch.xpack.core.indexlifecycle;
 
 import org.elasticsearch.action.ActionRequestValidationException;
 import org.elasticsearch.action.support.master.AcknowledgedRequest;
+import org.elasticsearch.common.io.stream.StreamInput;
+
+import java.io.IOException;
 
 public class StartILMRequest extends AcknowledgedRequest<StartILMRequest> {
 
+    public StartILMRequest(StreamInput in) throws IOException {
+        super(in);
+
+    }
+
     public StartILMRequest() {
     }
 

+ 8 - 0
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/indexlifecycle/StopILMRequest.java

@@ -8,9 +8,17 @@ package org.elasticsearch.xpack.core.indexlifecycle;
 
 import org.elasticsearch.action.ActionRequestValidationException;
 import org.elasticsearch.action.support.master.AcknowledgedRequest;
+import org.elasticsearch.common.io.stream.StreamInput;
+
+import java.io.IOException;
 
 public class StopILMRequest extends AcknowledgedRequest<StopILMRequest> {
 
+    public StopILMRequest(StreamInput in) throws IOException {
+        super(in);
+
+    }
+
     public StopILMRequest() {
     }
 

+ 5 - 6
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/indexlifecycle/action/DeleteLifecycleAction.java

@@ -53,6 +53,11 @@ public class DeleteLifecycleAction extends ActionType<DeleteLifecycleAction.Resp
             this.policyName = policyName;
         }
 
+        public Request(StreamInput in) throws IOException {
+            super(in);
+            policyName = in.readString();
+        }
+
         public Request() {
         }
 
@@ -65,12 +70,6 @@ public class DeleteLifecycleAction extends ActionType<DeleteLifecycleAction.Resp
             return null;
         }
 
-        @Override
-        public void readFrom(StreamInput in) throws IOException {
-            super.readFrom(in);
-            policyName = in.readString();
-        }
-
         @Override
         public void writeTo(StreamOutput out) throws IOException {
             super.writeTo(out);

+ 5 - 6
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/indexlifecycle/action/GetLifecycleAction.java

@@ -109,6 +109,11 @@ public class GetLifecycleAction extends StreamableResponseActionType<GetLifecycl
             this.policyNames = policyNames;
         }
 
+        public Request(StreamInput in) throws IOException {
+            super(in);
+            policyNames = in.readStringArray();
+        }
+
         public Request() {
             policyNames = Strings.EMPTY_ARRAY;
         }
@@ -122,12 +127,6 @@ public class GetLifecycleAction extends StreamableResponseActionType<GetLifecycl
             return null;
         }
 
-        @Override
-        public void readFrom(StreamInput in) throws IOException {
-            super.readFrom(in);
-            policyNames = in.readStringArray();
-        }
-
         @Override
         public void writeTo(StreamOutput out) throws IOException {
             super.writeTo(out);

+ 4 - 5
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/indexlifecycle/action/GetStatusAction.java

@@ -92,6 +92,10 @@ public class GetStatusAction extends StreamableResponseActionType<GetStatusActio
 
     public static class Request extends AcknowledgedRequest<Request> {
 
+        public Request(StreamInput in) throws IOException {
+            super(in);
+        }
+
         public Request() {
         }
 
@@ -100,11 +104,6 @@ public class GetStatusAction extends StreamableResponseActionType<GetStatusActio
             return null;
         }
 
-        @Override
-        public void readFrom(StreamInput in) throws IOException {
-            super.readFrom(in);
-        }
-
         @Override
         public void writeTo(StreamOutput out) throws IOException {
             super.writeTo(out);

+ 7 - 8
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/indexlifecycle/action/MoveToStepAction.java

@@ -73,6 +73,13 @@ public class MoveToStepAction extends ActionType<MoveToStepAction.Response> {
             this.nextStepKey = nextStepKey;
         }
 
+        public Request(StreamInput in) throws IOException {
+            super(in);
+            this.index = in.readString();
+            this.currentStepKey = new StepKey(in);
+            this.nextStepKey = new StepKey(in);
+        }
+
         public Request() {
         }
 
@@ -97,14 +104,6 @@ public class MoveToStepAction extends ActionType<MoveToStepAction.Response> {
             return PARSER.apply(parser, name);
         }
 
-        @Override
-        public void readFrom(StreamInput in) throws IOException {
-            super.readFrom(in);
-            this.index = in.readString();
-            this.currentStepKey = new StepKey(in);
-            this.nextStepKey = new StepKey(in);
-        }
-
         @Override
         public void writeTo(StreamOutput out) throws IOException {
             super.writeTo(out);

+ 5 - 6
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/indexlifecycle/action/PutLifecycleAction.java

@@ -62,6 +62,11 @@ public class PutLifecycleAction extends ActionType<PutLifecycleAction.Response>
             this.policy = policy;
         }
 
+        public Request(StreamInput in) throws IOException {
+            super(in);
+            policy = new LifecyclePolicy(in);
+        }
+
         public Request() {
         }
 
@@ -86,12 +91,6 @@ public class PutLifecycleAction extends ActionType<PutLifecycleAction.Response>
             return builder;
         }
 
-        @Override
-        public void readFrom(StreamInput in) throws IOException {
-            super.readFrom(in);
-            policy = new LifecyclePolicy(in);
-        }
-
         @Override
         public void writeTo(StreamOutput out) throws IOException {
             super.writeTo(out);

+ 6 - 7
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/indexlifecycle/action/RemoveIndexLifecyclePolicyAction.java

@@ -114,6 +114,12 @@ public class RemoveIndexLifecyclePolicyAction extends StreamableResponseActionTy
         private String[] indices;
         private IndicesOptions indicesOptions = IndicesOptions.strictExpandOpen();
 
+        public Request(StreamInput in) throws IOException {
+            super(in);
+            indices = in.readStringArray();
+            indicesOptions = IndicesOptions.readIndicesOptions(in);
+        }
+
         public Request() {
         }
 
@@ -148,13 +154,6 @@ public class RemoveIndexLifecyclePolicyAction extends StreamableResponseActionTy
             return null;
         }
 
-        @Override
-        public void readFrom(StreamInput in) throws IOException {
-            super.readFrom(in);
-            indices = in.readStringArray();
-            indicesOptions = IndicesOptions.readIndicesOptions(in);
-        }
-
         @Override
         public void writeTo(StreamOutput out) throws IOException {
             super.writeTo(out);

+ 6 - 7
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/indexlifecycle/action/RetryAction.java

@@ -54,6 +54,12 @@ public class RetryAction extends ActionType<RetryAction.Response> {
             this.indices = indices;
         }
 
+        public Request(StreamInput in) throws IOException {
+            super(in);
+            this.indices = in.readStringArray();
+            this.indicesOptions = IndicesOptions.readIndicesOptions(in);
+        }
+
         public Request() {
         }
 
@@ -83,13 +89,6 @@ public class RetryAction extends ActionType<RetryAction.Response> {
             return null;
         }
 
-        @Override
-        public void readFrom(StreamInput in) throws IOException {
-            super.readFrom(in);
-            this.indices = in.readStringArray();
-            this.indicesOptions = IndicesOptions.readIndicesOptions(in);
-        }
-
         @Override
         public void writeTo(StreamOutput out) throws IOException {
             super.writeTo(out);

+ 5 - 6
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteCalendarAction.java

@@ -39,6 +39,11 @@ public class DeleteCalendarAction extends ActionType<AcknowledgedResponse> {
 
         private String calendarId;
 
+        public Request(StreamInput in) throws IOException {
+            super(in);
+            calendarId = in.readString();
+        }
+
         public Request() {
         }
 
@@ -55,12 +60,6 @@ public class DeleteCalendarAction extends ActionType<AcknowledgedResponse> {
             return null;
         }
 
-        @Override
-        public void readFrom(StreamInput in) throws IOException {
-            super.readFrom(in);
-            calendarId = in.readString();
-        }
-
         @Override
         public void writeTo(StreamOutput out) throws IOException {
             super.writeTo(out);

+ 6 - 7
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteCalendarEventAction.java

@@ -39,6 +39,12 @@ public class DeleteCalendarEventAction extends ActionType<AcknowledgedResponse>
         private String calendarId;
         private String eventId;
 
+        public Request(StreamInput in) throws IOException {
+            super(in);
+            calendarId = in.readString();
+            eventId = in.readString();
+        }
+
         public Request() {
         }
 
@@ -60,13 +66,6 @@ public class DeleteCalendarEventAction extends ActionType<AcknowledgedResponse>
             return null;
         }
 
-        @Override
-        public void readFrom(StreamInput in) throws IOException {
-            super.readFrom(in);
-            calendarId = in.readString();
-            eventId = in.readString();
-        }
-
         @Override
         public void writeTo(StreamOutput out) throws IOException {
             super.writeTo(out);

+ 0 - 5
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteDatafeedAction.java

@@ -74,11 +74,6 @@ public class DeleteDatafeedAction extends ActionType<AcknowledgedResponse> {
             return null;
         }
 
-        @Override
-        public void readFrom(StreamInput in) throws IOException {
-            throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
-        }
-
         @Override
         public void writeTo(StreamOutput out) throws IOException {
             super.writeTo(out);

+ 5 - 6
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteFilterAction.java

@@ -41,6 +41,11 @@ public class DeleteFilterAction extends ActionType<AcknowledgedResponse> {
 
         private String filterId;
 
+        public Request(StreamInput in) throws IOException {
+            super(in);
+            filterId = in.readString();
+        }
+
         public Request() {
 
         }
@@ -58,12 +63,6 @@ public class DeleteFilterAction extends ActionType<AcknowledgedResponse> {
             return null;
         }
 
-        @Override
-        public void readFrom(StreamInput in) throws IOException {
-            super.readFrom(in);
-            filterId = in.readString();
-        }
-
         @Override
         public void writeTo(StreamOutput out) throws IOException {
             super.writeTo(out);

+ 7 - 8
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteForecastAction.java

@@ -40,6 +40,13 @@ public class DeleteForecastAction extends ActionType<AcknowledgedResponse> {
         private String forecastId;
         private boolean allowNoForecasts = true;
 
+        public Request(StreamInput in) throws IOException {
+            super(in);
+            jobId = in.readString();
+            forecastId = in.readString();
+            allowNoForecasts = in.readBoolean();
+        }
+
         public Request() {
         }
 
@@ -69,14 +76,6 @@ public class DeleteForecastAction extends ActionType<AcknowledgedResponse> {
             return null;
         }
 
-        @Override
-        public void readFrom(StreamInput in) throws IOException {
-            super.readFrom(in);
-            jobId = in.readString();
-            forecastId = in.readString();
-            allowNoForecasts = in.readBoolean();
-        }
-
         @Override
         public void writeTo(StreamOutput out) throws IOException {
             super.writeTo(out);

+ 0 - 5
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/DeleteJobAction.java

@@ -98,11 +98,6 @@ public class DeleteJobAction extends ActionType<AcknowledgedResponse> {
             return new JobDeletionTask(id, type, action, "delete-job-" + jobId, parentTaskId, headers);
         }
 
-        @Override
-        public void readFrom(StreamInput in) throws IOException {
-            throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
-        }
-
         @Override
         public void writeTo(StreamOutput out) throws IOException {
             super.writeTo(out);

+ 0 - 5
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutDataFrameAnalyticsAction.java

@@ -60,11 +60,6 @@ public class PutDataFrameAnalyticsAction extends ActionType<PutDataFrameAnalytic
             this.config = config;
         }
 
-        @Override
-        public void readFrom(StreamInput in) throws IOException {
-            throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
-        }
-
         @Override
         public void writeTo(StreamOutput out) throws IOException {
             super.writeTo(out);

+ 0 - 5
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutDatafeedAction.java

@@ -61,11 +61,6 @@ public class PutDatafeedAction extends ActionType<PutDatafeedAction.Response> {
             return null;
         }
 
-        @Override
-        public void readFrom(StreamInput in) throws IOException {
-            throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
-        }
-
         @Override
         public void writeTo(StreamOutput out) throws IOException {
             super.writeTo(out);

+ 0 - 5
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/PutJobAction.java

@@ -85,11 +85,6 @@ public class PutJobAction extends ActionType<PutJobAction.Response> {
             return null;
         }
 
-        @Override
-        public void readFrom(StreamInput in) throws IOException {
-            throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
-        }
-
         @Override
         public void writeTo(StreamOutput out) throws IOException {
             super.writeTo(out);

+ 0 - 5
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/RevertModelSnapshotAction.java

@@ -101,11 +101,6 @@ public class RevertModelSnapshotAction extends ActionType<RevertModelSnapshotAct
             return null;
         }
 
-        @Override
-        public void readFrom(StreamInput in) throws IOException {
-            throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
-        }
-
         @Override
         public void writeTo(StreamOutput out) throws IOException {
             super.writeTo(out);

+ 2 - 7
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/SetUpgradeModeAction.java

@@ -53,7 +53,8 @@ public class SetUpgradeModeAction extends ActionType<AcknowledgedResponse> {
         }
 
         public Request(StreamInput in) throws IOException {
-            readFrom(in);
+            super(in);
+            this.enabled = in.readBoolean();
         }
 
         public Request() {
@@ -68,12 +69,6 @@ public class SetUpgradeModeAction extends ActionType<AcknowledgedResponse> {
             return null;
         }
 
-        @Override
-        public void readFrom(StreamInput in) throws IOException {
-            super.readFrom(in);
-            this.enabled = in.readBoolean();
-        }
-
         @Override
         public void writeTo(StreamOutput out) throws IOException {
             super.writeTo(out);

+ 0 - 5
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateDatafeedAction.java

@@ -60,11 +60,6 @@ public class UpdateDatafeedAction extends ActionType<PutDatafeedAction.Response>
             return null;
         }
 
-        @Override
-        public void readFrom(StreamInput in) throws IOException {
-            throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
-        }
-
         @Override
         public void writeTo(StreamOutput out) throws IOException {
             super.writeTo(out);

+ 0 - 5
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/UpdateJobAction.java

@@ -88,11 +88,6 @@ public class UpdateJobAction extends ActionType<PutJobAction.Response> {
             return null;
         }
 
-        @Override
-        public void readFrom(StreamInput in) throws IOException {
-            throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
-        }
-
         @Override
         public void writeTo(StreamOutput out) throws IOException {
             super.writeTo(out);

+ 5 - 6
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/action/PutRollupJobAction.java

@@ -49,6 +49,11 @@ public class PutRollupJobAction extends ActionType<AcknowledgedResponse> {
             this.config = config;
         }
 
+        public Request(StreamInput in) throws IOException {
+            super(in);
+            this.config = new RollupJobConfig(in);
+        }
+
         public Request() {
 
         }
@@ -65,12 +70,6 @@ public class PutRollupJobAction extends ActionType<AcknowledgedResponse> {
             this.config = config;
         }
 
-        @Override
-        public void readFrom(StreamInput in) throws IOException {
-            super.readFrom(in);
-            this.config = new RollupJobConfig(in);
-        }
-
         @Override
         public void writeTo(StreamOutput out) throws IOException {
             super.writeTo(out);

+ 5 - 6
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/snapshotlifecycle/action/DeleteSnapshotLifecycleAction.java

@@ -35,6 +35,11 @@ public class DeleteSnapshotLifecycleAction extends ActionType<DeleteSnapshotLife
 
         private String lifecycleId;
 
+        public Request(StreamInput in) throws IOException {
+            super(in);
+            lifecycleId = in.readString();
+        }
+
         public Request() { }
 
         public Request(String lifecycleId) {
@@ -50,12 +55,6 @@ public class DeleteSnapshotLifecycleAction extends ActionType<DeleteSnapshotLife
             return null;
         }
 
-        @Override
-        public void readFrom(StreamInput in) throws IOException {
-            super.readFrom(in);
-            lifecycleId = in.readString();
-        }
-
         @Override
         public void writeTo(StreamOutput out) throws IOException {
             super.writeTo(out);

+ 5 - 6
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/snapshotlifecycle/action/ExecuteSnapshotLifecycleAction.java

@@ -45,18 +45,17 @@ public class ExecuteSnapshotLifecycleAction extends ActionType<ExecuteSnapshotLi
             this.lifecycleId = lifecycleId;
         }
 
+        public Request(StreamInput in) throws IOException {
+            super(in);
+            lifecycleId = in.readString();
+        }
+
         public Request() { }
 
         public String getLifecycleId() {
             return this.lifecycleId;
         }
 
-        @Override
-        public void readFrom(StreamInput in) throws IOException {
-            super.readFrom(in);
-            lifecycleId = in.readString();
-        }
-
         @Override
         public void writeTo(StreamOutput out) throws IOException {
             super.writeTo(out);

+ 5 - 6
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/snapshotlifecycle/action/GetSnapshotLifecycleAction.java

@@ -44,6 +44,11 @@ public class GetSnapshotLifecycleAction extends ActionType<GetSnapshotLifecycleA
             this.lifecycleIds = Objects.requireNonNull(lifecycleIds, "ids may not be null");
         }
 
+        public Request(StreamInput in) throws IOException {
+            super(in);
+            lifecycleIds = in.readStringArray();
+        }
+
         public Request() {
             this.lifecycleIds = Strings.EMPTY_ARRAY;
         }
@@ -57,12 +62,6 @@ public class GetSnapshotLifecycleAction extends ActionType<GetSnapshotLifecycleA
             return null;
         }
 
-        @Override
-        public void readFrom(StreamInput in) throws IOException {
-            super.readFrom(in);
-            lifecycleIds = in.readStringArray();
-        }
-
         @Override
         public void writeTo(StreamOutput out) throws IOException {
             super.writeTo(out);

+ 6 - 7
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/snapshotlifecycle/action/PutSnapshotLifecycleAction.java

@@ -45,6 +45,12 @@ public class PutSnapshotLifecycleAction extends ActionType<PutSnapshotLifecycleA
             this.lifecycle = lifecycle;
         }
 
+        public Request(StreamInput in) throws IOException {
+            super(in);
+            lifecycleId = in.readString();
+            lifecycle = new SnapshotLifecyclePolicy(in);
+        }
+
         public Request() { }
 
         public String getLifecycleId() {
@@ -59,13 +65,6 @@ public class PutSnapshotLifecycleAction extends ActionType<PutSnapshotLifecycleA
             return new Request(lifecycleId, SnapshotLifecyclePolicy.parse(parser, lifecycleId));
         }
 
-        @Override
-        public void readFrom(StreamInput in) throws IOException {
-            super.readFrom(in);
-            lifecycleId = in.readString();
-            lifecycle = new SnapshotLifecyclePolicy(in);
-        }
-
         @Override
         public void writeTo(StreamOutput out) throws IOException {
             super.writeTo(out);

+ 6 - 5
x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/indexlifecycle/StartILMRequestTests.java

@@ -6,18 +6,19 @@
 
 package org.elasticsearch.xpack.core.indexlifecycle;
 
-import org.elasticsearch.test.AbstractStreamableTestCase;
+import org.elasticsearch.common.io.stream.Writeable;
+import org.elasticsearch.test.AbstractWireSerializingTestCase;
 
-public class StartILMRequestTests extends AbstractStreamableTestCase<StartILMRequest> {
+public class StartILMRequestTests extends AbstractWireSerializingTestCase<StartILMRequest> {
 
     @Override
-    protected StartILMRequest createBlankInstance() {
+    protected StartILMRequest createTestInstance() {
         return new StartILMRequest();
     }
 
     @Override
-    protected StartILMRequest createTestInstance() {
-        return new StartILMRequest();
+    protected Writeable.Reader<StartILMRequest> instanceReader() {
+        return StartILMRequest::new;
     }
 
     public void testValidate() {

+ 6 - 5
x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/indexlifecycle/StopILMRequestTests.java

@@ -6,18 +6,19 @@
 
 package org.elasticsearch.xpack.core.indexlifecycle;
 
-import org.elasticsearch.test.AbstractStreamableTestCase;
+import org.elasticsearch.common.io.stream.Writeable;
+import org.elasticsearch.test.AbstractWireSerializingTestCase;
 
-public class StopILMRequestTests extends AbstractStreamableTestCase<StopILMRequest> {
+public class StopILMRequestTests extends AbstractWireSerializingTestCase<StopILMRequest> {
 
     @Override
-    protected StopILMRequest createBlankInstance() {
+    protected StopILMRequest createTestInstance() {
         return new StopILMRequest();
     }
 
     @Override
-    protected StopILMRequest createTestInstance() {
-        return new StopILMRequest();
+    protected Writeable.Reader<StopILMRequest> instanceReader() {
+        return StopILMRequest::new;
     }
 
     public void testValidate() {

+ 5 - 4
x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/indexlifecycle/action/DeleteLifecycleRequestTests.java

@@ -5,10 +5,11 @@
  */
 package org.elasticsearch.xpack.core.indexlifecycle.action;
 
-import org.elasticsearch.test.AbstractStreamableTestCase;
+import org.elasticsearch.common.io.stream.Writeable;
+import org.elasticsearch.test.AbstractWireSerializingTestCase;
 import org.elasticsearch.xpack.core.indexlifecycle.action.DeleteLifecycleAction.Request;
 
-public class DeleteLifecycleRequestTests extends AbstractStreamableTestCase<DeleteLifecycleAction.Request> {
+public class DeleteLifecycleRequestTests extends AbstractWireSerializingTestCase<Request> {
 
     @Override
     protected Request createTestInstance() {
@@ -16,8 +17,8 @@ public class DeleteLifecycleRequestTests extends AbstractStreamableTestCase<Dele
     }
 
     @Override
-    protected Request createBlankInstance() {
-        return new Request();
+    protected Writeable.Reader<Request> instanceReader() {
+        return Request::new;
     }
 
     @Override

+ 5 - 4
x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/indexlifecycle/action/GetLifecycleRequestTests.java

@@ -5,12 +5,13 @@
  */
 package org.elasticsearch.xpack.core.indexlifecycle.action;
 
-import org.elasticsearch.test.AbstractStreamableTestCase;
+import org.elasticsearch.common.io.stream.Writeable;
+import org.elasticsearch.test.AbstractWireSerializingTestCase;
 import org.elasticsearch.xpack.core.indexlifecycle.action.GetLifecycleAction.Request;
 
 import java.util.Arrays;
 
-public class GetLifecycleRequestTests extends AbstractStreamableTestCase<GetLifecycleAction.Request> {
+public class GetLifecycleRequestTests extends AbstractWireSerializingTestCase<Request> {
 
     @Override
     protected Request createTestInstance() {
@@ -18,8 +19,8 @@ public class GetLifecycleRequestTests extends AbstractStreamableTestCase<GetLife
     }
 
     @Override
-    protected Request createBlankInstance() {
-        return new Request();
+    protected Writeable.Reader<Request> instanceReader() {
+        return Request::new;
     }
 
     @Override

+ 5 - 4
x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/indexlifecycle/action/MoveToStepRequestTests.java

@@ -6,14 +6,15 @@
  */
 package org.elasticsearch.xpack.core.indexlifecycle.action;
 
+import org.elasticsearch.common.io.stream.Writeable;
 import org.elasticsearch.common.xcontent.XContentParser;
-import org.elasticsearch.test.AbstractStreamableXContentTestCase;
+import org.elasticsearch.test.AbstractSerializingTestCase;
 import org.elasticsearch.xpack.core.indexlifecycle.Step.StepKey;
 import org.elasticsearch.xpack.core.indexlifecycle.StepKeyTests;
 import org.elasticsearch.xpack.core.indexlifecycle.action.MoveToStepAction.Request;
 import org.junit.Before;
 
-public class MoveToStepRequestTests extends AbstractStreamableXContentTestCase<Request> {
+public class MoveToStepRequestTests extends AbstractSerializingTestCase<Request> {
 
     private String index;
     private static final StepKeyTests stepKeyTests = new StepKeyTests();
@@ -29,8 +30,8 @@ public class MoveToStepRequestTests extends AbstractStreamableXContentTestCase<R
     }
 
     @Override
-    protected Request createBlankInstance() {
-        return new Request();
+    protected Writeable.Reader<Request> instanceReader() {
+        return Request::new;
     }
 
     @Override

+ 5 - 4
x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/indexlifecycle/action/PutLifecycleRequestTests.java

@@ -8,9 +8,10 @@ package org.elasticsearch.xpack.core.indexlifecycle.action;
 import org.elasticsearch.cluster.ClusterModule;
 import org.elasticsearch.common.ParseField;
 import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
+import org.elasticsearch.common.io.stream.Writeable;
 import org.elasticsearch.common.xcontent.NamedXContentRegistry;
 import org.elasticsearch.common.xcontent.XContentParser;
-import org.elasticsearch.test.AbstractStreamableXContentTestCase;
+import org.elasticsearch.test.AbstractSerializingTestCase;
 import org.elasticsearch.xpack.core.indexlifecycle.AllocateAction;
 import org.elasticsearch.xpack.core.indexlifecycle.DeleteAction;
 import org.elasticsearch.xpack.core.indexlifecycle.ForceMergeAction;
@@ -32,7 +33,7 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 
-public class PutLifecycleRequestTests extends AbstractStreamableXContentTestCase<PutLifecycleAction.Request> {
+public class PutLifecycleRequestTests extends AbstractSerializingTestCase<Request> {
 
     private String lifecycleName;
 
@@ -47,8 +48,8 @@ public class PutLifecycleRequestTests extends AbstractStreamableXContentTestCase
     }
 
     @Override
-    protected Request createBlankInstance() {
-        return new Request();
+    protected Writeable.Reader<Request> instanceReader() {
+        return Request::new;
     }
 
     @Override

+ 6 - 5
x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/indexlifecycle/action/RemoveIndexLifecyclePolicyRequestTests.java

@@ -7,13 +7,14 @@
 package org.elasticsearch.xpack.core.indexlifecycle.action;
 
 import org.elasticsearch.action.support.IndicesOptions;
-import org.elasticsearch.test.AbstractStreamableTestCase;
+import org.elasticsearch.common.io.stream.Writeable;
+import org.elasticsearch.test.AbstractWireSerializingTestCase;
 import org.elasticsearch.xpack.core.indexlifecycle.action.RemoveIndexLifecyclePolicyAction.Request;
 
 import java.io.IOException;
 import java.util.Arrays;
 
-public class RemoveIndexLifecyclePolicyRequestTests extends AbstractStreamableTestCase<RemoveIndexLifecyclePolicyAction.Request> {
+public class RemoveIndexLifecyclePolicyRequestTests extends AbstractWireSerializingTestCase<Request> {
 
     @Override
     protected Request createTestInstance() {
@@ -30,10 +31,10 @@ public class RemoveIndexLifecyclePolicyRequestTests extends AbstractStreamableTe
     }
 
     @Override
-    protected Request createBlankInstance() {
-        return new Request();
+    protected Writeable.Reader<Request> instanceReader() {
+        return Request::new;
     }
-
+    
     @Override
     protected Request mutateInstance(Request instance) throws IOException {
         String[] indices = instance.indices();

+ 8 - 7
x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/indexlifecycle/action/RetryRequestTests.java

@@ -7,13 +7,14 @@
 package org.elasticsearch.xpack.core.indexlifecycle.action;
 
 import org.elasticsearch.action.support.IndicesOptions;
-import org.elasticsearch.test.AbstractStreamableTestCase;
+import org.elasticsearch.common.io.stream.Writeable;
+import org.elasticsearch.test.AbstractWireSerializingTestCase;
 import org.elasticsearch.xpack.core.indexlifecycle.action.RetryAction.Request;
 
 import java.io.IOException;
 import java.util.Arrays;
 
-public class RetryRequestTests extends AbstractStreamableTestCase<Request> {
+public class RetryRequestTests extends AbstractWireSerializingTestCase<Request> {
 
     @Override
     protected Request createTestInstance() {
@@ -29,6 +30,11 @@ public class RetryRequestTests extends AbstractStreamableTestCase<Request> {
         return request;
     }
 
+    @Override
+    protected Writeable.Reader<Request> instanceReader() {
+        return Request::new;
+    }
+
     @Override
     protected Request mutateInstance(Request instance) throws IOException {
         String[] indices = instance.indices();
@@ -50,9 +56,4 @@ public class RetryRequestTests extends AbstractStreamableTestCase<Request> {
         newRequest.indicesOptions(indicesOptions);
         return newRequest;
     }
-
-    @Override
-    protected Request createBlankInstance() {
-        return new Request();
-    }
 }

+ 5 - 4
x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/DeleteCalendarEventActionRequestTests.java

@@ -5,10 +5,11 @@
  */
 package org.elasticsearch.xpack.core.ml.action;
 
-import org.elasticsearch.test.AbstractStreamableTestCase;
+import org.elasticsearch.common.io.stream.Writeable;
+import org.elasticsearch.test.AbstractWireSerializingTestCase;
 import org.elasticsearch.xpack.core.ml.action.DeleteCalendarEventAction.Request;
 
-public class DeleteCalendarEventActionRequestTests extends AbstractStreamableTestCase<DeleteCalendarEventAction.Request> {
+public class DeleteCalendarEventActionRequestTests extends AbstractWireSerializingTestCase<Request> {
 
     @Override
     protected Request createTestInstance() {
@@ -16,7 +17,7 @@ public class DeleteCalendarEventActionRequestTests extends AbstractStreamableTes
     }
 
     @Override
-    protected Request createBlankInstance() {
-        return new Request();
+    protected Writeable.Reader<Request> instanceReader() {
+        return Request::new;
     }
 }

+ 1 - 1
x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/indexlifecycle/action/TransportDeleteLifecycleAction.java

@@ -46,7 +46,7 @@ public class TransportDeleteLifecycleAction extends TransportMasterNodeAction<Re
     public TransportDeleteLifecycleAction(TransportService transportService, ClusterService clusterService, ThreadPool threadPool,
                                           ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
         super(DeleteLifecycleAction.NAME, transportService, clusterService, threadPool, actionFilters,
-                indexNameExpressionResolver, Request::new);
+            Request::new, indexNameExpressionResolver);
     }
 
     @Override

+ 2 - 2
x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/indexlifecycle/action/TransportGetLifecycleAction.java

@@ -36,8 +36,8 @@ public class TransportGetLifecycleAction extends StreamableTransportMasterNodeAc
     @Inject
     public TransportGetLifecycleAction(TransportService transportService, ClusterService clusterService, ThreadPool threadPool,
                                        ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
-        super(GetLifecycleAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver,
-                Request::new);
+        super(GetLifecycleAction.NAME, transportService, clusterService, threadPool, actionFilters, Request::new,
+            indexNameExpressionResolver);
     }
 
     @Override

+ 1 - 1
x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/indexlifecycle/action/TransportGetStatusAction.java

@@ -30,7 +30,7 @@ public class TransportGetStatusAction extends StreamableTransportMasterNodeActio
     public TransportGetStatusAction(TransportService transportService, ClusterService clusterService, ThreadPool threadPool,
                                     ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
         super(GetStatusAction.NAME, transportService, clusterService, threadPool, actionFilters,
-            indexNameExpressionResolver, Request::new);
+            Request::new, indexNameExpressionResolver);
     }
 
     @Override

+ 2 - 2
x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/indexlifecycle/action/TransportMoveToStepAction.java

@@ -38,8 +38,8 @@ public class TransportMoveToStepAction extends TransportMasterNodeAction<Request
     public TransportMoveToStepAction(TransportService transportService, ClusterService clusterService, ThreadPool threadPool,
                                      ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
                                      IndexLifecycleService indexLifecycleService) {
-        super(MoveToStepAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver,
-            Request::new);
+        super(MoveToStepAction.NAME, transportService, clusterService, threadPool, actionFilters, Request::new,
+            indexNameExpressionResolver);
         this.indexLifecycleService = indexLifecycleService;
     }
 

+ 2 - 2
x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/indexlifecycle/action/TransportPutLifecycleAction.java

@@ -45,8 +45,8 @@ public class TransportPutLifecycleAction extends TransportMasterNodeAction<Reque
     @Inject
     public TransportPutLifecycleAction(TransportService transportService, ClusterService clusterService, ThreadPool threadPool,
                                        ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
-        super(PutLifecycleAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver,
-                Request::new);
+        super(PutLifecycleAction.NAME, transportService, clusterService, threadPool, actionFilters, Request::new,
+            indexNameExpressionResolver);
     }
 
     @Override

+ 1 - 1
x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/indexlifecycle/action/TransportRemoveIndexLifecyclePolicyAction.java

@@ -35,7 +35,7 @@ public class TransportRemoveIndexLifecyclePolicyAction extends StreamableTranspo
                                                      ThreadPool threadPool, ActionFilters actionFilters,
                                                      IndexNameExpressionResolver indexNameExpressionResolver) {
         super(RemoveIndexLifecyclePolicyAction.NAME, transportService, clusterService, threadPool, actionFilters,
-                indexNameExpressionResolver, Request::new);
+            Request::new, indexNameExpressionResolver);
     }
 
     @Override

+ 1 - 2
x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/indexlifecycle/action/TransportRetryAction.java

@@ -38,8 +38,7 @@ public class TransportRetryAction extends TransportMasterNodeAction<Request, Res
     public TransportRetryAction(TransportService transportService, ClusterService clusterService, ThreadPool threadPool,
                                 ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
                                 IndexLifecycleService indexLifecycleService) {
-        super(RetryAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver,
-                Request::new);
+        super(RetryAction.NAME, transportService, clusterService, threadPool, actionFilters, Request::new, indexNameExpressionResolver);
         this.indexLifecycleService = indexLifecycleService;
     }
 

+ 2 - 2
x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/indexlifecycle/action/TransportStartILMAction.java

@@ -33,8 +33,8 @@ public class TransportStartILMAction extends TransportMasterNodeAction<StartILMR
     @Inject
     public TransportStartILMAction(TransportService transportService, ClusterService clusterService, ThreadPool threadPool,
                                    ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
-        super(StartILMAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver,
-                StartILMRequest::new);
+        super(StartILMAction.NAME, transportService, clusterService, threadPool, actionFilters, StartILMRequest::new,
+            indexNameExpressionResolver);
     }
 
     @Override

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно