NIFI-4172: Renamed ClusteSummaryEntity to ClusterSummaryEntity

This closes #7900

Signed-off-by: David Handermann <exceptionfactory@apache.org>
This commit is contained in:
Mark Payne 2023-10-19 08:48:53 -04:00 committed by exceptionfactory
parent 97dfe2d812
commit 8bfb6be5ba
No known key found for this signature in database
GPG Key ID: 29B6A52D2AAE8DBA
10 changed files with 24 additions and 24 deletions

View File

@ -24,7 +24,7 @@ import javax.xml.bind.annotation.XmlRootElement;
* A serialized representation of this class can be placed in the entity body of a request or response to or from the API. This particular entity holds a reference to a ClusterSummaryDTO. * A serialized representation of this class can be placed in the entity body of a request or response to or from the API. This particular entity holds a reference to a ClusterSummaryDTO.
*/ */
@XmlRootElement(name = "clusterSummaryEntity") @XmlRootElement(name = "clusterSummaryEntity")
public class ClusteSummaryEntity extends Entity { public class ClusterSummaryEntity extends Entity {
private ClusterSummaryDTO clusterSummary; private ClusterSummaryDTO clusterSummary;

View File

@ -75,8 +75,8 @@ import org.apache.nifi.web.api.entity.ActionEntity;
import org.apache.nifi.web.api.entity.ActivateControllerServicesEntity; import org.apache.nifi.web.api.entity.ActivateControllerServicesEntity;
import org.apache.nifi.web.api.entity.BannerEntity; import org.apache.nifi.web.api.entity.BannerEntity;
import org.apache.nifi.web.api.entity.BulletinBoardEntity; import org.apache.nifi.web.api.entity.BulletinBoardEntity;
import org.apache.nifi.web.api.entity.ClusteSummaryEntity;
import org.apache.nifi.web.api.entity.ClusterSearchResultsEntity; import org.apache.nifi.web.api.entity.ClusterSearchResultsEntity;
import org.apache.nifi.web.api.entity.ClusterSummaryEntity;
import org.apache.nifi.web.api.entity.ComponentHistoryEntity; import org.apache.nifi.web.api.entity.ComponentHistoryEntity;
import org.apache.nifi.web.api.entity.ConnectionStatisticsEntity; import org.apache.nifi.web.api.entity.ConnectionStatisticsEntity;
import org.apache.nifi.web.api.entity.ConnectionStatusEntity; import org.apache.nifi.web.api.entity.ConnectionStatusEntity;
@ -1211,7 +1211,7 @@ public class FlowResource extends ApplicationResource {
@Path("cluster/summary") @Path("cluster/summary")
@ApiOperation( @ApiOperation(
value = "The cluster summary for this NiFi", value = "The cluster summary for this NiFi",
response = ClusteSummaryEntity.class, response = ClusterSummaryEntity.class,
authorizations = { authorizations = {
@Authorization(value = "Read - /flow") @Authorization(value = "Read - /flow")
} }
@ -1249,7 +1249,7 @@ public class FlowResource extends ApplicationResource {
clusterConfiguration.setConnectedToCluster(isConnectedToCluster()); clusterConfiguration.setConnectedToCluster(isConnectedToCluster());
// create the response entity // create the response entity
final ClusteSummaryEntity entity = new ClusteSummaryEntity(); final ClusterSummaryEntity entity = new ClusterSummaryEntity();
entity.setClusterSummary(clusterConfiguration); entity.setClusterSummary(clusterConfiguration);
// generate the response // generate the response

View File

@ -26,8 +26,8 @@ import org.apache.nifi.toolkit.cli.impl.client.nifi.impl.JerseyNiFiClient;
import org.apache.nifi.web.api.dto.NodeDTO; import org.apache.nifi.web.api.dto.NodeDTO;
import org.apache.nifi.web.api.dto.status.ConnectionStatusSnapshotDTO; import org.apache.nifi.web.api.dto.status.ConnectionStatusSnapshotDTO;
import org.apache.nifi.web.api.dto.status.ProcessGroupStatusSnapshotDTO; import org.apache.nifi.web.api.dto.status.ProcessGroupStatusSnapshotDTO;
import org.apache.nifi.web.api.entity.ClusteSummaryEntity;
import org.apache.nifi.web.api.entity.ClusterEntity; import org.apache.nifi.web.api.entity.ClusterEntity;
import org.apache.nifi.web.api.entity.ClusterSummaryEntity;
import org.apache.nifi.web.api.entity.ConnectionEntity; import org.apache.nifi.web.api.entity.ConnectionEntity;
import org.apache.nifi.web.api.entity.ConnectionStatusEntity; import org.apache.nifi.web.api.entity.ConnectionStatusEntity;
import org.apache.nifi.web.api.entity.ConnectionStatusSnapshotEntity; import org.apache.nifi.web.api.entity.ConnectionStatusSnapshotEntity;
@ -268,7 +268,7 @@ public abstract class NiFiSystemIT implements NiFiInstanceProvider {
while (true) { while (true) {
int connectedNodeCount = -1; int connectedNodeCount = -1;
try { try {
final ClusteSummaryEntity clusterSummary = client.getFlowClient().getClusterSummary(); final ClusterSummaryEntity clusterSummary = client.getFlowClient().getClusterSummary();
connectedNodeCount = clusterSummary.getClusterSummary().getConnectedNodeCount(); connectedNodeCount = clusterSummary.getClusterSummary().getConnectedNodeCount();
if (connectedNodeCount == expectedNumberOfNodes) { if (connectedNodeCount == expectedNumberOfNodes) {
logger.info("Wait successful, {} nodes connected", expectedNumberOfNodes); logger.info("Wait successful, {} nodes connected", expectedNumberOfNodes);

View File

@ -21,7 +21,7 @@ import org.apache.nifi.tests.system.NiFiInstanceFactory;
import org.apache.nifi.tests.system.NiFiSystemIT; import org.apache.nifi.tests.system.NiFiSystemIT;
import org.apache.nifi.toolkit.cli.impl.client.nifi.NiFiClientException; import org.apache.nifi.toolkit.cli.impl.client.nifi.NiFiClientException;
import org.apache.nifi.web.api.dto.NodeDTO; import org.apache.nifi.web.api.dto.NodeDTO;
import org.apache.nifi.web.api.entity.ClusteSummaryEntity; import org.apache.nifi.web.api.entity.ClusterSummaryEntity;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import java.io.File; import java.io.File;
@ -57,7 +57,7 @@ public class NodeRestartWithNewNodeIdIT extends NiFiSystemIT {
// Wait for the second node to reconnect. // Wait for the second node to reconnect.
waitForAllNodesConnected(); waitForAllNodesConnected();
final ClusteSummaryEntity clusterSummary = getNifiClient().getFlowClient().getClusterSummary(); final ClusterSummaryEntity clusterSummary = getNifiClient().getFlowClient().getClusterSummary();
// 2/2 because we replaced the state directory with a different state that had a different identifier. This will result in // 2/2 because we replaced the state directory with a different state that had a different identifier. This will result in
// 2 nodes each with a different UUID but the same hostname & port, but we should see that the cluster removes the old Node // 2 nodes each with a different UUID but the same hostname & port, but we should see that the cluster removes the old Node
// Identifier, so we will have only 2 nodes total. // Identifier, so we will have only 2 nodes total.

View File

@ -21,8 +21,8 @@ import org.apache.nifi.tests.system.NiFiInstanceFactory;
import org.apache.nifi.tests.system.NiFiSystemIT; import org.apache.nifi.tests.system.NiFiSystemIT;
import org.apache.nifi.toolkit.cli.impl.client.nifi.NiFiClientException; import org.apache.nifi.toolkit.cli.impl.client.nifi.NiFiClientException;
import org.apache.nifi.web.api.dto.NodeDTO; import org.apache.nifi.web.api.dto.NodeDTO;
import org.apache.nifi.web.api.entity.ClusteSummaryEntity;
import org.apache.nifi.web.api.entity.ClusterEntity; import org.apache.nifi.web.api.entity.ClusterEntity;
import org.apache.nifi.web.api.entity.ClusterSummaryEntity;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import java.io.IOException; import java.io.IOException;
@ -58,7 +58,7 @@ public class RestartWithDifferentPort extends NiFiSystemIT {
waitForAllNodesConnected(getNumberOfNodes(true), 2000L); waitForAllNodesConnected(getNumberOfNodes(true), 2000L);
// Wait for the second node to reconnect. // Wait for the second node to reconnect.
final ClusteSummaryEntity clusterSummary = getNifiClient().getFlowClient().getClusterSummary(); final ClusterSummaryEntity clusterSummary = getNifiClient().getFlowClient().getClusterSummary();
assertEquals("2 / 2", clusterSummary.getClusterSummary().getConnectedNodes()); assertEquals("2 / 2", clusterSummary.getClusterSummary().getConnectedNodes());
// Ensure that the Node UUID's are the same and that we now have 2 nodes: localhost:5671 and localhost:5673, but NOT localhost:5672 // Ensure that the Node UUID's are the same and that we now have 2 nodes: localhost:5671 and localhost:5673, but NOT localhost:5672

View File

@ -20,7 +20,7 @@ import org.apache.nifi.tests.system.NiFiInstance;
import org.apache.nifi.tests.system.NiFiInstanceFactory; import org.apache.nifi.tests.system.NiFiInstanceFactory;
import org.apache.nifi.tests.system.NiFiSystemIT; import org.apache.nifi.tests.system.NiFiSystemIT;
import org.apache.nifi.toolkit.cli.impl.client.nifi.NiFiClientException; import org.apache.nifi.toolkit.cli.impl.client.nifi.NiFiClientException;
import org.apache.nifi.web.api.entity.ClusteSummaryEntity; import org.apache.nifi.web.api.entity.ClusterSummaryEntity;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import java.io.IOException; import java.io.IOException;
@ -43,7 +43,7 @@ public class SimpleNodeRestartIT extends NiFiSystemIT {
secondNode.start(); secondNode.start();
waitForAllNodesConnected(); waitForAllNodesConnected();
final ClusteSummaryEntity clusterSummary = getNifiClient().getFlowClient().getClusterSummary(); final ClusterSummaryEntity clusterSummary = getNifiClient().getFlowClient().getClusterSummary();
assertEquals("2 / 2", clusterSummary.getClusterSummary().getConnectedNodes()); assertEquals("2 / 2", clusterSummary.getClusterSummary().getConnectedNodes());
} }
} }

View File

@ -18,7 +18,7 @@ package org.apache.nifi.toolkit.cli.impl.client.nifi;
import org.apache.nifi.flow.VersionedReportingTaskSnapshot; import org.apache.nifi.flow.VersionedReportingTaskSnapshot;
import org.apache.nifi.web.api.entity.ActivateControllerServicesEntity; import org.apache.nifi.web.api.entity.ActivateControllerServicesEntity;
import org.apache.nifi.web.api.entity.ClusteSummaryEntity; import org.apache.nifi.web.api.entity.ClusterSummaryEntity;
import org.apache.nifi.web.api.entity.ConnectionStatusEntity; import org.apache.nifi.web.api.entity.ConnectionStatusEntity;
import org.apache.nifi.web.api.entity.ControllerServicesEntity; import org.apache.nifi.web.api.entity.ControllerServicesEntity;
import org.apache.nifi.web.api.entity.CurrentUserEntity; import org.apache.nifi.web.api.entity.CurrentUserEntity;
@ -107,7 +107,7 @@ public interface FlowClient {
* *
* @return cluster summary response * @return cluster summary response
*/ */
ClusteSummaryEntity getClusterSummary() throws NiFiClientException, IOException; ClusterSummaryEntity getClusterSummary() throws NiFiClientException, IOException;
/** /**
* Retrieves the controller services for the reporting tasks. * Retrieves the controller services for the reporting tasks.

View File

@ -26,7 +26,7 @@ import org.apache.nifi.web.api.dto.PositionDTO;
import org.apache.nifi.web.api.dto.flow.FlowDTO; import org.apache.nifi.web.api.dto.flow.FlowDTO;
import org.apache.nifi.web.api.dto.flow.ProcessGroupFlowDTO; import org.apache.nifi.web.api.dto.flow.ProcessGroupFlowDTO;
import org.apache.nifi.web.api.entity.ActivateControllerServicesEntity; import org.apache.nifi.web.api.entity.ActivateControllerServicesEntity;
import org.apache.nifi.web.api.entity.ClusteSummaryEntity; import org.apache.nifi.web.api.entity.ClusterSummaryEntity;
import org.apache.nifi.web.api.entity.ComponentEntity; import org.apache.nifi.web.api.entity.ComponentEntity;
import org.apache.nifi.web.api.entity.ConnectionStatusEntity; import org.apache.nifi.web.api.entity.ConnectionStatusEntity;
import org.apache.nifi.web.api.entity.ControllerServicesEntity; import org.apache.nifi.web.api.entity.ControllerServicesEntity;
@ -224,10 +224,10 @@ public class JerseyFlowClient extends AbstractJerseyClient implements FlowClient
} }
@Override @Override
public ClusteSummaryEntity getClusterSummary() throws NiFiClientException, IOException { public ClusterSummaryEntity getClusterSummary() throws NiFiClientException, IOException {
return executeAction("Error retrieving cluster summary", () -> { return executeAction("Error retrieving cluster summary", () -> {
final WebTarget target = flowTarget.path("cluster/summary"); final WebTarget target = flowTarget.path("cluster/summary");
return getRequestBuilder(target).get(ClusteSummaryEntity.class); return getRequestBuilder(target).get(ClusterSummaryEntity.class);
}); });
} }

View File

@ -21,7 +21,7 @@ import org.apache.nifi.toolkit.cli.impl.client.nifi.NiFiClient;
import org.apache.nifi.toolkit.cli.impl.client.nifi.NiFiClientException; import org.apache.nifi.toolkit.cli.impl.client.nifi.NiFiClientException;
import org.apache.nifi.toolkit.cli.impl.command.nifi.AbstractNiFiCommand; import org.apache.nifi.toolkit.cli.impl.command.nifi.AbstractNiFiCommand;
import org.apache.nifi.toolkit.cli.impl.result.nifi.ClusterSummaryEntityResult; import org.apache.nifi.toolkit.cli.impl.result.nifi.ClusterSummaryEntityResult;
import org.apache.nifi.web.api.entity.ClusteSummaryEntity; import org.apache.nifi.web.api.entity.ClusterSummaryEntity;
import java.io.IOException; import java.io.IOException;
import java.util.Properties; import java.util.Properties;
@ -41,7 +41,7 @@ public class ClusterSummary extends AbstractNiFiCommand<ClusterSummaryEntityResu
public ClusterSummaryEntityResult doExecute(NiFiClient client, Properties properties) public ClusterSummaryEntityResult doExecute(NiFiClient client, Properties properties)
throws NiFiClientException, IOException { throws NiFiClientException, IOException {
final FlowClient flowClient = client.getFlowClient(); final FlowClient flowClient = client.getFlowClient();
final ClusteSummaryEntity clusterSummary = flowClient.getClusterSummary(); final ClusterSummaryEntity clusterSummary = flowClient.getClusterSummary();
return new ClusterSummaryEntityResult(getResultType(properties), clusterSummary); return new ClusterSummaryEntityResult(getResultType(properties), clusterSummary);
} }
} }

View File

@ -18,7 +18,7 @@ package org.apache.nifi.toolkit.cli.impl.result.nifi;
import org.apache.nifi.toolkit.cli.api.ResultType; import org.apache.nifi.toolkit.cli.api.ResultType;
import org.apache.nifi.toolkit.cli.impl.result.AbstractWritableResult; import org.apache.nifi.toolkit.cli.impl.result.AbstractWritableResult;
import org.apache.nifi.web.api.entity.ClusteSummaryEntity; import org.apache.nifi.web.api.entity.ClusterSummaryEntity;
import java.io.PrintStream; import java.io.PrintStream;
import java.util.Objects; import java.util.Objects;
@ -26,17 +26,17 @@ import java.util.Objects;
/** /**
* Result for CurrentUserEntity from NiFi. * Result for CurrentUserEntity from NiFi.
*/ */
public class ClusterSummaryEntityResult extends AbstractWritableResult<ClusteSummaryEntity> { public class ClusterSummaryEntityResult extends AbstractWritableResult<ClusterSummaryEntity> {
private final ClusteSummaryEntity clusteSummaryEntity; private final ClusterSummaryEntity clusteSummaryEntity;
public ClusterSummaryEntityResult(final ResultType resultType, final ClusteSummaryEntity clusteSummaryEntity) { public ClusterSummaryEntityResult(final ResultType resultType, final ClusterSummaryEntity clusteSummaryEntity) {
super(resultType); super(resultType);
this.clusteSummaryEntity = Objects.requireNonNull(clusteSummaryEntity); this.clusteSummaryEntity = Objects.requireNonNull(clusteSummaryEntity);
} }
@Override @Override
public ClusteSummaryEntity getResult() { public ClusterSummaryEntity getResult() {
return clusteSummaryEntity; return clusteSummaryEntity;
} }