@@ -115,19 +115,6 @@ public static Stage fromId(byte id) {
115115 private DiscoveryNode targetNode ;
116116 private boolean primary ;
117117
118- public RecoveryState (StreamInput in ) throws IOException {
119- timer = new Timer (in );
120- stage = Stage .fromId (in .readByte ());
121- shardId = ShardId .readShardId (in );
122- recoverySource = RecoverySource .readFrom (in );
123- targetNode = new DiscoveryNode (in );
124- sourceNode = in .readOptionalWriteable (DiscoveryNode ::new );
125- index = new Index (in );
126- translog = new Translog (in );
127- verifyIndex = new VerifyIndex (in );
128- primary = in .readBoolean ();
129- }
130-
131118 public RecoveryState (ShardRouting shardRouting , DiscoveryNode targetNode , @ Nullable DiscoveryNode sourceNode ) {
132119 assert shardRouting .initializing () : "only allow initializing shard routing to be recovered: " + shardRouting ;
133120 RecoverySource recoverySource = shardRouting .recoverySource ();
@@ -146,6 +133,19 @@ public RecoveryState(ShardRouting shardRouting, DiscoveryNode targetNode, @Nulla
146133 timer .start ();
147134 }
148135
136+ public RecoveryState (StreamInput in ) throws IOException {
137+ timer = new Timer (in );
138+ stage = Stage .fromId (in .readByte ());
139+ shardId = ShardId .readShardId (in );
140+ recoverySource = RecoverySource .readFrom (in );
141+ targetNode = new DiscoveryNode (in );
142+ sourceNode = in .readOptionalWriteable (DiscoveryNode ::new );
143+ index = new Index (in );
144+ translog = new Translog (in );
145+ verifyIndex = new VerifyIndex (in );
146+ primary = in .readBoolean ();
147+ }
148+
149149 @ Override
150150 public void writeTo (StreamOutput out ) throws IOException {
151151 timer .writeTo (out );
0 commit comments