Ensure replication response/requests implement writeable (#44392) (#44446)

This commit cleans up replication response and request so that the base
class does not allow subclasses to implement Streamable.

relates #34389
This commit is contained in:
Ryan Ernst 2019-07-16 12:53:08 -07:00 committed by GitHub
parent 901310a826
commit c26edb4c43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 2 additions and 57 deletions

View File

@ -171,11 +171,6 @@ public class TransportVerifyShardBeforeCloseAction extends TransportReplicationA
return "verify shard " + shardId + " before close with block " + clusterBlock;
}
@Override
public void readFrom(final StreamInput in) {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public void writeTo(final StreamOutput out) throws IOException {
super.writeTo(out);

View File

@ -46,11 +46,6 @@ public class ShardFlushRequest extends ReplicationRequest<ShardFlushRequest> {
return request;
}
@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);

View File

@ -84,11 +84,6 @@ public class BulkShardRequest extends ReplicatedWriteRequest<BulkShardRequest> {
}
}
@Override
public void readFrom(StreamInput in) {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public String toString() {
// This is included in error messages so we'll try to make it somewhat user friendly.

View File

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

View File

@ -630,11 +630,6 @@ public class IndexRequest extends ReplicatedWriteRequest<IndexRequest> implement
routing(metaData.resolveWriteIndexRouting(routing, index));
}
@Override
public void readFrom(StreamInput in) {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);

View File

@ -84,11 +84,6 @@ public final class ResyncReplicationRequest extends ReplicatedWriteRequest<Resyn
return operations;
}
@Override
public void readFrom(final StreamInput in) {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public void writeTo(final StreamOutput out) throws IOException {
super.writeTo(out);

View File

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

View File

@ -188,7 +188,7 @@ public abstract class ReplicationRequest<Request extends ReplicationRequest<Requ
}
@Override
public void readFrom(StreamInput in) throws IOException {
public final void readFrom(StreamInput in) throws IOException {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}

View File

@ -58,7 +58,7 @@ public class ReplicationResponse extends ActionResponse {
}
@Override
public void readFrom(StreamInput in) throws IOException {
public final void readFrom(StreamInput in) throws IOException {
throw new UnsupportedOperationException("Streamable no longer used");
}

View File

@ -167,11 +167,6 @@ public class RetentionLeaseBackgroundSyncAction extends TransportReplicationActi
waitForActiveShards(ActiveShardCount.NONE);
}
@Override
public void readFrom(final StreamInput in) {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public void writeTo(final StreamOutput out) throws IOException {
super.writeTo(Objects.requireNonNull(out));

View File

@ -169,11 +169,6 @@ public class RetentionLeaseSyncAction extends
waitForActiveShards(ActiveShardCount.NONE);
}
@Override
public void readFrom(final StreamInput in) {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public void writeTo(final StreamOutput out) throws IOException {
super.writeTo(Objects.requireNonNull(out));

View File

@ -1210,11 +1210,6 @@ public class TransportReplicationActionTests extends ESTestCase {
super.writeTo(out);
}
@Override
public void readFrom(StreamInput in) throws IOException {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public void onRetry() {
super.onRetry();

View File

@ -50,11 +50,6 @@ public final class BulkShardOperationsRequest extends ReplicatedWriteRequest<Bul
return maxSeqNoOfUpdatesOrDeletes;
}
@Override
public void readFrom(final StreamInput in) {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public void writeTo(final StreamOutput out) throws IOException {
super.writeTo(out);