Skip to content

Commit

Permalink
NIFI-4172: Renamed ClusteSummaryEntity to ClusterSummaryEntity
Browse files Browse the repository at this point in the history
This closes #7900

Signed-off-by: David Handermann <exceptionfactory@apache.org>
  • Loading branch information
markap14 authored and exceptionfactory committed Oct 19, 2023
1 parent 97dfe2d commit 8bfb6be
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* 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")
public class ClusteSummaryEntity extends Entity {
public class ClusterSummaryEntity extends Entity {

private ClusterSummaryDTO clusterSummary;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
import org.apache.nifi.web.api.entity.ActivateControllerServicesEntity;
import org.apache.nifi.web.api.entity.BannerEntity;
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.ClusterSummaryEntity;
import org.apache.nifi.web.api.entity.ComponentHistoryEntity;
import org.apache.nifi.web.api.entity.ConnectionStatisticsEntity;
import org.apache.nifi.web.api.entity.ConnectionStatusEntity;
Expand Down Expand Up @@ -1211,7 +1211,7 @@ public Response getControllerStatus() throws InterruptedException {
@Path("cluster/summary")
@ApiOperation(
value = "The cluster summary for this NiFi",
response = ClusteSummaryEntity.class,
response = ClusterSummaryEntity.class,
authorizations = {
@Authorization(value = "Read - /flow")
}
Expand Down Expand Up @@ -1249,7 +1249,7 @@ public Response getClusterSummary() {
clusterConfiguration.setConnectedToCluster(isConnectedToCluster());

// create the response entity
final ClusteSummaryEntity entity = new ClusteSummaryEntity();
final ClusterSummaryEntity entity = new ClusterSummaryEntity();
entity.setClusterSummary(clusterConfiguration);

// generate the response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
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.ProcessGroupStatusSnapshotDTO;
import org.apache.nifi.web.api.entity.ClusteSummaryEntity;
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.ConnectionStatusEntity;
import org.apache.nifi.web.api.entity.ConnectionStatusSnapshotEntity;
Expand Down Expand Up @@ -268,7 +268,7 @@ protected void waitForAllNodesConnected(final int expectedNumberOfNodes, final l
while (true) {
int connectedNodeCount = -1;
try {
final ClusteSummaryEntity clusterSummary = client.getFlowClient().getClusterSummary();
final ClusterSummaryEntity clusterSummary = client.getFlowClient().getClusterSummary();
connectedNodeCount = clusterSummary.getClusterSummary().getConnectedNodeCount();
if (connectedNodeCount == expectedNumberOfNodes) {
logger.info("Wait successful, {} nodes connected", expectedNumberOfNodes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.apache.nifi.tests.system.NiFiSystemIT;
import org.apache.nifi.toolkit.cli.impl.client.nifi.NiFiClientException;
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 java.io.File;
Expand Down Expand Up @@ -57,7 +57,7 @@ public void testRestartNodeWithDifferentNodeId() throws IOException, NiFiClientE
// Wait for the second node to reconnect.
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 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import org.apache.nifi.tests.system.NiFiSystemIT;
import org.apache.nifi.toolkit.cli.impl.client.nifi.NiFiClientException;
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.ClusterSummaryEntity;
import org.junit.jupiter.api.Test;

import java.io.IOException;
Expand Down Expand Up @@ -58,7 +58,7 @@ public void testRestartWithDifferentPortKeepsNodeIdUnchanged() throws IOExceptio
waitForAllNodesConnected(getNumberOfNodes(true), 2000L);

// 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());

// 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import org.apache.nifi.tests.system.NiFiInstanceFactory;
import org.apache.nifi.tests.system.NiFiSystemIT;
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 java.io.IOException;
Expand All @@ -43,7 +43,7 @@ public void testRestartNode() throws NiFiClientException, IOException {
secondNode.start();
waitForAllNodesConnected();

final ClusteSummaryEntity clusterSummary = getNifiClient().getFlowClient().getClusterSummary();
final ClusterSummaryEntity clusterSummary = getNifiClient().getFlowClient().getClusterSummary();
assertEquals("2 / 2", clusterSummary.getClusterSummary().getConnectedNodes());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import org.apache.nifi.flow.VersionedReportingTaskSnapshot;
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.ControllerServicesEntity;
import org.apache.nifi.web.api.entity.CurrentUserEntity;
Expand Down Expand Up @@ -107,7 +107,7 @@ VersionedFlowSnapshotMetadataSetEntity getVersions(String registryId, String buc
*
* @return cluster summary response
*/
ClusteSummaryEntity getClusterSummary() throws NiFiClientException, IOException;
ClusterSummaryEntity getClusterSummary() throws NiFiClientException, IOException;

/**
* Retrieves the controller services for the reporting tasks.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import org.apache.nifi.web.api.dto.flow.FlowDTO;
import org.apache.nifi.web.api.dto.flow.ProcessGroupFlowDTO;
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.ConnectionStatusEntity;
import org.apache.nifi.web.api.entity.ControllerServicesEntity;
Expand Down Expand Up @@ -224,10 +224,10 @@ public ActivateControllerServicesEntity activateControllerServices(final Activat
}

@Override
public ClusteSummaryEntity getClusterSummary() throws NiFiClientException, IOException {
public ClusterSummaryEntity getClusterSummary() throws NiFiClientException, IOException {
return executeAction("Error retrieving cluster summary", () -> {
final WebTarget target = flowTarget.path("cluster/summary");
return getRequestBuilder(target).get(ClusteSummaryEntity.class);
return getRequestBuilder(target).get(ClusterSummaryEntity.class);
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
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.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.util.Properties;
Expand All @@ -41,7 +41,7 @@ public String getDescription() {
public ClusterSummaryEntityResult doExecute(NiFiClient client, Properties properties)
throws NiFiClientException, IOException {
final FlowClient flowClient = client.getFlowClient();
final ClusteSummaryEntity clusterSummary = flowClient.getClusterSummary();
final ClusterSummaryEntity clusterSummary = flowClient.getClusterSummary();
return new ClusterSummaryEntityResult(getResultType(properties), clusterSummary);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,25 @@

import org.apache.nifi.toolkit.cli.api.ResultType;
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.util.Objects;

/**
* 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);
this.clusteSummaryEntity = Objects.requireNonNull(clusteSummaryEntity);
}

@Override
public ClusteSummaryEntity getResult() {
public ClusterSummaryEntity getResult() {
return clusteSummaryEntity;
}

Expand Down

0 comments on commit 8bfb6be

Please sign in to comment.