[SCB-612]delete useless MicroserviceMetaManager#861
[SCB-612]delete useless MicroserviceMetaManager#861liubao68 merged 3 commits intoapache:masterfrom heyile:cse-612
Conversation
| public SchemaMeta ensureFindSchemaMeta(String microserviceName, String schemaId) { | ||
| MicroserviceMeta microserviceMeta = microserviceMetaManager.ensureFindValue(microserviceName); | ||
| if (!RegistryUtils.getMicroservice().getServiceName().equals(microserviceName)) { | ||
| LOGGER.error("miroserviceName : {} is different from the default microserviceName :{}", |
There was a problem hiding this comment.
This is an internally used class, will this logic happen? Or can we delete the parameter microserviceName?
There was a problem hiding this comment.
this logic will not happen in the normal mode , and I have asked jimin about whether I could delete parameter microserviceName because it's no use now. He suggested me to keep it for the compatibility of the method with
other classes or modules and he advised me to compare the parameter microserviceName with the default right micorserviceName. just make sure the program is running as we expected。
|
|
||
| public Collection<SchemaMeta> getAllSchemaMeta(String microserviceName) { | ||
| MicroserviceMeta microserviceMeta = microserviceMetaManager.ensureFindValue(microserviceName); | ||
| if (!RegistryUtils.getMicroservice().getServiceName().equals(microserviceName)) { |
|
|
||
| MicroserviceMeta microserviceMeta = | ||
| microserviceMetaManager.getOrCreateMicroserviceMeta(RegistryUtils.getMicroservice()); | ||
| MicroserviceMeta microserviceMeta = SCBEngine.getInstance().getProducerMicroMeta(); |
There was a problem hiding this comment.
getProducerMicroserviceMeta?
| import mockit.MockUp; | ||
| import mockit.Mocked; | ||
|
|
||
| import io.vertx.core.buffer.Buffer; |
There was a problem hiding this comment.
did not import correct codestyle?
There was a problem hiding this comment.
I have import a wrong code style...
| if (!RegistryUtils.getMicroservice().getServiceName().equals(microserviceName)) { | ||
| LOGGER.error("miroserviceName : {} is different from the default microserviceName :{}", | ||
| microserviceName, | ||
| RegistryUtils.getMicroservice().getServiceName()); |
There was a problem hiding this comment.
I just want to make a warning there, tell the programer that he may have the mistake with the parameter microserviceName,and you should not set the microserviceName any more. I do not want to stop the program, I'm afraid that some other moduls or methods may invoke the method with the wrong microserviceName,so i just want to give a warnning there, tell them the microserviceName is wrong and keep the program running as usual.
There was a problem hiding this comment.
but the go on logic, will make producerMicroserviceMeta incorrect.
| if (!RegistryUtils.getMicroservice().getServiceName().equals(microserviceName)) { | ||
| LOGGER.error("miroserviceName : {} is different from the default microserviceName :{}", | ||
| microserviceName, | ||
| RegistryUtils.getMicroservice().getServiceName()); |
| if (!RegistryUtils.getMicroservice().getServiceName().equals(microserviceName)) { | ||
| LOGGER.error("miroserviceName : {} is different from the default microserviceName :{}", | ||
| microserviceName, | ||
| RegistryUtils.getMicroservice().getServiceName()); |
| if (!RegistryUtils.getMicroservice().getServiceName().equals(microserviceName)) { | ||
| LOGGER.error("miroserviceName : {} is different from the default microserviceName :{}", | ||
| microserviceName, | ||
| RegistryUtils.getMicroservice().getServiceName()); |
| @SuppressWarnings("unchecked") | ||
| @Mock | ||
| <T> T getBean(String name) { | ||
| @Mock <T> T getBean(String name) { |
There was a problem hiding this comment.
I don not know, when I use
@mock
T getBean(String name) {}
it can not pass the travis ci's check
| }); | ||
| if (wait) { | ||
| LOGGER.info("Refreshing remote config..."); | ||
| LOGGER.debug("Refreshing remote config..."); |
|
|
||
| public SchemaMeta ensureFindSchemaMeta(String microserviceName, String schemaId) { | ||
| MicroserviceMeta microserviceMeta = microserviceMetaManager.ensureFindValue(microserviceName); | ||
| if (!RegistryUtils.getMicroservice().getServiceName().equals(microserviceName)) { |
There was a problem hiding this comment.
if throw exception, then just remove "microserviceName" parameter is better.
so:
1.just log and return
2.deprecated the method, and invoke another method without parameter "microserviceName"
(old one will be deleted in future version)
There was a problem hiding this comment.
so i would better to choose 2 ?
ok. let me have a try
|
too many commit log...... |
| // 动态注册schemas目录下面的契约到当前服务 | ||
| org.apache.servicecomb.core.definition.loader.DynamicSchemaLoader.INSTANCE.registerSchemas("appServer:appService", | ||
| "classpath*:schemas/*.yaml"); | ||
| org.apache.servicecomb.core.definition.loader.DynamicSchemaLoader.INSTANCE |
There was a problem hiding this comment.
remote class CrossappBootListener
because it's used to register target microservice schema.
There was a problem hiding this comment.
so , what should i do there ?
There was a problem hiding this comment.
sorry, "remove", not "remote"
Follow this checklist to help us incorporate your contribution quickly and easily:
[SCB-XXX] Fixes bug in ApproximateQuantiles, where you replaceSCB-XXXwith the appropriate JIRA issue.mvn clean installto make sure basic checks pass. A more thorough check will be performed on your pull request automatically.