mirror of https://github.com/apache/nifi.git
NIFI-2261
- Addressed issue enabling/disabling controller services where the wrong URI was referenced. - Addressed with the update revisions in the controller service references. - Addressed issue with showing the disconnected from cluster dialog on page load. - Addressed issue with URI when adding a dynamic property. This closes #654.
This commit is contained in:
parent
3373e18158
commit
4f26072444
|
@ -1556,6 +1556,7 @@ public class StandardNiFiServiceFacade implements NiFiServiceFacade {
|
||||||
final Set<ConfiguredComponent> updated = controllerServiceDAO.updateControllerServiceReferencingComponents(controllerServiceId, scheduledState, controllerServiceState);
|
final Set<ConfiguredComponent> updated = controllerServiceDAO.updateControllerServiceReferencingComponents(controllerServiceId, scheduledState, controllerServiceState);
|
||||||
final ControllerServiceReference updatedReference = controllerServiceDAO.getControllerService(controllerServiceId).getReferences();
|
final ControllerServiceReference updatedReference = controllerServiceDAO.getControllerService(controllerServiceId).getReferences();
|
||||||
|
|
||||||
|
// get the revisions of the updated components
|
||||||
final Map<String, Revision> updatedRevisions = new HashMap<>();
|
final Map<String, Revision> updatedRevisions = new HashMap<>();
|
||||||
for (final ConfiguredComponent component : updated) {
|
for (final ConfiguredComponent component : updated) {
|
||||||
final Revision currentRevision = revisionManager.getRevision(component.getIdentifier());
|
final Revision currentRevision = revisionManager.getRevision(component.getIdentifier());
|
||||||
|
@ -1563,6 +1564,15 @@ public class StandardNiFiServiceFacade implements NiFiServiceFacade {
|
||||||
updatedRevisions.put(component.getIdentifier(), currentRevision.incrementRevision(requestRevision.getClientId()));
|
updatedRevisions.put(component.getIdentifier(), currentRevision.incrementRevision(requestRevision.getClientId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// return the current revision if the component wasn't updated
|
||||||
|
for (final Map.Entry<String, Revision> entry : referenceRevisions.entrySet()) {
|
||||||
|
final String componentId = entry.getKey();
|
||||||
|
if (!updatedRevisions.containsKey(componentId)) {
|
||||||
|
final Revision currentRevision = revisionManager.getRevision(componentId);
|
||||||
|
updatedRevisions.put(componentId, currentRevision);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
final ControllerServiceReferencingComponentsEntity entity = createControllerServiceReferencingComponentsEntity(updatedReference, updatedRevisions);
|
final ControllerServiceReferencingComponentsEntity entity = createControllerServiceReferencingComponentsEntity(updatedReference, updatedRevisions);
|
||||||
return new StandardRevisionUpdate<>(entity, null, new HashSet<>(updatedRevisions.values()));
|
return new StandardRevisionUpdate<>(entity, null, new HashSet<>(updatedRevisions.values()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -873,7 +873,7 @@ nf.Canvas = (function () {
|
||||||
var clusterSummary = clusterSummaryResponse.clusterSummary;
|
var clusterSummary = clusterSummaryResponse.clusterSummary;
|
||||||
|
|
||||||
// show disconnected message on load if necessary
|
// show disconnected message on load if necessary
|
||||||
if (clusterSummary.connectedToCluster === false) {
|
if (clusterSummary.clustered && !clusterSummary.connectedToCluster) {
|
||||||
nf.Canvas.showDisconnectedFromClusterMessage();
|
nf.Canvas.showDisconnectedFromClusterMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -613,7 +613,7 @@ nf.ControllerService = (function () {
|
||||||
// wait until the polling of each service finished
|
// wait until the polling of each service finished
|
||||||
return $.Deferred(function (deferred) {
|
return $.Deferred(function (deferred) {
|
||||||
updated.done(function () {
|
updated.done(function () {
|
||||||
var serviceUpdated = pollService(controllerServiceEntity.component, function (service, bulletins) {
|
var serviceUpdated = pollService(controllerServiceEntity, function (service, bulletins) {
|
||||||
if ($.isArray(bulletins)) {
|
if ($.isArray(bulletins)) {
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
updateBulletins(bulletins, $('#enable-controller-service-bulletins'));
|
updateBulletins(bulletins, $('#enable-controller-service-bulletins'));
|
||||||
|
@ -746,12 +746,14 @@ nf.ControllerService = (function () {
|
||||||
* Polls the specified services referencing components to see if the
|
* Polls the specified services referencing components to see if the
|
||||||
* specified condition is satisfied.
|
* specified condition is satisfied.
|
||||||
*
|
*
|
||||||
* @param {object} controllerService
|
* @param {object} controllerServiceEntity
|
||||||
* @param {function} completeCondition
|
* @param {function} completeCondition
|
||||||
* @param {function} bulletinDeferred
|
* @param {function} bulletinDeferred
|
||||||
* @param {function} pollCondition
|
* @param {function} pollCondition
|
||||||
*/
|
*/
|
||||||
var pollService = function (controllerService, completeCondition, bulletinDeferred, pollCondition) {
|
var pollService = function (controllerServiceEntity, completeCondition, bulletinDeferred, pollCondition) {
|
||||||
|
var controllerService = controllerServiceEntity.component;
|
||||||
|
|
||||||
// we want to keep polling until the condition is met
|
// we want to keep polling until the condition is met
|
||||||
return $.Deferred(function (deferred) {
|
return $.Deferred(function (deferred) {
|
||||||
var current = 2;
|
var current = 2;
|
||||||
|
@ -769,7 +771,7 @@ nf.ControllerService = (function () {
|
||||||
var bulletins = bulletinDeferred(controllerService);
|
var bulletins = bulletinDeferred(controllerService);
|
||||||
var service = $.ajax({
|
var service = $.ajax({
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
url: controllerService.uri,
|
url: controllerServiceEntity.uri,
|
||||||
dataType: 'json'
|
dataType: 'json'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -548,9 +548,10 @@ nf.ProcessorConfiguration = (function () {
|
||||||
dialogContainer: '#new-processor-property-container',
|
dialogContainer: '#new-processor-property-container',
|
||||||
descriptorDeferred: function (propertyName) {
|
descriptorDeferred: function (propertyName) {
|
||||||
var processor = $('#processor-configuration').data('processorDetails');
|
var processor = $('#processor-configuration').data('processorDetails');
|
||||||
|
var d = nf.Processor.get(processor.id);
|
||||||
return $.ajax({
|
return $.ajax({
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
url: processor.uri + '/descriptors',
|
url: d.uri + '/descriptors',
|
||||||
data: {
|
data: {
|
||||||
propertyName: propertyName
|
propertyName: propertyName
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue