-
Notifications
You must be signed in to change notification settings - Fork 8
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
SPOTAUT-9153 Implementation of EMR Scaler Routes #133
base: master
Are you sure you want to change the base?
Conversation
* | ||
* @return a list of Scaler cluster | ||
*/ | ||
public List<ApiMrScalerListScalersAws> listMrScalers(ApiMrScalerListMrScalersRequest mrScalerListScalersRequest) { |
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.
Do we need the ApiMrScalerListMrScalersRequest object. We can directly pass the MrScalerId.
* | ||
* @return a list of instances | ||
*/ | ||
public List<ApiMrScalerScaleUpAws> scaleUpMrScaler(ApiMrScalerScaleUpRequest mrScalerScaleUpRequest) { |
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.
Do we need the ApiMrScalerScaleUpRequest object. We can directly pass the MrScalerId and adjustment
* | ||
* @return a list of instances | ||
*/ | ||
public List<ApiMrScalerScaleDownAws> scaleDownMrScaler(ApiMrScalerScaleDownRequest mrScalerScaleDownRequest) { |
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.
Same comment as previous function.
* | ||
* @return a list of instances | ||
*/ | ||
public List<ApiMrScalerListInstancesAws> listMrScalerInstances( |
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.
This should return BL object list
* | ||
* @return a list of instances | ||
*/ | ||
public List<ApiMrScalerListInstancesAws> listMrScalerInstances( |
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.
Client class shouldn't have any reference of Api level objects.
* @return a list of Scaler cluster | ||
*/ | ||
public List<ApiMrScalerListScalersAws> listMrScalers(ApiMrScalerListMrScalersRequest mrScalerListScalersRequest) { | ||
List<ApiMrScalerListScalersAws> retVal; |
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.
Client class shouldn't have any reference of Api level objects.
public List<ApiMrScalerListScalersAws> listMrScalers(ApiMrScalerListMrScalersRequest mrScalerListScalersRequest) { | ||
List<ApiMrScalerListScalersAws> retVal; | ||
String clusterToGet = mrScalerListScalersRequest.getMrScalerId(); | ||
RepoGenericResponse<List<ApiMrScalerListScalersAws>> mrScalerListScalers = getSpotinstMrScalerListScalersRepo().listMrScalers(clusterToGet, authToken, account); |
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.
Client class shouldn't have any reference of Api level objects.
* | ||
* @return a list of instances | ||
*/ | ||
public List<ApiMrScalerScaleDownAws> scaleDownMrScaler(ApiMrScalerScaleDownRequest mrScalerScaleDownRequest) { |
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.
Client class shouldn't have any reference of Api level objects.
|
||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public class BlMrScalerListInstancesAws { |
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.
Remove Bl from class name.
|
||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public class BlMrScalerListScalersAws { |
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.
Remove Bl from class name.
|
||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public class BlMrScalerScaleDownAws { |
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.
Remove Bl from class name.
|
||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public class BlMrScalerScaleUpAws { |
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.
Remove Bl from class name.
import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerListInstancesAws; | ||
import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerListInstancesAws; | ||
|
||
public class MrScalerListInstancesConverter { |
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.
Can we combine all 8 converter functions to single file/class.
public class SpotinstMrScalerListInstancesRepo implements ISpotinstMrScalerListInstancesRepo { | ||
|
||
@Override | ||
public RepoGenericResponse<List<ApiMrScalerListInstancesAws>> listMrScalerInstances(String mrScalerId, String authToken, String account) { |
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.
Repo classes should return bl object list
public class SpotinstMrScalerListScalersRepo implements ISpotinstMrScalerListScalersRepo { | ||
|
||
@Override | ||
public RepoGenericResponse<List<ApiMrScalerListScalersAws>> listMrScalers(String mrScalerId, String authToken, String account) { |
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.
Repo classes should return bl object list
public class SpotinstMrScalerScaleDownRepo implements ISpotinstMrScalerScaleDownRepo { | ||
|
||
@Override | ||
public RepoGenericResponse<List<ApiMrScalerScaleDownAws>> scaleDownMrScaler(String mrScalerId, Integer adjustment, String authToken, String account) { |
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.
Repo classes should return bl object list
public class SpotinstMrScalerScaleUpRepo implements ISpotinstMrScalerScaleUpRepo { | ||
|
||
@Override | ||
public RepoGenericResponse<List<ApiMrScalerScaleUpAws>> scaleUpMrScaler(String mrScalerId, Integer adjustment, String authToken, String account) { |
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.
Repo classes should return bl object list
|
||
import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerListInstancesAws; | ||
|
||
public class ApiMrScalerListInstancesRequest { |
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.
Seems like this class is not required.
|
||
import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerListScalersAws; | ||
|
||
public class ApiMrScalerListMrScalersRequest { |
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.
Seems like this class is not required.
|
||
import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerScaleDownAws; | ||
|
||
public class ApiMrScalerScaleDownRequest { |
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.
Seems like this class is not required. This can be passed as parameters itself.
|
||
import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerScaleUpAws; | ||
|
||
public class ApiMrScalerScaleUpRequest { |
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.
Seems like this class is not required. This can be passed as parameters itself.
import com.spotinst.sdkjava.client.response.BaseServiceItemsResponse; | ||
import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerListInstancesAws; | ||
|
||
public class ApiMrScalerListInstancesResponse extends BaseServiceItemsResponse<BlMrScalerListInstancesAws> { |
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.
Seems incorrect Bl object is extended to Api response.
import com.spotinst.sdkjava.client.response.BaseServiceItemsResponse; | ||
import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerListScalersAws; | ||
|
||
public class ApiMrScalerListMrScalersResponse extends BaseServiceItemsResponse<BlMrScalerListScalersAws> { |
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.
Seems incorrect Bl object is extended to Api response.
import com.spotinst.sdkjava.client.response.BaseServiceItemsResponse; | ||
import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerScaleDownAws; | ||
|
||
public class ApiMrScalerScaleDownResponse extends BaseServiceItemsResponse<BlMrScalerScaleDownAws> { |
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.
Seems incorrect Bl object is extended to Api response.
import com.spotinst.sdkjava.client.response.BaseServiceItemsResponse; | ||
import com.spotinst.sdkjava.model.bl.mrScaler.aws.BlMrScalerScaleUpAws; | ||
|
||
public class ApiMrScalerScaleUpResponse extends BaseServiceItemsResponse<BlMrScalerScaleUpAws> { |
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.
Seems incorrect Bl object is extended to Api response.
import java.util.Map; | ||
|
||
public class SpotinstMrScalerListInstancesService extends BaseSpotinstService { | ||
public static List<BlMrScalerListInstancesAws> listMrScalerInstances(String clusterId, String authToken, String account) |
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.
Should return api object list
Don;t need 4 separate classes, this can be incorporated in the existing service class for MrScalers
SDK Changes
null check update
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.
please fix the comments
@@ -1,7 +1,10 @@ | |||
package com.spotinst.sdkjava.model; | |||
|
|||
import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerAws; | |||
import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerAwsCreationRequest; | |||
import com.spotinst.sdkjava.model.bl.mrScaler.aws.MrScalerAws; |
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.
is this class required now?
package com.spotinst.sdkjava.model.service.mrScaler.aws; | ||
|
||
import com.spotinst.sdkjava.client.response.BaseSpotinstService; | ||
import com.spotinst.sdkjava.client.rest.RestClient; |
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.
All the MrScaler routes can be in same service class right?
BlMrScalerOperatorResponse retVal = null; | ||
public static ApiMrScalerOperatorAwsResponse createMrScalerOperator(MrScalerOperatorAws mrScalerOperatorAws, | ||
String authToken, | ||
String account) throws SpotinstHttpException { |
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.
For MrScalerOperator keep one service class
import com.spotinst.sdkjava.model.bl.mrScaler.aws.MrScalerOperatorAws; | ||
|
||
public class MrScalerOperatorAwsRequest { | ||
// @JsonProperty("mrScalerOperator") |
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.
remove this commented line
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.
Do we need this class?
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.
This can be passed directly without request class
|
||
public class MrScalerListMrScalersRequest { | ||
//region Members | ||
private String mrScalerId; |
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.
why we need this request class
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.
This can be passed directly without request class
import com.spotinst.sdkjava.model.api.mrScaler.aws.ApiMrScalerOperatorAwsResponse; | ||
import com.spotinst.sdkjava.model.bl.mrScaler.aws.MrScalerOperatorResponse; | ||
|
||
public class SpotinstMrScalerAwsOperatorRepo implements ISpotinstMrScalerOperatorAwsRepo { |
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.
we can club all the functions into one repo class for MrScalerOperator
private String id; | ||
private String availabilityZone; | ||
private String state; | ||
private Date createdAt; |
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.
align this
private List<String> instanceTypes; | ||
private ElastigroupCapacityConfiguration capacity; | ||
private String lifeCycle; | ||
private MrScalerAwsEbsConfiguration ebsConfiguration; |
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.
align this
@@ -18,7 +18,7 @@ | |||
/** | |||
* Created by aharontwizer on 7/27/15. | |||
*/ | |||
class SpotinstElastigroupService extends BaseSpotinstService { | |||
public class SpotinstElastigroupService extends BaseSpotinstService { |
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.
why is this class changed to public
package com.spotinst.sdkjava.model; | ||
|
||
import com.spotinst.sdkjava.exception.SpotinstNotSupportedException; | ||
import com.spotinst.sdkjava.model.bl.mrScaler.aws.MrScalerScaleUpAws; |
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.
Not required to be separate interface for each function
This is the default pull request template. You can customize it by adding a
pull_request_template.md
at the root of your repo or inside the.github
folder.Jira Ticket
Include a link to your Jira Ticket
Example: JIRAISS-1234
Demo
Please add a recording of the feature/bug fix in work. if you added new routes, the recording should show the request and response for each new/changed route
Checklist: