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

Minor fixes to NamespaceMapping #5067

Merged
merged 1 commit into from
Nov 15, 2024
Merged

Conversation

ctubbsii
Copy link
Member

  • Add a check to make sure that if the name exists in the mapping, then it results in a namespace exists exception, rather than only do that if the ID exists in the mapping (this fixes the NamespaceIT failure seen after Add ZooKeeper Namespace Id-to-name mapping #4996 was merged)
  • Make NamespaceMapping.put() idempotent by checking the current mapping against the desired mapping (this preserves existing behavior at this point in the code, which was previously being handled by the Utils method that was deleted)

Trivial changes:

  • Add some stricter checks for parameters to NamespaceMapping methods (final and require non-null)
  • Avoid NPE problems by comparing the known non-null string on the left side of the .equals()
  • Make name and inline comments consistent between rename and put methods

* Add a check to make sure that if the name exists in the mapping, then
  it results in a namespace exists exception, rather than only do that
  if the ID exists in the mapping (this fixes the NamespaceIT failure
  seen after apache#4996 was merged)
* Make NamespaceMapping.put() idempotent by checking the current mapping
  against the desired mapping (this preserves existing behavior at this
  point in the code, which was previously being handled by the Utils
  method that was deleted)

Trivial changes:

* Add some stricter checks for parameters to NamespaceMapping methods
  (final and require non-null)
* Avoid NPE problems by comparing the known non-null string on the left
  side of the .equals()
* Make name and inline comments consistent between rename and put
  methods
@ctubbsii ctubbsii added this to the 3.1.0 milestone Nov 15, 2024
@ctubbsii ctubbsii merged commit 7511372 into apache:3.1 Nov 15, 2024
8 checks passed
@ctubbsii ctubbsii deleted the fix-NamespacesIT branch November 15, 2024 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants