-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
NIFI-401 #1117
NIFI-401 #1117
Conversation
@beugley Thanks for the PR! Going to start reviewing... Sorry this lingered a bit. I see there are a couple conflicting files but I'm going to see if I can rebase them locally. If I have any issues, I'll reach back out. |
@@ -110,6 +110,12 @@ div.processor-enabled-container { | |||
line-height: 18px; | |||
} | |||
|
|||
#execution-node-combo { |
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.
With the updated UI in 1.0.0 I don't think this style is necessary anymore. Specifically the width and height are not consistent with the other combos in the scheduling tab.
value: 'PRIMARY_NODE_ONLY', | ||
description: 'Processor will be scheduled on the primary node on an interval defined by the run schedule.' | ||
}); | ||
} else if (processor.config['schedulingStrategy'] === 'PRIMARY_NODE_ONLY') { |
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 realize that we are deprecating 'Primary Node Only' but I believe we still need to retain this case to handle existing components with this configuration. The disabled flag will prevent this option from being selected again.
@@ -201,6 +185,9 @@ nf.ProcessorConfiguration = (function () { | |||
return true; | |||
} | |||
|
|||
if ($('#execution-node-combo').combo('getSelectedOption').value !== (details.config['executionNode'] + '')) { |
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.
Should we be considering whether the execution node combo is available before using it to determine if a save is required?
// the dialog is applied. | ||
var schedulingStrategy = processor.config['schedulingStrategy']; | ||
var executionNode = processor.config['executionNode']; | ||
if (schedulingStrategy === 'PRIMARY_NODE_ONLY') { |
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.
This appears to be rendering the inferred configuration based on the currently (now deprecated) option. I think we should be rendering what is actually configured. If the option is now deprecated we should mark the item as disabled to prevent it from being selected again. But I do not believe we should be rendering something that is not actually configured.
$('#execution-node-combo').combo('setSelectedOption', { | ||
value: executionNode | ||
}); | ||
if (nf.Canvas.isClustered()) { |
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.
If we are going to hide/show the execution node container, we should probably also be considering the currently configured value. If a node is configured for 'Primary Node Only' we need to retain that fact even when not clustered. If a user has disconnected a node and then went to that node directly we still want the configuration actually reflected. Should probably show the field if clustered or if the execution node is 'primary node only'.
<div id="execution-node-container" class="execution-node-setting"> | ||
<div class="setting-name"> | ||
Execution node | ||
<img class="setting-icon icon-info" src="images/iconInfo.png" alt="Info" title="The node(s) that will run this processor."/> |
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 you update the 'Info Icon' to use the same styles as the others in the scheduling tab?
* NOTE: This option has been deprecated with the addition of the | ||
* execution-node combo box. It still exists for backward compatibility | ||
* with existing flows that still have this value for schedulingStrategy. | ||
** |
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.
Probably should actually mark this option as deprecated using an annotation.
@@ -108,6 +108,18 @@ | |||
</div> | |||
<div class="clear"></div> | |||
</div> | |||
<div class="setting"> |
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.
The Scheduling Strategy and the Run Schedule should probably remain closer together. Can you shift the Execution Node setting below the Concurrent Tasks and Run Schedule.
@@ -103,6 +103,18 @@ | |||
<div class="clear"></div> | |||
</div> | |||
<div class="setting"> | |||
<div id="details-execution-node-container" class="execution-node-setting"> |
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.
Same comment as above, we should keep the Scheduling Strategy and Run Schedule close together by shifting the Execution Node below the Concurrent Tasks and Run Schedule.
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.
Thanks for considering the PR. Seems like there are lots of problems with the code. If you want to take over, please do so, but at this point I'm not inclined to continue working on this feature.
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.
No worries. I don't think there are a lot of problems with the code. I think what was provided is quite good and really close. Most comments are mostly based on the same premise of retaining the existing configuration until a user has explicitly configured a Processor using the new options. I just tried to mark each spot where we should consider that.
Either way, I am happy to continue working with you on this PR or I would be happy to pick up at this point if you'd prefer.
Thanks again!
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.
yep, as you noted my goal was to accept processors with older configurations, and then update to a newer configuration when the user changed the processor in any form. At the moment, I'm very busy with other tasks, so don't have time to work on this now, and won't in the near future. If you want to pick this up, go ahead, I won't be offended in any way. Thanks again for reviewing it and considering the change!
Brian
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.
Awesome. Will do!
I will leave this PR open and I will issue another PR with this commit and any subsequent work. I'll close out both PRs once everything is merged in.
Thanks again!
@@ -264,6 +251,7 @@ nf.ProcessorConfiguration = (function () { | |||
processorConfigDto['schedulingPeriod'] = schedulingPeriod.val(); | |||
} | |||
|
|||
processorConfigDto['executionNode'] = $('#execution-node-combo').combo('getSelectedOption').value; |
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.
Should probably consider whether the execution node is available before including its value in the processor's configuration.
- Minor tweaks to PR apache#1117.
- Minor tweaks to PR apache#1117. - Ensuring existing configuraiton is retained and shown until the user explicits changes it. - Retaining, but disabling, deprecated options.
- Minor tweaks to PR apache#1117. - Ensuring existing configuraiton is retained and shown until the user explicits changes it. - Retaining, but disabling, deprecated options.
- Minor tweaks to PR apache#1117. - Ensuring existing configuraiton is retained and shown until the user explicits changes it. - Retaining, but disabling, deprecated options.
Thank you for submitting a contribution to Apache NiFi.
In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
For all changes:
in the commit message?
For code changes:
For documentation related changes:
Note:
Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.