Clean up ShardId usage of Streamable (#41843)
ShardId already implements Writeable so there is no need for it to implement Streamable too. Also the readShardId static method can be easily replaced with direct usages of the constructor that takes a StreamInput as argument.
This commit is contained in:
parent
96ba0b13e0
commit
29c9bb9181
|
@ -260,7 +260,7 @@ public abstract class DocWriteResponse extends ReplicationResponse implements Wr
|
||||||
@Override
|
@Override
|
||||||
public void readFrom(StreamInput in) throws IOException {
|
public void readFrom(StreamInput in) throws IOException {
|
||||||
super.readFrom(in);
|
super.readFrom(in);
|
||||||
shardId = ShardId.readShardId(in);
|
shardId = new ShardId(in);
|
||||||
type = in.readString();
|
type = in.readString();
|
||||||
id = in.readString();
|
id = in.readString();
|
||||||
version = in.readZLong();
|
version = in.readZLong();
|
||||||
|
|
|
@ -40,7 +40,7 @@ public class ClusterSearchShardsGroup implements Writeable, ToXContentObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
ClusterSearchShardsGroup(StreamInput in) throws IOException {
|
ClusterSearchShardsGroup(StreamInput in) throws IOException {
|
||||||
shardId = ShardId.readShardId(in);
|
shardId = new ShardId(in);
|
||||||
shards = new ShardRouting[in.readVInt()];
|
shards = new ShardRouting[in.readVInt()];
|
||||||
for (int i = 0; i < shards.length; i++) {
|
for (int i = 0; i < shards.length; i++) {
|
||||||
shards[i] = new ShardRouting(shardId, in);
|
shards[i] = new ShardRouting(shardId, in);
|
||||||
|
|
|
@ -214,7 +214,7 @@ public class TransportNodesSnapshotsStatus extends TransportNodesAction<Transpor
|
||||||
int numberOfShards = in.readVInt();
|
int numberOfShards = in.readVInt();
|
||||||
Map<ShardId, SnapshotIndexShardStatus> shardMapBuilder = new HashMap<>(numberOfShards);
|
Map<ShardId, SnapshotIndexShardStatus> shardMapBuilder = new HashMap<>(numberOfShards);
|
||||||
for (int j = 0; j < numberOfShards; j++) {
|
for (int j = 0; j < numberOfShards; j++) {
|
||||||
ShardId shardId = ShardId.readShardId(in);
|
ShardId shardId = new ShardId(in);
|
||||||
SnapshotIndexShardStatus status = SnapshotIndexShardStatus.readShardSnapshotStatus(in);
|
SnapshotIndexShardStatus status = SnapshotIndexShardStatus.readShardSnapshotStatus(in);
|
||||||
shardMapBuilder.put(shardId, status);
|
shardMapBuilder.put(shardId, status);
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,7 +90,7 @@ public class IndexShardStats implements Iterable<ShardStats>, Streamable {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void readFrom(StreamInput in) throws IOException {
|
public void readFrom(StreamInput in) throws IOException {
|
||||||
shardId = ShardId.readShardId(in);
|
shardId = new ShardId(in);
|
||||||
int shardSize = in.readVInt();
|
int shardSize = in.readVInt();
|
||||||
shards = new ShardStats[shardSize];
|
shards = new ShardStats[shardSize];
|
||||||
for (int i = 0; i < shardSize; i++) {
|
for (int i = 0; i < shardSize; i++) {
|
||||||
|
|
|
@ -68,7 +68,7 @@ class ShardUpgradeResult implements Streamable {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void readFrom(StreamInput in) throws IOException {
|
public void readFrom(StreamInput in) throws IOException {
|
||||||
shardId = ShardId.readShardId(in);
|
shardId = new ShardId(in);
|
||||||
primary = in.readBoolean();
|
primary = in.readBoolean();
|
||||||
upgradeVersion = Version.readVersion(in);
|
upgradeVersion = Version.readVersion(in);
|
||||||
try {
|
try {
|
||||||
|
@ -86,4 +86,4 @@ class ShardUpgradeResult implements Streamable {
|
||||||
Version.writeVersion(upgradeVersion, out);
|
Version.writeVersion(upgradeVersion, out);
|
||||||
out.writeString(oldestLuceneSegment.toString());
|
out.writeString(oldestLuceneSegment.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,7 +67,7 @@ public class BulkShardResponse extends ReplicationResponse implements WriteRespo
|
||||||
@Override
|
@Override
|
||||||
public void readFrom(StreamInput in) throws IOException {
|
public void readFrom(StreamInput in) throws IOException {
|
||||||
super.readFrom(in);
|
super.readFrom(in);
|
||||||
shardId = ShardId.readShardId(in);
|
shardId = new ShardId(in);
|
||||||
responses = new BulkItemResponse[in.readVInt()];
|
responses = new BulkItemResponse[in.readVInt()];
|
||||||
for (int i = 0; i < responses.length; i++) {
|
for (int i = 0; i < responses.length; i++) {
|
||||||
responses[i] = BulkItemResponse.readBulkItem(in);
|
responses[i] = BulkItemResponse.readBulkItem(in);
|
||||||
|
|
|
@ -65,7 +65,7 @@ public abstract class BroadcastShardRequest extends TransportRequest implements
|
||||||
@Override
|
@Override
|
||||||
public void readFrom(StreamInput in) throws IOException {
|
public void readFrom(StreamInput in) throws IOException {
|
||||||
super.readFrom(in);
|
super.readFrom(in);
|
||||||
shardId = ShardId.readShardId(in);
|
shardId = new ShardId(in);
|
||||||
originalIndices = OriginalIndices.readOriginalIndices(in);
|
originalIndices = OriginalIndices.readOriginalIndices(in);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ public abstract class BroadcastShardResponse extends TransportResponse {
|
||||||
@Override
|
@Override
|
||||||
public void readFrom(StreamInput in) throws IOException {
|
public void readFrom(StreamInput in) throws IOException {
|
||||||
super.readFrom(in);
|
super.readFrom(in);
|
||||||
shardId = ShardId.readShardId(in);
|
shardId = new ShardId(in);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -57,4 +57,4 @@ public abstract class BroadcastShardResponse extends TransportResponse {
|
||||||
super.writeTo(out);
|
super.writeTo(out);
|
||||||
shardId.writeTo(out);
|
shardId.writeTo(out);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,7 +69,7 @@ public abstract class ReplicationRequest<Request extends ReplicationRequest<Requ
|
||||||
public ReplicationRequest(StreamInput in) throws IOException {
|
public ReplicationRequest(StreamInput in) throws IOException {
|
||||||
super(in);
|
super(in);
|
||||||
if (in.readBoolean()) {
|
if (in.readBoolean()) {
|
||||||
shardId = ShardId.readShardId(in);
|
shardId = new ShardId(in);
|
||||||
} else {
|
} else {
|
||||||
shardId = null;
|
shardId = null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -269,7 +269,7 @@ public class ReplicationResponse extends ActionResponse {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void readFrom(StreamInput in) throws IOException {
|
public void readFrom(StreamInput in) throws IOException {
|
||||||
shardId = ShardId.readShardId(in);
|
shardId = new ShardId(in);
|
||||||
super.shardId = shardId.getId();
|
super.shardId = shardId.getId();
|
||||||
index = shardId.getIndexName();
|
index = shardId.getIndexName();
|
||||||
nodeId = in.readOptionalString();
|
nodeId = in.readOptionalString();
|
||||||
|
|
|
@ -114,7 +114,7 @@ public abstract class InstanceShardOperationRequest<Request extends InstanceShar
|
||||||
super.readFrom(in);
|
super.readFrom(in);
|
||||||
index = in.readString();
|
index = in.readString();
|
||||||
if (in.readBoolean()) {
|
if (in.readBoolean()) {
|
||||||
shardId = ShardId.readShardId(in);
|
shardId = new ShardId(in);
|
||||||
} else {
|
} else {
|
||||||
shardId = null;
|
shardId = null;
|
||||||
}
|
}
|
||||||
|
@ -126,7 +126,7 @@ public abstract class InstanceShardOperationRequest<Request extends InstanceShar
|
||||||
public void writeTo(StreamOutput out) throws IOException {
|
public void writeTo(StreamOutput out) throws IOException {
|
||||||
super.writeTo(out);
|
super.writeTo(out);
|
||||||
out.writeString(index);
|
out.writeString(index);
|
||||||
out.writeOptionalStreamable(shardId);
|
out.writeOptionalWriteable(shardId);
|
||||||
out.writeTimeValue(timeout);
|
out.writeTimeValue(timeout);
|
||||||
out.writeOptionalString(concreteIndex);
|
out.writeOptionalString(concreteIndex);
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,7 +97,7 @@ public abstract class SingleShardRequest<Request extends SingleShardRequest<Requ
|
||||||
public void readFrom(StreamInput in) throws IOException {
|
public void readFrom(StreamInput in) throws IOException {
|
||||||
super.readFrom(in);
|
super.readFrom(in);
|
||||||
if (in.readBoolean()) {
|
if (in.readBoolean()) {
|
||||||
internalShardId = ShardId.readShardId(in);
|
internalShardId = new ShardId(in);
|
||||||
}
|
}
|
||||||
index = in.readOptionalString();
|
index = in.readOptionalString();
|
||||||
// no need to pass threading over the network, they are always false when coming throw a thread pool
|
// no need to pass threading over the network, they are always false when coming throw a thread pool
|
||||||
|
@ -106,9 +106,8 @@ public abstract class SingleShardRequest<Request extends SingleShardRequest<Requ
|
||||||
@Override
|
@Override
|
||||||
public void writeTo(StreamOutput out) throws IOException {
|
public void writeTo(StreamOutput out) throws IOException {
|
||||||
super.writeTo(out);
|
super.writeTo(out);
|
||||||
out.writeOptionalStreamable(internalShardId);
|
out.writeOptionalWriteable(internalShardId);
|
||||||
out.writeOptionalString(index);
|
out.writeOptionalString(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -451,7 +451,7 @@ public class RestoreInProgress extends AbstractNamedDiffable<Custom> implements
|
||||||
ImmutableOpenMap.Builder<ShardId, ShardRestoreStatus> builder = ImmutableOpenMap.builder();
|
ImmutableOpenMap.Builder<ShardId, ShardRestoreStatus> builder = ImmutableOpenMap.builder();
|
||||||
int shards = in.readVInt();
|
int shards = in.readVInt();
|
||||||
for (int j = 0; j < shards; j++) {
|
for (int j = 0; j < shards; j++) {
|
||||||
ShardId shardId = ShardId.readShardId(in);
|
ShardId shardId = new ShardId(in);
|
||||||
ShardRestoreStatus shardState = ShardRestoreStatus.readShardRestoreStatus(in);
|
ShardRestoreStatus shardState = ShardRestoreStatus.readShardRestoreStatus(in);
|
||||||
builder.put(shardId, shardState);
|
builder.put(shardId, shardState);
|
||||||
}
|
}
|
||||||
|
|
|
@ -432,7 +432,7 @@ public class SnapshotsInProgress extends AbstractNamedDiffable<Custom> implement
|
||||||
ImmutableOpenMap.Builder<ShardId, ShardSnapshotStatus> builder = ImmutableOpenMap.builder();
|
ImmutableOpenMap.Builder<ShardId, ShardSnapshotStatus> builder = ImmutableOpenMap.builder();
|
||||||
int shards = in.readVInt();
|
int shards = in.readVInt();
|
||||||
for (int j = 0; j < shards; j++) {
|
for (int j = 0; j < shards; j++) {
|
||||||
ShardId shardId = ShardId.readShardId(in);
|
ShardId shardId = new ShardId(in);
|
||||||
if (in.getVersion().onOrAfter(Version.V_6_0_0_beta1)) {
|
if (in.getVersion().onOrAfter(Version.V_6_0_0_beta1)) {
|
||||||
builder.put(shardId, new ShardSnapshotStatus(in));
|
builder.put(shardId, new ShardSnapshotStatus(in));
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -397,7 +397,7 @@ public class ShardStateAction {
|
||||||
|
|
||||||
FailedShardEntry(StreamInput in) throws IOException {
|
FailedShardEntry(StreamInput in) throws IOException {
|
||||||
super(in);
|
super(in);
|
||||||
shardId = ShardId.readShardId(in);
|
shardId = new ShardId(in);
|
||||||
allocationId = in.readString();
|
allocationId = in.readString();
|
||||||
primaryTerm = in.readVLong();
|
primaryTerm = in.readVLong();
|
||||||
message = in.readString();
|
message = in.readString();
|
||||||
|
@ -601,7 +601,7 @@ public class ShardStateAction {
|
||||||
|
|
||||||
StartedShardEntry(StreamInput in) throws IOException {
|
StartedShardEntry(StreamInput in) throws IOException {
|
||||||
super(in);
|
super(in);
|
||||||
shardId = ShardId.readShardId(in);
|
shardId = new ShardId(in);
|
||||||
allocationId = in.readString();
|
allocationId = in.readString();
|
||||||
if (in.getVersion().before(Version.V_6_3_0)) {
|
if (in.getVersion().before(Version.V_6_3_0)) {
|
||||||
primaryTerm = in.readVLong();
|
primaryTerm = in.readVLong();
|
||||||
|
|
|
@ -279,7 +279,7 @@ public final class ShardRouting implements Writeable, ToXContentObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
public ShardRouting(StreamInput in) throws IOException {
|
public ShardRouting(StreamInput in) throws IOException {
|
||||||
this(ShardId.readShardId(in), in);
|
this(new ShardId(in), in);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -186,7 +186,7 @@ public class TransportNodesListGatewayStartedShards extends
|
||||||
@Override
|
@Override
|
||||||
public void readFrom(StreamInput in) throws IOException {
|
public void readFrom(StreamInput in) throws IOException {
|
||||||
super.readFrom(in);
|
super.readFrom(in);
|
||||||
shardId = ShardId.readShardId(in);
|
shardId = new ShardId(in);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -230,7 +230,7 @@ public class TransportNodesListGatewayStartedShards extends
|
||||||
@Override
|
@Override
|
||||||
public void readFrom(StreamInput in) throws IOException {
|
public void readFrom(StreamInput in) throws IOException {
|
||||||
super.readFrom(in);
|
super.readFrom(in);
|
||||||
shardId = ShardId.readShardId(in);
|
shardId = new ShardId(in);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -301,7 +301,7 @@ public class RetentionLeaseActions {
|
||||||
@Override
|
@Override
|
||||||
public void readFrom(final StreamInput in) throws IOException {
|
public void readFrom(final StreamInput in) throws IOException {
|
||||||
super.readFrom(in);
|
super.readFrom(in);
|
||||||
shardId = ShardId.readShardId(in);
|
shardId = new ShardId(in);
|
||||||
id = in.readString();
|
id = in.readString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,6 @@ package org.elasticsearch.index.shard;
|
||||||
import org.elasticsearch.cluster.metadata.IndexMetaData;
|
import org.elasticsearch.cluster.metadata.IndexMetaData;
|
||||||
import org.elasticsearch.common.io.stream.StreamInput;
|
import org.elasticsearch.common.io.stream.StreamInput;
|
||||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||||
import org.elasticsearch.common.io.stream.Streamable;
|
|
||||||
import org.elasticsearch.common.io.stream.Writeable;
|
import org.elasticsearch.common.io.stream.Writeable;
|
||||||
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
import org.elasticsearch.common.xcontent.ToXContentFragment;
|
||||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||||
|
@ -33,20 +32,12 @@ import java.io.IOException;
|
||||||
/**
|
/**
|
||||||
* Allows for shard level components to be injected with the shard id.
|
* Allows for shard level components to be injected with the shard id.
|
||||||
*/
|
*/
|
||||||
public class ShardId implements Streamable, Comparable<ShardId>, ToXContentFragment, Writeable {
|
public class ShardId implements Comparable<ShardId>, ToXContentFragment, Writeable {
|
||||||
|
|
||||||
private final Index index;
|
private final Index index;
|
||||||
|
|
||||||
private final int shardId;
|
private final int shardId;
|
||||||
|
|
||||||
private final int hashCode;
|
private final int hashCode;
|
||||||
|
|
||||||
public ShardId(StreamInput in) throws IOException {
|
|
||||||
index = new Index(in);
|
|
||||||
shardId = in.readVInt();
|
|
||||||
hashCode = computeHashCode();
|
|
||||||
}
|
|
||||||
|
|
||||||
public ShardId(Index index, int shardId) {
|
public ShardId(Index index, int shardId) {
|
||||||
this.index = index;
|
this.index = index;
|
||||||
this.shardId = shardId;
|
this.shardId = shardId;
|
||||||
|
@ -57,6 +48,18 @@ public class ShardId implements Streamable, Comparable<ShardId>, ToXContentFragm
|
||||||
this(new Index(index, indexUUID), shardId);
|
this(new Index(index, indexUUID), shardId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ShardId(StreamInput in) throws IOException {
|
||||||
|
index = new Index(in);
|
||||||
|
shardId = in.readVInt();
|
||||||
|
hashCode = computeHashCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeTo(StreamOutput out) throws IOException {
|
||||||
|
index.writeTo(out);
|
||||||
|
out.writeVInt(shardId);
|
||||||
|
}
|
||||||
|
|
||||||
public Index getIndex() {
|
public Index getIndex() {
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
@ -113,21 +116,6 @@ public class ShardId implements Streamable, Comparable<ShardId>, ToXContentFragm
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ShardId readShardId(StreamInput in) throws IOException {
|
|
||||||
return new ShardId(in);
|
|
||||||
}
|
|
||||||
|
|
||||||
@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 {
|
|
||||||
index.writeTo(out);
|
|
||||||
out.writeVInt(shardId);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int compareTo(ShardId o) {
|
public int compareTo(ShardId o) {
|
||||||
if (o.getId() == shardId) {
|
if (o.getId() == shardId) {
|
||||||
|
|
|
@ -149,7 +149,7 @@ public class ShardsSyncedFlushResult implements Streamable {
|
||||||
shardResponses.put(shardRouting, response);
|
shardResponses.put(shardRouting, response);
|
||||||
}
|
}
|
||||||
syncId = in.readOptionalString();
|
syncId = in.readOptionalString();
|
||||||
shardId = ShardId.readShardId(in);
|
shardId = new ShardId(in);
|
||||||
totalShards = in.readInt();
|
totalShards = in.readInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -567,7 +567,7 @@ public class SyncedFlushService implements IndexEventListener {
|
||||||
@Override
|
@Override
|
||||||
public void readFrom(StreamInput in) throws IOException {
|
public void readFrom(StreamInput in) throws IOException {
|
||||||
super.readFrom(in);
|
super.readFrom(in);
|
||||||
this.shardId = ShardId.readShardId(in);
|
this.shardId = new ShardId(in);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ShardId shardId() {
|
public ShardId shardId() {
|
||||||
|
@ -647,7 +647,7 @@ public class SyncedFlushService implements IndexEventListener {
|
||||||
@Override
|
@Override
|
||||||
public void readFrom(StreamInput in) throws IOException {
|
public void readFrom(StreamInput in) throws IOException {
|
||||||
super.readFrom(in);
|
super.readFrom(in);
|
||||||
shardId = ShardId.readShardId(in);
|
shardId = new ShardId(in);
|
||||||
expectedCommitId = new Engine.CommitId(in);
|
expectedCommitId = new Engine.CommitId(in);
|
||||||
syncId = in.readString();
|
syncId = in.readString();
|
||||||
}
|
}
|
||||||
|
@ -749,7 +749,7 @@ public class SyncedFlushService implements IndexEventListener {
|
||||||
@Override
|
@Override
|
||||||
public void readFrom(StreamInput in) throws IOException {
|
public void readFrom(StreamInput in) throws IOException {
|
||||||
super.readFrom(in);
|
super.readFrom(in);
|
||||||
shardId = ShardId.readShardId(in);
|
shardId = new ShardId(in);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -49,7 +49,7 @@ public class RecoveryCleanFilesRequest extends TransportRequest {
|
||||||
RecoveryCleanFilesRequest(StreamInput in) throws IOException {
|
RecoveryCleanFilesRequest(StreamInput in) throws IOException {
|
||||||
super(in);
|
super(in);
|
||||||
recoveryId = in.readLong();
|
recoveryId = in.readLong();
|
||||||
shardId = ShardId.readShardId(in);
|
shardId = new ShardId(in);
|
||||||
snapshotFiles = new Store.MetadataSnapshot(in);
|
snapshotFiles = new Store.MetadataSnapshot(in);
|
||||||
totalTranslogOps = in.readVInt();
|
totalTranslogOps = in.readVInt();
|
||||||
if (in.getVersion().onOrAfter(Version.V_7_2_0)) {
|
if (in.getVersion().onOrAfter(Version.V_7_2_0)) {
|
||||||
|
|
|
@ -96,7 +96,7 @@ public final class RecoveryFileChunkRequest extends TransportRequest {
|
||||||
public void readFrom(StreamInput in) throws IOException {
|
public void readFrom(StreamInput in) throws IOException {
|
||||||
super.readFrom(in);
|
super.readFrom(in);
|
||||||
recoveryId = in.readLong();
|
recoveryId = in.readLong();
|
||||||
shardId = ShardId.readShardId(in);
|
shardId = new ShardId(in);
|
||||||
String name = in.readString();
|
String name = in.readString();
|
||||||
position = in.readVLong();
|
position = in.readVLong();
|
||||||
long length = in.readVLong();
|
long length = in.readVLong();
|
||||||
|
|
|
@ -66,7 +66,7 @@ public class RecoveryFilesInfoRequest extends TransportRequest {
|
||||||
public void readFrom(StreamInput in) throws IOException {
|
public void readFrom(StreamInput in) throws IOException {
|
||||||
super.readFrom(in);
|
super.readFrom(in);
|
||||||
recoveryId = in.readLong();
|
recoveryId = in.readLong();
|
||||||
shardId = ShardId.readShardId(in);
|
shardId = new ShardId(in);
|
||||||
int size = in.readVInt();
|
int size = in.readVInt();
|
||||||
phase1FileNames = new ArrayList<>(size);
|
phase1FileNames = new ArrayList<>(size);
|
||||||
for (int i = 0; i < size; i++) {
|
for (int i = 0; i < size; i++) {
|
||||||
|
|
|
@ -59,7 +59,7 @@ public class RecoveryFinalizeRecoveryRequest extends TransportRequest {
|
||||||
public void readFrom(StreamInput in) throws IOException {
|
public void readFrom(StreamInput in) throws IOException {
|
||||||
super.readFrom(in);
|
super.readFrom(in);
|
||||||
recoveryId = in.readLong();
|
recoveryId = in.readLong();
|
||||||
shardId = ShardId.readShardId(in);
|
shardId = new ShardId(in);
|
||||||
if (in.getVersion().onOrAfter(Version.V_6_0_0_alpha1)) {
|
if (in.getVersion().onOrAfter(Version.V_6_0_0_alpha1)) {
|
||||||
globalCheckpoint = in.readZLong();
|
globalCheckpoint = in.readZLong();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -72,7 +72,7 @@ class RecoveryHandoffPrimaryContextRequest extends TransportRequest {
|
||||||
public void readFrom(final StreamInput in) throws IOException {
|
public void readFrom(final StreamInput in) throws IOException {
|
||||||
super.readFrom(in);
|
super.readFrom(in);
|
||||||
recoveryId = in.readLong();
|
recoveryId = in.readLong();
|
||||||
shardId = ShardId.readShardId(in);
|
shardId = new ShardId(in);
|
||||||
primaryContext = new ReplicationTracker.PrimaryContext(in);
|
primaryContext = new ReplicationTracker.PrimaryContext(in);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ class RecoveryPrepareForTranslogOperationsRequest extends TransportRequest {
|
||||||
RecoveryPrepareForTranslogOperationsRequest(StreamInput in) throws IOException {
|
RecoveryPrepareForTranslogOperationsRequest(StreamInput in) throws IOException {
|
||||||
super.readFrom(in);
|
super.readFrom(in);
|
||||||
recoveryId = in.readLong();
|
recoveryId = in.readLong();
|
||||||
shardId = ShardId.readShardId(in);
|
shardId = new ShardId(in);
|
||||||
totalTranslogOps = in.readVInt();
|
totalTranslogOps = in.readVInt();
|
||||||
if (in.getVersion().before(Version.V_6_0_0_alpha1)) {
|
if (in.getVersion().before(Version.V_6_0_0_alpha1)) {
|
||||||
in.readLong(); // maxUnsafeAutoIdTimestamp
|
in.readLong(); // maxUnsafeAutoIdTimestamp
|
||||||
|
|
|
@ -136,7 +136,7 @@ public class RecoveryState implements ToXContentFragment, Streamable, Writeable
|
||||||
public RecoveryState(StreamInput in) throws IOException {
|
public RecoveryState(StreamInput in) throws IOException {
|
||||||
timer = new Timer(in);
|
timer = new Timer(in);
|
||||||
stage = Stage.fromId(in.readByte());
|
stage = Stage.fromId(in.readByte());
|
||||||
shardId = ShardId.readShardId(in);
|
shardId = new ShardId(in);
|
||||||
recoverySource = RecoverySource.readFrom(in);
|
recoverySource = RecoverySource.readFrom(in);
|
||||||
targetNode = new DiscoveryNode(in);
|
targetNode = new DiscoveryNode(in);
|
||||||
sourceNode = in.readOptionalWriteable(DiscoveryNode::new);
|
sourceNode = in.readOptionalWriteable(DiscoveryNode::new);
|
||||||
|
|
|
@ -102,7 +102,7 @@ public class RecoveryTranslogOperationsRequest extends TransportRequest {
|
||||||
RecoveryTranslogOperationsRequest(StreamInput in) throws IOException {
|
RecoveryTranslogOperationsRequest(StreamInput in) throws IOException {
|
||||||
super.readFrom(in);
|
super.readFrom(in);
|
||||||
recoveryId = in.readLong();
|
recoveryId = in.readLong();
|
||||||
shardId = ShardId.readShardId(in);
|
shardId = new ShardId(in);
|
||||||
operations = Translog.readOperations(in, "recovery");
|
operations = Translog.readOperations(in, "recovery");
|
||||||
totalTranslogOps = in.readVInt();
|
totalTranslogOps = in.readVInt();
|
||||||
if (in.getVersion().onOrAfter(Version.V_6_5_0)) {
|
if (in.getVersion().onOrAfter(Version.V_6_5_0)) {
|
||||||
|
|
|
@ -56,7 +56,7 @@ public class RecoveryWaitForClusterStateRequest extends TransportRequest {
|
||||||
public void readFrom(StreamInput in) throws IOException {
|
public void readFrom(StreamInput in) throws IOException {
|
||||||
super.readFrom(in);
|
super.readFrom(in);
|
||||||
recoveryId = in.readLong();
|
recoveryId = in.readLong();
|
||||||
shardId = ShardId.readShardId(in);
|
shardId = new ShardId(in);
|
||||||
clusterStateVersion = in.readVLong();
|
clusterStateVersion = in.readVLong();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -115,7 +115,7 @@ public class StartRecoveryRequest extends TransportRequest {
|
||||||
public void readFrom(StreamInput in) throws IOException {
|
public void readFrom(StreamInput in) throws IOException {
|
||||||
super.readFrom(in);
|
super.readFrom(in);
|
||||||
recoveryId = in.readLong();
|
recoveryId = in.readLong();
|
||||||
shardId = ShardId.readShardId(in);
|
shardId = new ShardId(in);
|
||||||
targetAllocationId = in.readString();
|
targetAllocationId = in.readString();
|
||||||
sourceNode = new DiscoveryNode(in);
|
sourceNode = new DiscoveryNode(in);
|
||||||
targetNode = new DiscoveryNode(in);
|
targetNode = new DiscoveryNode(in);
|
||||||
|
|
|
@ -412,7 +412,7 @@ public class IndicesStore implements ClusterStateListener, Closeable {
|
||||||
super.readFrom(in);
|
super.readFrom(in);
|
||||||
clusterName = new ClusterName(in);
|
clusterName = new ClusterName(in);
|
||||||
indexUUID = in.readString();
|
indexUUID = in.readString();
|
||||||
shardId = ShardId.readShardId(in);
|
shardId = new ShardId(in);
|
||||||
timeout = new TimeValue(in.readLong(), TimeUnit.MILLISECONDS);
|
timeout = new TimeValue(in.readLong(), TimeUnit.MILLISECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -213,7 +213,7 @@ public class TransportNodesListShardStoreMetaData extends TransportNodesAction<T
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void readFrom(StreamInput in) throws IOException {
|
public void readFrom(StreamInput in) throws IOException {
|
||||||
shardId = ShardId.readShardId(in);
|
shardId = new ShardId(in);
|
||||||
this.metadataSnapshot = new Store.MetadataSnapshot(in);
|
this.metadataSnapshot = new Store.MetadataSnapshot(in);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -255,7 +255,7 @@ public class TransportNodesListShardStoreMetaData extends TransportNodesAction<T
|
||||||
@Override
|
@Override
|
||||||
public void readFrom(StreamInput in) throws IOException {
|
public void readFrom(StreamInput in) throws IOException {
|
||||||
super.readFrom(in);
|
super.readFrom(in);
|
||||||
shardId = ShardId.readShardId(in);
|
shardId = new ShardId(in);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -298,7 +298,7 @@ public class TransportNodesListShardStoreMetaData extends TransportNodesAction<T
|
||||||
@Override
|
@Override
|
||||||
public void readFrom(StreamInput in) throws IOException {
|
public void readFrom(StreamInput in) throws IOException {
|
||||||
super.readFrom(in);
|
super.readFrom(in);
|
||||||
shardId = ShardId.readShardId(in);
|
shardId = new ShardId(in);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -49,7 +49,7 @@ public final class SearchShardTarget implements Writeable, Comparable<SearchShar
|
||||||
} else {
|
} else {
|
||||||
nodeId = null;
|
nodeId = null;
|
||||||
}
|
}
|
||||||
shardId = ShardId.readShardId(in);
|
shardId = new ShardId(in);
|
||||||
this.originalIndices = null;
|
this.originalIndices = null;
|
||||||
clusterAlias = in.readOptionalString();
|
clusterAlias = in.readOptionalString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,7 +108,7 @@ public class ShardSearchLocalRequest implements ShardSearchRequest {
|
||||||
}
|
}
|
||||||
|
|
||||||
ShardSearchLocalRequest(StreamInput in) throws IOException {
|
ShardSearchLocalRequest(StreamInput in) throws IOException {
|
||||||
shardId = ShardId.readShardId(in);
|
shardId = new ShardId(in);
|
||||||
searchType = SearchType.fromId(in.readByte());
|
searchType = SearchType.fromId(in.readByte());
|
||||||
numberOfShards = in.readVInt();
|
numberOfShards = in.readVInt();
|
||||||
scroll = in.readOptionalWriteable(Scroll::new);
|
scroll = in.readOptionalWriteable(Scroll::new);
|
||||||
|
|
|
@ -99,7 +99,7 @@ public class SnapshotShardFailure extends ShardOperationFailedException {
|
||||||
@Override
|
@Override
|
||||||
public void readFrom(StreamInput in) throws IOException {
|
public void readFrom(StreamInput in) throws IOException {
|
||||||
nodeId = in.readOptionalString();
|
nodeId = in.readOptionalString();
|
||||||
shardId = ShardId.readShardId(in);
|
shardId = new ShardId(in);
|
||||||
super.shardId = shardId.getId();
|
super.shardId = shardId.getId();
|
||||||
index = shardId.getIndexName();
|
index = shardId.getIndexName();
|
||||||
reason = in.readString();
|
reason = in.readString();
|
||||||
|
|
|
@ -447,7 +447,7 @@ public class SnapshotShardsService extends AbstractLifecycleComponent implements
|
||||||
public void readFrom(StreamInput in) throws IOException {
|
public void readFrom(StreamInput in) throws IOException {
|
||||||
super.readFrom(in);
|
super.readFrom(in);
|
||||||
snapshot = new Snapshot(in);
|
snapshot = new Snapshot(in);
|
||||||
shardId = ShardId.readShardId(in);
|
shardId = new ShardId(in);
|
||||||
status = new ShardSnapshotStatus(in);
|
status = new ShardSnapshotStatus(in);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -152,7 +152,7 @@ public class ShardChangesAction extends Action<ShardChangesAction.Response> {
|
||||||
super.readFrom(in);
|
super.readFrom(in);
|
||||||
fromSeqNo = in.readVLong();
|
fromSeqNo = in.readVLong();
|
||||||
maxOperationCount = in.readVInt();
|
maxOperationCount = in.readVInt();
|
||||||
shardId = ShardId.readShardId(in);
|
shardId = new ShardId(in);
|
||||||
expectedHistoryUUID = in.readString();
|
expectedHistoryUUID = in.readString();
|
||||||
pollTimeout = in.readTimeValue();
|
pollTimeout = in.readTimeValue();
|
||||||
maxBatchSize = new ByteSizeValue(in);
|
maxBatchSize = new ByteSizeValue(in);
|
||||||
|
|
|
@ -94,8 +94,8 @@ public class ShardFollowTask extends ImmutableFollowParameters implements XPackP
|
||||||
|
|
||||||
public static ShardFollowTask readFrom(StreamInput in) throws IOException {
|
public static ShardFollowTask readFrom(StreamInput in) throws IOException {
|
||||||
String remoteCluster = in.readString();
|
String remoteCluster = in.readString();
|
||||||
ShardId followShardId = ShardId.readShardId(in);
|
ShardId followShardId = new ShardId(in);
|
||||||
ShardId leaderShardId = ShardId.readShardId(in);
|
ShardId leaderShardId = new ShardId(in);
|
||||||
return new ShardFollowTask(remoteCluster, followShardId, leaderShardId, in);
|
return new ShardFollowTask(remoteCluster, followShardId, leaderShardId, in);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ public class PutCcrRestoreSessionRequest extends SingleShardRequest<PutCcrRestor
|
||||||
public void readFrom(StreamInput in) throws IOException {
|
public void readFrom(StreamInput in) throws IOException {
|
||||||
super.readFrom(in);
|
super.readFrom(in);
|
||||||
sessionUUID = in.readString();
|
sessionUUID = in.readString();
|
||||||
shardId = ShardId.readShardId(in);
|
shardId = new ShardId(in);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue