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:31 UTC
[1/3] nifi git commit: NIFI-1563: - Removing unused endpoints.
Repository: nifi
Updated Branches:
refs/heads/NIFI-1563 61a7cbeaa -> 3337ea951
NIFI-1563:
- Removing unused endpoints.
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/8f28237f
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/8f28237f
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/8f28237f
Branch: refs/heads/NIFI-1563
Commit: 8f28237ff32acda4e937c8a06417019554657692
Parents: 61a7cbe
Author: Matt Gilman <ma...@gmail.com>
Authored: Fri Mar 18 12:46:44 2016 -0400
Committer: Matt Gilman <ma...@gmail.com>
Committed: Fri Mar 18 12:46:44 2016 -0400
----------------------------------------------------------------------
.../org/apache/nifi/web/NiFiServiceFacade.java | 7 --
.../nifi/web/StandardNiFiServiceFacade.java | 85 +++++---------------
.../apache/nifi/web/api/ClusterResource.java | 62 --------------
.../src/main/resources/nifi-web-api-context.xml | 1 -
4 files changed, 18 insertions(+), 137 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/8f28237f/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 d642079..c6e7ebb 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
@@ -1548,13 +1548,6 @@ public interface NiFiServiceFacade {
*/
void deleteNode(String nodeId);
- /**
- * Returns the cluster's status.
- *
- * @return The cluster status
- */
- ClusterStatusDTO getClusterStatus();
-
// ----------------------------------------
// BulletinBoard methods
// ----------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/8f28237f/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
index 563e7aa..b981bde 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
@@ -16,25 +16,6 @@
*/
package org.apache.nifi.web;
-import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Map;
-import java.util.Set;
-import java.util.TimeZone;
-import java.util.UUID;
-import java.util.concurrent.TimeUnit;
-
-import javax.ws.rs.WebApplicationException;
-
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.nifi.action.Action;
@@ -46,7 +27,6 @@ import org.apache.nifi.admin.service.AccountNotFoundException;
import org.apache.nifi.admin.service.AuditService;
import org.apache.nifi.admin.service.UserService;
import org.apache.nifi.authorization.Authority;
-import org.apache.nifi.cluster.HeartbeatPayload;
import org.apache.nifi.cluster.context.ClusterContext;
import org.apache.nifi.cluster.context.ClusterContextThreadLocal;
import org.apache.nifi.cluster.manager.exception.UnknownNodeException;
@@ -72,7 +52,6 @@ import org.apache.nifi.controller.repository.claim.ContentDirection;
import org.apache.nifi.controller.service.ControllerServiceNode;
import org.apache.nifi.controller.service.ControllerServiceReference;
import org.apache.nifi.controller.service.ControllerServiceState;
-import org.apache.nifi.controller.status.ProcessGroupStatus;
import org.apache.nifi.diagnostics.SystemDiagnostics;
import org.apache.nifi.groups.ProcessGroup;
import org.apache.nifi.groups.ProcessGroupCounts;
@@ -137,10 +116,8 @@ 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.NodeStatusDTO;
import org.apache.nifi.web.api.dto.status.PortStatusDTO;
import org.apache.nifi.web.api.dto.status.ProcessGroupStatusDTO;
import org.apache.nifi.web.api.dto.status.ProcessorStatusDTO;
@@ -165,6 +142,24 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.access.AccessDeniedException;
+import javax.ws.rs.WebApplicationException;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.ListIterator;
+import java.util.Map;
+import java.util.Set;
+import java.util.TimeZone;
+import java.util.UUID;
+import java.util.concurrent.TimeUnit;
+
/**
* Implementation of NiFiServiceFacade that performs revision checking.
*/
@@ -2836,50 +2831,6 @@ public class StandardNiFiServiceFacade implements NiFiServiceFacade {
}
@Override
- public ClusterStatusDTO getClusterStatus() {
-
- // create cluster status dto
- final ClusterStatusDTO clusterStatusDto = new ClusterStatusDTO();
-
- // populate node status dtos
- final Collection<NodeStatusDTO> nodeStatusDtos = new ArrayList<>();
- clusterStatusDto.setNodeStatus(nodeStatusDtos);
-
- for (final Node node : clusterManager.getNodes()) {
-
- if (Node.Status.CONNECTED != node.getStatus()) {
- continue;
- }
-
- final HeartbeatPayload nodeHeartbeatPayload = node.getHeartbeatPayload();
- if (nodeHeartbeatPayload == null) {
- continue;
- }
-
- final ProcessGroupStatus nodeProcessGroupStatus = nodeHeartbeatPayload.getProcessGroupStatus();
- if (nodeProcessGroupStatus == null) {
- continue;
- }
-
- final ProcessGroupStatusDTO nodeProcessGroupStatusDto = dtoFactory.createProcessGroupStatusDto(clusterManager.getBulletinRepository(), nodeProcessGroupStatus);
-
- // create node status dto
- final NodeStatusDTO nodeStatusDto = new NodeStatusDTO();
- nodeStatusDtos.add(nodeStatusDto);
-
- // populate the status
- nodeStatusDto.setControllerStatus(nodeProcessGroupStatusDto);
-
- // create and add node dto
- final String nodeId = node.getNodeId().getId();
- nodeStatusDto.setNode(dtoFactory.createNodeDTO(node, clusterManager.getNodeEvents(nodeId), isPrimaryNode(nodeId)));
-
- }
-
- return clusterStatusDto;
- }
-
- @Override
public ProcessorDTO getProcessor(String id) {
ClassLoader currentContextClassLoader = Thread.currentThread().getContextClassLoader();
try {
http://git-wip-us.apache.org/repos/asf/nifi/blob/8f28237f/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ClusterResource.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/ClusterResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ClusterResource.java
index bd6a39a..ec4c69e 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ClusterResource.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ClusterResource.java
@@ -37,10 +37,8 @@ import org.apache.nifi.web.api.dto.ProcessorConfigDTO;
import org.apache.nifi.web.api.dto.ProcessorDTO;
import org.apache.nifi.web.api.dto.RevisionDTO;
import org.apache.nifi.web.api.dto.search.NodeSearchResultDTO;
-import org.apache.nifi.web.api.dto.status.ClusterStatusDTO;
import org.apache.nifi.web.api.entity.ClusterEntity;
import org.apache.nifi.web.api.entity.ClusterSearchResultsEntity;
-import org.apache.nifi.web.api.entity.ClusterStatusEntity;
import org.apache.nifi.web.api.entity.ProcessorEntity;
import org.apache.nifi.web.api.request.ClientIdParameter;
import org.apache.nifi.web.api.request.LongParameter;
@@ -77,7 +75,6 @@ public class ClusterResource extends ApplicationResource {
private ResourceContext resourceContext;
private NiFiServiceFacade serviceFacade;
private NiFiProperties properties;
- private WebClusterManager clusterManager;
/**
* Locates the ClusterConnection sub-resource.
@@ -94,62 +91,6 @@ public class ClusterResource extends ApplicationResource {
}
/**
- * Gets the status of this NiFi cluster.
- *
- * @param clientId Optional client id. If the client id is not specified, a new one will be generated. This value (whether specified or generated) is included in the response.
- * @return A clusterStatusEntity
- */
- @GET
- @Consumes(MediaType.WILDCARD)
- @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
- @Path("/status")
- @PreAuthorize("hasAnyRole('ROLE_MONITOR', 'ROLE_DFM', 'ROLE_ADMIN')")
- @ApiOperation(
- value = "Gets the status of the cluster",
- response = ClusterStatusEntity.class,
- authorizations = {
- @Authorization(value = "Read Only", type = "ROLE_MONITOR"),
- @Authorization(value = "DFM", type = "ROLE_DFM"),
- @Authorization(value = "Admin", type = "ROLE_ADMIN")
- }
- )
- @ApiResponses(
- value = {
- @ApiResponse(code = 400, message = "NiFi was unable to complete the request because it was invalid. The request should not be retried without modification."),
- @ApiResponse(code = 401, message = "Client could not be authenticated."),
- @ApiResponse(code = 403, message = "Client is not authorized to make this request."),
- @ApiResponse(code = 409, message = "The request was valid but NiFi was not in the appropriate state to process it. Retrying the same request later may be successful.")
- }
- )
- public Response getClusterStatus(
- @ApiParam(
- 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) {
-
- if (properties.isClusterManager()) {
-
- ClusterStatusDTO dto = serviceFacade.getClusterStatus();
-
- // create the revision
- RevisionDTO revision = new RevisionDTO();
- revision.setClientId(clientId.getClientId());
-
- // create entity
- final ClusterStatusEntity entity = new ClusterStatusEntity();
- entity.setClusterStatus(dto);
- entity.setRevision(revision);
-
- // generate the response
- return generateOkResponse(entity).build();
- }
-
- throw new IllegalClusterResourceRequestException("Only a cluster manager can process the request.");
-
- }
-
- /**
* Returns a 200 OK response to indicate this is a valid cluster endpoint.
*
* @return An OK response with an empty entity body.
@@ -514,7 +455,4 @@ public class ClusterResource extends ApplicationResource {
this.properties = properties;
}
- public void setClusterManager(WebClusterManager clusterManager) {
- this.clusterManager = clusterManager;
- }
}
http://git-wip-us.apache.org/repos/asf/nifi/blob/8f28237f/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/nifi-web-api-context.xml
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/nifi-web-api-context.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/nifi-web-api-context.xml
index d5c5487..8afe59f 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/nifi-web-api-context.xml
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/nifi-web-api-context.xml
@@ -247,7 +247,6 @@
<bean id="clusterResource" class="org.apache.nifi.web.api.ClusterResource" scope="singleton">
<property name="serviceFacade" ref="serviceFacade"/>
<property name="properties" ref="nifiProperties"/>
- <property name="clusterManager" ref="clusterManager"/>
</bean>
<bean id="nodeResource" class="org.apache.nifi.web.api.NodeResource" scope="singleton">
<property name="serviceFacade" ref="serviceFacade"/>
[2/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.
Posted by mc...@apache.org.
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/nf-status-history.js
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-status-history.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-status-history.js
index 025422b..57f91fb 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-status-history.js
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-status-history.js
@@ -105,11 +105,11 @@ nf.StatusHistory = (function () {
statusHistory.selectedDescriptor = nf.Common.isUndefined(selectedDescriptor) ? descriptors[0] : selectedDescriptor;
// ensure enough status snapshots
- if (nf.Common.isDefinedAndNotNull(componentStatusHistory.aggregateStatusSnapshots) && componentStatusHistory.aggregateStatusSnapshots.length > 1) {
+ if (nf.Common.isDefinedAndNotNull(componentStatusHistory.aggregateSnapshots) && componentStatusHistory.aggregateSnapshots.length > 1) {
statusHistory.instances.push({
id: config.nifiInstanceId,
label: config.nifiInstanceLabel,
- snapshots: componentStatusHistory.aggregateStatusSnapshots
+ snapshots: componentStatusHistory.aggregateSnapshots
});
} else {
insufficientHistory();
@@ -117,13 +117,13 @@ nf.StatusHistory = (function () {
}
// get the status for each node in the cluster if applicable
- $.each(componentStatusHistory.nodeStatusSnapshots, function (_, nodeStatusSnapshots) {
+ $.each(componentStatusHistory.nodeSnapshots, function (_, nodeSnapshots) {
// ensure enough status snapshots
- if (nf.Common.isDefinedAndNotNull(nodeStatusSnapshots.statusSnapshots) && nodeStatusSnapshots.statusSnapshots.length > 1) {
+ if (nf.Common.isDefinedAndNotNull(nodeSnapshots.statusSnapshots) && nodeSnapshots.statusSnapshots.length > 1) {
statusHistory.instances.push({
- id: nodeStatusSnapshots.nodeId,
- label: nodeStatusSnapshots.address + ':' + nodeStatusSnapshots.apiPort,
- snapshots: nodeStatusSnapshots.statusSnapshots
+ id: nodeSnapshots.nodeId,
+ label: nodeSnapshots.address + ':' + nodeSnapshots.apiPort,
+ snapshots: nodeSnapshots.statusSnapshots
});
}
});
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/summary/nf-summary-table.js
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary-table.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary-table.js
index e86651a..b4f9ab2 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary-table.js
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary-table.js
@@ -1957,67 +1957,84 @@ nf.SummaryTable = (function () {
* Refreshes the system diagnostics.
*/
var refreshSystemDiagnostics = function () {
+ var systemDiagnosticsUri = config.urls.systemDiagnostics;
+
+ // add the parameter if appropriate
+ var parameters = {};
+ if (!nf.Common.isNull(clusterNodeId)) {
+ parameters['clusterNodeId'] = clusterNodeId;
+ }
+
+ // update the status uri if appropriate
+ if (!$.isEmptyObject(parameters)) {
+ systemDiagnosticsUri += '?' + $.param(parameters);
+ }
+
return $.ajax({
type: 'GET',
- url: nf.SummaryTable.systemDiagnosticsUrl,
+ url: systemDiagnosticsUri,
+ data: {
+ nodewise: true
+ },
dataType: 'json'
}).done(function (response) {
var systemDiagnostics = response.systemDiagnostics;
+ var aggregateSnapshot = systemDiagnostics.aggregateSnapshot;
// heap
- $('#max-heap').text(systemDiagnostics.maxHeap);
- $('#total-heap').text(systemDiagnostics.totalHeap);
- $('#used-heap').text(systemDiagnostics.usedHeap);
- $('#free-heap').text(systemDiagnostics.freeHeap);
+ $('#max-heap').text(aggregateSnapshot.maxHeap);
+ $('#total-heap').text(aggregateSnapshot.totalHeap);
+ $('#used-heap').text(aggregateSnapshot.usedHeap);
+ $('#free-heap').text(aggregateSnapshot.freeHeap);
// ensure the heap utilization could be calculated
- if (nf.Common.isDefinedAndNotNull(systemDiagnostics.heapUtilization)) {
- $('#utilization-heap').text('(' + systemDiagnostics.heapUtilization + ')');
+ if (nf.Common.isDefinedAndNotNull(aggregateSnapshot.heapUtilization)) {
+ $('#utilization-heap').text('(' + aggregateSnapshot.heapUtilization + ')');
} else {
$('#utilization-heap').text('');
}
// non heap
- $('#max-non-heap').text(systemDiagnostics.maxNonHeap);
- $('#total-non-heap').text(systemDiagnostics.totalNonHeap);
- $('#used-non-heap').text(systemDiagnostics.usedNonHeap);
- $('#free-non-heap').text(systemDiagnostics.freeNonHeap);
+ $('#max-non-heap').text(aggregateSnapshot.maxNonHeap);
+ $('#total-non-heap').text(aggregateSnapshot.totalNonHeap);
+ $('#used-non-heap').text(aggregateSnapshot.usedNonHeap);
+ $('#free-non-heap').text(aggregateSnapshot.freeNonHeap);
// enure the non heap utilization could be calculated
- if (nf.Common.isDefinedAndNotNull(systemDiagnostics.nonHeapUtilization)) {
- $('#utilization-non-heap').text('(' + systemDiagnostics.nonHeapUtilization + ')');
+ if (nf.Common.isDefinedAndNotNull(aggregateSnapshot.nonHeapUtilization)) {
+ $('#utilization-non-heap').text('(' + aggregateSnapshot.nonHeapUtilization + ')');
} else {
$('#utilization-non-heap').text('');
}
// garbage collection
var garbageCollectionContainer = $('#garbage-collection-table tbody').empty();
- $.each(systemDiagnostics.garbageCollection, function (_, garbageCollection) {
+ $.each(aggregateSnapshot.garbageCollection, function (_, garbageCollection) {
addGarbageCollection(garbageCollectionContainer, garbageCollection);
});
// available processors
- $('#available-processors').text(systemDiagnostics.availableProcessors);
+ $('#available-processors').text(aggregateSnapshot.availableProcessors);
// load
- if (nf.Common.isDefinedAndNotNull(systemDiagnostics.processorLoadAverage)) {
- $('#processor-load-average').text(nf.Common.formatFloat(systemDiagnostics.processorLoadAverage));
+ if (nf.Common.isDefinedAndNotNull(aggregateSnapshot.processorLoadAverage)) {
+ $('#processor-load-average').text(nf.Common.formatFloat(aggregateSnapshot.processorLoadAverage));
} else {
- $('#processor-load-average').html(nf.Common.formatValue(systemDiagnostics.processorLoadAverage));
+ $('#processor-load-average').html(nf.Common.formatValue(aggregateSnapshot.processorLoadAverage));
}
// database storage usage
var flowFileRepositoryStorageUsageContainer = $('#flow-file-repository-storage-usage-container').empty();
- addStorageUsage(flowFileRepositoryStorageUsageContainer, systemDiagnostics.flowFileRepositoryStorageUsage);
+ addStorageUsage(flowFileRepositoryStorageUsageContainer, aggregateSnapshot.flowFileRepositoryStorageUsage);
// database storage usage
var contentRepositoryUsageContainer = $('#content-repository-storage-usage-container').empty();
- $.each(systemDiagnostics.contentRepositoryStorageUsage, function (_, contentRepository) {
+ $.each(aggregateSnapshot.contentRepositoryStorageUsage, function (_, contentRepository) {
addStorageUsage(contentRepositoryUsageContainer, contentRepository);
});
// update the stats last refreshed timestamp
- $('#system-diagnostics-last-refreshed').text(systemDiagnostics.statsLastRefreshed);
+ $('#system-diagnostics-last-refreshed').text(aggregateSnapshot.statsLastRefreshed);
}).fail(nf.Common.handleAjaxError);
};
@@ -2076,39 +2093,39 @@ nf.SummaryTable = (function () {
* @argument {array} inputPortItems The input port data
* @argument {array} outputPortItems The input port data
* @argument {array} remoteProcessGroupItems The remote process group data
- * @argument {object} aggregateStatus The process group status
+ * @argument {object} aggregateSnapshot The process group status
*/
- var populateProcessGroupStatus = function (processorItems, connectionItems, processGroupItems, inputPortItems, outputPortItems, remoteProcessGroupItems, aggregateStatus) {
+ var populateProcessGroupStatus = function (processorItems, connectionItems, processGroupItems, inputPortItems, outputPortItems, remoteProcessGroupItems, aggregateSnapshot) {
// add the processors to the summary grid
- $.each(aggregateStatus.processorStatusSnapshots, function (i, procStatus) {
+ $.each(aggregateSnapshot.processorStatusSnapshots, function (i, procStatus) {
processorItems.push(procStatus);
});
// add the processors to the summary grid
- $.each(aggregateStatus.connectionStatusSnapshots, function (i, connStatus) {
+ $.each(aggregateSnapshot.connectionStatusSnapshots, function (i, connStatus) {
connectionItems.push(connStatus);
});
// add the input ports to the summary grid
- $.each(aggregateStatus.inputPortStatusSnapshots, function (i, portStatus) {
+ $.each(aggregateSnapshot.inputPortStatusSnapshots, function (i, portStatus) {
inputPortItems.push(portStatus);
});
// add the input ports to the summary grid
- $.each(aggregateStatus.outputPortStatusSnapshots, function (i, portStatus) {
+ $.each(aggregateSnapshot.outputPortStatusSnapshots, function (i, portStatus) {
outputPortItems.push(portStatus);
});
// add the input ports to the summary grid
- $.each(aggregateStatus.remoteProcessGroupStatusSnapshots, function (i, rpgStatus) {
+ $.each(aggregateSnapshot.remoteProcessGroupStatusSnapshots, function (i, rpgStatus) {
remoteProcessGroupItems.push(rpgStatus);
});
// add the process group status as well
- processGroupItems.push(aggregateStatus);
+ processGroupItems.push(aggregateSnapshot);
// add any child group's status
- $.each(aggregateStatus.processGroupStatusSnapshots, function (i, childProcessGroup) {
+ $.each(aggregateSnapshot.processGroupStatusSnapshots, function (i, childProcessGroup) {
populateProcessGroupStatus(processorItems, connectionItems, processGroupItems, inputPortItems, outputPortItems, remoteProcessGroupItems, childProcessGroup);
});
};
@@ -2162,11 +2179,11 @@ nf.SummaryTable = (function () {
var clusterProcessors = [];
// populate the table
- $.each(processorStatus.nodeStatuses, function (i, nodeStatus) {
- var snapshot = nodeStatus.statusSnapshot;
+ $.each(processorStatus.nodeSnapshots, function (i, nodeSnapshot) {
+ var snapshot = nodeSnapshot.statusSnapshot;
clusterProcessors.push({
- id: nodeStatus.nodeId,
- node: nodeStatus.address + ':' + nodeStatus.apiPort,
+ id: nodeSnapshot.nodeId,
+ node: nodeSnapshot.address + ':' + nodeSnapshot.apiPort,
runStatus: snapshot.runStatus,
activeThreadCount: snapshot.activeThreadCount,
input: snapshot.input,
@@ -2219,11 +2236,11 @@ nf.SummaryTable = (function () {
var clusterConnections = [];
// populate the table
- $.each(connectionStatus.nodeStatuses, function (i, nodeStatus) {
- var snapshot = nodeStatus.statusSnapshot;
+ $.each(connectionStatus.nodeSnapshots, function (i, nodeSnapshot) {
+ var snapshot = nodeSnapshot.statusSnapshot;
clusterConnections.push({
- id: nodeStatus.nodeId,
- node: nodeStatus.address + ':' + nodeStatus.apiPort,
+ id: nodeSnapshot.nodeId,
+ node: nodeSnapshot.address + ':' + nodeSnapshot.apiPort,
input: snapshot.input,
queued: snapshot.queued,
queuedCount: snapshot.queuedCount,
@@ -2273,11 +2290,11 @@ nf.SummaryTable = (function () {
var clusterProcessGroups = [];
// populate the table
- $.each(processGroupStatus.nodeStatuses, function (i, nodeStatus) {
- var snapshot = nodeStatus.statusSnapshot;
+ $.each(processGroupStatus.nodeSnapshots, function (i, nodeSnapshot) {
+ var snapshot = nodeSnapshot.statusSnapshot;
clusterProcessGroups.push({
- id: nodeStatus.nodeId,
- node: nodeStatus.address + ':' + nodeStatus.apiPort,
+ id: nodeSnapshot.nodeId,
+ node: nodeSnapshot.address + ':' + nodeSnapshot.apiPort,
activeThreadCount: snapshot.activeThreadCount,
transferred: snapshot.transferred,
input: snapshot.input,
@@ -2332,11 +2349,11 @@ nf.SummaryTable = (function () {
var clusterInputPorts = [];
// populate the table
- $.each(inputPortStatus.nodeStatuses, function (i, nodeStatus) {
- var snapshot = nodeStatus.statusSnapshot;
+ $.each(inputPortStatus.nodeSnapshots, function (i, nodeSnapshot) {
+ var snapshot = nodeSnapshot.statusSnapshot;
clusterInputPorts.push({
- id: nodeStatus.nodeId,
- node: nodeStatus.address + ':' + nodeStatus.apiPort,
+ id: nodeSnapshot.nodeId,
+ node: nodeSnapshot.address + ':' + nodeSnapshot.apiPort,
runStatus: snapshot.runStatus,
activeThreadCount: snapshot.activeThreadCount,
output: snapshot.output
@@ -2384,11 +2401,11 @@ nf.SummaryTable = (function () {
var clusterOutputPorts = [];
// populate the table
- $.each(outputPortStatus.nodeStatuses, function (i, nodeStatus) {
- var snapshot = nodeStatus.statusSnapshot;
+ $.each(outputPortStatus.nodeSnapshots, function (i, nodeSnapshot) {
+ var snapshot = nodeSnapshot.statusSnapshot;
clusterOutputPorts.push({
- id: nodeStatus.nodeId,
- node: nodeStatus.address + ':' + nodeStatus.apiPort,
+ id: nodeSnapshot.nodeId,
+ node: nodeSnapshot.address + ':' + nodeSnapshot.apiPort,
runStatus: snapshot.runStatus,
activeThreadCount: snapshot.activeThreadCount,
input: snapshot.input
@@ -2436,11 +2453,11 @@ nf.SummaryTable = (function () {
var clusterRemoteProcessGroups = [];
// populate the table
- $.each(remoteProcessGroupStatus.nodeStatuses, function (i, nodeStatus) {
- var snapshot = nodeStatus.statusSnapshot;
+ $.each(remoteProcessGroupStatus.nodeSnapshots, function (i, nodeSnapshot) {
+ var snapshot = nodeSnapshot.statusSnapshot;
clusterRemoteProcessGroups.push({
- id: nodeStatus.nodeId,
- node: nodeStatus.address + ':' + nodeStatus.apiPort,
+ id: nodeSnapshot.nodeId,
+ node: nodeSnapshot.address + ':' + nodeSnapshot.apiPort,
targetUri: snapshot.targetUri,
transmissionStatus: snapshot.transmissionStatus,
sent: snapshot.sent,
@@ -2471,19 +2488,11 @@ nf.SummaryTable = (function () {
return {
/**
- * URL for loading system diagnostics.
- */
- systemDiagnosticsUrl: null,
-
- /**
* Initializes the status table.
*
* @argument {boolean} isClustered Whether or not this NiFi is clustered.
*/
init: function (isClustered) {
- // initialize the summary urls
- nf.SummaryTable.systemDiagnosticsUrl = config.urls.systemDiagnostics;
-
return $.Deferred(function (deferred) {
loadChartCapabilities().done(function () {
// initialize the processor/connection details dialog
@@ -2568,9 +2577,9 @@ nf.SummaryTable = (function () {
dataType: 'json'
}).done(function (response) {
var processGroupStatus = response.processGroupStatus;
- var aggregateStatus = processGroupStatus.aggregateStatus;
+ var aggregateSnapshot = processGroupStatus.aggregateSnapshot;
- if (nf.Common.isDefinedAndNotNull(aggregateStatus)) {
+ if (nf.Common.isDefinedAndNotNull(aggregateSnapshot)) {
// remove any tooltips from the processor table
var processorsGridElement = $('#processor-summary-table');
nf.Common.cleanUpTooltips(processorsGridElement, 'img.has-bulletins');
@@ -2623,7 +2632,7 @@ nf.SummaryTable = (function () {
var remoteProcessGroupItems = [];
// populate the tables
- populateProcessGroupStatus(processorItems, connectionItems, processGroupItems, inputPortItems, outputPortItems, remoteProcessGroupItems, aggregateStatus);
+ populateProcessGroupStatus(processorItems, connectionItems, processGroupItems, inputPortItems, outputPortItems, remoteProcessGroupItems, aggregateSnapshot);
// update the processors
processorsData.setItems(processorItems);
[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.
Posted by mc...@apache.org.
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');
}