From dd2f26ca402c9e7eede68844f18e14f8ac93f3a1 Mon Sep 17 00:00:00 2001 From: Drew Raines Date: Thu, 8 Jan 2015 17:26:44 -0600 Subject: [PATCH] [cat/recovery] Make recovery time a TimeValue() Recovery `time` should be a TimeValue() to match other cat APIs. Closes #9209 --- .../org/elasticsearch/rest/action/cat/RestRecoveryAction.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/elasticsearch/rest/action/cat/RestRecoveryAction.java b/core/src/main/java/org/elasticsearch/rest/action/cat/RestRecoveryAction.java index 47265d9efaf..759fac2eb19 100644 --- a/core/src/main/java/org/elasticsearch/rest/action/cat/RestRecoveryAction.java +++ b/core/src/main/java/org/elasticsearch/rest/action/cat/RestRecoveryAction.java @@ -28,6 +28,7 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.Table; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.indices.recovery.RecoveryState; import org.elasticsearch.rest.RestChannel; import org.elasticsearch.rest.RestController; @@ -142,7 +143,7 @@ public class RestRecoveryAction extends AbstractCatAction { t.startRow(); t.addCell(index); 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.getStage().toString().toLowerCase(Locale.ROOT)); t.addCell(state.getSourceNode() == null ? "n/a" : state.getSourceNode().getHostName());