Skip to content
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
Merged

Get task info by runId #813

merged 7 commits into from Dec 29, 2015

Conversation

@ssalinas
Copy link
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

ssalinas added 2 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 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?

@@ -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}?

@@ -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

ssalinas added 2 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 Contributor

do we index on runId?

This comment has been minimized.

@ssalinas

ssalinas Dec 17, 2015 Author 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.

This comment has been minimized.

@ssalinas

ssalinas Dec 21, 2015 Author 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

This comment has been minimized.

@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 Author Member

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

@ssalinas
Copy link
Member Author

ssalinas commented Dec 17, 2015

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

ssalinas added 2 commits Dec 21, 2015
@tpetr
Copy link
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
Get task info by runId
@tpetr tpetr merged commit 9634c33 into master Dec 29, 2015
1 of 2 checks passed
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
@tpetr tpetr removed hs_qa labels Dec 29, 2015
@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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.