rename RETRY stage in recovery to THROTTLE

This commit is contained in:
kimchy 2010-08-21 15:13:34 +03:00
parent 0c72bb2125
commit e12bdd9faf
7 changed files with 14 additions and 14 deletions

View File

@ -30,7 +30,7 @@ public class GatewayRecoveryStatus {
public enum Stage {
INIT((byte) 0),
RETRY((byte) 1),
THROTTLE((byte) 1),
INDEX((byte) 2),
TRANSLOG((byte) 3),
FINALIZE((byte) 4),
@ -50,7 +50,7 @@ public class GatewayRecoveryStatus {
if (value == 0) {
return INIT;
} else if (value == 1) {
return RETRY;
return THROTTLE;
} else if (value == 2) {
return INDEX;
} else if (value == 3) {

View File

@ -30,7 +30,7 @@ public class PeerRecoveryStatus {
public enum Stage {
INIT((byte) 0),
RETRY((byte) 1),
THROTTLE((byte) 1),
INDEX((byte) 2),
TRANSLOG((byte) 3),
FINALIZE((byte) 4),
@ -50,7 +50,7 @@ public class PeerRecoveryStatus {
if (value == 0) {
return INIT;
} else if (value == 1) {
return RETRY;
return THROTTLE;
} else if (value == 2) {
return INDEX;
} else if (value == 3) {

View File

@ -177,8 +177,8 @@ public class TransportIndicesStatusAction extends TransportBroadcastOperationAct
case TRANSLOG:
stage = PeerRecoveryStatus.Stage.TRANSLOG;
break;
case RETRY:
stage = PeerRecoveryStatus.Stage.RETRY;
case THROTTLE:
stage = PeerRecoveryStatus.Stage.THROTTLE;
break;
case FINALIZE:
stage = PeerRecoveryStatus.Stage.FINALIZE;
@ -208,8 +208,8 @@ public class TransportIndicesStatusAction extends TransportBroadcastOperationAct
case TRANSLOG:
stage = GatewayRecoveryStatus.Stage.TRANSLOG;
break;
case RETRY:
stage = GatewayRecoveryStatus.Stage.RETRY;
case THROTTLE:
stage = GatewayRecoveryStatus.Stage.THROTTLE;
break;
case DONE:
stage = GatewayRecoveryStatus.Stage.DONE;

View File

@ -152,7 +152,7 @@ public class IndexShardGatewayService extends AbstractIndexShardComponent implem
listener.onIgnoreRecovery("ignoring recovery while waiting on retry, closed");
return;
}
recoveryStatus.updateStage(RecoveryStatus.Stage.RETRY);
recoveryStatus.updateStage(RecoveryStatus.Stage.THROTTLE);
try {
Thread.sleep(recoveryThrottler.throttleInterval().millis());
recoveryStatus.retryTime(System.currentTimeMillis() - recoveryStatus.startTime());

View File

@ -28,7 +28,7 @@ public class RecoveryStatus {
public static enum Stage {
INIT,
RETRY,
THROTTLE,
INDEX,
TRANSLOG,
DONE

View File

@ -33,7 +33,7 @@ public class RecoveryStatus {
public static enum Stage {
INIT,
RETRY,
THROTTLE,
INDEX,
TRANSLOG,
FINALIZE,

View File

@ -168,7 +168,7 @@ public class RecoveryTarget extends AbstractComponent {
}
if (!recoveryThrottler.tryRecovery(shard.shardId(), "peer recovery target")) {
recovery.stage = RecoveryStatus.Stage.RETRY;
recovery.stage = RecoveryStatus.Stage.THROTTLE;
recovery.retryTime = System.currentTimeMillis() - recovery.startTime;
listener.onRetryRecovery(recoveryThrottler.throttleInterval());
return;
@ -189,7 +189,7 @@ public class RecoveryTarget extends AbstractComponent {
return;
}
logger.trace("[{}][{}] retrying recovery in [{}], source shard is busy", request.shardId().index().name(), request.shardId().id(), recoveryThrottler.throttleInterval());
recovery.stage = RecoveryStatus.Stage.RETRY;
recovery.stage = RecoveryStatus.Stage.THROTTLE;
recovery.retryTime = System.currentTimeMillis() - recovery.startTime;
listener.onRetryRecovery(recoveryThrottler.throttleInterval());
return;
@ -231,7 +231,7 @@ public class RecoveryTarget extends AbstractComponent {
}
if (cause instanceof IndexShardNotStartedException || cause instanceof IndexMissingException || cause instanceof IndexShardMissingException) {
recovery.stage = RecoveryStatus.Stage.RETRY;
recovery.stage = RecoveryStatus.Stage.THROTTLE;
recovery.retryTime = System.currentTimeMillis() - recovery.startTime;
listener.onRetryRecovery(recoveryThrottler.throttleInterval());
return;