New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get task info by runId #813

Merged
merged 7 commits into from Dec 29, 2015

Conversation

Projects
None yet
5 participants
@ssalinas
Member

ssalinas commented Dec 17, 2015

Get the SingularityTaskIdHistory object for a task by it's run id

/cc @jhaber this should get you back taskId, last state, and the SingularityTaskId object

Show outdated Hide outdated ...vice/src/main/java/com/hubspot/singularity/data/history/HistoryJDBI.java
@@ -29,6 +29,9 @@
@SqlQuery("SELECT bytes FROM taskHistory WHERE taskId = :taskId")
byte[] getTaskHistoryForTask(@Bind("taskId") String taskId);
@SqlQuery("SELECT bytes FROM taskHistory WHERE runId = :runId")
byte[] getTaskHistoryForTaskByRunId(@Bind("runId") String runId);

This comment has been minimized.

@jhaber

jhaber Dec 17, 2015

Member

Shouldn't this also filter by requestId?

@jhaber

jhaber Dec 17, 2015

Member

Shouldn't this also filter by requestId?

Show outdated Hide outdated ...ice/src/main/java/com/hubspot/singularity/resources/HistoryResource.java
@@ -153,6 +153,18 @@ public SingularityDeployHistory getDeploy(@ApiParam("Request ID for deploy") @Pa
}
@GET
@Path("/request/{requestId}/tasks/{runId}")

This comment has been minimized.

@jhaber

jhaber Dec 17, 2015

Member

Should this be /request/{requestId}/run/{runId}?

@jhaber

jhaber Dec 17, 2015

Member

Should this be /request/{requestId}/run/{runId}?

Show outdated Hide outdated ...ice/src/main/java/com/hubspot/singularity/resources/HistoryResource.java
@@ -153,6 +153,18 @@ public SingularityDeployHistory getDeploy(@ApiParam("Request ID for deploy") @Pa
}
@GET
@Path("/request/{requestId}/tasks/{runId}")
@ApiOperation("Retrieve the history for all tasks of a specific request.")

This comment has been minimized.

@jhaber

jhaber Dec 17, 2015

Member

This doesn't sound right

@jhaber

jhaber Dec 17, 2015

Member

This doesn't sound right

ssalinas added some commits Dec 17, 2015

@@ -29,6 +29,9 @@
@SqlQuery("SELECT bytes FROM taskHistory WHERE taskId = :taskId")
byte[] getTaskHistoryForTask(@Bind("taskId") String taskId);
@SqlQuery("SELECT bytes FROM taskHistory WHERE requestId = :requestId AND runId = :runId")
byte[] getTaskHistoryForTaskByRunId(@Bind("requestId") String requestId, @Bind("runId") String runId);

This comment has been minimized.

@wsorenson

wsorenson Dec 17, 2015

Member

do we index on runId?

@wsorenson

wsorenson Dec 17, 2015

Member

do we index on runId?

This comment has been minimized.

@ssalinas

ssalinas Dec 17, 2015

Member

not currently, we would probably need to for this case

@ssalinas

ssalinas Dec 17, 2015

Member

not currently, we would probably need to for this case

This comment has been minimized.

@tpetr

tpetr Dec 18, 2015

Member

yeah, we should add an index. let me know if you need a hand with this.

@tpetr

tpetr Dec 18, 2015

Member

yeah, we should add an index. let me know if you need a hand with this.

This comment has been minimized.

@ssalinas

ssalinas Dec 21, 2015

Member

Added an index in b63cf47 , can someone with more mysql chops double check that please?

@ssalinas

ssalinas Dec 21, 2015

Member

Added an index in b63cf47 , can someone with more mysql chops double check that please?

This comment has been minimized.

@tpetr

tpetr Dec 21, 2015

Member

syncing up w/ monty about this

@tpetr

tpetr Dec 21, 2015

Member

syncing up w/ monty about this

This comment has been minimized.

@solomonty

solomonty Dec 21, 2015

Which query/queries will benefit from the added index in b63cf47?

@solomonty

solomonty Dec 21, 2015

Which query/queries will benefit from the added index in b63cf47?

This comment has been minimized.

@ssalinas

ssalinas Dec 21, 2015

Member

The one on the line for this comment thread:
SELECT bytes FROM taskHistory WHERE requestId = :requestId AND runId = :runId

@ssalinas

ssalinas Dec 21, 2015

Member

The one on the line for this comment thread:
SELECT bytes FROM taskHistory WHERE requestId = :requestId AND runId = :runId

@ssalinas

This comment has been minimized.

Show comment
Hide comment
@ssalinas

ssalinas Dec 17, 2015

Member

Updated a couple things, had forgotten about the description, thanks for that

Member

ssalinas commented Dec 17, 2015

Updated a couple things, had forgotten about the description, thanks for that

ssalinas added some commits Dec 21, 2015

@tpetr

This comment has been minimized.

Show comment
Hide comment
@tpetr

tpetr Dec 21, 2015

Member

This PR reads like there was an assumption that runId would be unique, but I don't see any constraint for that in #669. Did I miss something, or was this an oversight?

Member

tpetr commented Dec 21, 2015

This PR reads like there was an assumption that runId would be unique, but I don't see any constraint for that in #669. Did I miss something, or was this an oversight?

@tpetr tpetr added this to the 0.4.8 milestone Dec 28, 2015

tpetr added a commit that referenced this pull request Dec 29, 2015

@tpetr tpetr merged commit 9634c33 into master Dec 29, 2015

1 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@ssalinas ssalinas deleted the run_id_query branch Feb 9, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment