From 14d4cc4e51e79d6cdabe715feee0fe908804ee3c Mon Sep 17 00:00:00 2001 From: Stephen Salinas Date: Wed, 22 Feb 2017 12:18:41 -0500 Subject: [PATCH 1/2] ability to specify params on request history in client --- .../singularity/client/SingularityClient.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/SingularityClient/src/main/java/com/hubspot/singularity/client/SingularityClient.java b/SingularityClient/src/main/java/com/hubspot/singularity/client/SingularityClient.java index 613a0317d1..de398549f7 100644 --- a/SingularityClient/src/main/java/com/hubspot/singularity/client/SingularityClient.java +++ b/SingularityClient/src/main/java/com/hubspot/singularity/client/SingularityClient.java @@ -936,11 +936,23 @@ public Collection getActiveTaskHistoryForRequest(Strin } public Collection getInactiveTaskHistoryForRequest(String requestId) { + return getInactiveTaskHistoryForRequest(requestId, 10, 1); + } + + public Collection getInactiveTaskHistoryForRequest(String requestId, int count, int page) { + return getInactiveTaskHistoryForRequest(requestId, count, page, Optional.absent(), Optional.absent(), Optional.absent(), Optional.absent(), Optional.absent(), Optional.absent(), Optional.absent(), Optional.absent()); + } + + public Collection getInactiveTaskHistoryForRequest(String requestId, int count, int page, Optional host, Optional runId, + Optional lastTaskStatus, Optional startedBefore, Optional startedAfter, Optional updatedBefore, Optional updatedAfter, + Optional orderDirection) { final String requestUri = String.format(REQUEST_INACTIVE_TASKS_HISTORY_FORMAT, getHost(), contextPath, requestId); final String type = String.format("inactive (failed, killed, lost) task history for request %s", requestId); - return getCollection(requestUri, type, TASKID_HISTORY_COLLECTION); + Map params = taskSearchParams(Optional.of(requestId), Optional.absent(), runId, host, lastTaskStatus, startedBefore, startedAfter, updatedBefore, updatedAfter, orderDirection, count, page); + + return getCollectionWithParams(requestUri, type, Optional.of(params), TASKID_HISTORY_COLLECTION); } public Optional getHistoryForRequestDeploy(String requestId, String deployId) { From 817b3645fb03bcec5575461e09236589e1b0e46a Mon Sep 17 00:00:00 2001 From: Stephen Date: Mon, 27 Feb 2017 08:47:04 -0500 Subject: [PATCH 2/2] Keep the default at 100 --- .../java/com/hubspot/singularity/client/SingularityClient.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SingularityClient/src/main/java/com/hubspot/singularity/client/SingularityClient.java b/SingularityClient/src/main/java/com/hubspot/singularity/client/SingularityClient.java index de398549f7..06f2d0240b 100644 --- a/SingularityClient/src/main/java/com/hubspot/singularity/client/SingularityClient.java +++ b/SingularityClient/src/main/java/com/hubspot/singularity/client/SingularityClient.java @@ -936,7 +936,7 @@ public Collection getActiveTaskHistoryForRequest(Strin } public Collection getInactiveTaskHistoryForRequest(String requestId) { - return getInactiveTaskHistoryForRequest(requestId, 10, 1); + return getInactiveTaskHistoryForRequest(requestId, 100, 1); } public Collection getInactiveTaskHistoryForRequest(String requestId, int count, int page) {