-
Notifications
You must be signed in to change notification settings - Fork 24.7k
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
Conversation
* | ||
* The class is final due to serialization limitations | ||
*/ | ||
public final class TaskOperationFailedException implements Streamable, ToXContent { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
@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 |
f87f36d
to
f26f4d0
Compare
@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()); |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IOException?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
I left some minor comments - LGTM otherwise |
import org.elasticsearch.threadpool.ThreadPool; | ||
import org.elasticsearch.transport.TransportService; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leftovers?
Left minor comments. LGTM as well. I'm excited to get this merged and start integrating with it! |
567aa0a
to
6a947e0
Compare
… 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
4ac65f9
to
a89dba2
Compare
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 usingTransportTaskAction
.Related to #15117