[jira] [Commented] (SCB-729) check if instance cache equals to SC

2018-07-19 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on SCB-729:


wujimin closed pull request #809: [SCB-729] Instance cache check
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/809
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/foundations/foundation-test-scaffolding/src/main/java/org/apache/servicecomb/foundation/test/scaffolding/config/ArchaiusUtils.java
 
b/foundations/foundation-test-scaffolding/src/main/java/org/apache/servicecomb/foundation/test/scaffolding/config/ArchaiusUtils.java
index d913dc999..ca91ef617 100644
--- 
a/foundations/foundation-test-scaffolding/src/main/java/org/apache/servicecomb/foundation/test/scaffolding/config/ArchaiusUtils.java
+++ 
b/foundations/foundation-test-scaffolding/src/main/java/org/apache/servicecomb/foundation/test/scaffolding/config/ArchaiusUtils.java
@@ -18,6 +18,8 @@
 package org.apache.servicecomb.foundation.test.scaffolding.config;
 
 import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.concurrent.ConcurrentHashMap;
 
 import org.springframework.util.ReflectionUtils;
 
@@ -40,23 +42,34 @@
   private static final Field FIELD_DYNAMIC_PROPERTY_SUPPORTIMPL =
   ReflectionUtils.findField(DynamicProperty.class, 
"dynamicPropertySupportImpl");
 
+  private static final Field FIELD_DYNAMIC_PROPERTY_ALL_PROPS = ReflectionUtils
+  .findField(DynamicProperty.class, "ALL_PROPS");
+
+  private static Method updatePropertyMethod =
+  ReflectionUtils.findMethod(DynamicProperty.class, "updateProperty", 
String.class, Object.class);
+
   static {
 FIELD_INSTANCE.setAccessible(true);
 FIELD_CUSTOM_CONFIGURATION_INSTALLED.setAccessible(true);
 FIELD_CONFIG.setAccessible(true);
 FIELD_INITIALIZED_WITH_DEFAULT_CONFIG.setAccessible(true);
 FIELD_DYNAMIC_PROPERTY_SUPPORTIMPL.setAccessible(true);
+FIELD_DYNAMIC_PROPERTY_ALL_PROPS.setAccessible(true);
+updatePropertyMethod.setAccessible(true);
   }
 
   private ArchaiusUtils() {
   }
 
+  @SuppressWarnings("unchecked")
   public static void resetConfig() {
 ReflectionUtils.setField(FIELD_INSTANCE, null, null);
 ReflectionUtils.setField(FIELD_CUSTOM_CONFIGURATION_INSTALLED, null, 
false);
 ReflectionUtils.setField(FIELD_CONFIG, null, null);
 ReflectionUtils.setField(FIELD_INITIALIZED_WITH_DEFAULT_CONFIG, null, 
false);
 ReflectionUtils.setField(FIELD_DYNAMIC_PROPERTY_SUPPORTIMPL, null, null);
+((ConcurrentHashMap) 
ReflectionUtils.getField(FIELD_DYNAMIC_PROPERTY_ALL_PROPS, null))
+.clear();
   }
 
   public static void setProperty(String key, Object value) {
@@ -67,4 +80,13 @@ public static void setProperty(String key, Object value) {
 .getBackingConfigurationSource();
 config.getConfiguration(0).addProperty(key, value);
   }
+
+  /**
+   * difference with setProperty is that, updateProperty value can be null
+   * @param key
+   * @param value
+   */
+  public static void updateProperty(String key, Object value) {
+ReflectionUtils.invokeMethod(updatePropertyMethod, null, key, value);
+  }
 }
diff --git 
a/handlers/handler-flowcontrol-qps/src/test/java/org/apache/servicecomb/qps/QpsControllerManagerTest.java
 
b/handlers/handler-flowcontrol-qps/src/test/java/org/apache/servicecomb/qps/QpsControllerManagerTest.java
index 5f7f2821f..44b86b267 100644
--- 
a/handlers/handler-flowcontrol-qps/src/test/java/org/apache/servicecomb/qps/QpsControllerManagerTest.java
+++ 
b/handlers/handler-flowcontrol-qps/src/test/java/org/apache/servicecomb/qps/QpsControllerManagerTest.java
@@ -422,12 +422,12 @@ public static OperationMeta getMockOperationMeta(String 
microserviceName, String
   }
 
   public static void setConfig(String key, int value) {
-Utils.updateProperty(key, value);
+ArchaiusUtils.setProperty(key, value);
   }
 
   public static void setConfigWithDefaultPrefix(String key, int value) {
 String configKey = Config.CONSUMER_LIMIT_KEY_PREFIX + key;
-Utils.updateProperty(configKey, value);
+ArchaiusUtils.setProperty(configKey, value);
   }
 
   public static void clearState(QpsControllerManager qpsControllerManager) {
diff --git 
a/handlers/handler-flowcontrol-qps/src/test/java/org/apache/servicecomb/qps/TestConfig.java
 
b/handlers/handler-flowcontrol-qps/src/test/java/org/apache/servicecomb/qps/TestConfig.java
index 540d3031c..15d1e29b1 100644
--- 
a/handlers/handler-flowcontrol-qps/src/test/java/org/apache/servicecomb/qps/TestConfig.java
+++ 
b/handlers/handler-flowcontrol-qps/src/test/java/org/apache/servicecomb/qps/TestConfig.java
@@ -17,7 +17,10 @@
 
 package 

[jira] [Commented] (SCB-729) check if instance cache equals to SC

2018-07-17 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on SCB-729:


wujimin commented on a change in pull request #809: [SCB-729] Instance cache 
check
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/809#discussion_r202914863
 
 

 ##
 File path: 
service-registry/src/main/java/org/apache/servicecomb/serviceregistry/registry/ServiceRegistryTaskInitializer.java
 ##
 @@ -1,4 +1,4 @@
-/*
+package org.apache.servicecomb.serviceregistry.registry;/*
 
 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


> check if instance cache equals to SC
> 
>
> Key: SCB-729
> URL: https://issues.apache.org/jira/browse/SCB-729
> Project: Apache ServiceComb
>  Issue Type: Task
>  Components: Java-Chassis
>Reporter: wujimin
>Assignee: wujimin
>Priority: Major
>
> 1.support periodic check
> 2.support trigger by configuration update callback
> 3.post check result event



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


[jira] [Commented] (SCB-729) check if instance cache equals to SC

2018-07-16 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on SCB-729:


wujimin commented on a change in pull request #809: [SCB-729] Instance cache 
check
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/809#discussion_r202881859
 
 

 ##
 File path: 
service-registry/src/main/java/org/apache/servicecomb/serviceregistry/registry/ServiceRegistryTaskInitializer.java
 ##
 @@ -1,4 +1,4 @@
-/*
+package org.apache.servicecomb.serviceregistry.registry;/*
 
 Review comment:
   oh, this happened randomly
   do you know why..


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


> check if instance cache equals to SC
> 
>
> Key: SCB-729
> URL: https://issues.apache.org/jira/browse/SCB-729
> Project: Apache ServiceComb
>  Issue Type: Task
>  Components: Java-Chassis
>Reporter: wujimin
>Assignee: wujimin
>Priority: Major
>
> 1.support periodic check
> 2.support trigger by configuration update callback
> 3.post check result event



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


[jira] [Commented] (SCB-729) check if instance cache equals to SC

2018-07-16 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on SCB-729:


WillemJiang commented on a change in pull request #809: [SCB-729] Instance 
cache check
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/809#discussion_r202881660
 
 

 ##
 File path: 
service-registry/src/main/java/org/apache/servicecomb/serviceregistry/registry/ServiceRegistryTaskInitializer.java
 ##
 @@ -1,4 +1,4 @@
-/*
+package org.apache.servicecomb.serviceregistry.registry;/*
 
 Review comment:
   The package should add below the License header.


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


> check if instance cache equals to SC
> 
>
> Key: SCB-729
> URL: https://issues.apache.org/jira/browse/SCB-729
> Project: Apache ServiceComb
>  Issue Type: Task
>  Components: Java-Chassis
>Reporter: wujimin
>Assignee: wujimin
>Priority: Major
>
> 1.support periodic check
> 2.support trigger by configuration update callback
> 3.post check result event



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


[jira] [Commented] (SCB-729) check if instance cache equals to SC

2018-07-16 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on SCB-729:


coveralls commented on issue #809: [SCB-729] Instance cache check
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/809#issuecomment-405262682
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/18003957/badge)](https://coveralls.io/builds/18003957)
   
   Coverage increased (+0.07%) to 87.13% when pulling 
**af4c57e35d3ed43912c3b43a23a3622f8a8c27df on wujimin:instance-cache-check** 
into **6c4c1c1e9adc8e99fcc57cc4165576dc9655c4d9 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


> check if instance cache equals to SC
> 
>
> Key: SCB-729
> URL: https://issues.apache.org/jira/browse/SCB-729
> Project: Apache ServiceComb
>  Issue Type: Task
>  Components: Java-Chassis
>Reporter: wujimin
>Assignee: wujimin
>Priority: Major
>
> 1.support periodic check
> 2.support trigger by configuration update callback
> 3.post check result event



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


[jira] [Commented] (SCB-729) check if instance cache equals to SC

2018-07-16 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on SCB-729:


wujimin opened a new pull request #809: [SCB-729] Instance cache check
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/809
 
 
   1.instance cache check task can be trigger periodically or manually
   2.after check will post "InstanceCacheSummary" event, subscriber should 
subscrbe the event, and run their special logic


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


> check if instance cache equals to SC
> 
>
> Key: SCB-729
> URL: https://issues.apache.org/jira/browse/SCB-729
> Project: Apache ServiceComb
>  Issue Type: Task
>  Components: Java-Chassis
>Reporter: wujimin
>Assignee: wujimin
>Priority: Major
>
> 1.support periodic check
> 2.support trigger by configuration update callback
> 3.post check result event



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