You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by mc...@apache.org on 2016/03/18 21:33:33 UTC
[3/3] nifi git commit: NIFI-1563: - Supporting nodewise breakdown for
system diagnostics and counters. - Updating DTOs to use more consistent
naming. - Code clean up. - Addressing contrib issues.
NIFI-1563:
- Supporting nodewise breakdown for system diagnostics and counters.
- Updating DTOs to use more consistent naming.
- Code clean up.
- Addressing contrib issues.
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/3337ea95
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/3337ea95
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/3337ea95
Branch: refs/heads/NIFI-1563
Commit: 3337ea9513e32528838617c3649b9a00e9f4817a
Parents: 8f28237
Author: Matt Gilman <ma...@gmail.com>
Authored: Fri Mar 18 16:33:18 2016 -0400
Committer: Matt Gilman <ma...@gmail.com>
Committed: Fri Mar 18 16:33:18 2016 -0400
----------------------------------------------------------------------
.../nifi/web/api/dto/SystemDiagnosticsDTO.java | 10 +-
.../web/api/dto/status/ConnectionStatusDTO.java | 26 ++--
.../nifi/web/api/dto/status/PortStatusDTO.java | 20 +--
.../api/dto/status/ProcessGroupStatusDTO.java | 20 +--
.../status/ProcessGroupStatusSnapshotDTO.java | 11 +-
.../web/api/dto/status/ProcessorStatusDTO.java | 26 ++--
.../dto/status/RemoteProcessGroupStatusDTO.java | 20 +--
.../web/api/dto/status/StatusHistoryDTO.java | 20 +--
.../nifi/web/api/dto/status/StatusMerger.java | 44 +++---
.../cluster/manager/impl/WebClusterManager.java | 120 +++++++++++-----
.../status/history/StatusHistoryUtil.java | 2 +-
.../org/apache/nifi/web/NiFiServiceFacade.java | 1 -
.../apache/nifi/web/api/ConnectionResource.java | 2 +-
.../apache/nifi/web/api/ControllerResource.java | 102 ++++++++++----
.../apache/nifi/web/api/InputPortResource.java | 2 +-
.../apache/nifi/web/api/OutputPortResource.java | 2 +-
.../nifi/web/api/ProcessGroupResource.java | 8 +-
.../apache/nifi/web/api/ProcessorResource.java | 2 +-
.../web/api/RemoteProcessGroupResource.java | 2 +-
.../nifi/web/api/SystemDiagnosticsResource.java | 79 ++++++++---
.../org/apache/nifi/web/api/dto/DtoFactory.java | 22 +--
.../src/main/webapp/js/nf/canvas/nf-canvas.js | 4 +-
.../src/main/webapp/js/nf/canvas/nf-graph.js | 14 +-
.../webapp/js/nf/counters/nf-counters-table.js | 12 +-
.../src/main/webapp/js/nf/nf-status-history.js | 14 +-
.../webapp/js/nf/summary/nf-summary-table.js | 139 ++++++++++---------
26 files changed, 432 insertions(+), 292 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/3337ea95/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/SystemDiagnosticsDTO.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/SystemDiagnosticsDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/SystemDiagnosticsDTO.java
index 0aa3d2c..40a04d4 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/SystemDiagnosticsDTO.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/SystemDiagnosticsDTO.java
@@ -26,7 +26,7 @@ import com.wordnik.swagger.annotations.ApiModelProperty;
@XmlType(name = "systemDiagnostics")
public class SystemDiagnosticsDTO {
private SystemDiagnosticsSnapshotDTO aggregateSnapshot;
- private List<NodeSystemDiagnosticsSnapshotDTO> nodeSnapshot;
+ private List<NodeSystemDiagnosticsSnapshotDTO> nodeSnapshots;
@ApiModelProperty("A systems diagnostic snapshot that represents the aggregate values of all nodes in the cluster. If the NiFi instance is "
@@ -41,11 +41,11 @@ public class SystemDiagnosticsDTO {
@ApiModelProperty("A systems diagnostics snapshot for each node in the cluster. If the NiFi instance is a standalone instance, rather than "
+ "a cluster, this may be null.")
- public List<NodeSystemDiagnosticsSnapshotDTO> getNodeSnapshot() {
- return nodeSnapshot;
+ public List<NodeSystemDiagnosticsSnapshotDTO> getNodeSnapshots() {
+ return nodeSnapshots;
}
- public void setNodeSnapshot(List<NodeSystemDiagnosticsSnapshotDTO> nodeSnapshot) {
- this.nodeSnapshot = nodeSnapshot;
+ public void setNodeSnapshots(List<NodeSystemDiagnosticsSnapshotDTO> nodeSnapshots) {
+ this.nodeSnapshots = nodeSnapshots;
}
}
http://git-wip-us.apache.org/repos/asf/nifi/blob/3337ea95/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ConnectionStatusDTO.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ConnectionStatusDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ConnectionStatusDTO.java
index 84ec774..b9bfd00 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ConnectionStatusDTO.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ConnectionStatusDTO.java
@@ -39,8 +39,8 @@ public class ConnectionStatusDTO implements Cloneable {
private String destinationId;
private String destinationName;
- private ConnectionStatusSnapshotDTO aggregateStatus;
- private List<NodeConnectionStatusSnapshotDTO> nodeStatuses;
+ private ConnectionStatusSnapshotDTO aggregateSnapshot;
+ private List<NodeConnectionStatusSnapshotDTO> nodeSnapshots;
@ApiModelProperty("The ID of the connection")
public String getId() {
@@ -106,21 +106,21 @@ public class ConnectionStatusDTO implements Cloneable {
}
@ApiModelProperty("The status snapshot that represents the aggregate stats of the cluster")
- public ConnectionStatusSnapshotDTO getAggregateStatus() {
- return aggregateStatus;
+ public ConnectionStatusSnapshotDTO getAggregateSnapshot() {
+ return aggregateSnapshot;
}
- public void setAggregateStatus(ConnectionStatusSnapshotDTO aggregateStatus) {
- this.aggregateStatus = aggregateStatus;
+ public void setAggregateSnapshot(ConnectionStatusSnapshotDTO aggregateSnapshot) {
+ this.aggregateSnapshot = aggregateSnapshot;
}
@ApiModelProperty("A list of status snapshots for each node")
- public List<NodeConnectionStatusSnapshotDTO> getNodeStatuses() {
- return nodeStatuses;
+ public List<NodeConnectionStatusSnapshotDTO> getNodeSnapshots() {
+ return nodeSnapshots;
}
- public void setNodeStatuses(List<NodeConnectionStatusSnapshotDTO> nodeStatuses) {
- this.nodeStatuses = nodeStatuses;
+ public void setNodeSnapshots(List<NodeConnectionStatusSnapshotDTO> nodeSnapshots) {
+ this.nodeSnapshots = nodeSnapshots;
}
@XmlJavaTypeAdapter(TimeAdapter.class)
@@ -143,14 +143,14 @@ public class ConnectionStatusDTO implements Cloneable {
other.setName(getName());
other.setSourceId(getSourceId());
other.setSourceName(getSourceName());
- other.setAggregateStatus(getAggregateStatus().clone());
+ other.setAggregateSnapshot(getAggregateSnapshot().clone());
- final List<NodeConnectionStatusSnapshotDTO> nodeStatuses = getNodeStatuses();
+ final List<NodeConnectionStatusSnapshotDTO> nodeStatuses = getNodeSnapshots();
final List<NodeConnectionStatusSnapshotDTO> nodeStatusClones = new ArrayList<>(nodeStatuses.size());
for (final NodeConnectionStatusSnapshotDTO nodeStatus : nodeStatuses) {
nodeStatusClones.add(nodeStatus.clone());
}
- other.setNodeStatuses(nodeStatusClones);
+ other.setNodeSnapshots(nodeStatusClones);
return other;
}
http://git-wip-us.apache.org/repos/asf/nifi/blob/3337ea95/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/PortStatusDTO.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/PortStatusDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/PortStatusDTO.java
index 7e0ded5..5e44e71 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/PortStatusDTO.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/PortStatusDTO.java
@@ -35,8 +35,8 @@ public class PortStatusDTO {
private String runStatus;
private Date statsLastRefreshed;
- private PortStatusSnapshotDTO aggregateStatus;
- private List<NodePortStatusSnapshotDTO> nodeStatuses;
+ private PortStatusSnapshotDTO aggregateSnapshot;
+ private List<NodePortStatusSnapshotDTO> nodeSnapshots;
@ApiModelProperty("Whether the port has incoming or outgoing connections to a remote NiFi.")
public Boolean isTransmitting() {
@@ -89,22 +89,22 @@ public class PortStatusDTO {
@ApiModelProperty("A status snapshot that represents the aggregate stats of all nodes in the cluster. If the NiFi instance is "
+ "a standalone instance, rather than a cluster, this represents the stats of the single instance.")
- public PortStatusSnapshotDTO getAggregateStatus() {
- return aggregateStatus;
+ public PortStatusSnapshotDTO getAggregateSnapshot() {
+ return aggregateSnapshot;
}
- public void setAggregateStatus(PortStatusSnapshotDTO aggregateStatus) {
- this.aggregateStatus = aggregateStatus;
+ public void setAggregateSnapshot(PortStatusSnapshotDTO aggregateSnapshot) {
+ this.aggregateSnapshot = aggregateSnapshot;
}
@ApiModelProperty("A status snapshot for each node in the cluster. If the NiFi instance is a standalone instance, rather than "
+ "a cluster, this may be null.")
- public List<NodePortStatusSnapshotDTO> getNodeStatuses() {
- return nodeStatuses;
+ public List<NodePortStatusSnapshotDTO> getNodeSnapshots() {
+ return nodeSnapshots;
}
- public void setNodeStatuses(List<NodePortStatusSnapshotDTO> nodeStatuses) {
- this.nodeStatuses = nodeStatuses;
+ public void setNodeSnapshots(List<NodePortStatusSnapshotDTO> nodeSnapshots) {
+ this.nodeSnapshots = nodeSnapshots;
}
/**
http://git-wip-us.apache.org/repos/asf/nifi/blob/3337ea95/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ProcessGroupStatusDTO.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ProcessGroupStatusDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ProcessGroupStatusDTO.java
index c493fc4..1df212a 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ProcessGroupStatusDTO.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ProcessGroupStatusDTO.java
@@ -32,8 +32,8 @@ public class ProcessGroupStatusDTO implements Cloneable {
private String name;
private Date statsLastRefreshed;
- private ProcessGroupStatusSnapshotDTO aggregateStatus;
- private List<NodeProcessGroupStatusSnapshotDTO> nodeStatuses;
+ private ProcessGroupStatusSnapshotDTO aggregateSnapshot;
+ private List<NodeProcessGroupStatusSnapshotDTO> nodeSnapshots;
@ApiModelProperty("The ID of the Process Group")
public String getId() {
@@ -54,22 +54,22 @@ public class ProcessGroupStatusDTO implements Cloneable {
}
@ApiModelProperty("The aggregate status of all nodes in the cluster")
- public ProcessGroupStatusSnapshotDTO getAggregateStatus() {
- return aggregateStatus;
+ public ProcessGroupStatusSnapshotDTO getAggregateSnapshot() {
+ return aggregateSnapshot;
}
- public void setAggregateStatus(ProcessGroupStatusSnapshotDTO aggregateStatus) {
- this.aggregateStatus = aggregateStatus;
+ public void setAggregateSnapshot(ProcessGroupStatusSnapshotDTO aggregateSnapshot) {
+ this.aggregateSnapshot = aggregateSnapshot;
}
@ApiModelProperty("The status reported by each node in the cluster. If the NiFi instance is a standalone instance, rather than "
+ "a clustered instance, this value may be null.")
- public List<NodeProcessGroupStatusSnapshotDTO> getNodeStatuses() {
- return nodeStatuses;
+ public List<NodeProcessGroupStatusSnapshotDTO> getNodeSnapshots() {
+ return nodeSnapshots;
}
- public void setNodeStatuses(List<NodeProcessGroupStatusSnapshotDTO> nodeStatuses) {
- this.nodeStatuses = nodeStatuses;
+ public void setNodeSnapshots(List<NodeProcessGroupStatusSnapshotDTO> nodeSnapshots) {
+ this.nodeSnapshots = nodeSnapshots;
}
/**
http://git-wip-us.apache.org/repos/asf/nifi/blob/3337ea95/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ProcessGroupStatusSnapshotDTO.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ProcessGroupStatusSnapshotDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ProcessGroupStatusSnapshotDTO.java
index 0190bc3..e5c61dd 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ProcessGroupStatusSnapshotDTO.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ProcessGroupStatusSnapshotDTO.java
@@ -16,18 +16,13 @@
*/
package org.apache.nifi.web.api.dto.status;
+import com.wordnik.swagger.annotations.ApiModelProperty;
+
+import javax.xml.bind.annotation.XmlType;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Date;
import java.util.List;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-import org.apache.nifi.web.api.dto.util.TimeAdapter;
-
-import com.wordnik.swagger.annotations.ApiModelProperty;
-
/**
* The status for a process group in this NiFi.
*/
http://git-wip-us.apache.org/repos/asf/nifi/blob/3337ea95/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ProcessorStatusDTO.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ProcessorStatusDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ProcessorStatusDTO.java
index 01d1cdd..a4729c4 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ProcessorStatusDTO.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/ProcessorStatusDTO.java
@@ -39,8 +39,8 @@ public class ProcessorStatusDTO implements Cloneable {
private String runStatus;
private Date statsLastRefreshed;
- private ProcessorStatusSnapshotDTO aggregateStatus;
- private List<NodeProcessorStatusSnapshotDTO> nodeStatuses;
+ private ProcessorStatusSnapshotDTO aggregateSnapshot;
+ private List<NodeProcessorStatusSnapshotDTO> nodeSnapshots;
@ApiModelProperty("The unique ID of the process group that the Processor belongs to")
public String getGroupId() {
@@ -99,22 +99,22 @@ public class ProcessorStatusDTO implements Cloneable {
@ApiModelProperty("A status snapshot that represents the aggregate stats of all nodes in the cluster. If the NiFi instance is "
+ "a standalone instance, rather than a cluster, this represents the stats of the single instance.")
- public ProcessorStatusSnapshotDTO getAggregateStatus() {
- return aggregateStatus;
+ public ProcessorStatusSnapshotDTO getAggregateSnapshot() {
+ return aggregateSnapshot;
}
- public void setAggregateStatus(ProcessorStatusSnapshotDTO aggregateStatus) {
- this.aggregateStatus = aggregateStatus;
+ public void setAggregateSnapshot(ProcessorStatusSnapshotDTO aggregateSnapshot) {
+ this.aggregateSnapshot = aggregateSnapshot;
}
@ApiModelProperty("A status snapshot for each node in the cluster. If the NiFi instance is a standalone instance, rather than "
+ "a cluster, this may be null.")
- public List<NodeProcessorStatusSnapshotDTO> getNodeStatuses() {
- return nodeStatuses;
+ public List<NodeProcessorStatusSnapshotDTO> getNodeSnapshots() {
+ return nodeSnapshots;
}
- public void setNodeStatuses(List<NodeProcessorStatusSnapshotDTO> nodeStatuses) {
- this.nodeStatuses = nodeStatuses;
+ public void setNodeSnapshots(List<NodeProcessorStatusSnapshotDTO> nodeSnapshots) {
+ this.nodeSnapshots = nodeSnapshots;
}
@Override
@@ -126,14 +126,14 @@ public class ProcessorStatusDTO implements Cloneable {
other.setRunStatus(getRunStatus());
other.setType(getType());
other.setStatsLastRefreshed(getStatsLastRefreshed());
- other.setAggregateStatus(getAggregateStatus().clone());
+ other.setAggregateSnapshot(getAggregateSnapshot().clone());
- final List<NodeProcessorStatusSnapshotDTO> nodeStatuses = getNodeStatuses();
+ final List<NodeProcessorStatusSnapshotDTO> nodeStatuses = getNodeSnapshots();
final List<NodeProcessorStatusSnapshotDTO> nodeStatusClones = new ArrayList<>(nodeStatuses.size());
for (final NodeProcessorStatusSnapshotDTO status : nodeStatuses) {
nodeStatusClones.add(status.clone());
}
- other.setNodeStatuses(nodeStatusClones);
+ other.setNodeSnapshots(nodeStatusClones);
return other;
}
http://git-wip-us.apache.org/repos/asf/nifi/blob/3337ea95/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/RemoteProcessGroupStatusDTO.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/RemoteProcessGroupStatusDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/RemoteProcessGroupStatusDTO.java
index 64ba62f..62685b1 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/RemoteProcessGroupStatusDTO.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/RemoteProcessGroupStatusDTO.java
@@ -37,8 +37,8 @@ public class RemoteProcessGroupStatusDTO {
private List<String> authorizationIssues;
- private RemoteProcessGroupStatusSnapshotDTO aggregateStatus;
- private List<NodeRemoteProcessGroupStatusSnapshotDTO> nodeStatuses;
+ private RemoteProcessGroupStatusSnapshotDTO aggregateSnapshot;
+ private List<NodeRemoteProcessGroupStatusSnapshotDTO> nodeSnapshots;
@ApiModelProperty("The unique ID of the process group that the Processor belongs to")
public String getGroupId() {
@@ -97,22 +97,22 @@ public class RemoteProcessGroupStatusDTO {
@ApiModelProperty("A status snapshot that represents the aggregate stats of all nodes in the cluster. If the NiFi instance is "
+ "a standalone instance, rather than a cluster, this represents the stats of the single instance.")
- public RemoteProcessGroupStatusSnapshotDTO getAggregateStatus() {
- return aggregateStatus;
+ public RemoteProcessGroupStatusSnapshotDTO getAggregateSnapshot() {
+ return aggregateSnapshot;
}
- public void setAggregateStatus(RemoteProcessGroupStatusSnapshotDTO aggregateStatus) {
- this.aggregateStatus = aggregateStatus;
+ public void setAggregateSnapshot(RemoteProcessGroupStatusSnapshotDTO aggregateSnapshot) {
+ this.aggregateSnapshot = aggregateSnapshot;
}
@ApiModelProperty("A status snapshot for each node in the cluster. If the NiFi instance is a standalone instance, rather than "
+ "a cluster, this may be null.")
- public List<NodeRemoteProcessGroupStatusSnapshotDTO> getNodeStatuses() {
- return nodeStatuses;
+ public List<NodeRemoteProcessGroupStatusSnapshotDTO> getNodeSnapshots() {
+ return nodeSnapshots;
}
- public void setNodeStatuses(List<NodeRemoteProcessGroupStatusSnapshotDTO> nodeStatuses) {
- this.nodeStatuses = nodeStatuses;
+ public void setNodeSnapshots(List<NodeRemoteProcessGroupStatusSnapshotDTO> nodeSnapshots) {
+ this.nodeSnapshots = nodeSnapshots;
}
/**
http://git-wip-us.apache.org/repos/asf/nifi/blob/3337ea95/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/StatusHistoryDTO.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/StatusHistoryDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/StatusHistoryDTO.java
index 31d3cc3..3654e10 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/StatusHistoryDTO.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/StatusHistoryDTO.java
@@ -35,8 +35,8 @@ public class StatusHistoryDTO {
private LinkedHashMap<String, String> componentDetails;
private List<StatusDescriptorDTO> fieldDescriptors;
- private List<StatusSnapshotDTO> aggregateStatusSnapshots;
- private List<NodeStatusSnapshotsDTO> nodeStatusSnapshots;
+ private List<StatusSnapshotDTO> aggregateSnapshots;
+ private List<NodeStatusSnapshotsDTO> nodeSnapshots;
/**
* @return when this status history was generated
@@ -75,21 +75,21 @@ public class StatusHistoryDTO {
@ApiModelProperty("A list of StatusSnapshotDTO objects that provide the actual metric values for the component. If the NiFi instance "
+ "is clustered, this will represent the aggregate status across all nodes. If the NiFi instance is not clustered, this will represent "
+ "the status of the entire NiFi instance.")
- public List<StatusSnapshotDTO> getAggregateStatusSnapshots() {
- return aggregateStatusSnapshots;
+ public List<StatusSnapshotDTO> getAggregateSnapshots() {
+ return aggregateSnapshots;
}
- public void setAggregateStatusSnapshots(List<StatusSnapshotDTO> aggregateStatusSnapshots) {
- this.aggregateStatusSnapshots = aggregateStatusSnapshots;
+ public void setAggregateSnapshots(List<StatusSnapshotDTO> aggregateSnapshots) {
+ this.aggregateSnapshots = aggregateSnapshots;
}
@ApiModelProperty("The NodeStatusSnapshotsDTO objects that provide the actual metric values for the component, for each node. "
+ "If the NiFi instance is not clustered, this value will be null.")
- public List<NodeStatusSnapshotsDTO> getNodeStatusSnapshots() {
- return nodeStatusSnapshots;
+ public List<NodeStatusSnapshotsDTO> getNodeSnapshots() {
+ return nodeSnapshots;
}
- public void setNodeStatusSnapshots(List<NodeStatusSnapshotsDTO> nodeStatusSnapshots) {
- this.nodeStatusSnapshots = nodeStatusSnapshots;
+ public void setNodeSnapshots(List<NodeStatusSnapshotsDTO> nodeSnapshots) {
+ this.nodeSnapshots = nodeSnapshots;
}
}
http://git-wip-us.apache.org/repos/asf/nifi/blob/3337ea95/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/StatusMerger.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/StatusMerger.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/StatusMerger.java
index dd2a2f1..c8f468f 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/StatusMerger.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/status/StatusMerger.java
@@ -83,16 +83,16 @@ public class StatusMerger {
public static void merge(final ProcessGroupStatusDTO target, final ProcessGroupStatusDTO toMerge, final String nodeId, final String nodeAddress, final Integer nodeApiPort) {
- merge(target.getAggregateStatus(), toMerge.getAggregateStatus());
+ merge(target.getAggregateSnapshot(), toMerge.getAggregateSnapshot());
- if (target.getNodeStatuses() != null) {
+ if (target.getNodeSnapshots() != null) {
final NodeProcessGroupStatusSnapshotDTO nodeSnapshot = new NodeProcessGroupStatusSnapshotDTO();
- nodeSnapshot.setStatusSnapshot(toMerge.getAggregateStatus());
+ nodeSnapshot.setStatusSnapshot(toMerge.getAggregateSnapshot());
nodeSnapshot.setAddress(nodeAddress);
nodeSnapshot.setApiPort(nodeApiPort);
nodeSnapshot.setNodeId(nodeId);
- target.getNodeStatuses().add(nodeSnapshot);
+ target.getNodeSnapshots().add(nodeSnapshot);
}
}
@@ -261,58 +261,58 @@ public class StatusMerger {
}
public static void merge(final RemoteProcessGroupStatusDTO target, final RemoteProcessGroupStatusDTO toMerge, final String nodeId, final String nodeAddress, final Integer nodeApiPort) {
- merge(target.getAggregateStatus(), toMerge.getAggregateStatus());
+ merge(target.getAggregateSnapshot(), toMerge.getAggregateSnapshot());
- if (target.getNodeStatuses() != null) {
+ if (target.getNodeSnapshots() != null) {
final NodeRemoteProcessGroupStatusSnapshotDTO nodeSnapshot = new NodeRemoteProcessGroupStatusSnapshotDTO();
- nodeSnapshot.setStatusSnapshot(toMerge.getAggregateStatus());
+ nodeSnapshot.setStatusSnapshot(toMerge.getAggregateSnapshot());
nodeSnapshot.setAddress(nodeAddress);
nodeSnapshot.setApiPort(nodeApiPort);
nodeSnapshot.setNodeId(nodeId);
- target.getNodeStatuses().add(nodeSnapshot);
+ target.getNodeSnapshots().add(nodeSnapshot);
}
}
public static void merge(final PortStatusDTO target, final PortStatusDTO toMerge, final String nodeId, final String nodeAddress, final Integer nodeApiPort) {
- merge(target.getAggregateStatus(), toMerge.getAggregateStatus());
+ merge(target.getAggregateSnapshot(), toMerge.getAggregateSnapshot());
- if (target.getNodeStatuses() != null) {
+ if (target.getNodeSnapshots() != null) {
final NodePortStatusSnapshotDTO nodeSnapshot = new NodePortStatusSnapshotDTO();
- nodeSnapshot.setStatusSnapshot(toMerge.getAggregateStatus());
+ nodeSnapshot.setStatusSnapshot(toMerge.getAggregateSnapshot());
nodeSnapshot.setAddress(nodeAddress);
nodeSnapshot.setApiPort(nodeApiPort);
nodeSnapshot.setNodeId(nodeId);
- target.getNodeStatuses().add(nodeSnapshot);
+ target.getNodeSnapshots().add(nodeSnapshot);
}
}
public static void merge(final ConnectionStatusDTO target, final ConnectionStatusDTO toMerge, final String nodeId, final String nodeAddress, final Integer nodeApiPort) {
- merge(target.getAggregateStatus(), toMerge.getAggregateStatus());
+ merge(target.getAggregateSnapshot(), toMerge.getAggregateSnapshot());
- if (target.getNodeStatuses() != null) {
+ if (target.getNodeSnapshots() != null) {
final NodeConnectionStatusSnapshotDTO nodeSnapshot = new NodeConnectionStatusSnapshotDTO();
- nodeSnapshot.setStatusSnapshot(toMerge.getAggregateStatus());
+ nodeSnapshot.setStatusSnapshot(toMerge.getAggregateSnapshot());
nodeSnapshot.setAddress(nodeAddress);
nodeSnapshot.setApiPort(nodeApiPort);
nodeSnapshot.setNodeId(nodeId);
- target.getNodeStatuses().add(nodeSnapshot);
+ target.getNodeSnapshots().add(nodeSnapshot);
}
}
public static void merge(final ProcessorStatusDTO target, final ProcessorStatusDTO toMerge, final String nodeId, final String nodeAddress, final Integer nodeApiPort) {
- merge(target.getAggregateStatus(), toMerge.getAggregateStatus());
+ merge(target.getAggregateSnapshot(), toMerge.getAggregateSnapshot());
- if (target.getNodeStatuses() != null) {
+ if (target.getNodeSnapshots() != null) {
final NodeProcessorStatusSnapshotDTO nodeSnapshot = new NodeProcessorStatusSnapshotDTO();
- nodeSnapshot.setStatusSnapshot(toMerge.getAggregateStatus());
+ nodeSnapshot.setStatusSnapshot(toMerge.getAggregateSnapshot());
nodeSnapshot.setAddress(nodeAddress);
nodeSnapshot.setApiPort(nodeApiPort);
nodeSnapshot.setNodeId(nodeId);
- target.getNodeStatuses().add(nodeSnapshot);
+ target.getNodeSnapshots().add(nodeSnapshot);
}
}
@@ -441,7 +441,7 @@ public class StatusMerger {
public static void merge(final SystemDiagnosticsDTO target, final SystemDiagnosticsDTO toMerge, final String nodeId, final String nodeAddress, final Integer nodeApiPort) {
merge(target.getAggregateSnapshot(), toMerge.getAggregateSnapshot());
- List<NodeSystemDiagnosticsSnapshotDTO> nodeSnapshots = target.getNodeSnapshot();
+ List<NodeSystemDiagnosticsSnapshotDTO> nodeSnapshots = target.getNodeSnapshots();
if (nodeSnapshots == null) {
nodeSnapshots = new ArrayList<>();
}
@@ -453,7 +453,7 @@ public class StatusMerger {
nodeSnapshot.setSnapshot(toMerge.getAggregateSnapshot());
nodeSnapshots.add(nodeSnapshot);
- target.setNodeSnapshot(nodeSnapshots);
+ target.setNodeSnapshots(nodeSnapshots);
}
public static void merge(final SystemDiagnosticsSnapshotDTO target, final SystemDiagnosticsSnapshotDTO toMerge) {
http://git-wip-us.apache.org/repos/asf/nifi/blob/3337ea95/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/impl/WebClusterManager.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/impl/WebClusterManager.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/impl/WebClusterManager.java
index 8e4ca73..8a1854c 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/impl/WebClusterManager.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/impl/WebClusterManager.java
@@ -205,6 +205,8 @@ import org.apache.nifi.web.api.dto.DropRequestDTO;
import org.apache.nifi.web.api.dto.FlowFileSummaryDTO;
import org.apache.nifi.web.api.dto.FlowSnippetDTO;
import org.apache.nifi.web.api.dto.ListingRequestDTO;
+import org.apache.nifi.web.api.dto.NodeCountersSnapshotDTO;
+import org.apache.nifi.web.api.dto.NodeSystemDiagnosticsSnapshotDTO;
import org.apache.nifi.web.api.dto.ProcessGroupDTO;
import org.apache.nifi.web.api.dto.ProcessorDTO;
import org.apache.nifi.web.api.dto.QueueSizeDTO;
@@ -372,7 +374,8 @@ public class WebClusterManager implements HttpClusterManager, ProtocolHandler, C
public static final Pattern CONNECTION_STATUS_URI_PATTERN = Pattern.compile("/nifi-api/controller/process-groups/(?:(?:root)|(?:[a-f0-9\\-]{36}))/connections/[a-f0-9\\-]{36}/status");
public static final Pattern INPUT_PORT_STATUS_URI_PATTERN = Pattern.compile("/nifi-api/controller/process-groups/(?:(?:root)|(?:[a-f0-9\\-]{36}))/input-ports/[a-f0-9\\-]{36}/status");
public static final Pattern OUTPUT_PORT_STATUS_URI_PATTERN = Pattern.compile("/nifi-api/controller/process-groups/(?:(?:root)|(?:[a-f0-9\\-]{36}))/output-ports/[a-f0-9\\-]{36}/status");
- public static final Pattern REMOTE_PROCESS_GROUP_STATUS_URI_PATTERN = Pattern.compile("/nifi-api/controller/process-groups/(?:(?:root)|(?:[a-f0-9\\-]{36}))/remote-process-groups/[a-f0-9\\-]{36}/status");
+ public static final Pattern REMOTE_PROCESS_GROUP_STATUS_URI_PATTERN =
+ Pattern.compile("/nifi-api/controller/process-groups/(?:(?:root)|(?:[a-f0-9\\-]{36}))/remote-process-groups/[a-f0-9\\-]{36}/status");
@Deprecated
public static final Pattern QUEUE_CONTENTS_URI = Pattern.compile("/nifi-api/controller/process-groups/(?:(?:root)|(?:[a-f0-9\\-]{36}))/connections/[a-f0-9\\-]{36}/contents");
@@ -2669,36 +2672,63 @@ public class WebClusterManager implements HttpClusterManager, ProtocolHandler, C
}
- private void mergeSystemDiagnostics(final SystemDiagnosticsDTO target, final Map<NodeIdentifier, SystemDiagnosticsDTO> resultMap) {
+ private void mergeSystemDiagnostics(final SystemDiagnosticsDTO target, final NodeIdentifier selectedNodeId, final Map<NodeIdentifier, SystemDiagnosticsDTO> resultMap) {
+ final SystemDiagnosticsDTO mergedSystemDiagnostics = target;
+ mergedSystemDiagnostics.setNodeSnapshots(new ArrayList<NodeSystemDiagnosticsSnapshotDTO>());
+
+ final NodeSystemDiagnosticsSnapshotDTO selectedNodeSnapshot = new NodeSystemDiagnosticsSnapshotDTO();
+ selectedNodeSnapshot.setSnapshot(target.getAggregateSnapshot().clone());
+ selectedNodeSnapshot.setAddress(selectedNodeId.getApiAddress());
+ selectedNodeSnapshot.setApiPort(selectedNodeId.getApiPort());
+ selectedNodeSnapshot.setNodeId(selectedNodeId.getId());
+
+ mergedSystemDiagnostics.getNodeSnapshots().add(selectedNodeSnapshot);
+
for (final Map.Entry<NodeIdentifier, SystemDiagnosticsDTO> entry : resultMap.entrySet()) {
final NodeIdentifier nodeId = entry.getKey();
final SystemDiagnosticsDTO toMerge = entry.getValue();
+ if (toMerge == target) {
+ continue;
+ }
- StatusMerger.merge(target, toMerge, nodeId.getId(), nodeId.getApiAddress(), nodeId.getApiPort());
+ StatusMerger.merge(mergedSystemDiagnostics, toMerge, nodeId.getId(), nodeId.getApiAddress(), nodeId.getApiPort());
}
}
- private void mergeCounters(final CountersDTO target, final Map<NodeIdentifier, CountersDTO> resultMap) {
+ private void mergeCounters(final CountersDTO target, final NodeIdentifier selectedNodeId, final Map<NodeIdentifier, CountersDTO> resultMap) {
+ final CountersDTO mergedCounters = target;
+ mergedCounters.setNodeSnapshots(new ArrayList<NodeCountersSnapshotDTO>());
+
+ final NodeCountersSnapshotDTO selectedNodeSnapshot = new NodeCountersSnapshotDTO();
+ selectedNodeSnapshot.setSnapshot(target.getAggregateSnapshot().clone());
+ selectedNodeSnapshot.setAddress(selectedNodeId.getApiAddress());
+ selectedNodeSnapshot.setApiPort(selectedNodeId.getApiPort());
+ selectedNodeSnapshot.setNodeId(selectedNodeId.getId());
+
+ mergedCounters.getNodeSnapshots().add(selectedNodeSnapshot);
+
for (final Map.Entry<NodeIdentifier, CountersDTO> entry : resultMap.entrySet()) {
final NodeIdentifier nodeId = entry.getKey();
final CountersDTO toMerge = entry.getValue();
+ if (toMerge == target) {
+ continue;
+ }
- StatusMerger.merge(target, toMerge, nodeId.getId(), nodeId.getApiAddress(), nodeId.getApiPort());
+ StatusMerger.merge(mergedCounters, toMerge, nodeId.getId(), nodeId.getApiAddress(), nodeId.getApiPort());
}
}
private void mergeGroupStatus(final ProcessGroupStatusDTO statusDto, final NodeIdentifier selectedNodeId, final Map<NodeIdentifier, ProcessGroupStatusDTO> resultMap) {
- ProcessGroupStatusDTO mergedProcessGroupStatus = statusDto;
- mergedProcessGroupStatus.setNodeStatuses(new ArrayList<NodeProcessGroupStatusSnapshotDTO>());
+ final ProcessGroupStatusDTO mergedProcessGroupStatus = statusDto;
+ mergedProcessGroupStatus.setNodeSnapshots(new ArrayList<NodeProcessGroupStatusSnapshotDTO>());
final NodeProcessGroupStatusSnapshotDTO selectedNodeSnapshot = new NodeProcessGroupStatusSnapshotDTO();
- selectedNodeSnapshot.setStatusSnapshot(statusDto.getAggregateStatus().clone());
+ selectedNodeSnapshot.setStatusSnapshot(statusDto.getAggregateSnapshot().clone());
selectedNodeSnapshot.setAddress(selectedNodeId.getApiAddress());
selectedNodeSnapshot.setApiPort(selectedNodeId.getApiPort());
selectedNodeSnapshot.setNodeId(selectedNodeId.getId());
-
- mergedProcessGroupStatus.getNodeStatuses().add(selectedNodeSnapshot);
+ mergedProcessGroupStatus.getNodeSnapshots().add(selectedNodeSnapshot);
for (final Map.Entry<NodeIdentifier, ProcessGroupStatusDTO> entry : resultMap.entrySet()) {
final NodeIdentifier nodeId = entry.getKey();
@@ -2707,7 +2737,7 @@ public class WebClusterManager implements HttpClusterManager, ProtocolHandler, C
continue;
}
- final ProcessGroupStatusSnapshotDTO nodeSnapshot = nodeProcessGroupStatus.getAggregateStatus();
+ final ProcessGroupStatusSnapshotDTO nodeSnapshot = nodeProcessGroupStatus.getAggregateSnapshot();
for (final RemoteProcessGroupStatusSnapshotDTO remoteProcessGroupStatus : nodeSnapshot.getRemoteProcessGroupStatusSnapshots()) {
final List<String> nodeAuthorizationIssues = remoteProcessGroupStatus.getAuthorizationIssues();
if (!nodeAuthorizationIssues.isEmpty()) {
@@ -2726,15 +2756,15 @@ public class WebClusterManager implements HttpClusterManager, ProtocolHandler, C
private void mergeProcessorStatus(final ProcessorStatusDTO statusDto, final NodeIdentifier selectedNodeId, final Map<NodeIdentifier, ProcessorStatusDTO> resultMap) {
final ProcessorStatusDTO mergedProcessorStatus = statusDto;
- mergedProcessorStatus.setNodeStatuses(new ArrayList<NodeProcessorStatusSnapshotDTO>());
+ mergedProcessorStatus.setNodeSnapshots(new ArrayList<NodeProcessorStatusSnapshotDTO>());
final NodeProcessorStatusSnapshotDTO selectedNodeSnapshot = new NodeProcessorStatusSnapshotDTO();
- selectedNodeSnapshot.setStatusSnapshot(statusDto.getAggregateStatus().clone());
+ selectedNodeSnapshot.setStatusSnapshot(statusDto.getAggregateSnapshot().clone());
selectedNodeSnapshot.setAddress(selectedNodeId.getApiAddress());
selectedNodeSnapshot.setApiPort(selectedNodeId.getApiPort());
selectedNodeSnapshot.setNodeId(selectedNodeId.getId());
- mergedProcessorStatus.getNodeStatuses().add(selectedNodeSnapshot);
+ mergedProcessorStatus.getNodeSnapshots().add(selectedNodeSnapshot);
// merge the other nodes
for (final Map.Entry<NodeIdentifier, ProcessorStatusDTO> entry : resultMap.entrySet()) {
@@ -2750,15 +2780,15 @@ public class WebClusterManager implements HttpClusterManager, ProtocolHandler, C
private void mergeConnectionStatus(final ConnectionStatusDTO statusDto, final NodeIdentifier selectedNodeId, final Map<NodeIdentifier, ConnectionStatusDTO> resultMap) {
final ConnectionStatusDTO mergedConnectionStatus = statusDto;
- mergedConnectionStatus.setNodeStatuses(new ArrayList<NodeConnectionStatusSnapshotDTO>());
+ mergedConnectionStatus.setNodeSnapshots(new ArrayList<NodeConnectionStatusSnapshotDTO>());
final NodeConnectionStatusSnapshotDTO selectedNodeSnapshot = new NodeConnectionStatusSnapshotDTO();
- selectedNodeSnapshot.setStatusSnapshot(statusDto.getAggregateStatus().clone());
+ selectedNodeSnapshot.setStatusSnapshot(statusDto.getAggregateSnapshot().clone());
selectedNodeSnapshot.setAddress(selectedNodeId.getApiAddress());
selectedNodeSnapshot.setApiPort(selectedNodeId.getApiPort());
selectedNodeSnapshot.setNodeId(selectedNodeId.getId());
- mergedConnectionStatus.getNodeStatuses().add(selectedNodeSnapshot);
+ mergedConnectionStatus.getNodeSnapshots().add(selectedNodeSnapshot);
// merge the other nodes
for (final Map.Entry<NodeIdentifier, ConnectionStatusDTO> entry : resultMap.entrySet()) {
@@ -2774,15 +2804,15 @@ public class WebClusterManager implements HttpClusterManager, ProtocolHandler, C
private void mergePortStatus(final PortStatusDTO statusDto, final NodeIdentifier selectedNodeId, final Map<NodeIdentifier, PortStatusDTO> resultMap) {
final PortStatusDTO mergedPortStatus = statusDto;
- mergedPortStatus.setNodeStatuses(new ArrayList<NodePortStatusSnapshotDTO>());
+ mergedPortStatus.setNodeSnapshots(new ArrayList<NodePortStatusSnapshotDTO>());
final NodePortStatusSnapshotDTO selectedNodeSnapshot = new NodePortStatusSnapshotDTO();
- selectedNodeSnapshot.setStatusSnapshot(statusDto.getAggregateStatus().clone());
+ selectedNodeSnapshot.setStatusSnapshot(statusDto.getAggregateSnapshot().clone());
selectedNodeSnapshot.setAddress(selectedNodeId.getApiAddress());
selectedNodeSnapshot.setApiPort(selectedNodeId.getApiPort());
selectedNodeSnapshot.setNodeId(selectedNodeId.getId());
- mergedPortStatus.getNodeStatuses().add(selectedNodeSnapshot);
+ mergedPortStatus.getNodeSnapshots().add(selectedNodeSnapshot);
// merge the other nodes
for (final Map.Entry<NodeIdentifier, PortStatusDTO> entry : resultMap.entrySet()) {
@@ -2798,15 +2828,15 @@ public class WebClusterManager implements HttpClusterManager, ProtocolHandler, C
private void mergeRemoteProcessGroupStatus(final RemoteProcessGroupStatusDTO statusDto, final NodeIdentifier selectedNodeId, final Map<NodeIdentifier, RemoteProcessGroupStatusDTO> resultMap) {
final RemoteProcessGroupStatusDTO mergedRemoteProcessGroupStatus = statusDto;
- mergedRemoteProcessGroupStatus.setNodeStatuses(new ArrayList<NodeRemoteProcessGroupStatusSnapshotDTO>());
+ mergedRemoteProcessGroupStatus.setNodeSnapshots(new ArrayList<NodeRemoteProcessGroupStatusSnapshotDTO>());
final NodeRemoteProcessGroupStatusSnapshotDTO selectedNodeSnapshot = new NodeRemoteProcessGroupStatusSnapshotDTO();
- selectedNodeSnapshot.setStatusSnapshot(statusDto.getAggregateStatus().clone());
+ selectedNodeSnapshot.setStatusSnapshot(statusDto.getAggregateSnapshot().clone());
selectedNodeSnapshot.setAddress(selectedNodeId.getApiAddress());
selectedNodeSnapshot.setApiPort(selectedNodeId.getApiPort());
selectedNodeSnapshot.setNodeId(selectedNodeId.getId());
- mergedRemoteProcessGroupStatus.getNodeStatuses().add(selectedNodeSnapshot);
+ mergedRemoteProcessGroupStatus.getNodeSnapshots().add(selectedNodeSnapshot);
// merge the other nodes
for (final Map.Entry<NodeIdentifier, RemoteProcessGroupStatusDTO> entry : resultMap.entrySet()) {
@@ -4073,36 +4103,52 @@ public class WebClusterManager implements HttpClusterManager, ProtocolHandler, C
final SystemDiagnosticsEntity responseEntity = clientResponse.getClientResponse().getEntity(SystemDiagnosticsEntity.class);
final SystemDiagnosticsDTO responseDto = responseEntity.getSystemDiagnostics();
+ NodeIdentifier nodeIdentifier = null;
+
final Map<NodeIdentifier, SystemDiagnosticsDTO> resultsMap = new HashMap<>();
for (final NodeResponse nodeResponse : updatedNodesMap.values()) {
if (problematicNodeResponses.contains(nodeResponse)) {
continue;
}
- final SystemDiagnosticsEntity nodeResponseEntity = nodeResponse == clientResponse ? responseEntity : nodeResponse.getClientResponse().getEntity(SystemDiagnosticsEntity.class);
- final SystemDiagnosticsDTO nodeStatus = nodeResponseEntity.getSystemDiagnostics();
+ final SystemDiagnosticsEntity nodeResponseEntity;
+ if (nodeResponse == clientResponse) {
+ nodeIdentifier = nodeResponse.getNodeId();
+ nodeResponseEntity = responseEntity;
+ } else {
+ nodeResponseEntity = nodeResponse.getClientResponse().getEntity(SystemDiagnosticsEntity.class);
+ }
+ final SystemDiagnosticsDTO nodeStatus = nodeResponseEntity.getSystemDiagnostics();
resultsMap.put(nodeResponse.getNodeId(), nodeStatus);
}
- mergeSystemDiagnostics(responseDto, resultsMap);
+ mergeSystemDiagnostics(responseDto, nodeIdentifier, resultsMap);
clientResponse = new NodeResponse(clientResponse, responseEntity);
} else if (hasSuccessfulClientResponse && isCountersEndpoint(uri, method)) {
final CountersEntity responseEntity = clientResponse.getClientResponse().getEntity(CountersEntity.class);
final CountersDTO responseDto = responseEntity.getCounters();
+ NodeIdentifier nodeIdentifier = null;
+
final Map<NodeIdentifier, CountersDTO> resultsMap = new HashMap<>();
for (final NodeResponse nodeResponse : updatedNodesMap.values()) {
if (problematicNodeResponses.contains(nodeResponse)) {
continue;
}
- final CountersEntity nodeResponseEntity = nodeResponse == clientResponse ? responseEntity : nodeResponse.getClientResponse().getEntity(CountersEntity.class);
- final CountersDTO nodeStatus = nodeResponseEntity.getCounters();
+ final CountersEntity nodeResponseEntity;
+ if (nodeResponse == clientResponse) {
+ nodeIdentifier = nodeResponse.getNodeId();
+ nodeResponseEntity = responseEntity;
+ } else {
+ nodeResponseEntity = nodeResponse.getClientResponse().getEntity(CountersEntity.class);
+ }
+ final CountersDTO nodeStatus = nodeResponseEntity.getCounters();
resultsMap.put(nodeResponse.getNodeId(), nodeStatus);
}
- mergeCounters(responseDto, resultsMap);
+ mergeCounters(responseDto, nodeIdentifier, resultsMap);
clientResponse = new NodeResponse(clientResponse, responseEntity);
} else {
@@ -4180,18 +4226,18 @@ public class WebClusterManager implements HttpClusterManager, ProtocolHandler, C
lastStatusHistory = nodeStatus;
final NodeIdentifier nodeId = nodeResponse.getNodeId();
- final NodeStatusSnapshotsDTO nodeStatuSnapshot = new NodeStatusSnapshotsDTO();
- nodeStatuSnapshot.setNodeId(nodeId.getId());
- nodeStatuSnapshot.setAddress(nodeId.getApiAddress());
- nodeStatuSnapshot.setApiPort(nodeId.getApiPort());
- nodeStatuSnapshot.setStatusSnapshots(nodeStatus.getAggregateStatusSnapshots());
- nodeStatusSnapshots.add(nodeStatuSnapshot);
+ final NodeStatusSnapshotsDTO nodeStatusSnapshot = new NodeStatusSnapshotsDTO();
+ nodeStatusSnapshot.setNodeId(nodeId.getId());
+ nodeStatusSnapshot.setAddress(nodeId.getApiAddress());
+ nodeStatusSnapshot.setApiPort(nodeId.getApiPort());
+ nodeStatusSnapshot.setStatusSnapshots(nodeStatus.getAggregateSnapshots());
+ nodeStatusSnapshots.add(nodeStatusSnapshot);
}
final StatusHistoryDTO clusterStatusHistory = new StatusHistoryDTO();
- clusterStatusHistory.setAggregateStatusSnapshots(mergeStatusHistories(nodeStatusSnapshots, metricDescriptors));
+ clusterStatusHistory.setAggregateSnapshots(mergeStatusHistories(nodeStatusSnapshots, metricDescriptors));
clusterStatusHistory.setGenerated(new Date());
- clusterStatusHistory.setNodeStatusSnapshots(nodeStatusSnapshots);
+ clusterStatusHistory.setNodeSnapshots(nodeStatusSnapshots);
if (lastStatusHistory != null) {
clusterStatusHistory.setComponentDetails(lastStatusHistory.getComponentDetails());
clusterStatusHistory.setFieldDescriptors(lastStatusHistory.getFieldDescriptors());
http://git-wip-us.apache.org/repos/asf/nifi/blob/3337ea95/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/status/history/StatusHistoryUtil.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/status/history/StatusHistoryUtil.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/status/history/StatusHistoryUtil.java
index 2b0cd9e..756e576 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/status/history/StatusHistoryUtil.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/status/history/StatusHistoryUtil.java
@@ -46,7 +46,7 @@ public class StatusHistoryUtil {
dto.setGenerated(new Date());
dto.setComponentDetails(componentDetails);
dto.setFieldDescriptors(StatusHistoryUtil.createFieldDescriptorDtos(metricDescriptors));
- dto.setAggregateStatusSnapshots(snapshotDtos);
+ dto.setAggregateSnapshots(snapshotDtos);
return dto;
}
http://git-wip-us.apache.org/repos/asf/nifi/blob/3337ea95/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/NiFiServiceFacade.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/NiFiServiceFacade.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/NiFiServiceFacade.java
index c6e7ebb..cfe18c5 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/NiFiServiceFacade.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/NiFiServiceFacade.java
@@ -60,7 +60,6 @@ import org.apache.nifi.web.api.dto.provenance.ProvenanceEventDTO;
import org.apache.nifi.web.api.dto.provenance.ProvenanceOptionsDTO;
import org.apache.nifi.web.api.dto.provenance.lineage.LineageDTO;
import org.apache.nifi.web.api.dto.search.SearchResultsDTO;
-import org.apache.nifi.web.api.dto.status.ClusterStatusDTO;
import org.apache.nifi.web.api.dto.status.ConnectionStatusDTO;
import org.apache.nifi.web.api.dto.status.ControllerStatusDTO;
import org.apache.nifi.web.api.dto.status.PortStatusDTO;
http://git-wip-us.apache.org/repos/asf/nifi/blob/3337ea95/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ConnectionResource.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ConnectionResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ConnectionResource.java
index f2ce875..712233f 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ConnectionResource.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ConnectionResource.java
@@ -346,7 +346,7 @@ public class ConnectionResource extends ApplicationResource {
// ensure there is an updated entity (result of merging) and prune the response as necessary
if (entity != null && !nodewise) {
- entity.getConnectionStatus().setNodeStatuses(null);
+ entity.getConnectionStatus().setNodeSnapshots(null);
}
return nodeResponse.getResponse();
http://git-wip-us.apache.org/repos/asf/nifi/blob/3337ea95/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ControllerResource.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ControllerResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ControllerResource.java
index 91ac843..a3d0dc1 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ControllerResource.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ControllerResource.java
@@ -23,34 +23,17 @@ import com.wordnik.swagger.annotations.ApiParam;
import com.wordnik.swagger.annotations.ApiResponse;
import com.wordnik.swagger.annotations.ApiResponses;
import com.wordnik.swagger.annotations.Authorization;
-
-import java.net.URI;
-import java.util.HashMap;
-import java.util.Map;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DefaultValue;
-import javax.ws.rs.FormParam;
-import javax.ws.rs.GET;
-import javax.ws.rs.HEAD;
-import javax.ws.rs.HttpMethod;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.nifi.cluster.manager.NodeResponse;
+import org.apache.nifi.cluster.manager.exception.UnknownNodeException;
import org.apache.nifi.cluster.manager.impl.WebClusterManager;
-import org.apache.nifi.web.security.user.NiFiUserUtils;
+import org.apache.nifi.cluster.node.Node;
+import org.apache.nifi.cluster.protocol.NodeIdentifier;
import org.apache.nifi.user.NiFiUser;
import org.apache.nifi.util.NiFiProperties;
import org.apache.nifi.web.ConfigurationSnapshot;
-import org.apache.nifi.web.NiFiServiceFacade;
import org.apache.nifi.web.IllegalClusterResourceRequestException;
+import org.apache.nifi.web.NiFiServiceFacade;
import org.apache.nifi.web.Revision;
import org.apache.nifi.web.api.dto.AboutDTO;
import org.apache.nifi.web.api.dto.BannerDTO;
@@ -66,23 +49,46 @@ import org.apache.nifi.web.api.entity.AuthorityEntity;
import org.apache.nifi.web.api.entity.BannerEntity;
import org.apache.nifi.web.api.entity.ControllerConfigurationEntity;
import org.apache.nifi.web.api.entity.ControllerEntity;
+import org.apache.nifi.web.api.entity.ControllerServiceTypesEntity;
import org.apache.nifi.web.api.entity.ControllerStatusEntity;
import org.apache.nifi.web.api.entity.CounterEntity;
import org.apache.nifi.web.api.entity.CountersEntity;
import org.apache.nifi.web.api.entity.Entity;
+import org.apache.nifi.web.api.entity.IdentityEntity;
import org.apache.nifi.web.api.entity.PrioritizerTypesEntity;
import org.apache.nifi.web.api.entity.ProcessGroupEntity;
import org.apache.nifi.web.api.entity.ProcessorTypesEntity;
+import org.apache.nifi.web.api.entity.ReportingTaskTypesEntity;
import org.apache.nifi.web.api.entity.SearchResultsEntity;
import org.apache.nifi.web.api.request.ClientIdParameter;
import org.apache.nifi.web.api.request.IntegerParameter;
import org.apache.nifi.web.api.request.LongParameter;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.nifi.web.api.entity.ControllerServiceTypesEntity;
-import org.apache.nifi.web.api.entity.IdentityEntity;
-import org.apache.nifi.web.api.entity.ReportingTaskTypesEntity;
+import org.apache.nifi.web.security.user.NiFiUserUtils;
import org.springframework.security.access.prepost.PreAuthorize;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DefaultValue;
+import javax.ws.rs.FormParam;
+import javax.ws.rs.GET;
+import javax.ws.rs.HEAD;
+import javax.ws.rs.HttpMethod;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import java.net.URI;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
/**
* RESTful endpoint for managing a Flow Controller.
*/
@@ -576,11 +582,49 @@ public class ControllerResource extends ApplicationResource {
value = "If the client id is not specified, new one will be generated. This value (whether specified or generated) is included in the response.",
required = false
)
- @QueryParam(CLIENT_ID) @DefaultValue(StringUtils.EMPTY) ClientIdParameter clientId) {
+ @QueryParam(CLIENT_ID) @DefaultValue(StringUtils.EMPTY) ClientIdParameter clientId,
+ @ApiParam(
+ value = "Whether or not to include the breakdown per node. Optional, defaults to false",
+ required = false
+ )
+ @QueryParam("nodewise") @DefaultValue(NODEWISE) Boolean nodewise,
+ @ApiParam(
+ value = "The id of the node where to get the status.",
+ required = false
+ )
+ @QueryParam("clusterNodeId") String clusterNodeId) {
+
+ // ensure a valid request
+ if (Boolean.TRUE.equals(nodewise) && clusterNodeId != null) {
+ throw new IllegalArgumentException("Nodewise requests cannot be directed at a specific node.");
+ }
// replicate if cluster manager
if (properties.isClusterManager()) {
- return clusterManager.applyRequest(HttpMethod.GET, getAbsolutePath(), getRequestParameters(true), getHeaders()).getResponse();
+ // determine where this request should be sent
+ if (clusterNodeId == null) {
+ final NodeResponse nodeResponse = clusterManager.applyRequest(HttpMethod.GET, getAbsolutePath(), getRequestParameters(true), getHeaders());
+ final CountersEntity entity = (CountersEntity) nodeResponse.getUpdatedEntity();
+
+ // ensure there is an updated entity (result of merging) and prune the response as necessary
+ if (entity != null && !nodewise) {
+ entity.getCounters().setNodeSnapshots(null);
+ }
+
+ return nodeResponse.getResponse();
+ } else {
+ // get the target node and ensure it exists
+ final Node targetNode = clusterManager.getNode(clusterNodeId);
+ if (targetNode == null) {
+ throw new UnknownNodeException("The specified cluster node does not exist.");
+ }
+
+ final Set<NodeIdentifier> targetNodes = new HashSet<>();
+ targetNodes.add(targetNode.getNodeId());
+
+ // replicate the request to the specific node
+ return clusterManager.applyRequest(HttpMethod.GET, getAbsolutePath(), getRequestParameters(true), getHeaders(), targetNodes).getResponse();
+ }
}
final CountersDTO countersReport = serviceFacade.getCounters();
http://git-wip-us.apache.org/repos/asf/nifi/blob/3337ea95/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/InputPortResource.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/InputPortResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/InputPortResource.java
index c90c547..2f7eed6 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/InputPortResource.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/InputPortResource.java
@@ -438,7 +438,7 @@ public class InputPortResource extends ApplicationResource {
// ensure there is an updated entity (result of merging) and prune the response as necessary
if (entity != null && !nodewise) {
- entity.getPortStatus().setNodeStatuses(null);
+ entity.getPortStatus().setNodeSnapshots(null);
}
return nodeResponse.getResponse();
http://git-wip-us.apache.org/repos/asf/nifi/blob/3337ea95/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/OutputPortResource.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/OutputPortResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/OutputPortResource.java
index 26f08c3..e76fcf0 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/OutputPortResource.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/OutputPortResource.java
@@ -442,7 +442,7 @@ public class OutputPortResource extends ApplicationResource {
// ensure there is an updated entity (result of merging) and prune the response as necessary
if (entity != null && !nodewise) {
- entity.getPortStatus().setNodeStatuses(null);
+ entity.getPortStatus().setNodeSnapshots(null);
}
return nodeResponse.getResponse();
http://git-wip-us.apache.org/repos/asf/nifi/blob/3337ea95/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessGroupResource.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessGroupResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessGroupResource.java
index a42eaa0..96beff5 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessGroupResource.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessGroupResource.java
@@ -1321,7 +1321,7 @@ public class ProcessGroupResource extends ApplicationResource {
// ensure there is an updated entity (result of merging) and prune the response as necessary
if (entity != null && !nodewise) {
- entity.getProcessGroupStatus().setNodeStatuses(null);
+ entity.getProcessGroupStatus().setNodeSnapshots(null);
}
return nodeResponse.getResponse();
@@ -1345,9 +1345,9 @@ public class ProcessGroupResource extends ApplicationResource {
// prune the response as necessary
if (!recursive) {
- pruneChildGroups(statusReport.getAggregateStatus());
- if (statusReport.getNodeStatuses() != null) {
- for (final NodeProcessGroupStatusSnapshotDTO nodeSnapshot : statusReport.getNodeStatuses()) {
+ pruneChildGroups(statusReport.getAggregateSnapshot());
+ if (statusReport.getNodeSnapshots() != null) {
+ for (final NodeProcessGroupStatusSnapshotDTO nodeSnapshot : statusReport.getNodeSnapshots()) {
pruneChildGroups(nodeSnapshot.getStatusSnapshot());
}
}
http://git-wip-us.apache.org/repos/asf/nifi/blob/3337ea95/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessorResource.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessorResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessorResource.java
index 683d01b..adede7b 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessorResource.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessorResource.java
@@ -485,7 +485,7 @@ public class ProcessorResource extends ApplicationResource {
// ensure there is an updated entity (result of merging) and prune the response as necessary
if (entity != null && !nodewise) {
- entity.getProcessorStatus().setNodeStatuses(null);
+ entity.getProcessorStatus().setNodeSnapshots(null);
}
return nodeResponse.getResponse();
http://git-wip-us.apache.org/repos/asf/nifi/blob/3337ea95/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/RemoteProcessGroupResource.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/RemoteProcessGroupResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/RemoteProcessGroupResource.java
index 285522a..8fc6a2c 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/RemoteProcessGroupResource.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/RemoteProcessGroupResource.java
@@ -323,7 +323,7 @@ public class RemoteProcessGroupResource extends ApplicationResource {
// ensure there is an updated entity (result of merging) and prune the response as necessary
if (entity != null && !nodewise) {
- entity.getRemoteProcessGroupStatus().setNodeStatuses(null);
+ entity.getRemoteProcessGroupStatus().setNodeSnapshots(null);
}
return nodeResponse.getResponse();
http://git-wip-us.apache.org/repos/asf/nifi/blob/3337ea95/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/SystemDiagnosticsResource.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/SystemDiagnosticsResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/SystemDiagnosticsResource.java
index 0daa399..1bde7bf 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/SystemDiagnosticsResource.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/SystemDiagnosticsResource.java
@@ -16,18 +16,18 @@
*/
package org.apache.nifi.web.api;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DefaultValue;
-import javax.ws.rs.GET;
-import javax.ws.rs.HttpMethod;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
+import com.wordnik.swagger.annotations.Api;
+import com.wordnik.swagger.annotations.ApiOperation;
+import com.wordnik.swagger.annotations.ApiParam;
+import com.wordnik.swagger.annotations.ApiResponse;
+import com.wordnik.swagger.annotations.ApiResponses;
+import com.wordnik.swagger.annotations.Authorization;
import org.apache.commons.lang3.StringUtils;
+import org.apache.nifi.cluster.manager.NodeResponse;
+import org.apache.nifi.cluster.manager.exception.UnknownNodeException;
import org.apache.nifi.cluster.manager.impl.WebClusterManager;
+import org.apache.nifi.cluster.node.Node;
+import org.apache.nifi.cluster.protocol.NodeIdentifier;
import org.apache.nifi.util.NiFiProperties;
import org.apache.nifi.web.NiFiServiceFacade;
import org.apache.nifi.web.api.dto.RevisionDTO;
@@ -36,12 +36,17 @@ import org.apache.nifi.web.api.entity.SystemDiagnosticsEntity;
import org.apache.nifi.web.api.request.ClientIdParameter;
import org.springframework.security.access.prepost.PreAuthorize;
-import com.wordnik.swagger.annotations.Api;
-import com.wordnik.swagger.annotations.ApiOperation;
-import com.wordnik.swagger.annotations.ApiParam;
-import com.wordnik.swagger.annotations.ApiResponse;
-import com.wordnik.swagger.annotations.ApiResponses;
-import com.wordnik.swagger.annotations.Authorization;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DefaultValue;
+import javax.ws.rs.GET;
+import javax.ws.rs.HttpMethod;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import java.util.HashSet;
+import java.util.Set;
/**
* RESTful endpoint for retrieving system diagnostics.
@@ -89,10 +94,48 @@ public class SystemDiagnosticsResource extends ApplicationResource {
value = "If the client id is not specified, new one will be generated. This value (whether specified or generated) is included in the response.",
required = false
)
- @QueryParam(CLIENT_ID) @DefaultValue(StringUtils.EMPTY) ClientIdParameter clientId) {
+ @QueryParam(CLIENT_ID) @DefaultValue(StringUtils.EMPTY) ClientIdParameter clientId,
+ @ApiParam(
+ value = "Whether or not to include the breakdown per node. Optional, defaults to false",
+ required = false
+ )
+ @QueryParam("nodewise") @DefaultValue(NODEWISE) Boolean nodewise,
+ @ApiParam(
+ value = "The id of the node where to get the status.",
+ required = false
+ )
+ @QueryParam("clusterNodeId") String clusterNodeId) {
+
+ // ensure a valid request
+ if (Boolean.TRUE.equals(nodewise) && clusterNodeId != null) {
+ throw new IllegalArgumentException("Nodewise requests cannot be directed at a specific node.");
+ }
if (properties.isClusterManager()) {
- return clusterManager.applyRequest(HttpMethod.GET, getAbsolutePath(), getRequestParameters(true), getHeaders()).getResponse();
+ // determine where this request should be sent
+ if (clusterNodeId == null) {
+ final NodeResponse nodeResponse = clusterManager.applyRequest(HttpMethod.GET, getAbsolutePath(), getRequestParameters(true), getHeaders());
+ final SystemDiagnosticsEntity entity = (SystemDiagnosticsEntity) nodeResponse.getUpdatedEntity();
+
+ // ensure there is an updated entity (result of merging) and prune the response as necessary
+ if (entity != null && !nodewise) {
+ entity.getSystemDiagnostics().setNodeSnapshots(null);
+ }
+
+ return nodeResponse.getResponse();
+ } else {
+ // get the target node and ensure it exists
+ final Node targetNode = clusterManager.getNode(clusterNodeId);
+ if (targetNode == null) {
+ throw new UnknownNodeException("The specified cluster node does not exist.");
+ }
+
+ final Set<NodeIdentifier> targetNodes = new HashSet<>();
+ targetNodes.add(targetNode.getNodeId());
+
+ // replicate the request to the specific node
+ return clusterManager.applyRequest(HttpMethod.GET, getAbsolutePath(), getRequestParameters(true), getHeaders(), targetNodes).getResponse();
+ }
}
final SystemDiagnosticsDTO systemDiagnosticsDto = serviceFacade.getSystemDiagnostics();
http://git-wip-us.apache.org/repos/asf/nifi/blob/3337ea95/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java
index facc889..dbc717c 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java
@@ -722,7 +722,7 @@ public final class DtoFactory {
dto.setStatsLastRefreshed(new Date());
final RemoteProcessGroupStatusSnapshotDTO snapshot = new RemoteProcessGroupStatusSnapshotDTO();
- dto.setAggregateStatus(snapshot);
+ dto.setAggregateSnapshot(snapshot);
snapshot.setId(remoteProcessGroupStatus.getId());
snapshot.setGroupId(remoteProcessGroupStatus.getGroupId());
@@ -748,7 +748,7 @@ public final class DtoFactory {
processGroupStatusDto.setStatsLastRefreshed(new Date());
final ProcessGroupStatusSnapshotDTO snapshot = new ProcessGroupStatusSnapshotDTO();
- processGroupStatusDto.setAggregateStatus(snapshot);
+ processGroupStatusDto.setAggregateSnapshot(snapshot);
snapshot.setId(processGroupStatus.getId());
snapshot.setName(processGroupStatus.getName());
@@ -777,7 +777,7 @@ public final class DtoFactory {
if (processorStatusCollection != null) {
for (final ProcessorStatus processorStatus : processorStatusCollection) {
final ProcessorStatusDTO processorStatusDto = createProcessorStatusDto(processorStatus);
- processorStatDtoCollection.add(processorStatusDto.getAggregateStatus());
+ processorStatDtoCollection.add(processorStatusDto.getAggregateSnapshot());
}
}
@@ -788,7 +788,7 @@ public final class DtoFactory {
if (connectionStatusCollection != null) {
for (final ConnectionStatus connectionStatus : connectionStatusCollection) {
final ConnectionStatusDTO connectionStatusDto = createConnectionStatusDto(connectionStatus);
- connectionStatusDtoCollection.add(connectionStatusDto.getAggregateStatus());
+ connectionStatusDtoCollection.add(connectionStatusDto.getAggregateSnapshot());
}
}
@@ -799,7 +799,7 @@ public final class DtoFactory {
if (childProcessGroupStatusCollection != null) {
for (final ProcessGroupStatus childProcessGroupStatus : childProcessGroupStatusCollection) {
final ProcessGroupStatusDTO childProcessGroupStatusDto = createProcessGroupStatusDto(bulletinRepository, childProcessGroupStatus);
- childProcessGroupStatusDtoCollection.add(childProcessGroupStatusDto.getAggregateStatus());
+ childProcessGroupStatusDtoCollection.add(childProcessGroupStatusDto.getAggregateSnapshot());
}
}
@@ -810,7 +810,7 @@ public final class DtoFactory {
if (childRemoteProcessGroupStatusCollection != null) {
for (final RemoteProcessGroupStatus childRemoteProcessGroupStatus : childRemoteProcessGroupStatusCollection) {
final RemoteProcessGroupStatusDTO childRemoteProcessGroupStatusDto = createRemoteProcessGroupStatusDto(childRemoteProcessGroupStatus);
- childRemoteProcessGroupStatusDtoCollection.add(childRemoteProcessGroupStatusDto.getAggregateStatus());
+ childRemoteProcessGroupStatusDtoCollection.add(childRemoteProcessGroupStatusDto.getAggregateSnapshot());
}
}
@@ -821,7 +821,7 @@ public final class DtoFactory {
if (inputPortStatusCollection != null) {
for (final PortStatus portStatus : inputPortStatusCollection) {
final PortStatusDTO portStatusDto = createPortStatusDto(portStatus);
- inputPortStatusDtoCollection.add(portStatusDto.getAggregateStatus());
+ inputPortStatusDtoCollection.add(portStatusDto.getAggregateSnapshot());
}
}
@@ -832,7 +832,7 @@ public final class DtoFactory {
if (outputPortStatusCollection != null) {
for (final PortStatus portStatus : outputPortStatusCollection) {
final PortStatusDTO portStatusDto = createPortStatusDto(portStatus);
- outputPortStatusDtoCollection.add(portStatusDto.getAggregateStatus());
+ outputPortStatusDtoCollection.add(portStatusDto.getAggregateSnapshot());
}
}
@@ -851,7 +851,7 @@ public final class DtoFactory {
connectionStatusDto.setStatsLastRefreshed(new Date());
final ConnectionStatusSnapshotDTO snapshot = new ConnectionStatusSnapshotDTO();
- connectionStatusDto.setAggregateStatus(snapshot);
+ connectionStatusDto.setAggregateSnapshot(snapshot);
snapshot.setId(connectionStatus.getId());
snapshot.setGroupId(connectionStatus.getGroupId());
@@ -880,7 +880,7 @@ public final class DtoFactory {
dto.setStatsLastRefreshed(new Date());
final ProcessorStatusSnapshotDTO snapshot = new ProcessorStatusSnapshotDTO();
- dto.setAggregateStatus(snapshot);
+ dto.setAggregateSnapshot(snapshot);
snapshot.setId(procStatus.getId());
snapshot.setGroupId(procStatus.getGroupId());
@@ -925,7 +925,7 @@ public final class DtoFactory {
dto.setStatsLastRefreshed(new Date());
final PortStatusSnapshotDTO snapshot = new PortStatusSnapshotDTO();
- dto.setAggregateStatus(snapshot);
+ dto.setAggregateSnapshot(snapshot);
snapshot.setId(portStatus.getId());
snapshot.setGroupId(portStatus.getGroupId());
http://git-wip-us.apache.org/repos/asf/nifi/blob/3337ea95/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js
index 41bc1f0..72c8181 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js
@@ -844,10 +844,10 @@ nf.Canvas = (function () {
// report the updated stats
if (nf.Common.isDefinedAndNotNull(response.processGroupStatus)) {
var processGroupStatus = response.processGroupStatus;
- var aggregateStatus = processGroupStatus.aggregateStatus;
+ var aggregateSnapshot = processGroupStatus.aggregateSnapshot;
// update all the stats
- nf.Graph.setStatus(aggregateStatus);
+ nf.Graph.setStatus(aggregateSnapshot);
// update the timestamp
$('#stats-last-refreshed').text(processGroupStatus.statsLastRefreshed);
http://git-wip-us.apache.org/repos/asf/nifi/blob/3337ea95/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-graph.js
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-graph.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-graph.js
index 2589394..db720d0 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-graph.js
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-graph.js
@@ -158,18 +158,18 @@ nf.Graph = (function () {
* of the existing components on the graph and will not cause them to be repainted.
* This operation must be very inexpensive due to the frequency it is called.
*
- * @argument {object} aggregateStatus The status of the process group aggregated accross the cluster
+ * @argument {object} aggregateSnapshot The status of the process group aggregated accross the cluster
*/
- setStatus: function (aggregateStatus) {
+ setStatus: function (aggregateSnapshot) {
// merge the port status together
- var portStatus = combinePortStatus(aggregateStatus);
+ var portStatus = combinePortStatus(aggregateSnapshot);
// set the component status
nf.Port.setStatus(portStatus);
- nf.RemoteProcessGroup.setStatus(aggregateStatus.remoteProcessGroupStatusSnapshots);
- nf.ProcessGroup.setStatus(aggregateStatus.processGroupStatusSnapshots);
- nf.Processor.setStatus(aggregateStatus.processorStatusSnapshots);
- nf.Connection.setStatus(aggregateStatus.connectionStatusSnapshots);
+ nf.RemoteProcessGroup.setStatus(aggregateSnapshot.remoteProcessGroupStatusSnapshots);
+ nf.ProcessGroup.setStatus(aggregateSnapshot.processGroupStatusSnapshots);
+ nf.Processor.setStatus(aggregateSnapshot.processorStatusSnapshots);
+ nf.Connection.setStatus(aggregateSnapshot.connectionStatusSnapshots);
},
/**
http://git-wip-us.apache.org/repos/asf/nifi/blob/3337ea95/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/counters/nf-counters-table.js
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/counters/nf-counters-table.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/counters/nf-counters-table.js
index 5688118..18a4a33 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/counters/nf-counters-table.js
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/counters/nf-counters-table.js
@@ -278,25 +278,29 @@ nf.CountersTable = (function () {
return $.ajax({
type: 'GET',
url: config.urls.counters,
+ data: {
+ nodewise: true
+ },
dataType: 'json'
}).done(function (response) {
var report = response.counters;
+ var aggregateSnapshot = report.aggregateSnapshot;
// ensure there are groups specified
- if (nf.Common.isDefinedAndNotNull(report.counters)) {
+ if (nf.Common.isDefinedAndNotNull(aggregateSnapshot.counters)) {
var countersGrid = $('#counters-table').data('gridInstance');
var countersData = countersGrid.getData();
// set the items
- countersData.setItems(report.counters);
+ countersData.setItems(aggregateSnapshot.counters);
countersData.reSort();
countersGrid.invalidate();
// update the stats last refreshed timestamp
- $('#counters-last-refreshed').text(report.generated);
+ $('#counters-last-refreshed').text(aggregateSnapshot.generated);
// update the total number of processors
- $('#total-counters').text(report.counters.length);
+ $('#total-counters').text(aggregateSnapshot.counters.length);
} else {
$('#total-counters').text('0');
}