Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove duplicate check for replicationClusterSet #11429

Merged
merged 1 commit into from
Jul 23, 2021

Conversation

Technoboy-
Copy link
Contributor

Motivation

NamespacesBase#internalSetNamespaceReplicationClusters has duplicate codes:

Set<String> clusters = clusters();
for (String clusterId : replicationClusterSet) {
if (!clusters.contains(clusterId)) {
throw new RestException(Status.FORBIDDEN, "Invalid cluster id: " + clusterId);
}
validatePeerClusterConflict(clusterId, replicationClusterSet);
}
for (String clusterId : replicationClusterSet) {
if (!clusters.contains(clusterId)) {
throw new RestException(Status.FORBIDDEN, "Invalid cluster id: " + clusterId);
}
validatePeerClusterConflict(clusterId, replicationClusterSet);
}
for (String clusterId : replicationClusterSet) {
validateClusterForTenant(namespaceName.getTenant(), clusterId);
}

Modifications

Remove the duplicate codes.

For contributor

Small code adjustment, no need to update doc.

@Anonymitaet Anonymitaet added the doc-not-needed Your PR changes do not impact docs label Jul 22, 2021
@sijie sijie added this to the 2.9.0 milestone Jul 22, 2021
@Technoboy-
Copy link
Contributor Author

/pulsarbot run-failure-checks

1 similar comment
@Technoboy-
Copy link
Contributor Author

/pulsarbot run-failure-checks

@codelipenghui codelipenghui merged commit 083bb62 into apache:master Jul 23, 2021
@codelipenghui codelipenghui added the cherry-picked/branch-2.8 Archived: 2.8 is end of life label Jul 30, 2021
@Technoboy- Technoboy- deleted the remove-duplicate-check branch August 10, 2022 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/admin cherry-picked/branch-2.8 Archived: 2.8 is end of life doc-not-needed Your PR changes do not impact docs release/2.8.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants