Skip to content

Conversation

@weichao666
Copy link
Contributor

@weichao666 weichao666 commented Nov 28, 2017

JAV-429 Modify the startup policy of SDK
added schema summary,
added batch registration,
added to determine whether the servicecenter environment's runmode is dev,

/**
*Created by on 2017/11/22.
*/
public class Sha {
Copy link
Contributor

Choose a reason for hiding this comment

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

it seems guava already has this utils?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes,use guava is better

}

@Override
public ServiceCenter getServiceCenter() {
Copy link
Contributor

Choose a reason for hiding this comment

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

left these methods empty not good.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok,i'll use some information to mark

}

@Override
public boolean syncSchemasAll(Microservice microservice) {
Copy link
Contributor

Choose a reason for hiding this comment

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

if there are 600 schemas, will this request too big?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so how to deal with such a scene? if local schema is not same with SC's

if (Const.SERVICECENTER_RUNMODE_DEV.equals(srClient.getServiceCenter().getRunMode())) {
LOGGER.warn("The current servicecenter environment runmode is {}", Const.SERVICECENTER_RUNMODE_DEV);
return true;
} else if (Const.SERVICECENTER_RUNMODE_PROD.equals(srClient.getServiceCenter().getRunMode())) {
Copy link
Contributor

Choose a reason for hiding this comment

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

already return, no need else

return true;
}

private boolean serviceCenterEnv() {
Copy link
Contributor

Choose a reason for hiding this comment

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

serviceCenterEnv is not clear
it seems that to determine if it is dev mode.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Use String instead of boolean to do the return value type, and then judge?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

only in the dev can perform changes currently, so determine if it is dev mode in the method,we can only care about it'll return true or false

Copy link
Contributor

Choose a reason for hiding this comment

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

yes.
but method name is serviceCenterEnv, not relative to dev mode.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok,i've changed the metnod's name to serviceCenterEnvIsDev

*
* 同步本地schema
*/
boolean syncSchemasAll(Microservice microservice);
Copy link
Contributor

Choose a reason for hiding this comment

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

we need a batch api to determine if some schemas exist.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this time i use the batch upload interface that SC provided,if not good enough, we can use the better plan

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling cb2941a on wWX495170:master into ** on ServiceComb:master**.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 87.175% when pulling cb4f32f on wWX495170:master into 7ddf345 on ServiceComb:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 87.137% when pulling 9984962 on wWX495170:master into 7ddf345 on ServiceComb:master.

@WillemJiang
Copy link
Member

@wWX495170 Can you rebase the change to resolve the conflicts?
BTW, please add the JIRA number in each of your commit to keep tracing issue.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 87.115% when pulling 8a47e8b on wWX495170:master into 856657d on ServiceComb:master.

Copy link
Contributor Author

@weichao666 weichao666 left a comment

Choose a reason for hiding this comment

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

JAV-429 Modify the startup policy of SDK

Copy link
Contributor Author

@weichao666 weichao666 left a comment

Choose a reason for hiding this comment

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

JAV-429 Modify the startup policy of SDK

@weichao666 weichao666 closed this Dec 7, 2017
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.

4 participants