[GitHub] coveralls commented on issue #272: [SCB-865] Refactoring the Omega Interceptors

2018-08-24 Thread GitBox
coveralls commented on issue #272: [SCB-865] Refactoring the Omega Interceptors
URL: 
https://github.com/apache/incubator-servicecomb-saga/pull/272#issuecomment-415935933
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/18664047/badge)](https://coveralls.io/builds/18664047)
   
   Coverage increased (+0.01%) to 93.642% when pulling 
**d611f6e8ffe5dc8cffc4c5eec3ece9651b588024 on imlijinting:SCB-865** into 
**95be0967a837db70bc623462162c3495b05ae2c2 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


With regards,
Apache Git Services


[GitHub] imlijinting opened a new pull request #272: [SCB-865] Refactoring the Omega Interceptors

2018-08-24 Thread GitBox
imlijinting opened a new pull request #272: [SCB-865] Refactoring the Omega 
Interceptors
URL: https://github.com/apache/incubator-servicecomb-saga/pull/272
 
 
   1.Remove the inheritance hierarchy between SagaStartAnnotationProcessor and 
EventAwareInterceptor.
   2.Remove the NO_OP_INTERCEPTOR from the interface EventAwareInterceptor. 
Turning the NoOp Implementation into a class of static singleton pattern.
   3.Removing parentId when dealing with error.
   


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


With regards,
Apache Git Services


[GitHub] imlijinting commented on issue #271: [SCB-865] Refactoring the Omega Interceptors

2018-08-24 Thread GitBox
imlijinting commented on issue #271: [SCB-865] Refactoring the Omega 
Interceptors
URL: 
https://github.com/apache/incubator-servicecomb-saga/pull/271#issuecomment-415934201
 
 
   Something wrong with the test cases. 
   Close this.


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


With regards,
Apache Git Services


[GitHub] imlijinting closed pull request #271: [SCB-865] Refactoring the Omega Interceptors

2018-08-24 Thread GitBox
imlijinting closed pull request #271: [SCB-865] Refactoring the Omega 
Interceptors
URL: https://github.com/apache/incubator-servicecomb-saga/pull/271
 
 
   

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/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/EventAwareInterceptor.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/EventAwareInterceptor.java
index 285d5498..b54c 100644
--- 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/EventAwareInterceptor.java
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/EventAwareInterceptor.java
@@ -18,23 +18,9 @@
 package org.apache.servicecomb.saga.omega.transaction;
 
 public interface EventAwareInterceptor {
-  EventAwareInterceptor NO_OP_INTERCEPTOR = new EventAwareInterceptor() {
-@Override
-public AlphaResponse preIntercept(String parentTxId, String 
compensationMethod, int timeout, String retriesMethod,
-int retries, Object... message) {
-  return new AlphaResponse(false);
-}
 
-@Override
-public void postIntercept(String parentTxId, String compensationMethod) {
-}
-
-@Override
-public void onError(String parentTxId, String compensationMethod, 
Throwable throwable) {
-}
-  };
-
-  AlphaResponse preIntercept(String parentTxId, String compensationMethod, int 
timeout, String retriesMethod,
+  AlphaResponse preIntercept(String parentTxId, String compensationMethod, int 
timeout,
+  String retriesMethod,
   int retries, Object... message);
 
   void postIntercept(String parentTxId, String compensationMethod);
diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/NoOpEventAwareInterceptor.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/NoOpEventAwareInterceptor.java
new file mode 100644
index ..46d6a30d
--- /dev/null
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/NoOpEventAwareInterceptor.java
@@ -0,0 +1,23 @@
+package org.apache.servicecomb.saga.omega.transaction;
+
+public class NoOpEventAwareInterceptor implements EventAwareInterceptor {
+
+  public static final NoOpEventAwareInterceptor INSTANCE = new 
NoOpEventAwareInterceptor();
+
+  @Override
+  public AlphaResponse preIntercept(String parentTxId, String 
compensationMethod, int timeout,
+  String retriesMethod,
+  int retries, Object... message) {
+return new AlphaResponse(false);
+  }
+
+  @Override
+  public void postIntercept(String parentTxId, String compensationMethod) {
+// NoOp
+  }
+
+  @Override
+  public void onError(String parentTxId, String compensationMethod, Throwable 
throwable) {
+// NoOp
+  }
+}
diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/SagaStartAnnotationProcessor.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/SagaStartAnnotationProcessor.java
index b264096d..b0b2de4b 100644
--- 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/SagaStartAnnotationProcessor.java
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/SagaStartAnnotationProcessor.java
@@ -18,10 +18,9 @@
 package org.apache.servicecomb.saga.omega.transaction;
 
 import javax.transaction.TransactionalException;
-
 import org.apache.servicecomb.saga.omega.context.OmegaContext;
 
-class SagaStartAnnotationProcessor implements EventAwareInterceptor {
+class SagaStartAnnotationProcessor {
 
   private final OmegaContext omegaContext;
   private final MessageSender sender;
@@ -31,27 +30,27 @@
 this.sender = sender;
   }
 
-  @Override
-  public AlphaResponse preIntercept(String parentTxId, String 
compensationMethod, int timeout, String retriesMethod,
-  int retries, Object... message) {
+  AlphaResponse preIntercept(int timeout) {
 try {
-  return sender.send(new SagaStartedEvent(omegaContext.globalTxId(), 
omegaContext.localTxId(), timeout));
+  return sender
+  .send(new SagaStartedEvent(omegaContext.globalTxId(), 
omegaContext.localTxId(), timeout));
 } catch (OmegaException e) {
   throw new TransactionalException(e.getMessage(), e.getCause());
 }
   }
 
-  @Override
-  public void postIntercept(String parentTxId, String compensationMethod) {
-AlphaResponse response = sender.send(new 
SagaEndedEvent(omegaContext.globalTxId(), omegaContext.localTxId()));
+  void postIntercept(String parentTxId) {
+AlphaResponse response = sender
+.send(new SagaEndedEvent(omegaContext.globalTxId(), 

[GitHub] imlijinting opened a new pull request #271: [SCB-865] Refactoring the Omega Interceptors

2018-08-24 Thread GitBox
imlijinting opened a new pull request #271: [SCB-865] Refactoring the Omega 
Interceptors
URL: https://github.com/apache/incubator-servicecomb-saga/pull/271
 
 
   1.Remove the inheritance hierarchy between SagaStartAnnotationProcessor and 
EventAwareInterceptor.
   2.Remove the NO_OP_INTERCEPTOR from the interface EventAwareInterceptor. 
Turning the NoOp Implementation into a class of static singleton pattern.
   


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


With regards,
Apache Git Services


[GitHub] coveralls commented on issue #883: [SBC-870]refactor to using custom RuleExt, not using Robin IRule.

2018-08-24 Thread GitBox
coveralls commented on issue #883: [SBC-870]refactor to using custom RuleExt, 
not using Robin IRule.
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/883#issuecomment-415931423
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/18663835/badge)](https://coveralls.io/builds/18663835)
   
   Coverage decreased (-0.01%) to 86.169% when pulling 
**c1ab6c5be36681b590d6813330fd58d826f95deb on liubao68:empty_param** into 
**ea17cca3e2e35a2f2b779533189f242b0b1f9324 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


With regards,
Apache Git Services


[GitHub] wujimin commented on a change in pull request #883: [SBC-870]refactor to using custom RuleExt, not using Robin IRule.

2018-08-24 Thread GitBox
wujimin commented on a change in pull request #883: [SBC-870]refactor to using 
custom RuleExt, not using Robin IRule.
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/883#discussion_r212787431
 
 

 ##
 File path: 
handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/WeightedResponseTimeRuleExt.java
 ##
 @@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.loadbalance;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.apache.servicecomb.core.Invocation;
+
+/**
+ * Rule based on response time.
+ */
+public class WeightedResponseTimeRuleExt extends RoundRobinRuleExt {
+  // 10ms
+  private static final int MIN_GAP = 10;
+
+  private Random random = new Random();
+
+  @Override
+  public ServiceCombServer choose(List servers, Invocation 
invocation) {
+List stats = new ArrayList<>(servers.size());
+int totalWeights = 0;
+boolean needRandom = false;
+for (ServiceCombServer server : servers) {
+  ServiceCombServerStats serverStats = 
ServiceCombLoadBalancerStats.INSTANCE.getServiceCombServerStats(server);
+  int avgTime = (int) serverStats.getAverageResponseTime();
 
 Review comment:
   avg result better to be double


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


With regards,
Apache Git Services


[GitHub] wujimin commented on a change in pull request #883: [SBC-870]refactor to using custom RuleExt, not using Robin IRule.

2018-08-24 Thread GitBox
wujimin commented on a change in pull request #883: [SBC-870]refactor to using 
custom RuleExt, not using Robin IRule.
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/883#discussion_r212786931
 
 

 ##
 File path: 
handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/WeightedResponseTimeRuleExt.java
 ##
 @@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.loadbalance;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.apache.servicecomb.core.Invocation;
+
+/**
+ * Rule based on response time.
+ */
+public class WeightedResponseTimeRuleExt extends RoundRobinRuleExt {
+  // 10ms
+  private static final int MIN_GAP = 10;
+
+  private Random random = new Random();
+
+  @Override
+  public ServiceCombServer choose(List servers, Invocation 
invocation) {
+List stats = new ArrayList<>(servers.size());
+int totalWeights = 0;
+boolean needRandom = false;
+for (ServiceCombServer server : servers) {
 
 Review comment:
   calc weight for every invocation is not a good idea


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


With regards,
Apache Git Services


[GitHub] liubao68 opened a new pull request #883: [SBC-870]refactor to using custom RuleExt, not using Robin IRule.

2018-08-24 Thread GitBox
liubao68 opened a new pull request #883: [SBC-870]refactor to using custom 
RuleExt, not using Robin IRule.
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/883
 
 
   Follow this checklist to help us incorporate your contribution quickly and 
easily:
   
- [ ] Make sure there is a [JIRA 
issue](https://issues.apache.org/jira/browse/SCB) filed for the change (usually 
before you start working on it).  Trivial changes like typos do not require a 
JIRA issue.  Your pull request should address just this issue, without pulling 
in other changes.
- [ ] Each commit in the pull request should have a meaningful subject line 
and body.
- [ ] Format the pull request title like `[SCB-XXX] Fixes bug in 
ApproximateQuantiles`, where you replace `SCB-XXX` with the appropriate JIRA 
issue.
- [ ] Write a pull request description that is detailed enough to 
understand what the pull request does, how, and why.
- [ ] Run `mvn clean install` to make sure basic checks pass. A more 
thorough check will be performed on your pull request automatically.
- [ ] If this contribution is large, please file an Apache [Individual 
Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   ---
   


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


With regards,
Apache Git Services


[GitHub] liubao68 closed pull request #883: [SBC-870]refactor to using custom RuleExt, not using Robin IRule.

2018-08-24 Thread GitBox
liubao68 closed pull request #883: [SBC-870]refactor to using custom RuleExt, 
not using Robin IRule.
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/883
 
 
   

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/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/codec/RestObjectMapper.java
 
b/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/codec/RestObjectMapper.java
index f94ec2c15..327175b22 100644
--- 
a/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/codec/RestObjectMapper.java
+++ 
b/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/codec/RestObjectMapper.java
@@ -65,6 +65,8 @@ public StringBuffer format(Date date, StringBuffer 
toAppendTo, FieldPosition fie
 disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
 enable(DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS);
 enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
+// If required=true, need to fail, while required=false, default values is 
given.
+enable(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES);
 
 SimpleModule module = new SimpleModule();
 // custom types
diff --git 
a/demo/demo-jaxrs/jaxrs-client/src/main/java/org/apache/servicecomb/demo/jaxrs/client/CodeFirstRestTemplateJaxrs.java
 
b/demo/demo-jaxrs/jaxrs-client/src/main/java/org/apache/servicecomb/demo/jaxrs/client/CodeFirstRestTemplateJaxrs.java
index 38ae6e963..2481e5299 100644
--- 
a/demo/demo-jaxrs/jaxrs-client/src/main/java/org/apache/servicecomb/demo/jaxrs/client/CodeFirstRestTemplateJaxrs.java
+++ 
b/demo/demo-jaxrs/jaxrs-client/src/main/java/org/apache/servicecomb/demo/jaxrs/client/CodeFirstRestTemplateJaxrs.java
@@ -110,7 +110,7 @@ private void testFileAndStringUpload(RestTemplate template, 
String cseUrlPrefix,
   private void test404(RestTemplate template) {
 HttpClientErrorException exception = null;
 try {
-  template.getForEntity("http://127.0.0.1:8080/aPathNotExist;, 
String.class);
+  template.getForEntity("http://127.0.0.1:8086/aPathNotExist;, 
String.class);
 } catch (RestClientException e) {
   if (e instanceof HttpClientErrorException) {
 exception = (HttpClientErrorException) e;
diff --git 
a/demo/demo-jaxrs/jaxrs-client/src/main/java/org/apache/servicecomb/demo/jaxrs/client/CustomLoadbalanceExtensionsFactory.java
 
b/demo/demo-jaxrs/jaxrs-client/src/main/java/org/apache/servicecomb/demo/jaxrs/client/CustomLoadbalanceExtensionsFactory.java
index cb0eef6e1..c015165be 100644
--- 
a/demo/demo-jaxrs/jaxrs-client/src/main/java/org/apache/servicecomb/demo/jaxrs/client/CustomLoadbalanceExtensionsFactory.java
+++ 
b/demo/demo-jaxrs/jaxrs-client/src/main/java/org/apache/servicecomb/demo/jaxrs/client/CustomLoadbalanceExtensionsFactory.java
@@ -18,6 +18,8 @@
 
 import org.apache.servicecomb.loadbalance.Configuration;
 import org.apache.servicecomb.loadbalance.ExtensionsFactory;
+import org.apache.servicecomb.loadbalance.RoundRobinRuleExt;
+import org.apache.servicecomb.loadbalance.RuleExt;
 import org.springframework.stereotype.Component;
 
 import com.netflix.client.DefaultLoadBalancerRetryHandler;
@@ -29,7 +31,7 @@
 @Component
 public class CustomLoadbalanceExtensionsFactory implements ExtensionsFactory {
 
-  class MyCustomRule extends RoundRobinRule {
+  class MyCustomRule extends RoundRobinRuleExt {
 
   }
 
@@ -56,7 +58,7 @@ public boolean isSupport(String key, String value) {
   }
 
   @Override
-  public IRule createLoadBalancerRule(String ruleName) {
+  public RuleExt createLoadBalancerRule(String ruleName) {
 return new MyCustomRule();
   }
 
diff --git a/demo/demo-jaxrs/jaxrs-server/src/main/resources/microservice.yaml 
b/demo/demo-jaxrs/jaxrs-server/src/main/resources/microservice.yaml
index 89f324c36..c4bbcdd5b 100644
--- a/demo/demo-jaxrs/jaxrs-server/src/main/resources/microservice.yaml
+++ b/demo/demo-jaxrs/jaxrs-server/src/main/resources/microservice.yaml
@@ -24,9 +24,9 @@ servicecomb:
 registry:
   address: http://127.0.0.1:30100
   rest:
-address: 0.0.0.0:8080
+address: 0.0.0.0:8086
   highway:
-address: 0.0.0.0:7070
+address: 0.0.0.0:7076
   handler:
 chain:
   Provider:
diff --git 
a/demo/demo-pojo/pojo-client/src/main/java/org/apache/servicecomb/demo/pojo/client/PojoClient.java
 
b/demo/demo-pojo/pojo-client/src/main/java/org/apache/servicecomb/demo/pojo/client/PojoClient.java
index 3b55ebb17..ccb01ca79 100644
--- 
a/demo/demo-pojo/pojo-client/src/main/java/org/apache/servicecomb/demo/pojo/client/PojoClient.java
+++ 
b/demo/demo-pojo/pojo-client/src/main/java/org/apache/servicecomb/demo/pojo/client/PojoClient.java
@@ -111,24 +111,11 @@ public static void run() throws Exception {
   testNull(testFromXml);
   

[GitHub] wujimin commented on a change in pull request #883: [SBC-870]refactor to using custom RuleExt, not using Robin IRule.

2018-08-24 Thread GitBox
wujimin commented on a change in pull request #883: [SBC-870]refactor to using 
custom RuleExt, not using Robin IRule.
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/883#discussion_r212785116
 
 

 ##
 File path: 
handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/RuleNameExtentionsFactory.java
 ##
 @@ -51,13 +47,13 @@ public boolean isSupport(String key, String value) {
   }
 
   @Override
-  public IRule createLoadBalancerRule(String ruleName) {
+  public RuleExt createLoadBalancerRule(String ruleName) {
 if (RULE_RoundRobin.equals(ruleName)) {
 
 Review comment:
   support SPI?
   and use a map to manage them?


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


With regards,
Apache Git Services


[GitHub] wujimin commented on a change in pull request #883: [SBC-870]refactor to using custom RuleExt, not using Robin IRule.

2018-08-24 Thread GitBox
wujimin commented on a change in pull request #883: [SBC-870]refactor to using 
custom RuleExt, not using Robin IRule.
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/883#discussion_r212785082
 
 

 ##
 File path: 
handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/LoadbalanceHandler.java
 ##
 @@ -148,16 +146,13 @@ public LoadbalanceHandler() {
 
   @Override
   public void handle(Invocation invocation, AsyncResponse asyncResp) throws 
Exception {
-String policy = 
Configuration.INSTANCE.getPolicy(invocation.getMicroserviceName());
 String strategy = 
Configuration.INSTANCE.getRuleStrategyName(invocation.getMicroserviceName());
-boolean isRuleNotChanged = isEqual(policy, this.policy) && 
isEqual(strategy, this.strategy);
-if (!isRuleNotChanged) {
+if (!isEqual(strategy, this.strategy)) {
 
 Review comment:
   it's better to check if customers being using old policy configuration, and 
tell them how to switch to new mechanism
   check can be done when init, not when handle
   currently maybe init method not invoked.


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


With regards,
Apache Git Services


[GitHub] wujimin commented on a change in pull request #883: [SBC-870]refactor to using custom RuleExt, not using Robin IRule.

2018-08-24 Thread GitBox
wujimin commented on a change in pull request #883: [SBC-870]refactor to using 
custom RuleExt, not using Robin IRule.
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/883#discussion_r212784912
 
 

 ##
 File path: 
handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/LoadbalanceHandler.java
 ##
 @@ -148,16 +146,13 @@ public LoadbalanceHandler() {
 
   @Override
   public void handle(Invocation invocation, AsyncResponse asyncResp) throws 
Exception {
-String policy = 
Configuration.INSTANCE.getPolicy(invocation.getMicroserviceName());
 String strategy = 
Configuration.INSTANCE.getRuleStrategyName(invocation.getMicroserviceName());
-boolean isRuleNotChanged = isEqual(policy, this.policy) && 
isEqual(strategy, this.strategy);
-if (!isRuleNotChanged) {
+if (!isEqual(strategy, this.strategy)) {
   //配置变化,需要重新生成所有的lb实例
   synchronized (lock) {
 clearLoadBalancer();
   }
 }
-this.policy = policy;
 this.strategy = strategy;
 LoadBalancer loadBalancer = getOrCreateLoadBalancer(invocation);
 
 Review comment:
   better to make loadBalancer statless
   1.invoke discoveryTree before getOrCreateLoadBalancer
   2.getOrCreateLoadBalancer
   3.send or sendWithRetry with server list
 chooseServer with server list
 create RetryLoadBalancer instance with server list


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


With regards,
Apache Git Services


[GitHub] liubao68 commented on a change in pull request #883: [SBC-870]refactor to using custom RuleExt, not using Robin IRule.

2018-08-24 Thread GitBox
liubao68 commented on a change in pull request #883: [SBC-870]refactor to using 
custom RuleExt, not using Robin IRule.
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/883#discussion_r212784474
 
 

 ##
 File path: 
handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/WeightedResponseTimeRuleExt.java
 ##
 @@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.loadbalance;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.apache.servicecomb.core.Invocation;
+
+/**
+ * Rule based on response time.
+ */
+public class WeightedResponseTimeRuleExt extends RoundRobinRuleExt {
+  // 10ms
+  private static final int MIN_GAP = 10;
+
+  private Random random = new Random();
+
+  @Override
+  public ServiceCombServer choose(List servers, Invocation 
invocation) {
+List stats = new ArrayList<>(servers.size());
+int totalWeights = 0;
+boolean needRandom = false;
+for (ServiceCombServer server : servers) {
 
 Review comment:
   权重算法就是这样的。对我们的场景,这个计算量很少,以及过滤掉不可用实例了。 
即使200实例,这个算法复杂度也很低。比原来的Robin的WeightedResonseTimeRule要快,它的计算量更多。而且现在还省去了timer的后台计算。
 现在是简单权重算法,来换取可靠性,不追求权重的精确性。 


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


With regards,
Apache Git Services


[GitHub] liubao68 commented on a change in pull request #883: [SBC-870]refactor to using custom RuleExt, not using Robin IRule.

2018-08-24 Thread GitBox
liubao68 commented on a change in pull request #883: [SBC-870]refactor to using 
custom RuleExt, not using Robin IRule.
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/883#discussion_r212784474
 
 

 ##
 File path: 
handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/WeightedResponseTimeRuleExt.java
 ##
 @@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.loadbalance;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.apache.servicecomb.core.Invocation;
+
+/**
+ * Rule based on response time.
+ */
+public class WeightedResponseTimeRuleExt extends RoundRobinRuleExt {
+  // 10ms
+  private static final int MIN_GAP = 10;
+
+  private Random random = new Random();
+
+  @Override
+  public ServiceCombServer choose(List servers, Invocation 
invocation) {
+List stats = new ArrayList<>(servers.size());
+int totalWeights = 0;
+boolean needRandom = false;
+for (ServiceCombServer server : servers) {
 
 Review comment:
   权重算法就是这样的。对我们的场景,这个计算量很少,以及过滤掉不可用实例了。 即使200实例,这个算法复杂度也很低。


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


With regards,
Apache Git Services


[GitHub] jeho0815 commented on a change in pull request #883: [SBC-870]refactor to using custom RuleExt, not using Robin IRule.

2018-08-24 Thread GitBox
jeho0815 commented on a change in pull request #883: [SBC-870]refactor to using 
custom RuleExt, not using Robin IRule.
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/883#discussion_r212784348
 
 

 ##
 File path: 
handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/WeightedResponseTimeRuleExt.java
 ##
 @@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.loadbalance;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.apache.servicecomb.core.Invocation;
+
+/**
+ * Rule based on response time.
+ */
+public class WeightedResponseTimeRuleExt extends RoundRobinRuleExt {
+  // 10ms
+  private static final int MIN_GAP = 10;
+
+  private Random random = new Random();
+
+  @Override
+  public ServiceCombServer choose(List servers, Invocation 
invocation) {
+List stats = new ArrayList<>(servers.size());
+int totalWeights = 0;
+boolean needRandom = false;
+for (ServiceCombServer server : servers) {
 
 Review comment:
   每次都进行重新计算,如果server很多的时候,会影响性能吧


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


With regards,
Apache Git Services


[incubator-servicecomb-saga] 03/03: SCB-867 Add test for SQL Jackson format

2018-08-24 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git

commit 95be0967a837db70bc623462162c3495b05ae2c2
Author: KomachiSion <263976...@qq.com>
AuthorDate: Fri Aug 24 11:20:48 2018 +0800

SCB-867 Add test for SQL Jackson format
---
 .../format/JacksonFromJsonFormatForSQLTest.java| 212 +
 .../saga/format/JsonSQLSagaRequestTest.java|  72 +++
 2 files changed, 284 insertions(+)

diff --git 
a/saga-format/src/test/java/org/apache/servicecomb/saga/format/JacksonFromJsonFormatForSQLTest.java
 
b/saga-format/src/test/java/org/apache/servicecomb/saga/format/JacksonFromJsonFormatForSQLTest.java
new file mode 100644
index 000..ef40d17
--- /dev/null
+++ 
b/saga-format/src/test/java/org/apache/servicecomb/saga/format/JacksonFromJsonFormatForSQLTest.java
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.saga.format;
+
+import static com.seanyinx.github.unit.scaffolding.Randomness.uniquify;
+import static org.hamcrest.Matchers.contains;
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertThat;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.apache.servicecomb.saga.core.Operation;
+import org.apache.servicecomb.saga.core.SagaDefinition;
+import org.apache.servicecomb.saga.core.SagaException;
+import org.apache.servicecomb.saga.core.SagaRequest;
+import org.apache.servicecomb.saga.core.SagaResponse;
+import org.apache.servicecomb.saga.core.SuccessfulSagaResponse;
+import org.apache.servicecomb.saga.core.application.interpreter.FromJsonFormat;
+import org.apache.servicecomb.saga.transports.SQLTransport;
+import org.apache.servicecomb.saga.transports.TransportFactory;
+import org.junit.Test;
+
+import com.seanyinx.github.unit.scaffolding.AssertUtils;
+
+public class JacksonFromJsonFormatForSQLTest {
+  private static final String requestJson = "{\n"
+  + "\"requests\":[\n"
+  + "{\n"
+  + "\"id\":\"first-sql-sharding-1\",\n"
+  + "\"type\":\"sql\",\n"
+  + "\"datasource\":\"ds_0\",\n"
+  + "\"parents\":[],\n"
+  + "\"transaction\":{\n"
+  + "\"sql\":\"INSERT INTO TABLE ds_0.tb_0 (id, value) 
values (?, ?)\",\n"
+  + "\"params\":[\"1\", \"xxx\"]\n"
+  + "},\n"
+  + "\"compensation\":{\n"
+  + "\"sql\":\"DELETE FROM ds_0.tb_0 WHERE id=?\",\n"
+  + "\"params\":[\"1\"]\n"
+  + "}\n"
+  + "},\n"
+  + "{\n"
+  + "\"id\":\"first-sql-sharding-2\",\n"
+  + "\"type\":\"sql\",\n"
+  + "\"datasource\":\"ds_0\",\n"
+  + "\"parents\":[],\n"
+  + "\"transaction\":{\n"
+  + "\"sql\":\"INSERT INTO TABLE ds_0.tb_1 (id, value) 
values (?, ?)\",\n"
+  + "\"params\":[\"2\", \"xxx\"]\n"
+  + "},\n"
+  + "\"compensation\":{\n"
+  + "\"sql\":\"DELETE FROM ds_0.tb_1 WHERE id=?\",\n"
+  + "\"params\":[\"2\"]\n"
+  + "}\n"
+  + "},\n"
+  + "{\n"
+  + "\"id\":\"second-sql-sharding-1\",\n"
+  + "\"type\":\"sql\",\n"
+  + "\"datasource\":\"ds_1\",\n"
+  + "
\"parents\":[\"first-sql-sharding-1\",\"first-sql-sharding-2\"],\n"
+  + "\"transaction\":{\n"
+  + "\"sql\":\"INSERT INTO TABLE ds_1.tb_2 (id, value) 
values (?, ?)\",\n"
+  + "\"params\":[\"3\", \"xxx\"]\n"
+  + "},\n"
+  + "\"compensation\":{\n"
+  + "\"sql\":\"DELETE FROM ds_1.tb_2 WHERE id=?\",\n"
+  + "\"params\":[\"3\"]\n"
+  + "}\n"
+  + "},\n"
+  + "

[incubator-servicecomb-saga] 02/03: SCB-867 Add SQL type Jackson format

2018-08-24 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git

commit e38d1b769c6c40713a558f969a70ce4e01385839
Author: KomachiSion <263976...@qq.com>
AuthorDate: Fri Aug 24 11:20:05 2018 +0800

SCB-867 Add SQL type Jackson format
---
 ...agaRequest.java => JacksonSQLCompensation.java} | 48 ---
 ...onSagaRequest.java => JacksonSQLOperation.java} | 43 --
 ...SagaRequest.java => JacksonSQLTransaction.java} | 29 -
 .../saga/format/JsonSQLSagaRequest.java| 69 ++
 .../servicecomb/saga/format/JsonSagaRequest.java   |  3 +-
 5 files changed, 137 insertions(+), 55 deletions(-)

diff --git 
a/saga-format/src/main/java/org/apache/servicecomb/saga/format/JsonSagaRequest.java
 
b/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonSQLCompensation.java
similarity index 53%
copy from 
saga-format/src/main/java/org/apache/servicecomb/saga/format/JsonSagaRequest.java
copy to 
saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonSQLCompensation.java
index a25542f..6a61bf3 100644
--- 
a/saga-format/src/main/java/org/apache/servicecomb/saga/format/JsonSagaRequest.java
+++ 
b/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonSQLCompensation.java
@@ -17,24 +17,32 @@
 
 package org.apache.servicecomb.saga.format;
 
-import org.apache.servicecomb.saga.core.Operation;
-import org.apache.servicecomb.saga.core.SagaRequest;
-import org.apache.servicecomb.saga.core.Transport;
-import org.apache.servicecomb.saga.transports.TransportFactory;
-
-import com.fasterxml.jackson.annotation.JsonSubTypes;
-import com.fasterxml.jackson.annotation.JsonSubTypes.Type;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-
-@JsonTypeInfo(
-use = JsonTypeInfo.Id.NAME,
-include = JsonTypeInfo.As.PROPERTY,
-visible = true,
-property = "type")
-@JsonSubTypes({
-@Type(value = JsonRestSagaRequest.class, name = Operation.TYPE_REST)
-})
-public interface JsonSagaRequest extends SagaRequest {
-
-  JsonSagaRequest with(TransportFactory transportFactory);
+import java.util.List;
+
+import org.apache.servicecomb.saga.core.Compensation;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class JacksonSQLCompensation extends JacksonSQLOperation implements 
Compensation {
+
+  private final int retries;
+
+  public JacksonSQLCompensation(String sql, List params) {
+this(sql, params, DEFAULT_RETRIES);
+  }
+
+  @JsonCreator
+  public JacksonSQLCompensation(
+  @JsonProperty("sql") String sql,
+  @JsonProperty("params") List params,
+  @JsonProperty("retries") int retries) {
+super(sql, params);
+this.retries = retries <= 0? DEFAULT_RETRIES : retries;
+  }
+
+  @Override
+  public int retries() {
+return this.retries;
+  }
 }
diff --git 
a/saga-format/src/main/java/org/apache/servicecomb/saga/format/JsonSagaRequest.java
 
b/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonSQLOperation.java
similarity index 56%
copy from 
saga-format/src/main/java/org/apache/servicecomb/saga/format/JsonSagaRequest.java
copy to 
saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonSQLOperation.java
index a25542f..500bdfd 100644
--- 
a/saga-format/src/main/java/org/apache/servicecomb/saga/format/JsonSagaRequest.java
+++ 
b/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonSQLOperation.java
@@ -17,24 +17,33 @@
 
 package org.apache.servicecomb.saga.format;
 
+import java.util.List;
+
 import org.apache.servicecomb.saga.core.Operation;
-import org.apache.servicecomb.saga.core.SagaRequest;
-import org.apache.servicecomb.saga.core.Transport;
+import org.apache.servicecomb.saga.core.SQLOperation;
+import org.apache.servicecomb.saga.core.SagaResponse;
+import org.apache.servicecomb.saga.transports.SQLTransport;
 import org.apache.servicecomb.saga.transports.TransportFactory;
 
-import com.fasterxml.jackson.annotation.JsonSubTypes;
-import com.fasterxml.jackson.annotation.JsonSubTypes.Type;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-
-@JsonTypeInfo(
-use = JsonTypeInfo.Id.NAME,
-include = JsonTypeInfo.As.PROPERTY,
-visible = true,
-property = "type")
-@JsonSubTypes({
-@Type(value = JsonRestSagaRequest.class, name = Operation.TYPE_REST)
-})
-public interface JsonSagaRequest extends SagaRequest {
-
-  JsonSagaRequest with(TransportFactory transportFactory);
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+public class JacksonSQLOperation extends SQLOperation implements 
TransportAware {
+
+  @JsonIgnore
+  private SQLTransport transport;
+
+  public JacksonSQLOperation(String sql, List params) {
+super(sql, params);
+  }
+
+  @Override
+  public Operation with(TransportFactory transport) {
+this.transport = transport.getTransport();
+  

[GitHub] WillemJiang closed pull request #269: [SCB-864] Add SQLTransport and JacksonSQLFormat

2018-08-24 Thread GitBox
WillemJiang closed pull request #269: [SCB-864] Add SQLTransport and 
JacksonSQLFormat
URL: https://github.com/apache/incubator-servicecomb-saga/pull/269
 
 
   

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/saga-core/src/main/java/org/apache/servicecomb/saga/core/Operation.java 
b/saga-core/src/main/java/org/apache/servicecomb/saga/core/Operation.java
index 99e760ba..59508656 100644
--- a/saga-core/src/main/java/org/apache/servicecomb/saga/core/Operation.java
+++ b/saga-core/src/main/java/org/apache/servicecomb/saga/core/Operation.java
@@ -21,6 +21,7 @@
 
   String TYPE_NOP = "NOP";
   String TYPE_REST = "rest";
+  String TYPE_SQL = "sql";
   SagaResponse SUCCESSFUL_SAGA_RESPONSE = new 
SuccessfulSagaResponse("success");
 
   SagaResponse send(String address);
diff --git 
a/saga-core/src/main/java/org/apache/servicecomb/saga/core/SQLOperation.java 
b/saga-core/src/main/java/org/apache/servicecomb/saga/core/SQLOperation.java
new file mode 100644
index ..6444e2b7
--- /dev/null
+++ b/saga-core/src/main/java/org/apache/servicecomb/saga/core/SQLOperation.java
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.saga.core;
+
+import java.util.Collections;
+import java.util.List;
+
+public class SQLOperation implements Operation {
+
+  private final String sql;
+  private final List params;
+
+  public SQLOperation(String sql, List params) {
+this.sql = sql;
+this.params = params == null ? Collections.emptyList() : params;
+  }
+
+  public String sql() {
+return sql;
+  }
+
+  public List params() {
+return params;
+  }
+
+  @Override
+  public String toString() {
+return "SQLOperation{" +
+"sql='" + sql + '\'' +
+", params=" + params +
+'}';
+  }
+
+  @Override
+  public SagaResponse send(String datasource) {
+return SUCCESSFUL_SAGA_RESPONSE;
+  }
+
+  @Override
+  public SagaResponse send(String datasource, SagaResponse response) {
+return send(datasource);
+  }
+}
diff --git 
a/saga-core/src/main/java/org/apache/servicecomb/saga/transports/SQLTransport.java
 
b/saga-core/src/main/java/org/apache/servicecomb/saga/transports/SQLTransport.java
new file mode 100644
index ..6e534dd4
--- /dev/null
+++ 
b/saga-core/src/main/java/org/apache/servicecomb/saga/transports/SQLTransport.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.saga.transports;
+
+import java.util.List;
+
+import org.apache.servicecomb.saga.core.SagaResponse;
+import org.apache.servicecomb.saga.core.Transport;
+
+public interface SQLTransport extends Transport {
+
+  SagaResponse with(String datasource, String sql, List params);
+
+}
diff --git 
a/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonSQLCompensation.java
 
b/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonSQLCompensation.java
new file mode 100644
index ..6a61bf32
--- /dev/null
+++ 
b/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonSQLCompensation.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed 

[incubator-servicecomb-saga] 01/03: SCB-866 extend SQLTransport type

2018-08-24 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git

commit 22082fece5243be6b65499552089913cff2d9bb0
Author: KomachiSion <263976...@qq.com>
AuthorDate: Fri Aug 24 11:19:17 2018 +0800

SCB-866 extend SQLTransport type
---
 .../apache/servicecomb/saga/core/Operation.java|  1 +
 .../core/{Operation.java => SQLOperation.java} | 41 ++
 .../SQLTransport.java} | 14 
 3 files changed, 43 insertions(+), 13 deletions(-)

diff --git 
a/saga-core/src/main/java/org/apache/servicecomb/saga/core/Operation.java 
b/saga-core/src/main/java/org/apache/servicecomb/saga/core/Operation.java
index 99e760b..5950865 100644
--- a/saga-core/src/main/java/org/apache/servicecomb/saga/core/Operation.java
+++ b/saga-core/src/main/java/org/apache/servicecomb/saga/core/Operation.java
@@ -21,6 +21,7 @@ public interface Operation {
 
   String TYPE_NOP = "NOP";
   String TYPE_REST = "rest";
+  String TYPE_SQL = "sql";
   SagaResponse SUCCESSFUL_SAGA_RESPONSE = new 
SuccessfulSagaResponse("success");
 
   SagaResponse send(String address);
diff --git 
a/saga-core/src/main/java/org/apache/servicecomb/saga/core/Operation.java 
b/saga-core/src/main/java/org/apache/servicecomb/saga/core/SQLOperation.java
similarity index 51%
copy from 
saga-core/src/main/java/org/apache/servicecomb/saga/core/Operation.java
copy to 
saga-core/src/main/java/org/apache/servicecomb/saga/core/SQLOperation.java
index 99e760b..6444e2b 100644
--- a/saga-core/src/main/java/org/apache/servicecomb/saga/core/Operation.java
+++ b/saga-core/src/main/java/org/apache/servicecomb/saga/core/SQLOperation.java
@@ -17,13 +17,42 @@
 
 package org.apache.servicecomb.saga.core;
 
-public interface Operation {
+import java.util.Collections;
+import java.util.List;
 
-  String TYPE_NOP = "NOP";
-  String TYPE_REST = "rest";
-  SagaResponse SUCCESSFUL_SAGA_RESPONSE = new 
SuccessfulSagaResponse("success");
+public class SQLOperation implements Operation {
 
-  SagaResponse send(String address);
+  private final String sql;
+  private final List params;
 
-  SagaResponse send(String address, SagaResponse response);
+  public SQLOperation(String sql, List params) {
+this.sql = sql;
+this.params = params == null ? Collections.emptyList() : params;
+  }
+
+  public String sql() {
+return sql;
+  }
+
+  public List params() {
+return params;
+  }
+
+  @Override
+  public String toString() {
+return "SQLOperation{" +
+"sql='" + sql + '\'' +
+", params=" + params +
+'}';
+  }
+
+  @Override
+  public SagaResponse send(String datasource) {
+return SUCCESSFUL_SAGA_RESPONSE;
+  }
+
+  @Override
+  public SagaResponse send(String datasource, SagaResponse response) {
+return send(datasource);
+  }
 }
diff --git 
a/saga-core/src/main/java/org/apache/servicecomb/saga/core/Operation.java 
b/saga-core/src/main/java/org/apache/servicecomb/saga/transports/SQLTransport.java
similarity index 72%
copy from 
saga-core/src/main/java/org/apache/servicecomb/saga/core/Operation.java
copy to 
saga-core/src/main/java/org/apache/servicecomb/saga/transports/SQLTransport.java
index 99e760b..6e534dd 100644
--- a/saga-core/src/main/java/org/apache/servicecomb/saga/core/Operation.java
+++ 
b/saga-core/src/main/java/org/apache/servicecomb/saga/transports/SQLTransport.java
@@ -15,15 +15,15 @@
  * limitations under the License.
  */
 
-package org.apache.servicecomb.saga.core;
+package org.apache.servicecomb.saga.transports;
 
-public interface Operation {
+import java.util.List;
 
-  String TYPE_NOP = "NOP";
-  String TYPE_REST = "rest";
-  SagaResponse SUCCESSFUL_SAGA_RESPONSE = new 
SuccessfulSagaResponse("success");
+import org.apache.servicecomb.saga.core.SagaResponse;
+import org.apache.servicecomb.saga.core.Transport;
 
-  SagaResponse send(String address);
+public interface SQLTransport extends Transport {
+
+  SagaResponse with(String datasource, String sql, List params);
 
-  SagaResponse send(String address, SagaResponse response);
 }



[incubator-servicecomb-saga] branch master updated (6dee598 -> 95be096)

2018-08-24 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a change to branch master
in repository 
https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git.


from 6dee598  SCB-817 Added the unit tests of TCC related Aspect
 new 22082fe  SCB-866 extend SQLTransport type
 new e38d1b7  SCB-867 Add SQL type Jackson format
 new 95be096  SCB-867 Add test for SQL Jackson format

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../apache/servicecomb/saga/core/Operation.java|   1 +
 ...ccessfulSagaResponse.java => SQLOperation.java} |  39 ++--
 .../{RestTransport.java => SQLTransport.java}  |   8 +-
 ...mpensation.java => JacksonSQLCompensation.java} |  28 ++-
 ...onSagaRequest.java => JacksonSQLOperation.java} |  43 +++--
 ...Transaction.java => JacksonSQLTransaction.java} |  17 +-
 ...estSagaRequest.java => JsonSQLSagaRequest.java} |  28 ++-
 .../servicecomb/saga/format/JsonSagaRequest.java   |   3 +-
 .../format/JacksonFromJsonFormatForSQLTest.java| 212 +
 ...equestTest.java => JsonSQLSagaRequestTest.java} |  43 +
 10 files changed, 312 insertions(+), 110 deletions(-)
 copy 
saga-core/src/main/java/org/apache/servicecomb/saga/core/{SuccessfulSagaResponse.java
 => SQLOperation.java} (57%)
 copy 
saga-core/src/main/java/org/apache/servicecomb/saga/transports/{RestTransport.java
 => SQLTransport.java} (84%)
 copy 
saga-format/src/main/java/org/apache/servicecomb/saga/format/{JacksonRestCompensation.java
 => JacksonSQLCompensation.java} (67%)
 copy 
saga-format/src/main/java/org/apache/servicecomb/saga/format/{JsonSagaRequest.java
 => JacksonSQLOperation.java} (56%)
 copy 
saga-format/src/main/java/org/apache/servicecomb/saga/format/{JacksonRestTransaction.java
 => JacksonSQLTransaction.java} (75%)
 copy 
saga-format/src/main/java/org/apache/servicecomb/saga/format/{JsonRestSagaRequest.java
 => JsonSQLSagaRequest.java} (73%)
 create mode 100644 
saga-format/src/test/java/org/apache/servicecomb/saga/format/JacksonFromJsonFormatForSQLTest.java
 copy 
saga-format/src/test/java/org/apache/servicecomb/saga/format/{JsonRestSagaRequestTest.java
 => JsonSQLSagaRequestTest.java} (59%)



[GitHub] WillemJiang commented on a change in pull request #268: SCB-865 Implement reaction of the event in Alpha Server

2018-08-24 Thread GitBox
WillemJiang commented on a change in pull request #268: SCB-865 Implement 
reaction of the event in Alpha Server
URL: 
https://github.com/apache/incubator-servicecomb-saga/pull/268#discussion_r212771150
 
 

 ##
 File path: 
alpha/alpha-server/src/main/java/org/apache/servicecomb/saga/alpha/server/tcc/TransactionEventRegistry.java
 ##
 @@ -28,7 +28,7 @@
  */
 public final class TransactionEventRegistry {
 
-  private final static Map> REGISTRY = new 
ConcurrentHashMap<>();
+  private final static Map> REGISTRY = new 
ConcurrentHashMap<>();
 
 Review comment:
   Same 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


With regards,
Apache Git Services


[GitHub] WillemJiang commented on a change in pull request #268: SCB-865 Implement reaction of the event in Alpha Server

2018-08-24 Thread GitBox
WillemJiang commented on a change in pull request #268: SCB-865 Implement 
reaction of the event in Alpha Server
URL: 
https://github.com/apache/incubator-servicecomb-saga/pull/268#discussion_r212771101
 
 

 ##
 File path: 
alpha/alpha-server/src/main/java/org/apache/servicecomb/saga/alpha/server/tcc/OmegaCallbacksRegistry.java
 ##
 @@ -50,9 +55,18 @@ public static void register(GrpcServiceConfig request, 
StreamObserver

[GitHub] WillemJiang commented on a change in pull request #268: SCB-865 Implement reaction of the event in Alpha Server

2018-08-24 Thread GitBox
WillemJiang commented on a change in pull request #268: SCB-865 Implement 
reaction of the event in Alpha Server
URL: 
https://github.com/apache/incubator-servicecomb-saga/pull/268#discussion_r212770993
 
 

 ##
 File path: 
alpha/alpha-server/src/main/java/org/apache/servicecomb/saga/alpha/server/tcc/OmegaCallbacksRegistry.java
 ##
 @@ -32,6 +33,10 @@
 
   private final static Map> REGISTRY = new 
ConcurrentHashMap<>();
 
 Review comment:
   Please don't use the static Map as the registry, it could introduce lots of 
trouble 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


With regards,
Apache Git Services


[GitHub] WillemJiang commented on a change in pull request #268: SCB-865 Implement reaction of the event in Alpha Server

2018-08-24 Thread GitBox
WillemJiang commented on a change in pull request #268: SCB-865 Implement 
reaction of the event in Alpha Server
URL: 
https://github.com/apache/incubator-servicecomb-saga/pull/268#discussion_r212770866
 
 

 ##
 File path: 
alpha/alpha-server/src/main/java/org/apache/servicecomb/saga/alpha/server/tcc/OmegaCallback.java
 ##
 @@ -18,11 +18,10 @@
 package org.apache.servicecomb.saga.alpha.server.tcc;
 
 import org.apache.servicecomb.saga.alpha.server.tcc.event.ParticipatedEvent;
-import org.apache.servicecomb.saga.common.TransactionStatus;
 
 public interface OmegaCallback {
 
-  void compensate(ParticipatedEvent event, TransactionStatus status);
+  void invoke(ParticipatedEvent event, String status);
 
 Review comment:
   Why did you change the status to String?


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


With regards,
Apache Git Services


[GitHub] WillemJiang commented on a change in pull request #270: [SCB-868] Add Kamon metrics to Alpha Server

2018-08-24 Thread GitBox
WillemJiang commented on a change in pull request #270: [SCB-868] Add Kamon 
metrics to Alpha Server
URL: 
https://github.com/apache/incubator-servicecomb-saga/pull/270#discussion_r212769292
 
 

 ##
 File path: alpha/pom.xml
 ##
 @@ -35,6 +35,27 @@
 alpha-server
   
 
+  
+
+  io.kamon
+  kamon-core_2.12
+
+
+  io.kamon
+  kamon-annotation_2.12
+
+
+  org.apache.servicecomb.saga
 
 Review comment:
   alpha doesn't use saga-core , we should not add this dependency.


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


With regards,
Apache Git Services


[GitHub] liubao68 commented on issue #883: [SBC-870]refactor to using custom RuleExt, not using Robin IRule.

2018-08-24 Thread GitBox
liubao68 commented on issue #883: [SBC-870]refactor to using custom RuleExt, 
not using Robin IRule.
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/883#issuecomment-415769859
 
 
   1. refactor to RuleExt
   2. fix a bug required=true that int will have default value
   3. This commit is a initial commit, I am going to add more tests 


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


With regards,
Apache Git Services


[GitHub] liubao68 opened a new pull request #883: [SBC-870]refractor to using custom RuleExt, not using Robin IRule.

2018-08-24 Thread GitBox
liubao68 opened a new pull request #883: [SBC-870]refractor to using custom 
RuleExt, not using Robin IRule.
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/883
 
 
   Follow this checklist to help us incorporate your contribution quickly and 
easily:
   
- [ ] Make sure there is a [JIRA 
issue](https://issues.apache.org/jira/browse/SCB) filed for the change (usually 
before you start working on it).  Trivial changes like typos do not require a 
JIRA issue.  Your pull request should address just this issue, without pulling 
in other changes.
- [ ] Each commit in the pull request should have a meaningful subject line 
and body.
- [ ] Format the pull request title like `[SCB-XXX] Fixes bug in 
ApproximateQuantiles`, where you replace `SCB-XXX` with the appropriate JIRA 
issue.
- [ ] Write a pull request description that is detailed enough to 
understand what the pull request does, how, and why.
- [ ] Run `mvn clean install` to make sure basic checks pass. A more 
thorough check will be performed on your pull request automatically.
- [ ] If this contribution is large, please file an Apache [Individual 
Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   ---
   


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


With regards,
Apache Git Services


[GitHub] coveralls commented on issue #270: [SCB-868] Add Kamon metrics to Alpha Server

2018-08-24 Thread GitBox
coveralls commented on issue #270: [SCB-868] Add Kamon metrics to Alpha Server
URL: 
https://github.com/apache/incubator-servicecomb-saga/pull/270#issuecomment-415749887
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/18651955/badge)](https://coveralls.io/builds/18651955)
   
   Coverage decreased (-0.3%) to 93.596% when pulling 
**29054cc4b475dc8cb2f1e2563aeb30193c1ea246 on maheshrajus:master** into 
**6dee5988235181f3b0c90c99b0dc1a73d6b612f7 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


With regards,
Apache Git Services


[GitHub] maheshrajus opened a new pull request #270: [SCB-868] Add Kamon metrics to Alpha Server

2018-08-24 Thread GitBox
maheshrajus opened a new pull request #270: [SCB-868] Add Kamon metrics to 
Alpha Server
URL: https://github.com/apache/incubator-servicecomb-saga/pull/270
 
 
   Follow this checklist to help us incorporate your contribution quickly and 
easily:
   
- [x] Make sure there is a [JIRA 
issue](https://issues.apache.org/jira/browse/SCB) filed for the change (usually 
before you start working on it).  Trivial changes like typos do not require a 
JIRA issue.  Your pull request should address just this issue, without pulling 
in other changes.
- [x] Each commit in the pull request should have a meaningful subject line 
and body.
- [x] Format the pull request title like `[SCB-XXX] Fixes bug in 
ApproximateQuantiles`, where you replace `SCB-XXX` with the appropriate JIRA 
issue.
- [x] Write a pull request description that is detailed enough to 
understand what the pull request does, how, and why.
- [x] Run `mvn clean install` to make sure basic checks pass. A more 
thorough check will be performed on your pull request automatically.
- [x] If this contribution is large, please file an Apache [Individual 
Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   ---
   


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


With regards,
Apache Git Services


[GitHub] coveralls edited a comment on issue #268: SCB-865 Implement reaction of the event in Alpha Server

2018-08-24 Thread GitBox
coveralls edited a comment on issue #268: SCB-865 Implement reaction of the 
event in Alpha Server
URL: 
https://github.com/apache/incubator-servicecomb-saga/pull/268#issuecomment-415440047
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/18649956/badge)](https://coveralls.io/builds/18649956)
   
   Coverage increased (+0.004%) to 93.896% when pulling 
**c5f3b7bdbe5f811c02fe1ae0ba1b4d067c56492f on cherrylzhao:master** into 
**6dee5988235181f3b0c90c99b0dc1a73d6b612f7 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


With regards,
Apache Git Services


[GitHub] imlidian opened a new pull request #48: Introduction dir translation

2018-08-24 Thread GitBox
imlidian opened a new pull request #48: Introduction dir translation
URL: https://github.com/apache/incubator-servicecomb-docs/pull/48
 
 
   


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


With regards,
Apache Git Services


[GitHub] zhengyangyong commented on a change in pull request #47: General development dir translation and include img

2018-08-24 Thread GitBox
zhengyangyong commented on a change in pull request #47: General development 
dir translation and include img
URL: 
https://github.com/apache/incubator-servicecomb-docs/pull/47#discussion_r212552839
 
 

 ##
 File path: java-chassis-reference/en_US/general-development/reactive.md
 ##
 @@ -94,45 +94,45 @@ public CompletableFuture hello(@PathVariable(name 
= "name") String name)
 }
 ```
 
-与此对应的处理流程如下:
+The corresponding processing flow is as follows:
 
 ![](/assets/reactive/pureReactive.png)
 
-* 与传统流程不同的是,所有功能都在eventloop中执行,并不会进行线程切换
+* Unlike traditional processes, all functions are executed in the eventloop 
and no thread switching is performed.
 
-* 橙色箭头走完后,对本线程的占用即完成了,不会阻塞等待应答,该线程可以处理其他任务
+* After the orange arrow is finished, the occupation of this thread is 
completed, and it will not block waiting for response. The thread can handle 
other tasks.
 
-* 当收到远端应答后,由网络数据驱动开始走红色箭头的应答流程
+* After receiving the remote response, the network data drive starts to take 
the red arrow response process
 
-* 只要有任务,线程就不会停止,会一直执行任务,可以充分利用cpu资源,也不会产生多余的线程切换,去无谓地消耗cpu。
+* As long as there are tasks, the thread will not stop, the task will be 
executed all the time, you can make full use of the cpu resources, and will not 
generate redundant thread switching, to consume the CPU unnecessarily.
 
-因为同步模式下,需要大量的线程来提升并发度,而大量的线程又带来线程切换的额外消耗。
+Because in synchronous mode, a large number of threads are needed to increase 
the degree of concurrency, and a large number of threads bring additional 
consumption of thread switching.
 
-测试数据表明,reactive模式,只需要消耗同步模式不到一半的cpu,即可达到或超过同步模式的tps,并且时延更低。
+The test data shows that the reactive mode only needs to consume less than 
half of the CPU of the synchronous mode. And can reach or exceed the tps of the 
synchronous mode, and the delay is lower.
 
-## 混合Reactive机制
+## Hybrid Reactive Mechanism
 
-Reactvie要求:所有在eventloop中执行的逻辑,不允许有任何的阻塞动作,包括不限于wait、sleep、巨大循环、同步查询DB等等。
+Reactive requires that all logic executed in the eventloop does not allow any 
blocking actions, including not limited to wait, sleep, large loops, 
synchronous query DB, and so on.
 
 Review comment:
   including not limited 有点生硬


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


With regards,
Apache Git Services


[GitHub] zhengyangyong commented on a change in pull request #47: General development dir translation and include img

2018-08-24 Thread GitBox
zhengyangyong commented on a change in pull request #47: General development 
dir translation and include img
URL: 
https://github.com/apache/incubator-servicecomb-docs/pull/47#discussion_r212539007
 
 

 ##
 File path: 
java-chassis-reference/en_US/general-development/local-develop-test.md
 ##
 @@ -1,21 +1,21 @@
-## 概念阐述
+# Local Development and Test  
+## Concept Description
 
-本小节介绍如何在开发者本地进行消费者/提供者应用的开发调试。开发服务提供者请参考3 开发服务提供者章节,开发服务消费者请参考4 
开发服务消费者。服务提供者和消费提供者均需要连接到在远程的服务中心,为了本地微服务的开发和调试,本小节介绍了两种搭建本地服务中心的方法进行本地微服务调试:
+This section describes how developers can locally develop and commission 
consumer and provider applications. Both service providers and consumers need 
to connect to the remote service center. Two methods of building Local  
ServiceCenter for local microservice commissioning are as follows:
 
-* 启动[本地服务中心](#section2945986191314);
+* Starting [Local Service Center](#section2945986191314)。
 
-* 通过local file模拟启动服务中心\([Mock机制](#section960893593759)\)。
+* Starting Local Service Center [Mock mechanism](#section960893593759)。
 
-* 通过设置环境信息方便本地调试
+### Local debugging by setting up environmental information 
 
-服务中心是微服务框架中的重要组件,用于服务元数据以及服务实例元数据的管理和处理注册、发现。服务中心与微服务提供/消费者的逻辑关系下图所示:  
-![](/start/develop-test.png)
+Service center is an important component in the microservice architecture, and 
is used for managing, registering, and detecting metadata and instance 
metadata. The logic relationship between the service center and microservice 
provider/consumer is as follows:![](../assets/images/local_develop_test_en.png)
 
 Review comment:
   and is used for managing, registering, and detecting metadata and instance 
metadata 这句话不大通顺。。


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


With regards,
Apache Git Services


[GitHub] zhengyangyong commented on a change in pull request #47: General development dir translation and include img

2018-08-24 Thread GitBox
zhengyangyong commented on a change in pull request #47: General development 
dir translation and include img
URL: 
https://github.com/apache/incubator-servicecomb-docs/pull/47#discussion_r212554864
 
 

 ##
 File path: java-chassis-reference/en_US/general-development/reactive.md
 ##
 @@ -34,45 +34,45 @@ public String hello(@PathVariable(name = "name") String 
name){
 }
 ```
 
-与此对应的处理流程如下:
+The corresponding processing flow is as follows:
 
 ![](/assets/reactive/nestedSync.png)
 
-根据这个流程的特点,可以看到会产生以下结果:
+According to the characteristics of this process, you can see the following 
results:
 
-* 因为是同步调用,在“Other microservices”未应答之前“Microservice A”的调用线程一直处于阻塞等待状态,不处理任何其他事务
+* Because it is a synchronous call, the calling thread of "Microservice A" is 
always in the blocking wait state before "Other microservices" is not answered, 
and does not process any other transactions.
 
-* 当Executor中所有线程都在等待远程应答时,所有新的请求都只能在Queue中排队,得不到处理,此时整个系统相当于停止工作了
+* When all threads in the Executor are waiting for a remote response, all new 
requests can only be queued in the Queue and cannot be processed. At this 
point, the entire system is equivalent to stop working.
 
-* 
要增加处理能力,只能增加Executor中的线程数,而操作系统并不能无限地增加线程数,事实上增加线程数带来的收益是一个抛物线模型,超出一定的临界值后,系统的处理能力其实会下降,而这个临界值并不会太大
+* To increase the processing power, only increase the number of threads in the 
Executor, and the operating system can not increase the number of threads 
indefinitely. The benefit of increasing the number of threads is a parabolic 
model. After a specific critical value, the system handles The ability will 
drop, and this threshold will not be too big.
 
-* 当业务逻辑中,需要多次进行远程同步操作时,会更加恶化这个现象
+* This phenomenon is exacerbated when the remote synchronization operation is 
required multiple times in the business logic.
 
 Review comment:
   This phenomenon is exacerbated


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


With regards,
Apache Git Services


[GitHub] zhengyangyong commented on a change in pull request #47: General development dir translation and include img

2018-08-24 Thread GitBox
zhengyangyong commented on a change in pull request #47: General development 
dir translation and include img
URL: 
https://github.com/apache/incubator-servicecomb-docs/pull/47#discussion_r212553742
 
 

 ##
 File path: java-chassis-reference/en_US/general-development/reactive.md
 ##
 @@ -34,45 +34,45 @@ public String hello(@PathVariable(name = "name") String 
name){
 }
 ```
 
-与此对应的处理流程如下:
+The corresponding processing flow is as follows:
 
 ![](/assets/reactive/nestedSync.png)
 
-根据这个流程的特点,可以看到会产生以下结果:
+According to the characteristics of this process, you can see the following 
results:
 
-* 因为是同步调用,在“Other microservices”未应答之前“Microservice A”的调用线程一直处于阻塞等待状态,不处理任何其他事务
+* Because it is a synchronous call, the calling thread of "Microservice A" is 
always in the blocking wait state before "Other microservices" is not answered, 
and does not process any other transactions.
 
-* 当Executor中所有线程都在等待远程应答时,所有新的请求都只能在Queue中排队,得不到处理,此时整个系统相当于停止工作了
+* When all threads in the Executor are waiting for a remote response, all new 
requests can only be queued in the Queue and cannot be processed. At this 
point, the entire system is equivalent to stop working.
 
-* 
要增加处理能力,只能增加Executor中的线程数,而操作系统并不能无限地增加线程数,事实上增加线程数带来的收益是一个抛物线模型,超出一定的临界值后,系统的处理能力其实会下降,而这个临界值并不会太大
+* To increase the processing power, only increase the number of threads in the 
Executor, and the operating system can not increase the number of threads 
indefinitely. The benefit of increasing the number of threads is a parabolic 
model. After a specific critical value, the system handles The ability will 
drop, and this threshold will not be too big.
 
-* 当业务逻辑中,需要多次进行远程同步操作时,会更加恶化这个现象
+* This phenomenon is exacerbated when the remote synchronization operation is 
required multiple times in the business logic.
 
-## 嵌套同步调用的“错误”优化:
+## "Error" optimization for nested synchronous calls:
 
-针对前一场景,有人会认为将“Invoke producer method”丢进另一个线程池,可以解决问题,包括以下处理方式:
+For the previous scenario, someone would think that throwing the "Invoke 
producer method" into another thread pool can solve the problem, including the 
following:
 
-* 在producer method打标注@Async,由AOP负责将对该方法的调用丢进其他线程池去
+* In the producer method, mark @Async, which is responsible for throwing the 
call to the method into other thread pools.
 
-* 在producer method内部通过业务代码转移线程
+* Transferring threads through business code inside the producer method
 
-形成以下流程:
+Form the following process:
 
 ![](/assets/reactive/wrongSyncOptimization.png)
 
-根据这个流程的特点,可以看到会产生以下结果:
+According to the characteristics of this process, you can see the following 
results:
 
-* “Invoke producer method”必须立即返回,否则Executor线程还是得不到释放
+* "Invoke producer method" must be returned immediately, otherwise, the 
Executor thread will not be released
 
-* “Invoke producer method”必须提供一个新的机制告知调用流程自己的返回值,不是最终返回值(当前没有这个机制)
+* "Invoke producer method" must provide a new mechanism to inform the calling 
process of its return value, not the final return value (currently no such 
mechanism)
 
-* 虽然Executor线程释放了,但是Customer 
Executor,其实还是阻塞住,在等待远端应答,整个系统的阻塞状态并没有得到改变;而且还凭空多了一次线程切换
+* Although the Executor thread is released, the Customer Executor is blocked, 
waiting for the remote response, the blocking state of the entire system has 
not changed, and there is one more thread switching out of thin air.
 
 Review comment:
   这段改一下,不用原文机翻。。。


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


With regards,
Apache Git Services


[GitHub] zhengyangyong commented on a change in pull request #47: General development dir translation and include img

2018-08-24 Thread GitBox
zhengyangyong commented on a change in pull request #47: General development 
dir translation and include img
URL: 
https://github.com/apache/incubator-servicecomb-docs/pull/47#discussion_r212551742
 
 

 ##
 File path: java-chassis-reference/en_US/general-development/reactive.md
 ##
 @@ -141,21 +141,18 @@ servicecomb:
   sid.asyncQuery: cse.executor.groupThreadPool
 ```
 
-这里的cse.executor.groupThreadPool是serviceComb内置的默认线程池,用户可以任意指定为自己的定制线程池。
+The cse.executor.groupThreadPool here is the default thread pool built into 
serviceComb, which can be arbitrarily specified by the user as its custom 
thread pool.
 
-* Consumer:
+* Consumer:
 
-  * consumer是否使用reactive与producer如何实现,没有任何联系
+  * Whether the consumer uses reactive and producer how to achieve, there is 
no connection
 
 Review comment:
   achieve -> implement


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


With regards,
Apache Git Services


[GitHub] zhengyangyong commented on a change in pull request #47: General development dir translation and include img

2018-08-24 Thread GitBox
zhengyangyong commented on a change in pull request #47: General development 
dir translation and include img
URL: 
https://github.com/apache/incubator-servicecomb-docs/pull/47#discussion_r212550484
 
 

 ##
 File path: java-chassis-reference/zh_CN/general-development/dnsconfig.md
 ##
 @@ -24,7 +24,7 @@ addressResolver.[tag].[property]
 ``` yaml
 addressResolver:
   servers: 8.8.8.8,8.8.4.4   #对应Linux 
/etc/resolv.conf的nameserver,DNS服务器地址,支持配置多个,以逗号隔开
-  ndots: 1   #对应linux /etc/resolv.conf里面的options: ndots, 
作用就是如果给的域名里面包含的点的个数少于该阈值,那么DNS解析的时候就会默认加上searchDomains的值,这个必须和searchDomains搭配使用,Linux默认为1,华为公有云PAAS(包含容器)默认是4
 
 Review comment:
   应该去掉华为


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


With regards,
Apache Git Services


[GitHub] coveralls commented on issue #431: [SCB-809]Verify the chinese version of the UI

2018-08-24 Thread GitBox
coveralls commented on issue #431: [SCB-809]Verify the chinese version of the UI
URL: 
https://github.com/apache/incubator-servicecomb-service-center/pull/431#issuecomment-415688687
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/18648459/badge)](https://coveralls.io/builds/18648459)
   
   Coverage decreased (-0.02%) to 72.058% when pulling 
**f4b939565664113048be8bf152694c8c49392522 on xiaoyimei:SCB-809** into 
**77ae91e5adc580861358a814096dd0f824073dc5 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


With regards,
Apache Git Services


[GitHub] codecov-io commented on issue #431: [SCB-809]Verify the chinese version of the UI

2018-08-24 Thread GitBox
codecov-io commented on issue #431: [SCB-809]Verify the chinese version of the 
UI
URL: 
https://github.com/apache/incubator-servicecomb-service-center/pull/431#issuecomment-415688629
 
 
   # 
[Codecov](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/431?src=pr=h1)
 Report
   > Merging 
[#431](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/431?src=pr=desc)
 into 
[master](https://codecov.io/gh/apache/incubator-servicecomb-service-center/commit/77ae91e5adc580861358a814096dd0f824073dc5?src=pr=desc)
 will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/431/graphs/tree.svg?width=650=GAaF7zrg8R=150=pr)](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/431?src=pr=tree)
   
   ```diff
   @@   Coverage Diff   @@
   ##   master #431   +/-   ##
   ===
 Coverage   69.22%   69.22%   
   ===
 Files 139  139   
 Lines   1077010770   
   ===
 Hits 7455 7455   
 Misses   2839 2839   
 Partials  476  476
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/431?src=pr=tree)
 | Coverage Δ | |
   |---|---|---|
   | 
[server/core/backend/metrics.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/431/diff?src=pr=tree#diff-c2VydmVyL2NvcmUvYmFja2VuZC9tZXRyaWNzLmdv)
 | `71.42% <0%> (-14.29%)` | :arrow_down: |
   | 
[server/plugin/infra/registry/etcd/tracing.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/431/diff?src=pr=tree#diff-c2VydmVyL3BsdWdpbi9pbmZyYS9yZWdpc3RyeS9ldGNkL3RyYWNpbmcuZ28=)
 | `72.72% <0%> (-9.1%)` | :arrow_down: |
   | 
[pkg/log/logrotate.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/431/diff?src=pr=tree#diff-cGtnL2xvZy9sb2dyb3RhdGUuZ28=)
 | `34.28% <0%> (+0.57%)` | :arrow_up: |
   | 
[pkg/util/tree.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/431/diff?src=pr=tree#diff-cGtnL3V0aWwvdHJlZS5nbw==)
 | `84.37% <0%> (+3.12%)` | :arrow_up: |
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/431?src=pr=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/431?src=pr=footer).
 Last update 
[77ae91e...f4b9395](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/431?src=pr=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


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


With regards,
Apache Git Services


[GitHub] xiaoyimei opened a new pull request #431: [SCB-809]Verify the chinese version of the UI as all chinese text was…

2018-08-24 Thread GitBox
xiaoyimei opened a new pull request #431: [SCB-809]Verify the chinese version 
of the UI as all chinese text was…
URL: https://github.com/apache/incubator-servicecomb-service-center/pull/431
 
 
   … translated using Google Translate
   
   Follow this checklist to help us incorporate your contribution quickly and 
easily:
   
- [ ] Make sure there is a [JIRA 
issue](https://issues.apache.org/jira/browse/SCB) filed for the change (usually 
before you start working on it).  Trivial changes like typos do not require a 
JIRA issue.  Your pull request should address just this issue, without pulling 
in other changes.
- [ ] Each commit in the pull request should have a meaningful subject line 
and body.
- [ ] Format the pull request title like `[SCB-XXX] Fixes bug in 
ApproximateQuantiles`, where you replace `SCB-XXX` with the appropriate JIRA 
issue.
- [ ] Write a pull request description that is detailed enough to 
understand what the pull request does, how, and why.
- [ ] Run `go build` `go test` `go fmt` `go vet` to make sure basic checks 
pass. A more thorough check will be performed on your pull request 
automatically.
- [ ] If this contribution is large, please file an Apache [Individual 
Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   ---
   


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


With regards,
Apache Git Services


[GitHub] coveralls commented on issue #430: [SCB-808]Aut-refresh the dashboard and service-list page every 10sec

2018-08-24 Thread GitBox
coveralls commented on issue #430: [SCB-808]Aut-refresh the dashboard and 
service-list page every 10sec
URL: 
https://github.com/apache/incubator-servicecomb-service-center/pull/430#issuecomment-415674213
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/18647742/badge)](https://coveralls.io/builds/18647742)
   
   Coverage increased (+0.005%) to 72.084% when pulling 
**2278eddff87e1e8119bd419483730a0100439b94 on xiaoyimei:SCB-8080** into 
**77ae91e5adc580861358a814096dd0f824073dc5 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


With regards,
Apache Git Services


[GitHub] codecov-io commented on issue #430: [SCB-808]Aut-refresh the dashboard and service-list page every 10sec

2018-08-24 Thread GitBox
codecov-io commented on issue #430: [SCB-808]Aut-refresh the dashboard and 
service-list page every 10sec
URL: 
https://github.com/apache/incubator-servicecomb-service-center/pull/430#issuecomment-415674193
 
 
   # 
[Codecov](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/430?src=pr=h1)
 Report
   > Merging 
[#430](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/430?src=pr=desc)
 into 
[master](https://codecov.io/gh/apache/incubator-servicecomb-service-center/commit/77ae91e5adc580861358a814096dd0f824073dc5?src=pr=desc)
 will **decrease** coverage by `0.03%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/430/graphs/tree.svg?token=GAaF7zrg8R=pr=650=150)](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/430?src=pr=tree)
   
   ```diff
   @@Coverage Diff @@
   ##   master #430  +/-   ##
   ==
   - Coverage   69.22%   69.18%   -0.04% 
   ==
 Files 139  139  
 Lines   1077010770  
   ==
   - Hits 7455 7451   -4 
   - Misses   2839 2841   +2 
   - Partials  476  478   +2
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/430?src=pr=tree)
 | Coverage Δ | |
   |---|---|---|
   | 
[server/core/backend/metrics.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/430/diff?src=pr=tree#diff-c2VydmVyL2NvcmUvYmFja2VuZC9tZXRyaWNzLmdv)
 | `71.42% <0%> (-14.29%)` | :arrow_down: |
   | 
[server/service/notification/websocket.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/430/diff?src=pr=tree#diff-c2VydmVyL3NlcnZpY2Uvbm90aWZpY2F0aW9uL3dlYnNvY2tldC5nbw==)
 | `81.93% <0%> (-1.94%)` | :arrow_down: |
   | 
[server/govern/service.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/430/diff?src=pr=tree#diff-c2VydmVyL2dvdmVybi9zZXJ2aWNlLmdv)
 | `73.33% <0%> (-0.34%)` | :arrow_down: |
   | 
[server/broker/util.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/430/diff?src=pr=tree#diff-c2VydmVyL2Jyb2tlci91dGlsLmdv)
 | `53.47% <0%> (+0.26%)` | :arrow_up: |
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/430?src=pr=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/430?src=pr=footer).
 Last update 
[77ae91e...2278edd](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/430?src=pr=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


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


With regards,
Apache Git Services


[GitHub] wangkirin opened a new pull request #134: change latest release to Github link

2018-08-24 Thread GitBox
wangkirin opened a new pull request #134: change latest release to Github link
URL: https://github.com/apache/incubator-servicecomb-website/pull/134
 
 
   Signed-off-by: Wang Kirin 


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


With regards,
Apache Git Services


[GitHub] xiaoyimei opened a new pull request #430: [SCB-808]Aut-refresh the dashboard and service-list page every 10sec

2018-08-24 Thread GitBox
xiaoyimei opened a new pull request #430: [SCB-808]Aut-refresh the dashboard 
and service-list page every 10sec
URL: https://github.com/apache/incubator-servicecomb-service-center/pull/430
 
 
   Follow this checklist to help us incorporate your contribution quickly and 
easily:
   
- [ ] Make sure there is a [JIRA 
issue](https://issues.apache.org/jira/browse/SCB) filed for the change (usually 
before you start working on it).  Trivial changes like typos do not require a 
JIRA issue.  Your pull request should address just this issue, without pulling 
in other changes.
- [ ] Each commit in the pull request should have a meaningful subject line 
and body.
- [ ] Format the pull request title like `[SCB-XXX] Fixes bug in 
ApproximateQuantiles`, where you replace `SCB-XXX` with the appropriate JIRA 
issue.
- [ ] Write a pull request description that is detailed enough to 
understand what the pull request does, how, and why.
- [ ] Run `go build` `go test` `go fmt` `go vet` to make sure basic checks 
pass. A more thorough check will be performed on your pull request 
automatically.
- [ ] If this contribution is large, please file an Apache [Individual 
Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   ---
   


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


With regards,
Apache Git Services


[GitHub] zhengyangyong commented on a change in pull request #47: General development dir translation and include img

2018-08-24 Thread GitBox
zhengyangyong commented on a change in pull request #47: General development 
dir translation and include img
URL: 
https://github.com/apache/incubator-servicecomb-docs/pull/47#discussion_r212529128
 
 

 ##
 File path: java-chassis-reference/en_US/general-development/file-upload.md
 ##
 @@ -1,54 +1,54 @@
-文件上传,当前支持在vertx rest通道和servlet rest中使用。
+File upload, currently supported in vertx rest channel and servlet rest.
 
-文件上传使用标准的http form格式,可与浏览器的上传直接对接。
+File uploads use the standard http form format, which can directly upload the 
file from the browser.
 
-## Producer:
-支持jaxrs和springmvc开发模式
+## Producer:
+Support jaxrs and springmvc development mode
 
-jaxrs开发模式:
-* 支持servlet定义的javax.servlet.http.Part类型
+Jaxrs development model:
 
 Review comment:
   mode


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


With regards,
Apache Git Services


[GitHub] zhengyangyong commented on a change in pull request #47: General development dir translation and include img

2018-08-24 Thread GitBox
zhengyangyong commented on a change in pull request #47: General development 
dir translation and include img
URL: 
https://github.com/apache/incubator-servicecomb-docs/pull/47#discussion_r212530882
 
 

 ##
 File path: java-chassis-reference/en_US/general-development/http-filter.md
 ##
 @@ -75,23 +77,20 @@ public interface HttpServerFilter {
 
 ## 3.2 needCacheRequest
 
-与HttpClientFilter不同的是,增加了决定是否缓存请求的功能。
+Unlike HttpClientFilter, the ability to decide whether to cache requests is 
added.
 
-这是因为ServiceComb不仅仅能使用standalone的方式运行,也能运行于web容器(比如tomcat),在servlet的实现上,请求码流只能读取一次,并且不一定支持reset(比如tomcat),RESTful框架需要执行反序列化,需要读取body码流,签名逻辑也需要读取body码流,如果使用默认的处理,必然有一方功能无法实现。
+This is because ServiceComb can not only run in standalone mode but also run 
in web container (such as Tomcat). In the implementation of a servlet, request 
stream can only be read once, and does not necessarily support reset (such as 
Tomcat), RESTful The framework needs to perform deserialization. It needs to 
read the body stream. The signature logic also needs to read the body stream. 
If the default processing is used, one of the functions cannot be implemented.
 
-所以运行于web容器场景时,所有HttpServerFilter,只要有一个返回需要缓存请求,则body码流会被复制保存起来,以支持重复读取。
+So when running in a web container scenario, all HttpServerFilters, as long as 
there is a return request that needs to be cached, the body stream will be 
copied and saved to support repeated reads.
 
-入参是本次请求对应的元数据,业务可以针对该请求决定是否需要缓存请求。
+The input parameter is the metadata corresponding to the request, and the 
service can decide whether the cache request is needed for the request.
 
 ## 3.3 afterReceiveRequest
 
-在收到请求后,根据url、header、query、码流计算签名,并与header中的签名对比,如果签名不对,直接构造一个Response作为返回值,只要不是返回NULL,则框架会中断对其他HttpClientFilter的调用。
+After receiving the request, the signature is calculated according to the URL, 
header, query, and code stream, and compared with the signature in the header. 
If the signature is incorrect, a Response is directly constructed as the return 
value. As long as the NULL is not returned, the framework will interrupt the 
other HttpClientFilter. Call.
 
 Review comment:
   怎么有一个.


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


With regards,
Apache Git Services


[GitHub] zhengyangyong commented on a change in pull request #47: General development dir translation and include img

2018-08-24 Thread GitBox
zhengyangyong commented on a change in pull request #47: General development 
dir translation and include img
URL: 
https://github.com/apache/incubator-servicecomb-docs/pull/47#discussion_r212530089
 
 

 ##
 File path: java-chassis-reference/en_US/general-development/http-filter.md
 ##
 @@ -1,32 +1,32 @@
-某些场景中,业务使用http而不是https,作为网络传输通道,此时为了防止被伪造或篡改请求,需要提供consumer、producer之间对http码流的签名功能。
+In some scenarios, the service uses http instead of https as the network 
transmission channel. To prevent the falsification or tampering request, 
consumer and the producer must be provided a method to signature the http 
stream.
 
-签名功能使用org.apache.servicecomb.common.rest.filter.HttpClientFilter和org.apache.servicecomb.common.rest.filter.HttpServerFilter接口来承载,建议http码流强相关的逻辑使用这里的Filter机制,而契约参数相关逻辑使用Handler机制。
+The signature method is carried using the 
org.apache.servicecomb.common.rest.filter.HttpClientFilter and 
org.apache.servicecomb.common.rest.filter.HttpServerFilter interfaces. It is 
recommended that the http stream related logic use the Filter mechanism here, 
and the contract The parameter related logic uses the Handler mechanism.
 
-关于Filter接口的使用,可以参考[demo-signature](https://github.com/ServiceComb/ServiceComb-Java-Chassis/tree/master/demo/demo-signature)。
+About the use of the Filter interface, please reference [demo-signature] 
(https://github.com/ServiceComb/ServiceComb-Java-Chassis/tree/master/demo/demo-signature).
 
 
 
-# 1.概述
+# 1 Overview
 
-Filter机制使用Java标准的SPI机制加载。
+The Filter mechanism is loaded using the Java standard SPI mechanism.
 
-HttpClientFilter、HttpServerFilter都各自允许加载多个:
+Both HttpClientFilter and HttpServerFilter allow multiple loads:
 
-* 各实例之间的执行顺序由getOrder的返回值决定
+* The order of execution between instances is determined by the return value 
of getOrder
 
-* 如果getOrder返回值相同,则相应的实例顺序随机决定
+* If getOrder returns the same value, the corresponding instance order is 
randomly determined
 
-无论是request,还是response,读取body码流,都使用getBodyBytes\(\),返回值可能为null(比如get调用的场景),如果不为null,对应的码流长度,通过getBodyBytesLength\(\)获取。
+Whether it is request or response, read the body stream, use getBodyBytes\ 
(\), the return value may be null (such as the scene called get), if not null, 
the corresponding stream length, Obtain through getBodyBytesLength\ (\ ).
 
 Review comment:
   such as the scene called get 修一下


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


With regards,
Apache Git Services


[GitHub] zhengyangyong commented on a change in pull request #47: General development dir translation and include img

2018-08-24 Thread GitBox
zhengyangyong commented on a change in pull request #47: General development 
dir translation and include img
URL: 
https://github.com/apache/incubator-servicecomb-docs/pull/47#discussion_r212529381
 
 

 ##
 File path: java-chassis-reference/en_US/general-development/file-upload.md
 ##
 @@ -1,54 +1,54 @@
-文件上传,当前支持在vertx rest通道和servlet rest中使用。
+File upload, currently supported in vertx rest channel and servlet rest.
 
-文件上传使用标准的http form格式,可与浏览器的上传直接对接。
+File uploads use the standard http form format, which can directly upload the 
file from the browser.
 
-## Producer:
-支持jaxrs和springmvc开发模式
+## Producer:
+Support jaxrs and springmvc development mode
 
-jaxrs开发模式:
-* 支持servlet定义的javax.servlet.http.Part类型
+Jaxrs development model:
+* javax.servlet.http.Part type that supports servlet definitions
 
-* 可以直接使用@FormParam传递文件类型及普通参数
+* You can directly use @FormParam to pass file types and common parameters
 
-springmvc开发模式:
+Springmvc development mode:
 
-* 
支持servlet定义的javax.servlet.http.Part类型,也支持org.springframework.web.multipart.MultipartFile类型
+* Supports servlet-defined javax.servlet.http.Part type, also supports 
org.springframework.web.multipart.MultipartFile type
 
-* 两种数据类型功能是一致的,MultipartFile的底层也是Part
+* The two datatype functions are consistent, and the underlying part of 
MultipartFile is also Part
 
 Review comment:
   and the underlying part of MultipartFile is also Part 请修正一下有点绕


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


With regards,
Apache Git Services


[GitHub] zhengyangyong commented on a change in pull request #47: General development dir translation and include img

2018-08-24 Thread GitBox
zhengyangyong commented on a change in pull request #47: General development 
dir translation and include img
URL: 
https://github.com/apache/incubator-servicecomb-docs/pull/47#discussion_r212530960
 
 

 ##
 File path: java-chassis-reference/en_US/general-development/http-filter.md
 ##
 @@ -75,23 +77,20 @@ public interface HttpServerFilter {
 
 ## 3.2 needCacheRequest
 
-与HttpClientFilter不同的是,增加了决定是否缓存请求的功能。
+Unlike HttpClientFilter, the ability to decide whether to cache requests is 
added.
 
-这是因为ServiceComb不仅仅能使用standalone的方式运行,也能运行于web容器(比如tomcat),在servlet的实现上,请求码流只能读取一次,并且不一定支持reset(比如tomcat),RESTful框架需要执行反序列化,需要读取body码流,签名逻辑也需要读取body码流,如果使用默认的处理,必然有一方功能无法实现。
+This is because ServiceComb can not only run in standalone mode but also run 
in web container (such as Tomcat). In the implementation of a servlet, request 
stream can only be read once, and does not necessarily support reset (such as 
Tomcat), RESTful The framework needs to perform deserialization. It needs to 
read the body stream. The signature logic also needs to read the body stream. 
If the default processing is used, one of the functions cannot be implemented.
 
-所以运行于web容器场景时,所有HttpServerFilter,只要有一个返回需要缓存请求,则body码流会被复制保存起来,以支持重复读取。
+So when running in a web container scenario, all HttpServerFilters, as long as 
there is a return request that needs to be cached, the body stream will be 
copied and saved to support repeated reads.
 
-入参是本次请求对应的元数据,业务可以针对该请求决定是否需要缓存请求。
+The input parameter is the metadata corresponding to the request, and the 
service can decide whether the cache request is needed for the request.
 
 ## 3.3 afterReceiveRequest
 
-在收到请求后,根据url、header、query、码流计算签名,并与header中的签名对比,如果签名不对,直接构造一个Response作为返回值,只要不是返回NULL,则框架会中断对其他HttpClientFilter的调用。
+After receiving the request, the signature is calculated according to the URL, 
header, query, and code stream, and compared with the signature in the header. 
If the signature is incorrect, a Response is directly constructed as the return 
value. As long as the NULL is not returned, the framework will interrupt the 
other HttpClientFilter. Call.
 
 ## 3.4 beforeSendResponse
 
-在发送应答之前,根据header、码流计算签名,并设置到header中去。
-
-因为可能invocation还没来得及构造,调用流程已经出错,所以入参invocation可能是null。
-
-
+Before sending a response, the signature is calculated according to the header 
and the stream and set to the header.
 
+Because the invocation has not yet been constructed, the call flow has gone 
wrong, so the invocation may be null.
 
 Review comment:
   “.《Paste》” 删掉


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


With regards,
Apache Git Services