-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Move persistent task registrations to core #30755
Merged
droberts195
merged 4 commits into
elastic:master
from
droberts195:move_persistent_task_registrations_to_core
May 24, 2018
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
e03c4f2
Move persistent task registrations to core
droberts195 9c47c7e
Move registrations from NetworkModule to ClusterModule
droberts195 1e02781
Merge branch 'master' into move_persistent_task_registrations_to_core
droberts195 9838f0f
Remove more duplicate registrations of persistent tasks named writables
droberts195 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,13 +90,7 @@ | |
import org.elasticsearch.xpack.core.ml.datafeed.DatafeedState; | ||
import org.elasticsearch.xpack.core.ml.job.config.JobTaskStatus; | ||
import org.elasticsearch.xpack.core.monitoring.MonitoringFeatureSetUsage; | ||
import org.elasticsearch.persistent.CompletionPersistentTaskAction; | ||
import org.elasticsearch.persistent.PersistentTaskParams; | ||
import org.elasticsearch.persistent.PersistentTasksCustomMetaData; | ||
import org.elasticsearch.persistent.PersistentTasksNodeService; | ||
import org.elasticsearch.persistent.RemovePersistentTaskAction; | ||
import org.elasticsearch.persistent.StartPersistentTaskAction; | ||
import org.elasticsearch.persistent.UpdatePersistentTaskStatusAction; | ||
import org.elasticsearch.xpack.core.rollup.RollupFeatureSetUsage; | ||
import org.elasticsearch.xpack.core.rollup.RollupField; | ||
import org.elasticsearch.xpack.core.rollup.action.DeleteRollupJobAction; | ||
|
@@ -253,11 +247,6 @@ public List<GenericAction> getClientActions() { | |
GetCalendarEventsAction.INSTANCE, | ||
PostCalendarEventsAction.INSTANCE, | ||
PersistJobAction.INSTANCE, | ||
// licensing | ||
StartPersistentTaskAction.INSTANCE, | ||
UpdatePersistentTaskStatusAction.INSTANCE, | ||
RemovePersistentTaskAction.INSTANCE, | ||
CompletionPersistentTaskAction.INSTANCE, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think these are redundant because the same four actions are already registered in |
||
// security | ||
ClearRealmCacheAction.INSTANCE, | ||
ClearRolesCacheAction.INSTANCE, | ||
|
@@ -322,18 +311,12 @@ public List<NamedWriteableRegistry.Entry> getNamedWriteables() { | |
// ML - Custom metadata | ||
new NamedWriteableRegistry.Entry(MetaData.Custom.class, "ml", MlMetadata::new), | ||
new NamedWriteableRegistry.Entry(NamedDiff.class, "ml", MlMetadata.MlMetadataDiff::new), | ||
new NamedWriteableRegistry.Entry(MetaData.Custom.class, PersistentTasksCustomMetaData.TYPE, | ||
PersistentTasksCustomMetaData::new), | ||
new NamedWriteableRegistry.Entry(NamedDiff.class, PersistentTasksCustomMetaData.TYPE, | ||
PersistentTasksCustomMetaData::readDiffFrom), | ||
// ML - Persistent action requests | ||
new NamedWriteableRegistry.Entry(PersistentTaskParams.class, StartDatafeedAction.TASK_NAME, | ||
StartDatafeedAction.DatafeedParams::new), | ||
new NamedWriteableRegistry.Entry(PersistentTaskParams.class, OpenJobAction.TASK_NAME, | ||
OpenJobAction.JobParams::new), | ||
// ML - Task statuses | ||
new NamedWriteableRegistry.Entry(Task.Status.class, PersistentTasksNodeService.Status.NAME, | ||
PersistentTasksNodeService.Status::new), | ||
new NamedWriteableRegistry.Entry(Task.Status.class, JobTaskStatus.NAME, JobTaskStatus::new), | ||
new NamedWriteableRegistry.Entry(Task.Status.class, DatafeedState.NAME, DatafeedState::fromStream), | ||
new NamedWriteableRegistry.Entry(XPackFeatureSet.Usage.class, XPackField.MACHINE_LEARNING, | ||
|
@@ -368,8 +351,6 @@ public List<NamedXContentRegistry.Entry> getNamedXContent() { | |
// ML - Custom metadata | ||
new NamedXContentRegistry.Entry(MetaData.Custom.class, new ParseField("ml"), | ||
parser -> MlMetadata.METADATA_PARSER.parse(parser, null).build()), | ||
new NamedXContentRegistry.Entry(MetaData.Custom.class, new ParseField(PersistentTasksCustomMetaData.TYPE), | ||
PersistentTasksCustomMetaData::fromXContent), | ||
// ML - Persistent action requests | ||
new NamedXContentRegistry.Entry(PersistentTaskParams.class, new ParseField(StartDatafeedAction.TASK_NAME), | ||
StartDatafeedAction.DatafeedParams::fromXContent), | ||
|
@@ -385,8 +366,7 @@ public List<NamedXContentRegistry.Entry> getNamedXContent() { | |
new NamedXContentRegistry.Entry(MetaData.Custom.class, new ParseField(LicensesMetaData.TYPE), | ||
LicensesMetaData::fromXContent), | ||
//rollup | ||
new NamedXContentRegistry.Entry(PersistentTaskParams.class, new ParseField(RollupField.TASK_NAME), | ||
parser -> RollupJob.fromXContent(parser)), | ||
new NamedXContentRegistry.Entry(PersistentTaskParams.class, new ParseField(RollupField.TASK_NAME), RollupJob::fromXContent), | ||
new NamedXContentRegistry.Entry(Task.Status.class, new ParseField(RollupJobStatus.NAME), RollupJobStatus::fromXContent) | ||
); | ||
} | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I think that
ClusterModule
is a better place to register these classes, because this class already has the majority (I think all of them) default custom metadata registrations and in my mindNetworkModule
is more for real network things like http and transport.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.
I agree.