-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[AMBARI-22878] Update Service Group API to take list of mpack name associated with the service group #234
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
Merged
jayush
merged 17 commits into
apache:branch-feature-AMBARI-14714
from
scottduan:AMBARI-22878-branch-feature-AMBARI-14714
Feb 22, 2018
Merged
[AMBARI-22878] Update Service Group API to take list of mpack name associated with the service group #234
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
dcb871b
AMBARI-22878: Update Service Group API to take list of mpack name ass…
scottduan e97eb29
AMBARI-22878: Update Service Group API to take list of mpack name ass…
scottduan da41ca0
Merge branch 'AMBARI-22878-branch-feature-AMBARI-14714' of https://gi…
scottduan 158cd85
Merge branch 'AMBARI-22878-branch-feature-AMBARI-14714' of https://gi…
scottduan decbf54
Merge branch 'AMBARI-22878-branch-feature-AMBARI-14714' of https://gi…
scottduan 68c1f04
Merge remote-tracking branch 'upstream/branch-feature-AMBARI-14714' i…
scottduan a2340a6
Merge remote-tracking branch 'upstream/branch-feature-AMBARI-14714' i…
scottduan 04345f8
Merge branch 'AMBARI-22878-branch-feature-AMBARI-14714' of https://gi…
scottduan 90f354f
Merge remote-tracking branch 'upstream/branch-feature-AMBARI-14714' i…
scottduan a331735
Merge remote-tracking branch 'upstream/branch-feature-AMBARI-14714' i…
scottduan 3de0e93
Merge branch 'AMBARI-22878-branch-feature-AMBARI-14714' of https://gi…
f74af11
Merge branch 'AMBARI-22878-branch-feature-AMBARI-14714' of https://gi…
afc6a3b
Merge branch 'AMBARI-22878-branch-feature-AMBARI-14714' of https://gi…
fb3e005
Merge branch 'AMBARI-22878-branch-feature-AMBARI-14714' of https://gi…
7bcd6fe
Merge branch 'AMBARI-22878-branch-feature-AMBARI-14714' of https://gi…
cfe5295
Merge branch 'AMBARI-22878-branch-feature-AMBARI-14714' of https://gi…
d370602
Merge branch 'AMBARI-22878-branch-feature-AMBARI-14714' of https://gi…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,10 +23,12 @@ public class ServiceGroupRequest { | |
|
|
||
| private String clusterName; // REF | ||
| private String serviceGroupName; // GET/CREATE/UPDATE/DELETE | ||
| private String version; // Associated stack version info | ||
|
|
||
| public ServiceGroupRequest(String clusterName, String serviceGroupName) { | ||
| public ServiceGroupRequest(String clusterName, String serviceGroupName, String version) { | ||
| this.clusterName = clusterName; | ||
| this.serviceGroupName = serviceGroupName; | ||
| this.version = version; | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -57,9 +59,25 @@ public void setServiceGroupName(String serviceGroupName) { | |
| this.serviceGroupName = serviceGroupName; | ||
| } | ||
|
|
||
| /** | ||
| * @return the servicegroup version | ||
| */ | ||
| public String getVersion() { | ||
| return version; | ||
| } | ||
|
|
||
| /** | ||
| * @param version the servicegroup version to set | ||
| */ | ||
| public void setVersion(String version) { | ||
| this.version = version; | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| return String.format("clusterName=%s, serviceGroupName=%s", clusterName, serviceGroupName); | ||
| StringBuilder sb = new StringBuilder(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We've been gradually moving to ToStringBuilder here instead
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, we should switch this to ToStringBuilder. |
||
| sb.append("clusterName=").append(clusterName).append(", serviceGroupName=").append(serviceGroupName).append(", version=").append(version); | ||
| return sb.toString(); | ||
| } | ||
|
|
||
| @Override | ||
|
|
@@ -73,12 +91,11 @@ public boolean equals(Object obj) { | |
|
|
||
| ServiceGroupRequest other = (ServiceGroupRequest) obj; | ||
|
|
||
| return Objects.equals(clusterName, other.clusterName) && | ||
| Objects.equals(serviceGroupName, other.serviceGroupName); | ||
| return Objects.equals(clusterName, other.clusterName) && Objects.equals(serviceGroupName, other.serviceGroupName) && Objects.equals(version, other.version); | ||
| } | ||
|
|
||
| @Override | ||
| public int hashCode() { | ||
| return Objects.hash(clusterName, serviceGroupName); | ||
| return Objects.hash(clusterName, serviceGroupName, version); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there's still a misunderstanding here - I thought it would be cleaner to separate this out into 2 fields so that it's clear to the user what is expected: mpack name and then mpack version. You can combine this and call it a stack ID internally, that's fine - but we should take 2 different properties.
Same goes for API requests where we're currently given
name-versionas a string. This should be broken out into 2 fields.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am ok for this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jayush What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets keep it as "version" for now for legacy purposes. When we upgrade to ambari 3.0 assuming the existing cluster is on HDP-2.6 stack, calling this as mpack name and mpack version would be misleading.
We should handle this in a separate JIRA if we really want to change this convention for all APIs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But "version" in legacy terms meant only the numeric value. If we don't want to break it out into 2 references, I think we'd rather use stackId, right?