Skip to content

Conversation

@pfz168
Copy link
Contributor

@pfz168 pfz168 commented Feb 9, 2022

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:

  • I have filled relevant self assessment (NodeJS, Frontend, Backend)
  • I have run ESlint on my changes and fixed all warnings and errors (NodeJS & Frontend Services)
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have validated all the requirements in the Jira task were answered
  • I have all neccessary approvals for the design/mini design of this task
  • I have approved the API changes and granular permission patterns (documentation subtask) (For public services only)

*
* @return a list of Scaler cluster
*/
public List<ApiMrScalerListScalersAws> listMrScalers(ApiMrScalerListMrScalersRequest mrScalerListScalersRequest) {

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) {

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) {

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(

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(

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;

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);

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) {

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 {

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 {

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 {

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 {

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 {

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) {

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) {

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) {

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) {

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 {

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 {

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 {

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 {

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> {

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> {

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> {

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> {

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)
Copy link

@anuragsharma-123 anuragsharma-123 Feb 10, 2022

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
Copy link
Contributor

@janetlinkiruba janetlinkiruba left a 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


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;
Copy link
Contributor

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;
Copy link
Contributor

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 {
Copy link
Contributor

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")
Copy link
Contributor

Choose a reason for hiding this comment

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

remove this commented line

Copy link
Contributor

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?

Copy link
Contributor

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;
Copy link
Contributor

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

Copy link
Contributor

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 {
Copy link
Contributor

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;
Copy link
Contributor

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;
Copy link
Contributor

Choose a reason for hiding this comment

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

align this

* Created by aharontwizer on 7/27/15.
*/
class SpotinstElastigroupService extends BaseSpotinstService {
public class SpotinstElastigroupService extends BaseSpotinstService {
Copy link
Contributor

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;
Copy link
Contributor

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

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.

5 participants