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

Allow me to set the JobId for a JobTicket #752

Closed
paxtonhare opened this issue Jun 10, 2017 · 4 comments
Closed

Allow me to set the JobId for a JobTicket #752

paxtonhare opened this issue Jun 10, 2017 · 4 comments

Comments

@paxtonhare
Copy link

Rather than automagically setting the JobId to a UUID, please allow me to manually set it to whatever I like.

Why? you might ask...

My use case is that my "job" consists of 2 parts. I must first run a module to get a list of things to batch on. Then I use the QueryBatcher to do stuff. Both parts of the "job" need to use the jobId but currently I can only get a jobId from the querybatcher after I start it.

I'd like to do something like this:

String jobId = UUID.randomUUID().toString();

Collector c = new Collector();
Vector<String> uris = c.run(jobId);

QueryBatcher queryBatcher = dataMovementManager.newQueryBatcher(uris.iterator())
   .withJobId(jobId)
   .withThreadCount(4)
   ...

Hopefully that makes sense.

@sammefford
Copy link
Contributor

Yes, that makes sense. Do you think we should merge jobName (which currently you can set on a batcher calling withJobName(String)) with the concept of jobId (which currently you can get from a JobTicket)? Or is it helpful in the long-run to have both jobName and jobId?

@paxtonhare
Copy link
Author

@sammefford not sure I follow your question. For me personally, I am not using job names right now.

@sammefford
Copy link
Contributor

sammefford commented Jun 26, 2017

I envision that a job dashboard might have something like this:

Actions Job ID Job Name
[Status] [Stop] [Restart] 5324 Write docs from /tmp/employees/
[Status] [Stop] [Restart] 2345 Write docs from /hr/salaries/

Where the Job ID must be unique for job control purposes (and frankly, doesn't even need to show on the dashboard). And the Job Name can be human readable text for understanding what the job is doing.

I guess my question is whether you agree we should have both?

@vivekmuniyandi vivekmuniyandi added fix and removed verify labels Jun 26, 2017
vivekmuniyandi added a commit that referenced this issue Jun 27, 2017
@vivekmuniyandi
Copy link
Contributor

vivekmuniyandi commented Jun 27, 2017

Here are the APIs we added:

Batcher withJobID(String jobId)
String getJobId()
QueryBatcher withJobID(String jobId) 
WriteBatcher withJobID(String jobId)

These would enable the user to set and retrieve the job id. They should be called like this:

QueryBatcher queryBatcher = dataMovementManager.newQueryBatcher(uris.iterator())
   							.withJobId("QueryjobId001")
   							.withThreadCount(4)

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

No branches or pull requests

4 participants