Skip to content

CASSSIDECAR-417 : CdcManager.getInstanceId(instanceIp) returns -1 as it resolves ipAddress to null#332

Open
jyothsnakonisa wants to merge 4 commits intoapache:trunkfrom
jyothsnakonisa:get-instance-id
Open

CASSSIDECAR-417 : CdcManager.getInstanceId(instanceIp) returns -1 as it resolves ipAddress to null#332
jyothsnakonisa wants to merge 4 commits intoapache:trunkfrom
jyothsnakonisa:get-instance-id

Conversation

@jyothsnakonisa
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Contributor

@skoppu22 skoppu22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor changes needed

LOGGER.warn("Could not resolve hostname: {}", e.getMessage());
return address1.equals(address2); // Fallback to string comparison
LOGGER.warn("Requested IP {} does not match with any instances", instanceIp);
return -1;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wdyt about, instead of using -1 here as a magic number, we define a static constant UNKNOWN_INSTANCE or something we return when we fail to match and check against?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup agree, that looks better!

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