[GitHub] WillemJiang closed pull request #137: SCB-344 add document for how to use mysql as alpha's backend database
WillemJiang closed pull request #137: SCB-344 add document for how to use mysql as alpha's backend database URL: https://github.com/apache/incubator-servicecomb-saga/pull/137 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/README.md b/README.md index aa9b8400..61c9c8f8 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,10 @@ See [Booking Demo](saga-demo/pack-demo/README.md) for details. ## User Guide See [User Guide](docs/user_guide.md) for details. + +## FAQ +* [How to use MySQL as alpha's backend database?](docs/faq/en/how_to_use_mysql_as_alpha_backend_database.md) + ## Contact Us * [issues](https://issues.apache.org/jira/browse/SCB) * [gitter](https://gitter.im/ServiceCombUsers/Lobby) diff --git a/README_ZH.md b/README_ZH.md index 2ea467be..ac5f8a3e 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -25,6 +25,9 @@ Saga?? **alpha** ? **omega**?? ## ?[](docs/user_guide_zh.md)? +## +* [MySQL??alpha???](docs/faq/cn/how_to_use_mysql_as_alpha_backend_database.md) + ## * [??issues](https://issues.apache.org/jira/browse/SCB) * [gitter???](https://gitter.im/ServiceCombUsers/Lobby) diff --git a/alpha/alpha-core/src/main/java/org/apache/servicecomb/saga/alpha/core/Command.java b/alpha/alpha-core/src/main/java/org/apache/servicecomb/saga/alpha/core/Command.java index 1e6f21be..0f016d38 100644 --- a/alpha/alpha-core/src/main/java/org/apache/servicecomb/saga/alpha/core/Command.java +++ b/alpha/alpha-core/src/main/java/org/apache/servicecomb/saga/alpha/core/Command.java @@ -25,9 +25,11 @@ import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; +import javax.persistence.Table; import javax.persistence.Version; @Entity +@Table(name = "Command") public class Command { @Id diff --git a/alpha/alpha-core/src/main/java/org/apache/servicecomb/saga/alpha/core/TxEvent.java b/alpha/alpha-core/src/main/java/org/apache/servicecomb/saga/alpha/core/TxEvent.java index 42a202fd..b17a1209 100644 --- a/alpha/alpha-core/src/main/java/org/apache/servicecomb/saga/alpha/core/TxEvent.java +++ b/alpha/alpha-core/src/main/java/org/apache/servicecomb/saga/alpha/core/TxEvent.java @@ -25,9 +25,11 @@ import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; +import javax.persistence.Table; import javax.persistence.Transient; @Entity +@Table(name = "TxEvent") public class TxEvent { @Transient private static final long MAX_TIMESTAMP = 25340221440L; // -12-31 00:00:00 diff --git a/alpha/alpha-core/src/main/java/org/apache/servicecomb/saga/alpha/core/TxTimeout.java b/alpha/alpha-core/src/main/java/org/apache/servicecomb/saga/alpha/core/TxTimeout.java index 00ca2ec7..342321fd 100644 --- a/alpha/alpha-core/src/main/java/org/apache/servicecomb/saga/alpha/core/TxTimeout.java +++ b/alpha/alpha-core/src/main/java/org/apache/servicecomb/saga/alpha/core/TxTimeout.java @@ -23,9 +23,11 @@ import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; +import javax.persistence.Table; import javax.persistence.Version; @Entity +@Table(name = "TxTimeout") public class TxTimeout { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) diff --git a/alpha/alpha-server/src/main/resources/application.yaml b/alpha/alpha-server/src/main/resources/application.yaml index a4790e25..43b39dc6 100644 --- a/alpha/alpha-server/src/main/resources/application.yaml +++ b/alpha/alpha-server/src/main/resources/application.yaml @@ -14,6 +14,10 @@ ## See the License for the specific language governing permissions and ## limitations under the License. ## --- +server: + port: 8090 + +--- spring: profiles: prd datasource: @@ -23,5 +27,16 @@ spring: platform: postgresql #continue-on-error: true -server: - port: 8090 +--- +spring: + profiles: mysql + datasource: +username: saga +password: password +url: jdbc:mysql://mysql.servicecomb.io:3306/saga?useSSL=false +platform: mysql +continue-on-error: true + jpa: +properties: + eclipselink: +ddl-generation: none \ No newline at end of file diff --git a/alpha/alpha-server/src/main/resources/schema-mysql.sql b/alpha/alpha-server/src/main/resources/schema-mysql.sql new file mode 100644 index ..b0bc8d71 --- /dev/null +++ b/alpha/alpha-server/src/main/resources/schema-mysql.sql @@ -0,0 +1,66 @@ +/* + * 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
[GitHub] jjtyro commented on issue #283: service center frontend how to support https?
jjtyro commented on issue #283: service center frontend how to support https? URL: https://github.com/apache/incubator-servicecomb-service-center/issues/283#issuecomment-365179550 frontend???https???service center???service center? Thanks! 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 closed pull request #135: SCB-330 add user guide and Chinese version of docs
WillemJiang closed pull request #135: SCB-330 add user guide and Chinese version of docs URL: https://github.com/apache/incubator-servicecomb-saga/pull/135 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/README.md b/README.md index e8e62a21..aa9b8400 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Saga [![Build Status](https://travis-ci.org/apache/incubator-servicecomb-saga.svg?branch=master)](https://travis-ci.org/apache/incubator-servicecomb-saga?branch=master) [![Coverage Status](https://coveralls.io/repos/github/apache/incubator-servicecomb-saga/badge.svg?branch=master)](https://coveralls.io/github/apache/incubator-servicecomb-saga?branch=master) [![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) +# Saga | [??](README_ZH.md) [![Build Status](https://travis-ci.org/apache/incubator-servicecomb-saga.svg?branch=master)](https://travis-ci.org/apache/incubator-servicecomb-saga?branch=master) [![Coverage Status](https://coveralls.io/repos/github/apache/incubator-servicecomb-saga/badge.svg?branch=master)](https://coveralls.io/github/apache/incubator-servicecomb-saga?branch=master) [![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) Apache ServiceComb (incubating) Saga is an eventually data consistency solution for micro-service applications. Transactions are commited directly in the try phase and compensated in reverse order in the rollback phase comparing to [TCC](http://design.inf.usi.ch/sites/default/files/biblio/rest-tcc.pdf). ## Features @@ -22,6 +22,9 @@ See [Saga Pack Design](docs/design.md) for details. If you are interested in our ## Get Started See [Booking Demo](saga-demo/pack-demo/README.md) for details. +## User Guide +See [User Guide](docs/user_guide.md) for details. + ## Contact Us * [issues](https://issues.apache.org/jira/browse/SCB) * [gitter](https://gitter.im/ServiceCombUsers/Lobby) @@ -31,4 +34,4 @@ See [Booking Demo](saga-demo/pack-demo/README.md) for details. See [Pull Request Guide](http://servicecomb.incubator.apache.org/developers/submit-codes/) for details. ## License -Licensed under an [Apache 2.0](https://github.com/apache/incubator-servicecomb-saga/blob/master/LICENSE) license. +Licensed under an [Apache 2.0 license](https://github.com/apache/incubator-servicecomb-saga/blob/master/LICENSE). diff --git a/README_ZH.md b/README_ZH.md new file mode 100644 index ..2ea467be --- /dev/null +++ b/README_ZH.md @@ -0,0 +1,37 @@ +# Saga | [English](README.md) [![Build Status](https://travis-ci.org/apache/incubator-servicecomb-saga.svg?branch=master)](https://travis-ci.org/apache/incubator-servicecomb-saga?branch=master) [![Coverage Status](https://coveralls.io/repos/github/apache/incubator-servicecomb-saga/badge.svg?branch=master)](https://coveralls.io/github/apache/incubator-servicecomb-saga?branch=master) [![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) +Apache ServiceComb (incubating) Saga [TCC](http://design.inf.usi.ch/sites/default/files/biblio/rest-tcc.pdf)try???Saga??rollback + +## ?? +* ??? +* ?? +* ???gRPCKyro +* ??2-3??? +* Docker? +* + +## ?? +Saga?? **alpha** ? **omega**?? +* alpha +* omega??agent??alpha??? + +?alpha, omega??? +![Saga Pack ??](docs/static_files/pack.png) + +?[Saga Pack ](docs/design_zh.md). Saga??[???Saga??](docs/old_saga.md)? + +## +?[??](saga-demo/pack-demo/README.md)? + +## +?[](docs/user_guide_zh.md)? + +## +* [??issues](https://issues.apache.org/jira/browse/SCB) +* [gitter???](https://gitter.im/ServiceCombUsers/Lobby) +* : [??](mailto:dev-subscr...@servicecomb.incubator.apache.org) [??](https://lists.apache.org/list.html?dev@servicecomb.apache.org) + +## ?? +?[??](http://servicecomb.incubator.apache.org/cn/developers/submit-codes/)? + +## License +[Apache 2.0 license](https://github.com/apache/incubator-servicecomb-saga/blob/master/LICENSE)? diff --git a/alpha/alpha-server/src/test/java/org/apache/servicecomb/saga/alpha/server/AlphaIntegrationTest.java b/alpha/alpha-server/src/test/java/org/apache/servicecomb/saga/alpha/server/AlphaIntegrationTest.java index 497c2443..8b2672ce 100644 --- a/alpha/alpha-server/src/test/java/org/apache/servicecomb/saga/alpha/server/AlphaIntegrationTest.java +++
[GitHub] WillemJiang closed pull request #136: SCB-243 able to intercept old java chassis requests
WillemJiang closed pull request #136: SCB-243 able to intercept old java chassis requests URL: https://github.com/apache/incubator-servicecomb-saga/pull/136 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-transport/omega-transport-resttemplate/src/test/java/org/apache/servicecomb/saga/omega/transport/resttemplate/UniqueIdGeneratorTest.java b/omega/omega-context/src/test/java/org/apache/servicecomb/saga/omega/context/UniqueIdGeneratorTest.java similarity index 91% rename from omega/omega-transport/omega-transport-resttemplate/src/test/java/org/apache/servicecomb/saga/omega/transport/resttemplate/UniqueIdGeneratorTest.java rename to omega/omega-context/src/test/java/org/apache/servicecomb/saga/omega/context/UniqueIdGeneratorTest.java index 88ffac2e..bcedcfa2 100644 --- a/omega/omega-transport/omega-transport-resttemplate/src/test/java/org/apache/servicecomb/saga/omega/transport/resttemplate/UniqueIdGeneratorTest.java +++ b/omega/omega-context/src/test/java/org/apache/servicecomb/saga/omega/context/UniqueIdGeneratorTest.java @@ -6,17 +6,16 @@ * (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 + * 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.omega.transport.resttemplate; +package org.apache.servicecomb.saga.omega.context; import static org.hamcrest.core.Is.is; import static org.junit.Assert.assertThat; @@ -32,7 +31,6 @@ import java.util.concurrent.Executors; import java.util.concurrent.Future; -import org.apache.servicecomb.saga.omega.context.UniqueIdGenerator; import org.junit.Test; public class UniqueIdGeneratorTest { diff --git a/omega/omega-transport/omega-transport-servicecomb/pom.xml b/omega/omega-transport/omega-transport-servicecomb/pom.xml new file mode 100644 index ..2798f7d4 --- /dev/null +++ b/omega/omega-transport/omega-transport-servicecomb/pom.xml @@ -0,0 +1,39 @@ + + + +http://maven.apache.org/POM/4.0.0; + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd;> + +omega-transport +org.apache.servicecomb.saga +0.0.3-SNAPSHOT + + 4.0.0 + + omega-transport-servicecomb + + + + io.servicecomb + java-chassis-core + ${java.chassis.version} + + + + \ No newline at end of file diff --git a/omega/omega-transport/omega-transport-servicecomb/src/main/java/org/apache/servicecomb/saga/omega/transport/servicecomb/SagaConsumerHandler.java b/omega/omega-transport/omega-transport-servicecomb/src/main/java/org/apache/servicecomb/saga/omega/transport/servicecomb/SagaConsumerHandler.java new file mode 100644 index ..8fd296fe --- /dev/null +++ b/omega/omega-transport/omega-transport-servicecomb/src/main/java/org/apache/servicecomb/saga/omega/transport/servicecomb/SagaConsumerHandler.java @@ -0,0 +1,59 @@ +/* + * 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.omega.transport.servicecomb; + +import static org.apache.servicecomb.saga.omega.context.OmegaContext.GLOBAL_TX_ID_KEY; +import static org.apache.servicecomb.saga.omega.context.OmegaContext.LOCAL_TX_ID_KEY; + +import java.lang.invoke.MethodHandles; + +import org.apache.servicecomb.saga.omega.context.OmegaContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +import io.servicecomb.core.Handler; +import io.servicecomb.core.Invocation; +import
[GitHub] jjtyro opened a new issue #283: service center frontend how to support https?
jjtyro opened a new issue #283: service center frontend how to support https? URL: https://github.com/apache/incubator-servicecomb-service-center/issues/283 service centerhttpsfrontend??https? 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 #543: [SCB-324] Fault-Injection handler implementation
coveralls commented on issue #543: [SCB-324] Fault-Injection handler implementation URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/543#issuecomment-362319234 [![Coverage Status](https://coveralls.io/builds/15497556/badge)](https://coveralls.io/builds/15497556) Coverage decreased (-0.03%) to 87.286% when pulling **50b9dfb316431e950ab8bcce388b346a576c22e1 on maheshrajus:master** into **25fe20db66cfa96c524111c775f9415b16917c75 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] asifdxtreme closed pull request #282: SCB-343 Batch delete micro-services and enable tracing will cause SC crash
asifdxtreme closed pull request #282: SCB-343 Batch delete micro-services and enable tracing will cause SC crash URL: https://github.com/apache/incubator-servicecomb-service-center/pull/282 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/pkg/chain/handler.go b/pkg/chain/handler.go index 46d74911..be482994 100644 --- a/pkg/chain/handler.go +++ b/pkg/chain/handler.go @@ -18,13 +18,12 @@ package chain import ( "github.com/apache/incubator-servicecomb-service-center/pkg/util" - "github.com/apache/incubator-servicecomb-service-center/pkg/validate" "reflect" ) const CAP_SIZE = 10 -var handlersMap map[string][]Handler = make(map[string][]Handler, CAP_SIZE) +var handlersMap = make(map[string][]Handler, CAP_SIZE) type Handler interface { Handle(i *Invocation) @@ -38,7 +37,7 @@ func RegisterHandler(catalog string, h Handler) { handlers = append(handlers, h) handlersMap[catalog] = handlers - t := validate.LoadStruct(reflect.ValueOf(h).Elem().Interface()) + t := util.LoadStruct(reflect.ValueOf(h).Elem().Interface()) util.Logger().Infof("register handler[%s] %s/%s", catalog, t.Type.PkgPath(), t.Type.Name()) } diff --git a/pkg/etcdsync/mutex.go b/pkg/etcdsync/mutex.go index 3cb4bcfd..f54ef6f5 100644 --- a/pkg/etcdsync/mutex.go +++ b/pkg/etcdsync/mutex.go @@ -23,24 +23,22 @@ import ( "github.com/apache/incubator-servicecomb-service-center/server/infra/registry" "github.com/coreos/etcd/client" "golang.org/x/net/context" - "io" "os" "sync" "time" ) const ( - defaultTTL = 60 - defaultTry = 3 - ROOT_PATH = "/cse/etcdsync" + DEFAULT_LOCK_TTL= 60 + DEFAULT_RETRY_TIMES = 3 + ROOT_PATH = "/cse/etcdsync" ) type DLockFactory struct { - keystring - ctxcontext.Context - ttlint64 - mutex *sync.Mutex - logger io.Writer + key string + ctx context.Context + ttl int64 + mutex *sync.Mutex } type DLock struct { @@ -49,31 +47,19 @@ type DLock struct { } var ( - globalMap map[string]*DLockFactory + globalMap = make(map[string]*DLockFactory) globalMux sync.Mutex IsDebug bool - hostname string - pid int + hostname string = util.HostName() + pid int= os.Getpid() ) -func init() { - globalMap = make(map[string]*DLockFactory) - IsDebug = false - - var err error - hostname, err = os.Hostname() - if err != nil { - hostname = "UNKNOWN" - } - pid = os.Getpid() -} - func NewLockFactory(key string, ttl int64) *DLockFactory { if len(key) == 0 { return nil } if ttl < 1 { - ttl = defaultTTL + ttl = DEFAULT_LOCK_TTL } return { @@ -92,7 +78,7 @@ func (m *DLockFactory) NewDLock(wait bool) (l *DLock, err error) { builder: m, id: fmt.Sprintf("%v-%v-%v", hostname, pid, time.Now().Format("20060102-15:04:05.9")), } - for try := 1; try <= defaultTry; try++ { + for try := 1; try <= DEFAULT_RETRY_TIMES; try++ { err = l.Lock(wait) if err == nil { return l, nil @@ -103,7 +89,7 @@ func (m *DLockFactory) NewDLock(wait bool) (l *DLock, err error) { break } - if try <= defaultTry { + if try <= DEFAULT_RETRY_TIMES { util.Logger().Warnf(err, "Try to lock key %s again, id=%s", m.key, l.id) } else { util.Logger().Errorf(err, "Lock key %s failed, id=%s", m.key, l.id) @@ -147,7 +133,7 @@ func (m *DLock) Lock(wait bool) error { util.Logger().Warnf(err, "Key %s is locked, waiting for other node releases it, id=%s", m.builder.key, m.id) - ctx, cancel := context.WithTimeout(m.builder.ctx, defaultTTL*time.Second) + ctx, cancel := context.WithTimeout(m.builder.ctx, DEFAULT_LOCK_TTL*time.Second) go func() { err := backend.Registry().Watch(ctx, registry.WithStrKey(m.builder.key), @@ -179,7 +165,7 @@ func (m *DLock) Unlock() (err error) { registry.DEL, registry.WithStrKey(m.builder.key)} - for i := 1; i <= defaultTry; i++ { + for i := 1; i <= DEFAULT_RETRY_TIMES; i++ { _, err = backend.Registry().Do(m.builder.ctx, opts...) if err == nil { if !IsDebug { diff --git a/pkg/grace/grace.go
[GitHub] coveralls commented on issue #282: SCB-343 Batch delete micro-services and enable tracing will cause SC crash
coveralls commented on issue #282: SCB-343 Batch delete micro-services and enable tracing will cause SC crash URL: https://github.com/apache/incubator-servicecomb-service-center/pull/282#issuecomment-364961544 [![Coverage Status](https://coveralls.io/builds/15496863/badge)](https://coveralls.io/builds/15496863) Coverage increased (+0.1%) to 74.144% when pulling **f96ba9676d1a1ceadf1d126d908e5496fec7ce19 on little-cui:release** into **cffba0d6aeef8c1da2278b137a950575a73719ec 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] coveralls commented on issue #558: [SCB-314] Support custom rest transport server compress and max header size
coveralls commented on issue #558: [SCB-314] Support custom rest transport server compress and max header size URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/558#issuecomment-365141325 [![Coverage Status](https://coveralls.io/builds/15496857/badge)](https://coveralls.io/builds/15496857) Coverage decreased (-0.01%) to 87.224% when pulling **e3f229f80ac764929fb11e30c61caf45b6e8ce8a on hwcse:SCB-314** into **9720cfc5c9f7ea2e7902a821ef031203ddfd8808 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] coveralls commented on issue #137: SCB-344 add document for how to use mysql as alpha's backend database
coveralls commented on issue #137: SCB-344 add document for how to use mysql as alpha's backend database URL: https://github.com/apache/incubator-servicecomb-saga/pull/137#issuecomment-365139896 [![Coverage Status](https://coveralls.io/builds/15496742/badge)](https://coveralls.io/builds/15496742) Coverage remained the same at 95.273% when pulling **d124955da2984d9a0388af76099d5bc1dd3268f3 on eric-lee-ltk:SCB-344** into **697bf60b68fb44ae0a5f61b68e4412e660adc75e 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] coveralls commented on issue #135: SCB-330 add user guide and Chinese version of docs
coveralls commented on issue #135: SCB-330 add user guide and Chinese version of docs URL: https://github.com/apache/incubator-servicecomb-saga/pull/135#issuecomment-364468203 [![Coverage Status](https://coveralls.io/builds/15496706/badge)](https://coveralls.io/builds/15496706) Coverage increased (+0.05%) to 95.318% when pulling **79ca2be9fb902659b58a4f0bc49b26f8c715889d on eric-lee-ltk:SCB-330-1** into **697bf60b68fb44ae0a5f61b68e4412e660adc75e 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] eric-lee-ltk opened a new pull request #137: SCB-344 add document for how to use mysql as alpha's backend database
eric-lee-ltk opened a new pull request #137: SCB-344 add document for how to use mysql as alpha's backend database URL: https://github.com/apache/incubator-servicecomb-saga/pull/137 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 PR is based on #135 . As the default table name in eclipselink is upper case and table name in query is case sensitive, we need to explicitly tell the query the exact table name. That's why the `@Table` came for. 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 #135: SCB-330 add user guide and Chinese version of docs
coveralls commented on issue #135: SCB-330 add user guide and Chinese version of docs URL: https://github.com/apache/incubator-servicecomb-saga/pull/135#issuecomment-364468203 [![Coverage Status](https://coveralls.io/builds/15496614/badge)](https://coveralls.io/builds/15496614) Coverage decreased (-0.05%) to 95.227% when pulling **cc0e594a8e8680eb9135bcf94e165922b3d651c5 on eric-lee-ltk:SCB-330-1** into **697bf60b68fb44ae0a5f61b68e4412e660adc75e 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] coveralls commented on issue #282: SCB-343 Batch delete micro-services and enable tracing will cause SC crash
coveralls commented on issue #282: SCB-343 Batch delete micro-services and enable tracing will cause SC crash URL: https://github.com/apache/incubator-servicecomb-service-center/pull/282#issuecomment-364961544 [![Coverage Status](https://coveralls.io/builds/15496655/badge)](https://coveralls.io/builds/15496655) Coverage increased (+0.04%) to 74.041% when pulling **f7c706887eae4fa375c7937ac4b66e9e07035982 on little-cui:release** into **cffba0d6aeef8c1da2278b137a950575a73719ec 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] coveralls commented on issue #135: SCB-330 add user guide and Chinese version of docs
coveralls commented on issue #135: SCB-330 add user guide and Chinese version of docs URL: https://github.com/apache/incubator-servicecomb-saga/pull/135#issuecomment-364468203 [![Coverage Status](https://coveralls.io/builds/15495543/badge)](https://coveralls.io/builds/15495543) Coverage remained the same at 95.273% when pulling **51a7410304c76a6c743655462e2037255f465595 on eric-lee-ltk:SCB-330-1** into **697bf60b68fb44ae0a5f61b68e4412e660adc75e 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] coveralls commented on issue #282: SCB-343 Batch delete micro-services and enable tracing will cause SC crash
coveralls commented on issue #282: SCB-343 Batch delete micro-services and enable tracing will cause SC crash URL: https://github.com/apache/incubator-servicecomb-service-center/pull/282#issuecomment-364961544 [![Coverage Status](https://coveralls.io/builds/15486155/badge)](https://coveralls.io/builds/15486155) Coverage increased (+0.02%) to 74.022% when pulling **eb8acb66f9cf7414ceeb5707c43f57089943340d on little-cui:release** into **cffba0d6aeef8c1da2278b137a950575a73719ec 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 #282: SCB-343 Batch delete micro-services and enable tracing will cause SC crash
codecov-io commented on issue #282: SCB-343 Batch delete micro-services and enable tracing will cause SC crash URL: https://github.com/apache/incubator-servicecomb-service-center/pull/282#issuecomment-364961368 # [Codecov](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/282?src=pr=h1) Report > Merging [#282](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/282?src=pr=desc) into [master](https://codecov.io/gh/apache/incubator-servicecomb-service-center/commit/cffba0d6aeef8c1da2278b137a950575a73719ec?src=pr=desc) will **increase** coverage by `0.04%`. > The diff coverage is `100%`. [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/282/graphs/tree.svg?width=650=150=pr=GAaF7zrg8R)](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/282?src=pr=tree) ```diff @@Coverage Diff@@ ## master#282 +/- ## = + Coverage 70.36% 70.4% +0.04% = Files 17 17 Lines34183413 -5 = - Hits 24052403 -2 + Misses846 842 -4 - Partials 167 168 +1 ``` | [Impacted Files](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/282?src=pr=tree) | Coverage ? | | |---|---|---| | [server/service/util/rule\_util.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/282/diff?src=pr=tree#diff-c2VydmVyL3NlcnZpY2UvdXRpbC9ydWxlX3V0aWwuZ28=) | `68.91% (+0.46%)` | :arrow_up: | | [server/service/util/instance\_util.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/282/diff?src=pr=tree#diff-c2VydmVyL3NlcnZpY2UvdXRpbC9pbnN0YW5jZV91dGlsLmdv) | `49.09% (-0.63%)` | :arrow_down: | | [server/service/instances.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/282/diff?src=pr=tree#diff-c2VydmVyL3NlcnZpY2UvaW5zdGFuY2VzLmdv) | `71.16% <100%> (+0.04%)` | :arrow_up: | | [server/service/microservices.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/282/diff?src=pr=tree#diff-c2VydmVyL3NlcnZpY2UvbWljcm9zZXJ2aWNlcy5nbw==) | `74.6% <100%> (+0.15%)` | :arrow_up: | | [server/service/tag.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/282/diff?src=pr=tree#diff-c2VydmVyL3NlcnZpY2UvdGFnLmdv) | `75.43% <0%> (-0.59%)` | :arrow_down: | -- [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/282?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/282?src=pr=footer). Last update [cffba0d...eb8acb6](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/282?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] little-cui closed pull request #281: SCB-337 Add a concurrent map impl
little-cui closed pull request #281: SCB-337 Add a concurrent map impl URL: https://github.com/apache/incubator-servicecomb-service-center/pull/281 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/pkg/util/concurrent_map.go b/pkg/util/concurrent_map.go new file mode 100644 index ..b7ec0399 --- /dev/null +++ b/pkg/util/concurrent_map.go @@ -0,0 +1,120 @@ +/* + * 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 util + +import "sync" + +type MapItem struct { + Key interface{} + Value interface{} +} + +type ConcurrentMap struct { + items map[interface{}]interface{} + size int + mux sync.RWMutex + once sync.Once +} + +func (cm *ConcurrentMap) resize() { + cm.items = make(map[interface{}]interface{}, cm.size) +} + +func (cm *ConcurrentMap) init() { + cm.once.Do(cm.resize) +} + +func (cm *ConcurrentMap) Put(key, val interface{}) (old interface{}) { + cm.init() + cm.mux.Lock() + old, cm.items[key] = cm.items[key], val + cm.mux.Unlock() + return +} + +func (cm *ConcurrentMap) PutIfAbsent(key, val interface{}) (old interface{}) { + var b bool + cm.init() + cm.mux.Lock() + old, b = cm.items[key] + if !b { + cm.items[key] = val + } + cm.mux.Unlock() + return +} + +func (cm *ConcurrentMap) Get(key interface{}) (val interface{}, b bool) { + cm.init() + cm.mux.RLock() + val, b = cm.items[key] + cm.mux.RUnlock() + return +} + +func (cm *ConcurrentMap) Remove(key interface{}) (old interface{}) { + var b bool + cm.init() + cm.mux.Lock() + old, b = cm.items[key] + if b { + delete(cm.items, key) + } + cm.mux.Unlock() + return +} + +func (cm *ConcurrentMap) Clear() { + cm.mux.Lock() + cm.resize() + cm.mux.Unlock() +} + +func (cm *ConcurrentMap) Size() (s int) { + return len(cm.items) +} + +func (cm *ConcurrentMap) ForEach(f func(item MapItem) (next bool)) { + cm.mux.RLock() + s := len(cm.items) + if s == 0 { + cm.mux.RUnlock() + return + } + // avoid dead lock in function 'f' + ch := make(chan MapItem, s) + for k, v := range cm.items { + ch <- MapItem{k, v} + } + cm.mux.RUnlock() + + for { + select { + case item := <-ch: + if b := f(item); b { + continue + } + default: + } + break + } + close(ch) +} + +func NewConcurrentMap(size int) ConcurrentMap { + return ConcurrentMap{size: size} +} diff --git a/pkg/util/concurrent_map_test.go b/pkg/util/concurrent_map_test.go new file mode 100644 index ..b0cc1c6c --- /dev/null +++ b/pkg/util/concurrent_map_test.go @@ -0,0 +1,177 @@ +/* + * 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 util + +import ( + "fmt" + "testing" +) + +func TestConcurrentMap(t *testing.T) { + cm := ConcurrentMap{} + s := cm.Size() + if s != 0 { + fmt.Println("TestConcurrentMap Size
[GitHub] coveralls commented on issue #136: SCB-243 able to intercept old java chassis requests
coveralls commented on issue #136: SCB-243 able to intercept old java chassis requests URL: https://github.com/apache/incubator-servicecomb-saga/pull/136#issuecomment-364877631 [![Coverage Status](https://coveralls.io/builds/15484006/badge)](https://coveralls.io/builds/15484006) Coverage increased (+0.09%) to 95.367% when pulling **468a6b0e28ec8c5870484d87d6bec7007b50 on eric-lee-ltk:SCB-243** into **697bf60b68fb44ae0a5f61b68e4412e660adc75e 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] coveralls commented on issue #557: [SCB-338] Refactor access log
coveralls commented on issue #557: [SCB-338] Refactor access log URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/557#issuecomment-364841319 [![Coverage Status](https://coveralls.io/builds/15482273/badge)](https://coveralls.io/builds/15482273) Coverage decreased (-0.1%) to 87.141% when pulling **581da800ecca37b710395db67b35667af5e7cc77 on yhs0092:refactor_access_log** into **9720cfc5c9f7ea2e7902a821ef031203ddfd8808 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] coveralls commented on issue #136: SCB-243 able to intercept old java chassis requests
coveralls commented on issue #136: SCB-243 able to intercept old java chassis requests URL: https://github.com/apache/incubator-servicecomb-saga/pull/136#issuecomment-364877631 [![Coverage Status](https://coveralls.io/builds/15481604/badge)](https://coveralls.io/builds/15481604) Coverage increased (+0.05%) to 95.322% when pulling **5dc5033c49e26453b37534cd0428ad3cc0729172 on eric-lee-ltk:SCB-243** into **697bf60b68fb44ae0a5f61b68e4412e660adc75e 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] coveralls commented on issue #557: [SCB-338] Refactor access log
coveralls commented on issue #557: [SCB-338] Refactor access log URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/557#issuecomment-364841319 [![Coverage Status](https://coveralls.io/builds/15481579/badge)](https://coveralls.io/builds/15481579) Coverage decreased (-0.07%) to 87.165% when pulling **1ed9ab672761f0ba9ab51d41870aea112dbab3f6 on yhs0092:refactor_access_log** into **9720cfc5c9f7ea2e7902a821ef031203ddfd8808 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] eric-lee-ltk opened a new pull request #136: SCB-243 able to intercept old java chassis requests
eric-lee-ltk opened a new pull request #136: SCB-243 able to intercept old java chassis requests URL: https://github.com/apache/incubator-servicecomb-saga/pull/136 Signed-off-by: Eric LeeFollow 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
?????? [VOTE] Release Apache ServiceComb Service-Center (incubating)version 1.0.0-m1
ISSUE link: https://issues.apache.org/jira/browse/SCB-343 -- -- ??: "Sure"; : 2018??2??12??(??) 5:27 ??: "dev@servicecomb.apache.org" ; : ?? [VOTE] Release Apache ServiceComb Service-Center (incubating)version 1.0.0-m1 -1 there is a major bug in this version, i have raise an ISSUE here. and i will fix it as soon as possible. -- -- ??: "Mahesh Raju Somalaraju" ; : 2018??2??12??(??) 2:42 ??: "dev" ; : Re: [VOTE] Release Apache ServiceComb Service-Center (incubating)version 1.0.0-m1 +1 Tested build from source on linux/windows machine and tested user case to be OK On 2018/02/09 03:26:16, Mohammad Asif Siddiqui wrote: > Hi All,> > This is a call for vote to release ServiceComb Service-Center (Incubating) version 1.0.0-m1> > Release Notes: https://github.com/asifdxtreme/incubator-servicecomb-service-center/tree/master/docs/release-notes > > > Release Candidate: https://dist.apache.org/repos/dist/dev/incubator/servicecomb/incubator-servicecomb-service-center/1.0.0-m1/ > > Release Tag: https://github.com/apache/incubator-servicecomb-service-center/releases/tag/1.0.0-m1 > > Release CommitId: d34f6619d76667c038bd2e8f2ab5c00dc45c5cab > > > Keys to Verify the Release Candidate: https://dist.apache.org/repos/dist/dev/incubator/servicecomb/KEYS > > For building the binary from the source you can refer to https://github.com/apache/incubator-servicecomb-service-center/tree/master/scripts/release > > > Voting will start now (Firday, 9th Feburary, 2018) and will remain open for next 72 hours, Request all PPMC members to give their vote.> > > [ ] +1 Release this package as 1.0.0-m1 [ ] +0 No opinion[ ] -1 Do not release this package because> > > > > With RegardsMohammad Asif Siddiqui> > >
?????? [VOTE] Release Apache ServiceComb Service-Center (incubating)version 1.0.0-m1
-1 there is a major bug in this version, i have raise an ISSUE here. and i will fix it as soon as possible. -- -- ??: "Mahesh Raju Somalaraju"; : 2018??2??12??(??) 2:42 ??: "dev" ; : Re: [VOTE] Release Apache ServiceComb Service-Center (incubating)version 1.0.0-m1 +1 Tested build from source on linux/windows machine and tested user case to be OK On 2018/02/09 03:26:16, Mohammad Asif Siddiqui wrote: > Hi All,> > This is a call for vote to release ServiceComb Service-Center (Incubating) version 1.0.0-m1> > Release Notes: https://github.com/asifdxtreme/incubator-servicecomb-service-center/tree/master/docs/release-notes > > > Release Candidate: https://dist.apache.org/repos/dist/dev/incubator/servicecomb/incubator-servicecomb-service-center/1.0.0-m1/ > > Release Tag: https://github.com/apache/incubator-servicecomb-service-center/releases/tag/1.0.0-m1 > > Release CommitId: d34f6619d76667c038bd2e8f2ab5c00dc45c5cab > > > Keys to Verify the Release Candidate: https://dist.apache.org/repos/dist/dev/incubator/servicecomb/KEYS > > For building the binary from the source you can refer to https://github.com/apache/incubator-servicecomb-service-center/tree/master/scripts/release > > > Voting will start now (Firday, 9th Feburary, 2018) and will remain open for next 72 hours, Request all PPMC members to give their vote.> > > [ ] +1 Release this package as 1.0.0-m1 [ ] +0 No opinion[ ] -1 Do not release this package because> > > > > With RegardsMohammad Asif Siddiqui> > >