[cat/recovery] Make recovery time a TimeValue()

Recovery `time` should be a TimeValue() to match other cat APIs.

Closes #9209
This commit is contained in:
Drew Raines 2015-01-08 17:26:44 -06:00 committed by David Pilato
parent 6c3f6778df
commit dd2f26ca40
1 changed files with 2 additions and 1 deletions

View File

@ -28,6 +28,7 @@ import org.elasticsearch.common.Strings;
import org.elasticsearch.common.Table; import org.elasticsearch.common.Table;
import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.indices.recovery.RecoveryState; import org.elasticsearch.indices.recovery.RecoveryState;
import org.elasticsearch.rest.RestChannel; import org.elasticsearch.rest.RestChannel;
import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestController;
@ -142,7 +143,7 @@ public class RestRecoveryAction extends AbstractCatAction {
t.startRow(); t.startRow();
t.addCell(index); t.addCell(index);
t.addCell(state.getShardId().id()); t.addCell(state.getShardId().id());
t.addCell(state.getTimer().time()); t.addCell(new TimeValue(state.getTimer().time()));
t.addCell(state.getType().toString().toLowerCase(Locale.ROOT)); t.addCell(state.getType().toString().toLowerCase(Locale.ROOT));
t.addCell(state.getStage().toString().toLowerCase(Locale.ROOT)); t.addCell(state.getStage().toString().toLowerCase(Locale.ROOT));
t.addCell(state.getSourceNode() == null ? "n/a" : state.getSourceNode().getHostName()); t.addCell(state.getSourceNode() == null ? "n/a" : state.getSourceNode().getHostName());