diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/ClearIndicesCacheAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/ClearIndicesCacheAction.java index 8f020df00ed..6c098353ec1 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/ClearIndicesCacheAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/ClearIndicesCacheAction.java @@ -19,19 +19,14 @@ package org.elasticsearch.action.admin.indices.cache.clear; -import org.elasticsearch.action.StreamableResponseActionType; +import org.elasticsearch.action.ActionType; -public class ClearIndicesCacheAction extends StreamableResponseActionType { +public class ClearIndicesCacheAction extends ActionType { public static final ClearIndicesCacheAction INSTANCE = new ClearIndicesCacheAction(); public static final String NAME = "indices:admin/cache/clear"; private ClearIndicesCacheAction() { - super(NAME); - } - - @Override - public ClearIndicesCacheResponse newResponse() { - return new ClearIndicesCacheResponse(); + super(NAME, ClearIndicesCacheResponse::new); } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/ClearIndicesCacheRequest.java b/server/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/ClearIndicesCacheRequest.java index df2c7d7d850..6eb4e6d61a1 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/ClearIndicesCacheRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/ClearIndicesCacheRequest.java @@ -34,8 +34,15 @@ public class ClearIndicesCacheRequest extends BroadcastRequest { +public class FlushAction extends ActionType { public static final FlushAction INSTANCE = new FlushAction(); public static final String NAME = "indices:admin/flush"; private FlushAction() { - super(NAME); - } - - @Override - public FlushResponse newResponse() { - return new FlushResponse(); + super(NAME, FlushResponse::new); } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/flush/FlushRequest.java b/server/src/main/java/org/elasticsearch/action/admin/indices/flush/FlushRequest.java index a6a72b92ce7..5b3fd965721 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/flush/FlushRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/flush/FlushRequest.java @@ -107,11 +107,6 @@ public class FlushRequest extends BroadcastRequest { out.writeBoolean(waitIfOngoing); } - @Override - public void readFrom(StreamInput in) throws IOException { - throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable"); - } - @Override public String toString() { return "FlushRequest{" + diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/flush/FlushResponse.java b/server/src/main/java/org/elasticsearch/action/admin/indices/flush/FlushResponse.java index c64abe61973..e6632e59d9e 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/flush/FlushResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/flush/FlushResponse.java @@ -21,9 +21,11 @@ package org.elasticsearch.action.admin.indices.flush; import org.elasticsearch.action.support.DefaultShardOperationFailedException; import org.elasticsearch.action.support.broadcast.BroadcastResponse; +import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.xcontent.ConstructingObjectParser; import org.elasticsearch.common.xcontent.XContentParser; +import java.io.IOException; import java.util.Arrays; import java.util.List; @@ -43,8 +45,8 @@ public class FlushResponse extends BroadcastResponse { declareBroadcastFields(PARSER); } - FlushResponse() { - + FlushResponse(StreamInput in) throws IOException { + super(in); } FlushResponse(int totalShards, int successfulShards, int failedShards, List shardFailures) { diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/flush/SyncedFlushRequest.java b/server/src/main/java/org/elasticsearch/action/admin/indices/flush/SyncedFlushRequest.java index 2862ae10e05..cb3333354b8 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/flush/SyncedFlushRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/flush/SyncedFlushRequest.java @@ -20,7 +20,9 @@ package org.elasticsearch.action.admin.indices.flush; import org.elasticsearch.action.support.broadcast.BroadcastRequest; +import org.elasticsearch.common.io.stream.StreamInput; +import java.io.IOException; import java.util.Arrays; /** @@ -43,6 +45,9 @@ public class SyncedFlushRequest extends BroadcastRequest { super(indices); } + public SyncedFlushRequest(StreamInput in) throws IOException { + super(in); + } @Override public String toString() { diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/flush/TransportSyncedFlushAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/flush/TransportSyncedFlushAction.java index c0fe0d020e4..989d679f905 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/flush/TransportSyncedFlushAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/flush/TransportSyncedFlushAction.java @@ -37,7 +37,7 @@ public class TransportSyncedFlushAction extends HandledTransportAction { +public class ForceMergeAction extends ActionType { public static final ForceMergeAction INSTANCE = new ForceMergeAction(); public static final String NAME = "indices:admin/forcemerge"; private ForceMergeAction() { - super(NAME); - } - - @Override - public ForceMergeResponse newResponse() { - return new ForceMergeResponse(); + super(NAME, ForceMergeResponse::new); } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/forcemerge/ForceMergeRequest.java b/server/src/main/java/org/elasticsearch/action/admin/indices/forcemerge/ForceMergeRequest.java index 91f965d6268..b7fa9094540 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/forcemerge/ForceMergeRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/forcemerge/ForceMergeRequest.java @@ -58,8 +58,11 @@ public class ForceMergeRequest extends BroadcastRequest { super(indices); } - public ForceMergeRequest() { - + public ForceMergeRequest(StreamInput in) throws IOException { + super(in); + maxNumSegments = in.readInt(); + onlyExpungeDeletes = in.readBoolean(); + flush = in.readBoolean(); } /** @@ -111,14 +114,6 @@ public class ForceMergeRequest extends BroadcastRequest { return this; } - @Override - public void readFrom(StreamInput in) throws IOException { - super.readFrom(in); - maxNumSegments = in.readInt(); - onlyExpungeDeletes = in.readBoolean(); - flush = in.readBoolean(); - } - @Override public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/forcemerge/ForceMergeResponse.java b/server/src/main/java/org/elasticsearch/action/admin/indices/forcemerge/ForceMergeResponse.java index 6ebbbbd34cd..a8860e61b9b 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/forcemerge/ForceMergeResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/forcemerge/ForceMergeResponse.java @@ -21,9 +21,11 @@ package org.elasticsearch.action.admin.indices.forcemerge; import org.elasticsearch.action.support.DefaultShardOperationFailedException; import org.elasticsearch.action.support.broadcast.BroadcastResponse; +import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.xcontent.ConstructingObjectParser; import org.elasticsearch.common.xcontent.XContentParser; +import java.io.IOException; import java.util.Arrays; import java.util.List; @@ -43,7 +45,8 @@ public class ForceMergeResponse extends BroadcastResponse { declareBroadcastFields(PARSER); } - ForceMergeResponse() { + ForceMergeResponse(StreamInput in) throws IOException { + super(in); } ForceMergeResponse(int totalShards, int successfulShards, int failedShards, List shardFailures) { diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/forcemerge/TransportForceMergeAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/forcemerge/TransportForceMergeAction.java index a7d4fd8cf4c..3affb65ffef 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/forcemerge/TransportForceMergeAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/forcemerge/TransportForceMergeAction.java @@ -69,9 +69,7 @@ public class TransportForceMergeAction @Override protected ForceMergeRequest readRequestFrom(StreamInput in) throws IOException { - final ForceMergeRequest request = new ForceMergeRequest(); - request.readFrom(in); - return request; + return new ForceMergeRequest(in); } @Override diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/recovery/RecoveryAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/recovery/RecoveryAction.java index e41a766aa4b..84f166ed661 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/recovery/RecoveryAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/recovery/RecoveryAction.java @@ -19,22 +19,17 @@ package org.elasticsearch.action.admin.indices.recovery; -import org.elasticsearch.action.StreamableResponseActionType; +import org.elasticsearch.action.ActionType; /** * Recovery information action */ -public class RecoveryAction extends StreamableResponseActionType { +public class RecoveryAction extends ActionType { public static final RecoveryAction INSTANCE = new RecoveryAction(); public static final String NAME = "indices:monitor/recovery"; private RecoveryAction() { - super(NAME); - } - - @Override - public RecoveryResponse newResponse() { - return new RecoveryResponse(); + super(NAME, RecoveryResponse::new); } } \ No newline at end of file diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/recovery/RecoveryRequest.java b/server/src/main/java/org/elasticsearch/action/admin/indices/recovery/RecoveryRequest.java index 78d2969c2fd..dca11b0d99a 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/recovery/RecoveryRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/recovery/RecoveryRequest.java @@ -42,6 +42,12 @@ public class RecoveryRequest extends BroadcastRequest { this(Strings.EMPTY_ARRAY); } + public RecoveryRequest(StreamInput in) throws IOException { + super(in); + detailed = in.readBoolean(); + activeOnly = in.readBoolean(); + } + /** * Constructs a request for recovery information for all shards for the given indices * @@ -95,11 +101,4 @@ public class RecoveryRequest extends BroadcastRequest { out.writeBoolean(detailed); out.writeBoolean(activeOnly); } - - @Override - public void readFrom(StreamInput in) throws IOException { - super.readFrom(in); - detailed = in.readBoolean(); - activeOnly = in.readBoolean(); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/recovery/RecoveryResponse.java b/server/src/main/java/org/elasticsearch/action/admin/indices/recovery/RecoveryResponse.java index 7c51edc4d95..c07071735e4 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/recovery/RecoveryResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/recovery/RecoveryResponse.java @@ -40,7 +40,19 @@ public class RecoveryResponse extends BroadcastResponse { private Map> shardRecoveryStates = new HashMap<>(); - public RecoveryResponse() { } + public RecoveryResponse(StreamInput in) throws IOException { + super(in); + int size = in.readVInt(); + for (int i = 0; i < size; i++) { + String s = in.readString(); + int listSize = in.readVInt(); + List list = new ArrayList<>(listSize); + for (int j = 0; j < listSize; j++) { + list.add(RecoveryState.readRecoveryState(in)); + } + shardRecoveryStates.put(s, list); + } + } /** * Constructs recovery information for a collection of indices and associated shards. Keeps track of how many total shards @@ -103,21 +115,6 @@ public class RecoveryResponse extends BroadcastResponse { } } - @Override - public void readFrom(StreamInput in) throws IOException { - super.readFrom(in); - int size = in.readVInt(); - for (int i = 0; i < size; i++) { - String s = in.readString(); - int listSize = in.readVInt(); - List list = new ArrayList<>(listSize); - for (int j = 0; j < listSize; j++) { - list.add(RecoveryState.readRecoveryState(in)); - } - shardRecoveryStates.put(s, list); - } - } - @Override public String toString() { return Strings.toString(this, true, true); diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/recovery/TransportRecoveryAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/recovery/TransportRecoveryAction.java index 0ff31f42b92..f948b6dd94a 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/recovery/TransportRecoveryAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/recovery/TransportRecoveryAction.java @@ -93,9 +93,7 @@ public class TransportRecoveryAction extends TransportBroadcastByNodeAction { +public class RefreshAction extends ActionType { public static final RefreshAction INSTANCE = new RefreshAction(); public static final String NAME = "indices:admin/refresh"; private RefreshAction() { - super(NAME); - } - - @Override - public RefreshResponse newResponse() { - return new RefreshResponse(); + super(NAME, RefreshResponse::new); } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/refresh/RefreshResponse.java b/server/src/main/java/org/elasticsearch/action/admin/indices/refresh/RefreshResponse.java index 20165d078c5..b220db2d21e 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/refresh/RefreshResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/refresh/RefreshResponse.java @@ -21,9 +21,11 @@ package org.elasticsearch.action.admin.indices.refresh; import org.elasticsearch.action.support.DefaultShardOperationFailedException; import org.elasticsearch.action.support.broadcast.BroadcastResponse; +import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.xcontent.ConstructingObjectParser; import org.elasticsearch.common.xcontent.XContentParser; +import java.io.IOException; import java.util.Arrays; import java.util.List; @@ -43,7 +45,8 @@ public class RefreshResponse extends BroadcastResponse { declareBroadcastFields(PARSER); } - RefreshResponse() { + RefreshResponse(StreamInput in) throws IOException { + super(in); } RefreshResponse(int totalShards, int successfulShards, int failedShards, List shardFailures) { diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentResponse.java b/server/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentResponse.java index cc68a4a7e34..5cb8accb317 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentResponse.java @@ -48,8 +48,12 @@ public class IndicesSegmentResponse extends BroadcastResponse { private Map indicesSegments; - IndicesSegmentResponse() { - + IndicesSegmentResponse(StreamInput in) throws IOException { + super(in); + shards = new ShardSegments[in.readVInt()]; + for (int i = 0; i < shards.length; i++) { + shards[i] = ShardSegments.readShardSegments(in); + } } IndicesSegmentResponse(ShardSegments[] shards, int totalShards, int successfulShards, int failedShards, @@ -82,16 +86,6 @@ public class IndicesSegmentResponse extends BroadcastResponse { return indicesSegments; } - - @Override - public void readFrom(StreamInput in) throws IOException { - super.readFrom(in); - shards = new ShardSegments[in.readVInt()]; - for (int i = 0; i < shards.length; i++) { - shards[i] = ShardSegments.readShardSegments(in); - } - } - @Override public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentsAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentsAction.java index edc9df6e912..7b169e672b2 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentsAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentsAction.java @@ -19,19 +19,14 @@ package org.elasticsearch.action.admin.indices.segments; -import org.elasticsearch.action.StreamableResponseActionType; +import org.elasticsearch.action.ActionType; -public class IndicesSegmentsAction extends StreamableResponseActionType { +public class IndicesSegmentsAction extends ActionType { public static final IndicesSegmentsAction INSTANCE = new IndicesSegmentsAction(); public static final String NAME = "indices:monitor/segments"; private IndicesSegmentsAction() { - super(NAME); - } - - @Override - public IndicesSegmentResponse newResponse() { - return new IndicesSegmentResponse(); + super(NAME, IndicesSegmentResponse::new); } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentsRequest.java b/server/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentsRequest.java index 570fa89e026..8c4e9e3bb45 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentsRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentsRequest.java @@ -34,6 +34,11 @@ public class IndicesSegmentsRequest extends BroadcastRequest { +public class IndicesStatsAction extends ActionType { public static final IndicesStatsAction INSTANCE = new IndicesStatsAction(); public static final String NAME = "indices:monitor/stats"; private IndicesStatsAction() { - super(NAME); - } - - @Override - public IndicesStatsResponse newResponse() { - return new IndicesStatsResponse(); + super(NAME, IndicesStatsResponse::new); } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsRequest.java b/server/src/main/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsRequest.java index b162a232585..345939900b8 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsRequest.java @@ -38,6 +38,15 @@ public class IndicesStatsRequest extends BroadcastRequest { private CommonStatsFlags flags = new CommonStatsFlags(); + public IndicesStatsRequest() { + super((String[])null); + } + + public IndicesStatsRequest(StreamInput in) throws IOException { + super(in); + flags = new CommonStatsFlags(in); + } + /** * Sets all flags to return all stats. */ @@ -281,10 +290,4 @@ public class IndicesStatsRequest extends BroadcastRequest { super.writeTo(out); flags.writeTo(out); } - - @Override - public void readFrom(StreamInput in) throws IOException { - super.readFrom(in); - flags = new CommonStatsFlags(in); - } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsResponse.java b/server/src/main/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsResponse.java index 0540bc3ad5c..91a7ec5d31c 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsResponse.java @@ -43,8 +43,9 @@ public class IndicesStatsResponse extends BroadcastResponse { private Map shardStatsMap; - IndicesStatsResponse() { - + IndicesStatsResponse(StreamInput in) throws IOException { + super(in); + shards = in.readArray(ShardStats::readShardStats, (size) -> new ShardStats[size]); } IndicesStatsResponse(ShardStats[] shards, int totalShards, int successfulShards, int failedShards, @@ -126,12 +127,6 @@ public class IndicesStatsResponse extends BroadcastResponse { return stats; } - @Override - public void readFrom(StreamInput in) throws IOException { - super.readFrom(in); - shards = in.readArray(ShardStats::readShardStats, (size) -> new ShardStats[size]); - } - @Override public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/stats/TransportIndicesStatsAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/stats/TransportIndicesStatsAction.java index 8371023738b..80c7377087e 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/stats/TransportIndicesStatsAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/stats/TransportIndicesStatsAction.java @@ -90,9 +90,7 @@ public class TransportIndicesStatsAction extends TransportBroadcastByNodeAction< @Override protected IndicesStatsRequest readRequestFrom(StreamInput in) throws IOException { - IndicesStatsRequest request = new IndicesStatsRequest(); - request.readFrom(in); - return request; + return new IndicesStatsRequest(in); } @Override diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/get/TransportUpgradeStatusAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/get/TransportUpgradeStatusAction.java index a09a46c2ab7..988e9401233 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/get/TransportUpgradeStatusAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/get/TransportUpgradeStatusAction.java @@ -89,9 +89,7 @@ public class TransportUpgradeStatusAction @Override protected UpgradeStatusRequest readRequestFrom(StreamInput in) throws IOException { - UpgradeStatusRequest request = new UpgradeStatusRequest(); - request.readFrom(in); - return request; + return new UpgradeStatusRequest(in); } @Override diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/get/UpgradeStatusAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/get/UpgradeStatusAction.java index f111e342aaf..27060c06192 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/get/UpgradeStatusAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/get/UpgradeStatusAction.java @@ -19,19 +19,14 @@ package org.elasticsearch.action.admin.indices.upgrade.get; -import org.elasticsearch.action.StreamableResponseActionType; +import org.elasticsearch.action.ActionType; -public class UpgradeStatusAction extends StreamableResponseActionType { +public class UpgradeStatusAction extends ActionType { public static final UpgradeStatusAction INSTANCE = new UpgradeStatusAction(); public static final String NAME = "indices:monitor/upgrade"; private UpgradeStatusAction() { - super(NAME); - } - - @Override - public UpgradeStatusResponse newResponse() { - return new UpgradeStatusResponse(); + super(NAME, UpgradeStatusResponse::new); } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/get/UpgradeStatusRequest.java b/server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/get/UpgradeStatusRequest.java index de4ea72c663..c42a9c11860 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/get/UpgradeStatusRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/get/UpgradeStatusRequest.java @@ -21,6 +21,9 @@ package org.elasticsearch.action.admin.indices.upgrade.get; import org.elasticsearch.action.support.broadcast.BroadcastRequest; import org.elasticsearch.common.Strings; +import org.elasticsearch.common.io.stream.StreamInput; + +import java.io.IOException; public class UpgradeStatusRequest extends BroadcastRequest { @@ -28,6 +31,10 @@ public class UpgradeStatusRequest extends BroadcastRequest this(Strings.EMPTY_ARRAY); } + public UpgradeStatusRequest(StreamInput in) throws IOException { + super(in); + } + public UpgradeStatusRequest(String... indices) { super(indices); } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/get/UpgradeStatusResponse.java b/server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/get/UpgradeStatusResponse.java index 76a85a24163..3533799019c 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/get/UpgradeStatusResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/get/UpgradeStatusResponse.java @@ -39,7 +39,12 @@ public class UpgradeStatusResponse extends BroadcastResponse { private Map indicesUpgradeStatus; - UpgradeStatusResponse() { + UpgradeStatusResponse(StreamInput in) throws IOException { + super(in); + shards = new ShardUpgradeStatus[in.readVInt()]; + for (int i = 0; i < shards.length; i++) { + shards[i] = ShardUpgradeStatus.readShardUpgradeStatus(in); + } } UpgradeStatusResponse(ShardUpgradeStatus[] shards, int totalShards, int successfulShards, int failedShards, @@ -72,15 +77,6 @@ public class UpgradeStatusResponse extends BroadcastResponse { return indicesUpgradeStats; } - @Override - public void readFrom(StreamInput in) throws IOException { - super.readFrom(in); - shards = new ShardUpgradeStatus[in.readVInt()]; - for (int i = 0; i < shards.length; i++) { - shards[i] = ShardUpgradeStatus.readShardUpgradeStatus(in); - } - } - @Override public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/post/TransportUpgradeAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/post/TransportUpgradeAction.java index b122350c3e6..32880c8dad2 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/post/TransportUpgradeAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/post/TransportUpgradeAction.java @@ -137,9 +137,7 @@ public class TransportUpgradeAction extends TransportBroadcastByNodeAction { +public class UpgradeAction extends ActionType { public static final UpgradeAction INSTANCE = new UpgradeAction(); public static final String NAME = "indices:admin/upgrade"; private UpgradeAction() { - super(NAME); - } - - @Override - public UpgradeResponse newResponse() { - return new UpgradeResponse(); + super(NAME, UpgradeResponse::new); } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/post/UpgradeRequest.java b/server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/post/UpgradeRequest.java index 6a0288b78d4..1cb14ca6fd4 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/post/UpgradeRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/post/UpgradeRequest.java @@ -49,13 +49,8 @@ public class UpgradeRequest extends BroadcastRequest { super(indices); } - public UpgradeRequest() { - - } - - @Override - public void readFrom(StreamInput in) throws IOException { - super.readFrom(in); + public UpgradeRequest(StreamInput in) throws IOException { + super(in); upgradeOnlyAncientSegments = in.readBoolean(); } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/post/UpgradeResponse.java b/server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/post/UpgradeResponse.java index 4a760e273a0..9dacda2f16f 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/post/UpgradeResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/upgrade/post/UpgradeResponse.java @@ -41,19 +41,8 @@ public class UpgradeResponse extends BroadcastResponse { private Map> versions; - UpgradeResponse() { - - } - - UpgradeResponse(Map> versions, int totalShards, int successfulShards, int failedShards, - List shardFailures) { - super(totalShards, successfulShards, failedShards, shardFailures); - this.versions = versions; - } - - @Override - public void readFrom(StreamInput in) throws IOException { - super.readFrom(in); + UpgradeResponse(StreamInput in) throws IOException { + super(in); int size = in.readVInt(); versions = new HashMap<>(); for (int i=0; i> versions, int totalShards, int successfulShards, int failedShards, + List shardFailures) { + super(totalShards, successfulShards, failedShards, shardFailures); + this.versions = versions; + } + @Override public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/validate/query/ValidateQueryAction.java b/server/src/main/java/org/elasticsearch/action/admin/indices/validate/query/ValidateQueryAction.java index 713f9400364..07421d17931 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/validate/query/ValidateQueryAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/validate/query/ValidateQueryAction.java @@ -19,19 +19,14 @@ package org.elasticsearch.action.admin.indices.validate.query; -import org.elasticsearch.action.StreamableResponseActionType; +import org.elasticsearch.action.ActionType; -public class ValidateQueryAction extends StreamableResponseActionType { +public class ValidateQueryAction extends ActionType { public static final ValidateQueryAction INSTANCE = new ValidateQueryAction(); public static final String NAME = "indices:admin/validate/query"; private ValidateQueryAction() { - super(NAME); - } - - @Override - public ValidateQueryResponse newResponse() { - return new ValidateQueryResponse(); + super(NAME, ValidateQueryResponse::new); } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/validate/query/ValidateQueryRequest.java b/server/src/main/java/org/elasticsearch/action/admin/indices/validate/query/ValidateQueryRequest.java index 4f993e40d0b..06965beb44d 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/validate/query/ValidateQueryRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/validate/query/ValidateQueryRequest.java @@ -55,6 +55,21 @@ public class ValidateQueryRequest extends BroadcastRequest this(Strings.EMPTY_ARRAY); } + public ValidateQueryRequest(StreamInput in) throws IOException { + super(in); + query = in.readNamedWriteable(QueryBuilder.class); + int typesSize = in.readVInt(); + if (typesSize > 0) { + types = new String[typesSize]; + for (int i = 0; i < typesSize; i++) { + types[i] = in.readString(); + } + } + explain = in.readBoolean(); + rewrite = in.readBoolean(); + allShards = in.readBoolean(); + } + /** * Constructs a new validate request against the provided indices. No indices provided means it will * run against all indices. @@ -150,22 +165,6 @@ public class ValidateQueryRequest extends BroadcastRequest return allShards; } - @Override - public void readFrom(StreamInput in) throws IOException { - super.readFrom(in); - query = in.readNamedWriteable(QueryBuilder.class); - int typesSize = in.readVInt(); - if (typesSize > 0) { - types = new String[typesSize]; - for (int i = 0; i < typesSize; i++) { - types[i] = in.readString(); - } - } - explain = in.readBoolean(); - rewrite = in.readBoolean(); - allShards = in.readBoolean(); - } - @Override public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/validate/query/ValidateQueryResponse.java b/server/src/main/java/org/elasticsearch/action/admin/indices/validate/query/ValidateQueryResponse.java index f766e1d9c6a..5b8995766c1 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/validate/query/ValidateQueryResponse.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/validate/query/ValidateQueryResponse.java @@ -77,8 +77,16 @@ public class ValidateQueryResponse extends BroadcastResponse { private List queryExplanations; - ValidateQueryResponse() { - + ValidateQueryResponse(StreamInput in) throws IOException { + super(in); + valid = in.readBoolean(); + int size = in.readVInt(); + if (size > 0) { + queryExplanations = new ArrayList<>(size); + for (int i = 0; i < size; i++) { + queryExplanations.add(readQueryExplanation(in)); + } + } } ValidateQueryResponse(boolean valid, List queryExplanations, int totalShards, int successfulShards, int failedShards, @@ -108,19 +116,6 @@ public class ValidateQueryResponse extends BroadcastResponse { return queryExplanations; } - @Override - public void readFrom(StreamInput in) throws IOException { - super.readFrom(in); - valid = in.readBoolean(); - int size = in.readVInt(); - if (size > 0) { - queryExplanations = new ArrayList<>(size); - for (int i = 0; i < size; i++) { - queryExplanations.add(readQueryExplanation(in)); - } - } - } - @Override public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); diff --git a/server/src/main/java/org/elasticsearch/action/support/broadcast/BroadcastRequest.java b/server/src/main/java/org/elasticsearch/action/support/broadcast/BroadcastRequest.java index d19b28036b9..8875c2400f0 100644 --- a/server/src/main/java/org/elasticsearch/action/support/broadcast/BroadcastRequest.java +++ b/server/src/main/java/org/elasticsearch/action/support/broadcast/BroadcastRequest.java @@ -33,16 +33,13 @@ public class BroadcastRequest> extends protected String[] indices; private IndicesOptions indicesOptions = IndicesOptions.strictExpandOpenAndForbidClosed(); - public BroadcastRequest() { - } - public BroadcastRequest(StreamInput in) throws IOException { super(in); indices = in.readStringArray(); indicesOptions = IndicesOptions.readIndicesOptions(in); } - protected BroadcastRequest(String[] indices) { + protected BroadcastRequest(String... indices) { this.indices = indices; } @@ -87,9 +84,7 @@ public class BroadcastRequest> extends } @Override - public void readFrom(StreamInput in) throws IOException { - super.readFrom(in); - indices = in.readStringArray(); - indicesOptions = IndicesOptions.readIndicesOptions(in); + public final void readFrom(StreamInput in) throws IOException { + throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable " + getClass().getName()); } } diff --git a/server/src/main/java/org/elasticsearch/action/support/broadcast/BroadcastResponse.java b/server/src/main/java/org/elasticsearch/action/support/broadcast/BroadcastResponse.java index 1cf1488f822..92ac04d333c 100644 --- a/server/src/main/java/org/elasticsearch/action/support/broadcast/BroadcastResponse.java +++ b/server/src/main/java/org/elasticsearch/action/support/broadcast/BroadcastResponse.java @@ -66,7 +66,19 @@ public class BroadcastResponse extends ActionResponse implements ToXContentObjec PARSER.declareObject(constructorArg(), shardsParser, _SHARDS_FIELD); } - public BroadcastResponse() { + public BroadcastResponse() {} + + public BroadcastResponse(StreamInput in) throws IOException { + totalShards = in.readVInt(); + successfulShards = in.readVInt(); + failedShards = in.readVInt(); + int size = in.readVInt(); + if (size > 0) { + shardFailures = new DefaultShardOperationFailedException[size]; + for (int i = 0; i < size; i++) { + shardFailures[i] = readShardOperationFailed(in); + } + } } public BroadcastResponse(int totalShards, int successfulShards, int failedShards, @@ -121,18 +133,8 @@ public class BroadcastResponse extends ActionResponse implements ToXContentObjec } @Override - public void readFrom(StreamInput in) throws IOException { - super.readFrom(in); - totalShards = in.readVInt(); - successfulShards = in.readVInt(); - failedShards = in.readVInt(); - int size = in.readVInt(); - if (size > 0) { - shardFailures = new DefaultShardOperationFailedException[size]; - for (int i = 0; i < size; i++) { - shardFailures[i] = readShardOperationFailed(in); - } - } + public final void readFrom(StreamInput in) throws IOException { + throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable"); } @Override diff --git a/server/src/main/java/org/elasticsearch/action/support/broadcast/TransportBroadcastAction.java b/server/src/main/java/org/elasticsearch/action/support/broadcast/TransportBroadcastAction.java index 5731b0e9d8e..14423ad6d93 100644 --- a/server/src/main/java/org/elasticsearch/action/support/broadcast/TransportBroadcastAction.java +++ b/server/src/main/java/org/elasticsearch/action/support/broadcast/TransportBroadcastAction.java @@ -37,6 +37,7 @@ import org.elasticsearch.cluster.routing.ShardRouting; import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.Nullable; import org.elasticsearch.common.io.stream.StreamInput; +import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.tasks.Task; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportChannel; @@ -66,9 +67,9 @@ public abstract class TransportBroadcastAction< protected TransportBroadcastAction(String actionName, ClusterService clusterService, TransportService transportService, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver, Supplier request, + IndexNameExpressionResolver indexNameExpressionResolver, Writeable.Reader request, Supplier shardRequest, String shardExecutor) { - super(actionName, transportService, request, actionFilters); + super(actionName, transportService, actionFilters, request); this.clusterService = clusterService; this.transportService = transportService; this.indexNameExpressionResolver = indexNameExpressionResolver; diff --git a/server/src/main/java/org/elasticsearch/action/support/broadcast/node/TransportBroadcastByNodeAction.java b/server/src/main/java/org/elasticsearch/action/support/broadcast/node/TransportBroadcastByNodeAction.java index 10f748083b7..8652838e312 100644 --- a/server/src/main/java/org/elasticsearch/action/support/broadcast/node/TransportBroadcastByNodeAction.java +++ b/server/src/main/java/org/elasticsearch/action/support/broadcast/node/TransportBroadcastByNodeAction.java @@ -43,6 +43,7 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Streamable; +import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.tasks.Task; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.NodeShouldNotConnectException; @@ -61,7 +62,6 @@ import java.util.List; import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReferenceArray; -import java.util.function.Supplier; /** * Abstraction for transporting aggregated shard-level operations in a single request (NodeRequest) per-node @@ -90,7 +90,7 @@ public abstract class TransportBroadcastByNodeAction request, + Writeable.Reader request, String executor) { this(actionName, clusterService, transportService, actionFilters, indexNameExpressionResolver, request, executor, true); } @@ -101,10 +101,10 @@ public abstract class TransportBroadcastByNodeAction request, + Writeable.Reader request, String executor, boolean canTripCircuitBreaker) { - super(actionName, canTripCircuitBreaker, transportService, request, actionFilters); + super(actionName, canTripCircuitBreaker, transportService, actionFilters, request); this.clusterService = clusterService; this.transportService = transportService; @@ -314,9 +314,7 @@ public abstract class TransportBroadcastByNodeAction() { @Override public NodeResponse read(StreamInput in) throws IOException { - NodeResponse nodeResponse = new NodeResponse(); - nodeResponse.readFrom(in); - return nodeResponse; + return new NodeResponse(in); } @Override @@ -505,7 +503,16 @@ public abstract class TransportBroadcastByNodeAction exceptions; protected List results; - NodeResponse() { + NodeResponse(StreamInput in) throws IOException { + super(in); + nodeId = in.readString(); + totalShards = in.readVInt(); + results = in.readList((stream) -> stream.readBoolean() ? readShardResult(stream) : null); + if (in.readBoolean()) { + exceptions = in.readList(BroadcastShardOperationFailedException::new); + } else { + exceptions = null; + } } NodeResponse(String nodeId, @@ -536,15 +543,7 @@ public abstract class TransportBroadcastByNodeAction stream.readBoolean() ? readShardResult(stream) : null); - if (in.readBoolean()) { - exceptions = in.readList(BroadcastShardOperationFailedException::new); - } else { - exceptions = null; - } + throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable"); } @Override diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsResponseTests.java b/server/src/test/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsResponseTests.java index 99850699ec2..00274929407 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsResponseTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsResponseTests.java @@ -46,7 +46,7 @@ import static org.hamcrest.object.HasToString.hasToString; public class IndicesStatsResponseTests extends ESTestCase { public void testInvalidLevel() { - final IndicesStatsResponse response = new IndicesStatsResponse(); + final IndicesStatsResponse response = new IndicesStatsResponse(null, 0, 0, 0, null); final String level = randomAlphaOfLength(16); final ToXContent.Params params = new ToXContent.MapParams(Collections.singletonMap("level", level)); final IllegalArgumentException e = expectThrows(IllegalArgumentException.class, diff --git a/server/src/test/java/org/elasticsearch/action/support/broadcast/node/TransportBroadcastByNodeActionTests.java b/server/src/test/java/org/elasticsearch/action/support/broadcast/node/TransportBroadcastByNodeActionTests.java index 8aca4d7105e..b6fbbc97fae 100644 --- a/server/src/test/java/org/elasticsearch/action/support/broadcast/node/TransportBroadcastByNodeActionTests.java +++ b/server/src/test/java/org/elasticsearch/action/support/broadcast/node/TransportBroadcastByNodeActionTests.java @@ -48,6 +48,7 @@ import org.elasticsearch.cluster.routing.ShardsIterator; import org.elasticsearch.cluster.routing.TestShardRouting; import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.io.stream.StreamInput; +import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.Index; import org.elasticsearch.index.shard.ShardId; @@ -74,7 +75,6 @@ import java.util.Map; import java.util.Set; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; -import java.util.function.Supplier; import static java.util.Collections.emptyMap; import static java.util.Collections.emptySet; @@ -96,16 +96,19 @@ public class TransportBroadcastByNodeActionTests extends ESTestCase { private TestTransportBroadcastByNodeAction action; public static class Request extends BroadcastRequest { - public Request() { + + public Request(StreamInput in) throws IOException { + super(in); } - public Request(String[] indices) { + public Request(String... indices) { super(indices); } } public static class Response extends BroadcastResponse { - public Response() { + public Response(StreamInput in) throws IOException { + super(in); } public Response(int totalShards, int successfulShards, int failedShards, List shardFailures) { @@ -118,7 +121,7 @@ public class TransportBroadcastByNodeActionTests extends ESTestCase { private final Map shards = new HashMap<>(); TestTransportBroadcastByNodeAction(TransportService transportService, ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver, Supplier request, + IndexNameExpressionResolver indexNameExpressionResolver, Writeable.Reader request, String executor) { super("indices:admin/test", TransportBroadcastByNodeActionTests.this.clusterService, transportService, actionFilters, indexNameExpressionResolver, request, executor); @@ -138,9 +141,7 @@ public class TransportBroadcastByNodeActionTests extends ESTestCase { @Override protected Request readRequestFrom(StreamInput in) throws IOException { - final Request request = new Request(); - request.readFrom(in); - return request; + return new Request(in); } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/ReloadAnalyzersRequest.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/ReloadAnalyzersRequest.java index 8721abd3403..31e99ec9d85 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/ReloadAnalyzersRequest.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/ReloadAnalyzersRequest.java @@ -6,7 +6,9 @@ package org.elasticsearch.xpack.core.action; import org.elasticsearch.action.support.broadcast.BroadcastRequest; +import org.elasticsearch.common.io.stream.StreamInput; +import java.io.IOException; import java.util.Arrays; import java.util.Objects; @@ -22,6 +24,10 @@ public class ReloadAnalyzersRequest extends BroadcastRequest shardFailures, Map reloadedIndicesNodes) { super(totalShards, successfulShards, failedShards, shardFailures); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/TransportReloadAnalyzersAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/TransportReloadAnalyzersAction.java index 4ae7b45db73..2064c212e81 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/TransportReloadAnalyzersAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/TransportReloadAnalyzersAction.java @@ -84,9 +84,7 @@ public class TransportReloadAnalyzersAction @Override protected ReloadAnalyzersRequest readRequestFrom(StreamInput in) throws IOException { - final ReloadAnalyzersRequest request = new ReloadAnalyzersRequest(); - request.readFrom(in); - return request; + return new ReloadAnalyzersRequest(in); } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/ForgetFollowerAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/ForgetFollowerAction.java index a86ac8abf56..1d4792aa447 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/ForgetFollowerAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ccr/action/ForgetFollowerAction.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.core.ccr.action; import org.elasticsearch.action.ActionRequestValidationException; -import org.elasticsearch.action.StreamableResponseActionType; +import org.elasticsearch.action.ActionType; import org.elasticsearch.action.support.broadcast.BroadcastRequest; import org.elasticsearch.action.support.broadcast.BroadcastResponse; import org.elasticsearch.common.ParseField; @@ -19,18 +19,13 @@ import org.elasticsearch.common.xcontent.XContentParser; import java.io.IOException; import java.util.Objects; -public class ForgetFollowerAction extends StreamableResponseActionType { +public class ForgetFollowerAction extends ActionType { public static final String NAME = "indices:admin/xpack/ccr/forget_follower"; public static final ForgetFollowerAction INSTANCE = new ForgetFollowerAction(); private ForgetFollowerAction() { - super(NAME); - } - - @Override - public BroadcastResponse newResponse() { - return new BroadcastResponse(); + super(NAME, BroadcastResponse::new); } /** @@ -115,8 +110,13 @@ public class ForgetFollowerAction extends StreamableResponseActionType newRandomMonitoringDocs(int nb) {