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

Task Management: Add framework for registering and communicating with tasks #15347

Merged
merged 1 commit into from
Jan 5, 2016

Conversation

imotov
Copy link
Contributor

@imotov imotov commented Dec 9, 2015

Adds task manager class and enables all activities to register with the task manager. Currently, the immutable Transport*Activity class represents activity itself shared across all requests. This PR adds and an additional structure Task that keeps track of currently running requests and can be used to communicate with these requests using TransportTaskAction.

Related to #15117

@imotov imotov added >feature review :Distributed/Task Management Issues for anything around the Tasks API - both persistent and node level. labels Dec 9, 2015
@imotov imotov mentioned this pull request Dec 9, 2015
12 tasks
*
* The class is final due to serialization limitations
*/
public final class TaskOperationFailedException implements Streamable, ToXContent {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it super weird that this class doesn't subclass Exception - I think it should be TaskOperationFailure instead?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should also implement Writeable instead to make it immutable?

@s1monw
Copy link
Contributor

s1monw commented Dec 11, 2015

@imotov I left a bunch of comments and some requests on how to make the change way smaller and way less intrusive. I want those to be addressed before reviewing more of this. I don't think we can go with adding Task and friends everywhere this is just not the way we can expose a feature like this. I am happy to discuss the alternatives but I gave you examples in my comments

@imotov
Copy link
Contributor Author

imotov commented Dec 13, 2015

@s1monw I pushed the changes that you have requests. Could you take another look when you have a chance?


@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
builder.field("getTaskId", getTaskId());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use task_id instead?

/**
* Reads a list of objects
*/
public <T> List<T> readList(Reader<T> producer) throws IOException {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need this Reader interface? can't this just be Funciton<StreamInput, T> reader

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IOException?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly, Function<StreamInput, T> reader cannot throw any checked exceptions and all our reading methods throw IOException.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok makes sense - we already have IOSupplier for the same reason, I think we should maybe add them as seperate classes in a util package?

@s1monw
Copy link
Contributor

s1monw commented Dec 22, 2015

I left some minor comments - LGTM otherwise

import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.TransportService;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leftovers?

@nik9000
Copy link
Member

nik9000 commented Dec 22, 2015

Left minor comments. LGTM as well. I'm excited to get this merged and start integrating with it!

… tasks

Adds task manager class and enables all activities to register with the task manager. Currently, the immutable Transport*Activity class represents activity itself shared across all requests. This PR adds and an additional structure Task that keeps track of currently running requests and can be used to communicate with these requests using TransportTaskAction.

Related to elastic#15117
@imotov imotov merged commit a89dba2 into elastic:master Jan 5, 2016
@imotov imotov deleted the issue-6914-task-management branch May 1, 2020 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed/Task Management Issues for anything around the Tasks API - both persistent and node level. >feature release highlight v5.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants