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

Associate an external id with a task, so that it can be cancelled later. #3277

Merged
merged 3 commits into from
Jun 18, 2018

Conversation

codebrain
Copy link
Contributor

Closes #3259

public bool Cancellable { get; internal set; }

[JsonProperty("headers")]
public IReadOnlyDictionary<string, string> Headers { get; internal set; } = EmptyReadOnly<string, string>.Dictionary;
Copy link
Member

Choose a reason for hiding this comment

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

LGTM, do we know what headers are possibly returned here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sadly not (from the source code I read) but certainly X-Opaque-Id.

I had considered a helper method to expose this value, but just left to the user for the time being...

Copy link
Contributor

@russcam russcam left a comment

Choose a reason for hiding this comment

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

Generally LGTM, left some comments. It looks like TasKInfo is missing child tasks

/// Associate an Id with this user-initiated task, such that it can be located in the cluster task list.
/// <pre>https://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html#_identifying_running_tasks</pre>
/// </summary>
string OpaqueId { get; set; }
Copy link
Contributor

Choose a reason for hiding this comment

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

Add something to indicate that this is valid only for Elasticsearch 6.2.0+

Copy link
Contributor Author

Choose a reason for hiding this comment

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

++

/// Associate an Id with this user-initiated task, such that it can be located in the cluster task list.
/// <pre>https://www.elastic.co/guide/en/elasticsearch/reference/6.2/tasks.html#_identifying_running_tasks</pre>
/// </summary>
public RequestConfigurationDescriptor OpaqueId(string opaqueId)
Copy link
Contributor

Choose a reason for hiding this comment

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

Add something to indicate that this is valid only for Elasticsearch 6.2.0+

Copy link
Contributor Author

Choose a reason for hiding this comment

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

++

Copy link
Contributor

Choose a reason for hiding this comment

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

I think rather than having a link to docs, something like "Valid for Elasticsearch 6.2.0+" would be sufficient.

@@ -36,5 +36,8 @@ public class TaskInfo

[JsonProperty("cancellable")]
public bool Cancellable { get; internal set; }

[JsonProperty("headers")]
public IReadOnlyDictionary<string, string> Headers { get; internal set; } = EmptyReadOnly<string, string>.Dictionary;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

missing child tasks in children array?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, have added.

@codebrain codebrain merged commit 61d4e07 into master Jun 18, 2018
@codebrain
Copy link
Contributor Author

Backported to 6.x

@codebrain codebrain deleted the feature/6.2-associate-task-ids branch June 18, 2018 08:32
@codebrain
Copy link
Contributor Author

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

Successfully merging this pull request may close these issues.

3 participants