mirror of https://github.com/apache/nifi.git
NIFI-3002:
- Removing legacy code when retrieving site to site details when the target instance is this local NiFi. - Ensures the UI accurately reflects available remote ports. NIFI-2603: - Fixing color of remote output port status in connection label. This closes #1189.
This commit is contained in:
parent
4957b628fb
commit
9f417a84b9
|
@ -106,8 +106,6 @@ public class StandardRemoteProcessGroup implements RemoteProcessGroup {
|
||||||
private final AtomicBoolean transmitting = new AtomicBoolean(false);
|
private final AtomicBoolean transmitting = new AtomicBoolean(false);
|
||||||
private final FlowController flowController;
|
private final FlowController flowController;
|
||||||
private final SSLContext sslContext;
|
private final SSLContext sslContext;
|
||||||
private final AtomicReference<Boolean> pointsToCluster = new AtomicReference<>(null);
|
|
||||||
private final AtomicBoolean targetIsUnreachable = new AtomicBoolean(false);
|
|
||||||
|
|
||||||
private volatile String communicationsTimeout = "30 sec";
|
private volatile String communicationsTimeout = "30 sec";
|
||||||
private volatile String targetId;
|
private volatile String targetId;
|
||||||
|
@ -184,7 +182,6 @@ public class StandardRemoteProcessGroup implements RemoteProcessGroup {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void reinitialize(boolean isClustered) {
|
public void reinitialize(boolean isClustered) {
|
||||||
this.pointsToCluster.set(null);
|
|
||||||
backgroundThreadExecutor.submit(new InitializationTask());
|
backgroundThreadExecutor.submit(new InitializationTask());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -767,38 +764,6 @@ public class StandardRemoteProcessGroup implements RemoteProcessGroup {
|
||||||
return parent == null ? context : getRootGroup(parent);
|
return parent == null ? context : getRootGroup(parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void refreshFlowContentsFromLocal() {
|
|
||||||
final ProcessGroup rootGroup = getRootGroup();
|
|
||||||
setName(rootGroup.getName());
|
|
||||||
setTargetId(rootGroup.getIdentifier());
|
|
||||||
setComments(rootGroup.getComments());
|
|
||||||
setCounts(rootGroup.getCounts());
|
|
||||||
|
|
||||||
final Set<RemoteProcessGroupPortDescriptor> convertedInputPorts = new HashSet<>();
|
|
||||||
for (final Port port : rootGroup.getInputPorts()) {
|
|
||||||
convertedInputPorts.add(convertPortToRemotePortDescriptor(port));
|
|
||||||
}
|
|
||||||
|
|
||||||
final Set<RemoteProcessGroupPortDescriptor> convertedOutputPorts = new HashSet<>();
|
|
||||||
for (final Port port : rootGroup.getOutputPorts()) {
|
|
||||||
convertedOutputPorts.add(convertPortToRemotePortDescriptor(port));
|
|
||||||
}
|
|
||||||
|
|
||||||
setInputPorts(convertedInputPorts);
|
|
||||||
setOutputPorts(convertedOutputPorts);
|
|
||||||
|
|
||||||
writeLock.lock();
|
|
||||||
try {
|
|
||||||
this.destinationSecure = nifiProperties.isSiteToSiteSecure();
|
|
||||||
this.listeningPort = nifiProperties.getRemoteInputPort();
|
|
||||||
this.listeningHttpPort = nifiProperties.getRemoteInputHttpPort();
|
|
||||||
|
|
||||||
refreshContentsTimestamp = System.currentTimeMillis();
|
|
||||||
} finally {
|
|
||||||
writeLock.unlock();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Date getLastRefreshTime() {
|
public Date getLastRefreshTime() {
|
||||||
readLock.lock();
|
readLock.lock();
|
||||||
|
@ -811,22 +776,6 @@ public class StandardRemoteProcessGroup implements RemoteProcessGroup {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void refreshFlowContents() throws CommunicationsException {
|
public void refreshFlowContents() throws CommunicationsException {
|
||||||
// check to see if we know whether we pointing to a local cluster or not -
|
|
||||||
// we must know this before we attempt to update since querying the cluster
|
|
||||||
// will cause a deadlock if we are in the context of another replicated request
|
|
||||||
if (pointsToCluster.get() == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pointsToCluster.get()) {
|
|
||||||
refreshFlowContentsFromLocal();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (targetIsUnreachable.get()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// perform the request
|
// perform the request
|
||||||
final ControllerDTO dto;
|
final ControllerDTO dto;
|
||||||
|
@ -1180,11 +1129,6 @@ public class StandardRemoteProcessGroup implements RemoteProcessGroup {
|
||||||
} finally {
|
} finally {
|
||||||
writeLock.unlock();
|
writeLock.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
final String remoteInstanceId = dto.getInstanceId();
|
|
||||||
final boolean isPointingToCluster = flowController.getInstanceId().equals(remoteInstanceId);
|
|
||||||
pointsToCluster.set(isPointingToCluster);
|
|
||||||
|
|
||||||
} catch (SiteToSiteRestApiClient.HttpGetFailedException e) {
|
} catch (SiteToSiteRestApiClient.HttpGetFailedException e) {
|
||||||
|
|
||||||
if (e.getResponseCode() == UNAUTHORIZED_STATUS_CODE) {
|
if (e.getResponseCode() == UNAUTHORIZED_STATUS_CODE) {
|
||||||
|
|
|
@ -2529,7 +2529,7 @@ public class StandardNiFiServiceFacade implements NiFiServiceFacade {
|
||||||
controllerDTO.setInstanceId(controllerFacade.getInstanceId());
|
controllerDTO.setInstanceId(controllerFacade.getInstanceId());
|
||||||
controllerDTO.setInputPorts(inputPortDtos);
|
controllerDTO.setInputPorts(inputPortDtos);
|
||||||
controllerDTO.setOutputPorts(outputPortDtos);
|
controllerDTO.setOutputPorts(outputPortDtos);
|
||||||
controllerDTO.setInputPortCount(inputPorts.size());
|
controllerDTO.setInputPortCount(inputPortDtos.size());
|
||||||
controllerDTO.setOutputPortCount(outputPortDtos.size());
|
controllerDTO.setOutputPortCount(outputPortDtos.size());
|
||||||
controllerDTO.setRunningCount(counts.getRunningCount());
|
controllerDTO.setRunningCount(counts.getRunningCount());
|
||||||
controllerDTO.setStoppedCount(counts.getStoppedCount());
|
controllerDTO.setStoppedCount(counts.getStoppedCount());
|
||||||
|
|
|
@ -863,17 +863,17 @@ nf.Connection = (function () {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.classed('running', function () {
|
.classed('running', function () {
|
||||||
if (d.component.source.exists === true) {
|
if (d.component.source.exists === false) {
|
||||||
return d.component.source.running;
|
|
||||||
} else {
|
|
||||||
return false;
|
return false;
|
||||||
|
} else {
|
||||||
|
return d.component.source.running;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.classed('stopped', function () {
|
.classed('stopped', function () {
|
||||||
if (d.component.source.exists === true) {
|
if (d.component.source.exists === false) {
|
||||||
return !d.component.source.running;
|
|
||||||
} else {
|
|
||||||
return false;
|
return false;
|
||||||
|
} else {
|
||||||
|
return !d.component.source.running;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.classed('is-missing-port', function () {
|
.classed('is-missing-port', function () {
|
||||||
|
@ -972,17 +972,17 @@ nf.Connection = (function () {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.classed('running', function () {
|
.classed('running', function () {
|
||||||
if (d.component.destination.running === true) {
|
if (d.component.destination.exists === false) {
|
||||||
return d.component.destination.running;
|
|
||||||
} else {
|
|
||||||
return false;
|
return false;
|
||||||
|
} else {
|
||||||
|
return d.component.destination.running;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.classed('stopped', function () {
|
.classed('stopped', function () {
|
||||||
if (d.component.destination.running !== true) {
|
if (d.component.destination.exists === false) {
|
||||||
return !d.component.destination.running;
|
|
||||||
} else {
|
|
||||||
return false;
|
return false;
|
||||||
|
} else {
|
||||||
|
return !d.component.destination.running;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.classed('is-missing-port', function () {
|
.classed('is-missing-port', function () {
|
||||||
|
|
|
@ -668,7 +668,7 @@ nf.PolicyManagement = (function () {
|
||||||
var promptToDeletePolicy = function () {
|
var promptToDeletePolicy = function () {
|
||||||
nf.Dialog.showYesNoDialog({
|
nf.Dialog.showYesNoDialog({
|
||||||
headerText: 'Delete Policy',
|
headerText: 'Delete Policy',
|
||||||
dialogContent: 'By deleting this policy, the permissions for this component will revert to the inherited policy.',
|
dialogContent: 'By deleting this policy, the permissions for this component will revert to the inherited policy if applicable.',
|
||||||
yesText: 'Delete',
|
yesText: 'Delete',
|
||||||
noText: 'Cancel',
|
noText: 'Cancel',
|
||||||
yesHandler: function () {
|
yesHandler: function () {
|
||||||
|
|
Loading…
Reference in New Issue