SnapshotStatus snapshotStatus = this.currentSnapshotStatus;
if (snapshotStatus == null) {
return snapshotStatus;
}
if (snapshotStatus.stage() != SnapshotStatus.Stage.DONE || snapshotStatus.stage() != SnapshotStatus.Stage.FAILURE) {
snapshotStatus.time(System.currentTimeMillis() - snapshotStatus.startTime());
}
return snapshotStatus;
}
@Override public SnapshotStatus snapshot(final Snapshot snapshot) throws IndexShardGatewaySnapshotFailedException {