[jira] [Commented] (SCB-589) allow consumer upgrade before producer

2018-05-27 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/SCB-589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16492231#comment-16492231
 ] 

ASF GitHub Bot commented on SCB-589:


wujimin commented on a change in pull request #728:  [SCB-589] Consumer 
producer upgrade unordered
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/728#discussion_r191102803
 
 

 ##
 File path: 
common/common-protobuf/src/main/java/org/apache/servicecomb/codec/protobuf/definition/ProtobufManager.java
 ##
 @@ -37,6 +39,9 @@
 
   private static final Object LOCK = new Object();
 
+  private static ScopedProtobufSchemaManager 
defaultScopedProtobufSchemaManager = new ScopedProtobufSchemaManager(
 
 Review comment:
   this is for app classloader, will never changed.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> allow consumer upgrade before producer
> --
>
> Key: SCB-589
> URL: https://issues.apache.org/jira/browse/SCB-589
> Project: Apache ServiceComb
>  Issue Type: Task
>  Components: Java-Chassis
>Reporter: wujimin
>Assignee: wujimin
>Priority: Major
>
> 1.normal consumer use PrivateMicroserviceClassLoaderFactory, just like edge
> 2.consumer microserviceMeta will not save in microserviceMetaManager any 
> more, just like edge, use appManager; and change consumer default versionRule 
> from latest to all
> 3.allow consumer schema set or method set bigger than contract
> 4.protobuf dynamic class created in microservice classloader
> 5.seems that can delete MicroserviceMetaManager
> 6.edge remains task should be finished: 
> https://issues.apache.org/jira/browse/SCB-279
>  
> jackson hold classes by a LRU map, will not always hold class, so there is no 
> big problems.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SCB-589) allow consumer upgrade before producer

2018-05-27 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/SCB-589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16492230#comment-16492230
 ] 

ASF GitHub Bot commented on SCB-589:


WillemJiang commented on a change in pull request #728:  [SCB-589] Consumer 
producer upgrade unordered
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/728#discussion_r191101947
 
 

 ##
 File path: 
common/common-protobuf/src/main/java/org/apache/servicecomb/codec/protobuf/definition/ProtobufManager.java
 ##
 @@ -37,6 +39,9 @@
 
   private static final Object LOCK = new Object();
 
+  private static ScopedProtobufSchemaManager 
defaultScopedProtobufSchemaManager = new ScopedProtobufSchemaManager(
 
 Review comment:
   It could cause some trouble as the schema manager's class loader cannot be 
changed after the static initial time.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> allow consumer upgrade before producer
> --
>
> Key: SCB-589
> URL: https://issues.apache.org/jira/browse/SCB-589
> Project: Apache ServiceComb
>  Issue Type: Task
>  Components: Java-Chassis
>Reporter: wujimin
>Assignee: wujimin
>Priority: Major
>
> 1.normal consumer use PrivateMicroserviceClassLoaderFactory, just like edge
> 2.consumer microserviceMeta will not save in microserviceMetaManager any 
> more, just like edge, use appManager; and change consumer default versionRule 
> from latest to all
> 3.allow consumer schema set or method set bigger than contract
> 4.protobuf dynamic class created in microservice classloader
> 5.seems that can delete MicroserviceMetaManager
> 6.edge remains task should be finished: 
> https://issues.apache.org/jira/browse/SCB-279
>  
> jackson hold classes by a LRU map, will not always hold class, so there is no 
> big problems.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SCB-589) allow consumer upgrade before producer

2018-05-27 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/SCB-589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16492094#comment-16492094
 ] 

ASF GitHub Bot commented on SCB-589:


coveralls commented on issue #728:  [SCB-589] Consumer producer upgrade 
unordered
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/728#issuecomment-392180292
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/17187707/badge)](https://coveralls.io/builds/17187707)
   
   Coverage decreased (-0.009%) to 87.496% when pulling 
**22dd3c4aef451376374a1786a8d9ade4bbb8ad27 on 
wujimin:consumer-producer-upgrade-unordered** into 
**95c0d81f35983c9ef184fd4be59d78f90f7c1ee6 on apache:master**.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> allow consumer upgrade before producer
> --
>
> Key: SCB-589
> URL: https://issues.apache.org/jira/browse/SCB-589
> Project: Apache ServiceComb
>  Issue Type: Task
>  Components: Java-Chassis
>Reporter: wujimin
>Assignee: wujimin
>Priority: Major
>
> 1.normal consumer use PrivateMicroserviceClassLoaderFactory, just like edge
> 2.consumer microserviceMeta will not save in microserviceMetaManager any 
> more, just like edge, use appManager; and change consumer default versionRule 
> from latest to all
> 3.allow consumer schema set or method set bigger than contract
> 4.protobuf dynamic class created in microservice classloader
> 5.seems that can delete MicroserviceMetaManager
> 6.edge remains task should be finished: 
> https://issues.apache.org/jira/browse/SCB-279
>  
> jackson hold classes by a LRU map, will not always hold class, so there is no 
> big problems.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SCB-589) allow consumer upgrade before producer

2018-05-27 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/SCB-589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16492088#comment-16492088
 ] 

ASF GitHub Bot commented on SCB-589:


wujimin commented on a change in pull request #728:  [SCB-589] Consumer 
producer upgrade unordered
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/728#discussion_r191082099
 
 

 ##
 File path: 
core/src/main/java/org/apache/servicecomb/core/provider/consumer/InvokerUtils.java
 ##
 @@ -35,31 +33,37 @@
   private static final Logger LOGGER = 
LoggerFactory.getLogger(InvokerUtils.class);
 
   public static Object syncInvoke(String microserviceName, String schemaId, 
String operationName, Object[] args) {
-checkEngineStatus();
-ReferenceConfig referenceConfig = 
CseContext.getInstance().getConsumerProviderManager()
-.getReferenceConfig(microserviceName);
+ReferenceConfig referenceConfig = 
SCBEngine.getInstance().getReferenceConfigForInvoke(microserviceName);
 return syncInvoke(generateInvocation(schemaId, operationName, args, 
referenceConfig));
   }
 
   public static Object syncInvoke(String microserviceName, String 
microserviceVersion, String transport,
   String schemaId, String operationName, Object[] args) {
-checkEngineStatus();
-ReferenceConfig referenceConfig = 
CseContext.getInstance().getConsumerProviderManager()
-.createReferenceConfig(microserviceName, microserviceVersion, 
transport);
+ReferenceConfig referenceConfig = SCBEngine.getInstance()
+.createReferenceConfigForInvoke(microserviceName, microserviceVersion, 
transport);
 return syncInvoke(generateInvocation(schemaId, operationName, args, 
referenceConfig));
   }
 
+  /**
+   * it's a internal API, caller make sure already invoked 
SCBEngine.ensureStatusUp
+   * @param invocation
+   * @return
+   * @throws InvocationException
+   */
   public static Object syncInvoke(Invocation invocation) throws 
InvocationException {
-checkEngineStatus();
 Response response = innerSyncInvoke(invocation);
 if (response.isSuccessed()) {
   return response.getResult();
 }
 throw ExceptionFactory.convertConsumerException(response.getResult());
   }
 
+  /**
+   * it's a internal API, caller make sure already invoked 
SCBEngine.ensureStatusUp
+   * @param invocation
+   * @return
 
 Review comment:
   done


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> allow consumer upgrade before producer
> --
>
> Key: SCB-589
> URL: https://issues.apache.org/jira/browse/SCB-589
> Project: Apache ServiceComb
>  Issue Type: Task
>  Components: Java-Chassis
>Reporter: wujimin
>Assignee: wujimin
>Priority: Major
>
> 1.normal consumer use PrivateMicroserviceClassLoaderFactory, just like edge
> 2.consumer microserviceMeta will not save in microserviceMetaManager any 
> more, just like edge, use appManager; and change consumer default versionRule 
> from latest to all
> 3.allow consumer schema set or method set bigger than contract
> 4.protobuf dynamic class created in microservice classloader
> 5.seems that can delete MicroserviceMetaManager
> 6.edge remains task should be finished: 
> https://issues.apache.org/jira/browse/SCB-279
>  
> jackson hold classes by a LRU map, will not always hold class, so there is no 
> big problems.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SCB-589) allow consumer upgrade before producer

2018-05-27 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/SCB-589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16492087#comment-16492087
 ] 

ASF GitHub Bot commented on SCB-589:


wujimin commented on a change in pull request #728:  [SCB-589] Consumer 
producer upgrade unordered
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/728#discussion_r191081945
 
 

 ##
 File path: 
core/src/main/java/org/apache/servicecomb/core/provider/consumer/ConsumerProviderManager.java
 ##
 @@ -54,38 +51,32 @@ public void init() throws Exception {
 }
   }
 
-  public ReferenceConfig createReferenceConfig(String microserviceName, String 
microserviceVersion,
-  String transport) {
-return new ReferenceConfig(consumerSchemaFactory, microserviceName, 
microserviceVersion, transport);
+  public ReferenceConfig createReferenceConfig(String microserviceName, String 
versionRule, String transport) {
+return new ReferenceConfig(appManager, microserviceName, versionRule, 
transport);
   }
 
-  public ReferenceConfig getReferenceConfig(String microserviceName) {
-ReferenceConfig config = referenceConfigMap.get(microserviceName);
-if (config == null) {
-  synchronized (this) {
-config = referenceConfigMap.get(microserviceName);
-if (config == null) {
-  String key = "cse.references." + microserviceName;
-  DynamicStringProperty versionRule = 
DynamicPropertyFactory.getInstance()
-  .getStringProperty(key + ".version-rule",
-  DynamicPropertyFactory.getInstance()
-  .getStringProperty("cse.references.version-rule", 
Const.VERSION_RULE_LATEST)
-  .getValue());
-  DynamicStringProperty transport =
-  DynamicPropertyFactory.getInstance().getStringProperty(key + 
".transport",
-  DynamicPropertyFactory.getInstance()
-  .getStringProperty("cse.references.transport",
-  Const.ANY_TRANSPORT)
-  .getValue());
-
-  config = new ReferenceConfig(consumerSchemaFactory, 
microserviceName, versionRule.getValue(),
-  transport.getValue());
-  referenceConfigMap.put(microserviceName, config);
-}
-  }
-}
+  public ReferenceConfig createReferenceConfig(String microserviceName) {
+String key = "cse.references." + microserviceName;
 
-return config;
+String defaultVersionRule = DynamicPropertyFactory.getInstance()
+.getStringProperty("cse.references.version-rule", 
DefinitionConst.VERSION_RULE_ALL)
+.get();
+String versionRule = DynamicPropertyFactory.getInstance()
+.getStringProperty(key + ".version-rule", defaultVersionRule)
+.get();
+
+String defaultTransport = DynamicPropertyFactory.getInstance()
+.getStringProperty("cse.references.transport", Const.ANY_TRANSPORT)
+.get();
+String transport = DynamicPropertyFactory.getInstance()
+.getStringProperty(key + ".transport", defaultTransport)
+.get();
+
+return new ReferenceConfig(appManager, microserviceName, versionRule, 
transport);
+  }
+
+  public ReferenceConfig getReferenceConfig(String microserviceName) {
+return referenceConfigMap.computeIfAbsent(microserviceName, 
this::createReferenceConfig);
 
 Review comment:
   ConcurrentHashMapEx extends from ConcurrentHashMap
   ConcurrentHashMap.computeIfAbsent even lock when key exists, so there is 
performance problem
   
   ```
 // ConcurrentHashMap.computeIfAbsent always do "synchronized" operation
 // so we wrap it to improve performance
 @Override
 public V computeIfAbsent(K key, Function 
mappingFunction) {
   V value = get(key);
   if (value != null) {
 return value;
   }
   
   return super.computeIfAbsent(key, mappingFunction);
 }
   ```


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> allow consumer upgrade before producer
> --
>
> Key: SCB-589
> URL: https://issues.apache.org/jira/browse/SCB-589
> Project: Apache ServiceComb
>  Issue Type: Task
>  Components: Java-Chassis
>Reporter: wujimin
>Assignee: wujimin
>Priority: Major
>
> 1.normal consumer use PrivateMicroserviceClassLoaderFactory, just like edge
> 2.consumer microserviceMeta will not save in microserviceMetaManager any 
> more, just like edge, use appManager; and change consumer default versionRule 
> from latest to all
> 3.allow consumer schema set or method set bigger than contract
> 

[jira] [Commented] (SCB-589) allow consumer upgrade before producer

2018-05-27 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/SCB-589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16492086#comment-16492086
 ] 

ASF GitHub Bot commented on SCB-589:


wujimin commented on a change in pull request #728:  [SCB-589] Consumer 
producer upgrade unordered
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/728#discussion_r191081888
 
 

 ##
 File path: 
common/common-protobuf/src/main/java/org/apache/servicecomb/codec/protobuf/definition/ProtobufManager.java
 ##
 @@ -45,13 +50,28 @@
   private ProtobufManager() {
   }
 
+  /**
+   * only for app classloader
+   * @return
+   */
+  public static ScopedProtobufSchemaManager 
getDefaultScopedProtobufSchemaManager() {
+return defaultScopedProtobufSchemaManager;
+  }
+
   public static OperationProtobuf getOrCreateOperation(OperationMeta 
operationMeta) throws Exception {
-OperationProtobuf operationProtobuf = 
operationMeta.getExtData(ProtobufManager.EXT_ID);
+OperationProtobuf operationProtobuf = operationMeta.getExtData(EXT_ID);
 
 Review comment:
   extData is a ConcurrentHashMap, no problem.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> allow consumer upgrade before producer
> --
>
> Key: SCB-589
> URL: https://issues.apache.org/jira/browse/SCB-589
> Project: Apache ServiceComb
>  Issue Type: Task
>  Components: Java-Chassis
>Reporter: wujimin
>Assignee: wujimin
>Priority: Major
>
> 1.normal consumer use PrivateMicroserviceClassLoaderFactory, just like edge
> 2.consumer microserviceMeta will not save in microserviceMetaManager any 
> more, just like edge, use appManager; and change consumer default versionRule 
> from latest to all
> 3.allow consumer schema set or method set bigger than contract
> 4.protobuf dynamic class created in microservice classloader
> 5.seems that can delete MicroserviceMetaManager
> 6.edge remains task should be finished: 
> https://issues.apache.org/jira/browse/SCB-279
>  
> jackson hold classes by a LRU map, will not always hold class, so there is no 
> big problems.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SCB-589) allow consumer upgrade before producer

2018-05-26 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/SCB-589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16491592#comment-16491592
 ] 

ASF GitHub Bot commented on SCB-589:


WillemJiang commented on a change in pull request #728:  [SCB-589] Consumer 
producer upgrade unordered
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/728#discussion_r191044580
 
 

 ##
 File path: 
core/src/main/java/org/apache/servicecomb/core/provider/consumer/InvokerUtils.java
 ##
 @@ -35,31 +33,37 @@
   private static final Logger LOGGER = 
LoggerFactory.getLogger(InvokerUtils.class);
 
   public static Object syncInvoke(String microserviceName, String schemaId, 
String operationName, Object[] args) {
-checkEngineStatus();
-ReferenceConfig referenceConfig = 
CseContext.getInstance().getConsumerProviderManager()
-.getReferenceConfig(microserviceName);
+ReferenceConfig referenceConfig = 
SCBEngine.getInstance().getReferenceConfigForInvoke(microserviceName);
 return syncInvoke(generateInvocation(schemaId, operationName, args, 
referenceConfig));
   }
 
   public static Object syncInvoke(String microserviceName, String 
microserviceVersion, String transport,
   String schemaId, String operationName, Object[] args) {
-checkEngineStatus();
-ReferenceConfig referenceConfig = 
CseContext.getInstance().getConsumerProviderManager()
-.createReferenceConfig(microserviceName, microserviceVersion, 
transport);
+ReferenceConfig referenceConfig = SCBEngine.getInstance()
+.createReferenceConfigForInvoke(microserviceName, microserviceVersion, 
transport);
 return syncInvoke(generateInvocation(schemaId, operationName, args, 
referenceConfig));
   }
 
+  /**
+   * it's a internal API, caller make sure already invoked 
SCBEngine.ensureStatusUp
+   * @param invocation
+   * @return
+   * @throws InvocationException
+   */
   public static Object syncInvoke(Invocation invocation) throws 
InvocationException {
-checkEngineStatus();
 Response response = innerSyncInvoke(invocation);
 if (response.isSuccessed()) {
   return response.getResult();
 }
 throw ExceptionFactory.convertConsumerException(response.getResult());
   }
 
+  /**
+   * it's a internal API, caller make sure already invoked 
SCBEngine.ensureStatusUp
+   * @param invocation
+   * @return
 
 Review comment:
   It's better to specify the return response.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> allow consumer upgrade before producer
> --
>
> Key: SCB-589
> URL: https://issues.apache.org/jira/browse/SCB-589
> Project: Apache ServiceComb
>  Issue Type: Task
>  Components: Java-Chassis
>Reporter: wujimin
>Assignee: wujimin
>Priority: Major
>
> 1.normal consumer use PrivateMicroserviceClassLoaderFactory, just like edge
> 2.consumer microserviceMeta will not save in microserviceMetaManager any 
> more, just like edge, use appManager; and change consumer default versionRule 
> from latest to all
> 3.allow consumer schema set or method set bigger than contract
> 4.protobuf dynamic class created in microservice classloader
> 5.seems that can delete MicroserviceMetaManager
> 6.edge remains task should be finished: 
> https://issues.apache.org/jira/browse/SCB-279
>  
> jackson hold classes by a LRU map, will not always hold class, so there is no 
> big problems.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SCB-589) allow consumer upgrade before producer

2018-05-26 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/SCB-589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16491590#comment-16491590
 ] 

ASF GitHub Bot commented on SCB-589:


WillemJiang commented on a change in pull request #728:  [SCB-589] Consumer 
producer upgrade unordered
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/728#discussion_r191044562
 
 

 ##
 File path: 
core/src/main/java/org/apache/servicecomb/core/provider/consumer/ConsumerProviderManager.java
 ##
 @@ -54,38 +51,32 @@ public void init() throws Exception {
 }
   }
 
-  public ReferenceConfig createReferenceConfig(String microserviceName, String 
microserviceVersion,
-  String transport) {
-return new ReferenceConfig(consumerSchemaFactory, microserviceName, 
microserviceVersion, transport);
+  public ReferenceConfig createReferenceConfig(String microserviceName, String 
versionRule, String transport) {
+return new ReferenceConfig(appManager, microserviceName, versionRule, 
transport);
   }
 
-  public ReferenceConfig getReferenceConfig(String microserviceName) {
-ReferenceConfig config = referenceConfigMap.get(microserviceName);
-if (config == null) {
-  synchronized (this) {
-config = referenceConfigMap.get(microserviceName);
-if (config == null) {
-  String key = "cse.references." + microserviceName;
-  DynamicStringProperty versionRule = 
DynamicPropertyFactory.getInstance()
-  .getStringProperty(key + ".version-rule",
-  DynamicPropertyFactory.getInstance()
-  .getStringProperty("cse.references.version-rule", 
Const.VERSION_RULE_LATEST)
-  .getValue());
-  DynamicStringProperty transport =
-  DynamicPropertyFactory.getInstance().getStringProperty(key + 
".transport",
-  DynamicPropertyFactory.getInstance()
-  .getStringProperty("cse.references.transport",
-  Const.ANY_TRANSPORT)
-  .getValue());
-
-  config = new ReferenceConfig(consumerSchemaFactory, 
microserviceName, versionRule.getValue(),
-  transport.getValue());
-  referenceConfigMap.put(microserviceName, config);
-}
-  }
-}
+  public ReferenceConfig createReferenceConfig(String microserviceName) {
+String key = "cse.references." + microserviceName;
 
-return config;
+String defaultVersionRule = DynamicPropertyFactory.getInstance()
+.getStringProperty("cse.references.version-rule", 
DefinitionConst.VERSION_RULE_ALL)
+.get();
+String versionRule = DynamicPropertyFactory.getInstance()
+.getStringProperty(key + ".version-rule", defaultVersionRule)
+.get();
+
+String defaultTransport = DynamicPropertyFactory.getInstance()
+.getStringProperty("cse.references.transport", Const.ANY_TRANSPORT)
+.get();
+String transport = DynamicPropertyFactory.getInstance()
+.getStringProperty(key + ".transport", defaultTransport)
+.get();
+
+return new ReferenceConfig(appManager, microserviceName, versionRule, 
transport);
+  }
+
+  public ReferenceConfig getReferenceConfig(String microserviceName) {
+return referenceConfigMap.computeIfAbsent(microserviceName, 
this::createReferenceConfig);
 
 Review comment:
   Not sure if the ConcurrentHashMapEx.computeIfAbsent is atomic,  but if we 
use the JDK's  one, it's atomic.
   
https://stackoverflow.com/questions/26481796/concurrenthashmap-computeifabsent


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> allow consumer upgrade before producer
> --
>
> Key: SCB-589
> URL: https://issues.apache.org/jira/browse/SCB-589
> Project: Apache ServiceComb
>  Issue Type: Task
>  Components: Java-Chassis
>Reporter: wujimin
>Assignee: wujimin
>Priority: Major
>
> 1.normal consumer use PrivateMicroserviceClassLoaderFactory, just like edge
> 2.consumer microserviceMeta will not save in microserviceMetaManager any 
> more, just like edge, use appManager; and change consumer default versionRule 
> from latest to all
> 3.allow consumer schema set or method set bigger than contract
> 4.protobuf dynamic class created in microservice classloader
> 5.seems that can delete MicroserviceMetaManager
> 6.edge remains task should be finished: 
> https://issues.apache.org/jira/browse/SCB-279
>  
> jackson hold classes by a LRU map, will not always hold class, so there is no 
> big problems.



--
This message was sent 

[jira] [Commented] (SCB-589) allow consumer upgrade before producer

2018-05-26 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/SCB-589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16491588#comment-16491588
 ] 

ASF GitHub Bot commented on SCB-589:


WillemJiang commented on a change in pull request #728:  [SCB-589] Consumer 
producer upgrade unordered
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/728#discussion_r191044374
 
 

 ##
 File path: 
common/common-protobuf/src/main/java/org/apache/servicecomb/codec/protobuf/definition/ProtobufManager.java
 ##
 @@ -45,13 +50,28 @@
   private ProtobufManager() {
   }
 
+  /**
+   * only for app classloader
+   * @return
+   */
+  public static ScopedProtobufSchemaManager 
getDefaultScopedProtobufSchemaManager() {
+return defaultScopedProtobufSchemaManager;
+  }
+
   public static OperationProtobuf getOrCreateOperation(OperationMeta 
operationMeta) throws Exception {
-OperationProtobuf operationProtobuf = 
operationMeta.getExtData(ProtobufManager.EXT_ID);
+OperationProtobuf operationProtobuf = operationMeta.getExtData(EXT_ID);
 
 Review comment:
   if the ExtData is not volatile,  and there are two thread a modify it, you 
may face some issue here.



This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> allow consumer upgrade before producer
> --
>
> Key: SCB-589
> URL: https://issues.apache.org/jira/browse/SCB-589
> Project: Apache ServiceComb
>  Issue Type: Task
>  Components: Java-Chassis
>Reporter: wujimin
>Assignee: wujimin
>Priority: Major
>
> 1.normal consumer use PrivateMicroserviceClassLoaderFactory, just like edge
> 2.consumer microserviceMeta will not save in microserviceMetaManager any 
> more, just like edge, use appManager; and change consumer default versionRule 
> from latest to all
> 3.allow consumer schema set or method set bigger than contract
> 4.protobuf dynamic class created in microservice classloader
> 5.seems that can delete MicroserviceMetaManager
> 6.edge remains task should be finished: 
> https://issues.apache.org/jira/browse/SCB-279
>  
> jackson hold classes by a LRU map, will not always hold class, so there is no 
> big problems.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SCB-589) allow consumer upgrade before producer

2018-05-25 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/SCB-589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16491245#comment-16491245
 ] 

ASF GitHub Bot commented on SCB-589:


coveralls commented on issue #728:  [SCB-589] Consumer producer upgrade 
unordered
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/728#issuecomment-392180292
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/17162375/badge)](https://coveralls.io/builds/17162375)
   
   Coverage increased (+0.03%) to 87.526% when pulling 
**ed0c58c13f596d074a78899b33accdc71d06443f on 
wujimin:consumer-producer-upgrade-unordered** into 
**f1415fe328c321fcd82c81cacb11166571d8a172 on apache:master**.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> allow consumer upgrade before producer
> --
>
> Key: SCB-589
> URL: https://issues.apache.org/jira/browse/SCB-589
> Project: Apache ServiceComb
>  Issue Type: Task
>  Components: Java-Chassis
>Reporter: wujimin
>Assignee: wujimin
>Priority: Major
>
> 1.normal consumer use PrivateMicroserviceClassLoaderFactory, just like edge
> 2.consumer microserviceMeta will not save in microserviceMetaManager any 
> more, just like edge, use appManager; and change consumer default versionRule 
> from latest to all
> 3.allow consumer schema set or method set bigger than contract
> 4.protobuf dynamic class created in microservice classloader
> 5.seems that can delete MicroserviceMetaManager
> 6.edge remains task should be finished: 
> https://issues.apache.org/jira/browse/SCB-279
>  
> jackson hold classes by a LRU map, will not always hold class, so there is no 
> big problems.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SCB-589) allow consumer upgrade before producer

2018-05-24 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/SCB-589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16490144#comment-16490144
 ] 

ASF GitHub Bot commented on SCB-589:


wujimin opened a new pull request #728:  [SCB-589] Consumer producer upgrade 
unordered
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/728
 
 
   1.normal consumer use PrivateMicroserviceClassLoaderFactory, just like edge
   2.consumer microserviceMeta will not save in microserviceMetaManager any 
more, just like edge, use appManager; and change consumer default versionRule 
from latest to all
   3.allow consumer schema set or method set bigger than contract
   4.protobuf dynamic class created in microservice classloader
   
   integration test case:
   1.start old producer
   2.start new consumer, which have new schems or new method belongs to old 
schema
 features about old producer no problem
   3.start new producer
 not restart consumer, features about new producer become no problem
 
   
   All commits are logically related, difficult to split to subtasks
   please review commits one by one.
   
   there is no automatic integration test case, because need a controller to do 
this,  our integration test not support this now.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> allow consumer upgrade before producer
> --
>
> Key: SCB-589
> URL: https://issues.apache.org/jira/browse/SCB-589
> Project: Apache ServiceComb
>  Issue Type: Task
>  Components: Java-Chassis
>Reporter: wujimin
>Assignee: wujimin
>Priority: Major
>
> 1.normal consumer use PrivateMicroserviceClassLoaderFactory, just like edge
> 2.consumer microserviceMeta will not save in microserviceMetaManager any 
> more, just like edge, use appManager; and change consumer default versionRule 
> from latest to all
> 3.allow consumer schema set or method set bigger than contract
> 4.protobuf dynamic class created in microservice classloader
> 5.seems that can delete MicroserviceMetaManager
> 6.edge remains task should be finished: 
> https://issues.apache.org/jira/browse/SCB-279
>  
> jackson hold classes by a LRU map, will not always hold class, so there is no 
> big problems.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)