Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rft: network & codec #673

Merged
merged 68 commits into from
Sep 19, 2020
Merged
Show file tree
Hide file tree
Changes from 63 commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
1eb4a83
getty refactor
cvictory Apr 24, 2020
fa61e9d
refactor getty
cvictory Apr 26, 2020
0ba15c8
refactor getty
cvictory May 8, 2020
9bc37f3
Merge branch 'master' of github.com:apache/dubbo-go into getty_reactor
cvictory May 8, 2020
c67d34a
fix review issue
cvictory May 8, 2020
acc7c79
fix review issue
cvictory May 8, 2020
d48fd1e
remove unused code, add license
cvictory May 9, 2020
58e7e86
fix review issue: add comment and some optimization
cvictory May 14, 2020
adb55ce
split import sentense, fix some review
cvictory May 18, 2020
1bbe0b4
modify log
cvictory May 18, 2020
dc2b68f
fix run issue
cvictory May 19, 2020
fe3c5b0
fix issue: create gettyClientConn every time
cvictory May 19, 2020
1e07952
fix : url.getPath contains slash, but it don't in dubbo-java
cvictory May 19, 2020
c6abc0d
unit test
cvictory May 20, 2020
15608af
fix review issue
cvictory May 27, 2020
cbac0c9
remove unused code
cvictory May 27, 2020
7f9c7a4
reactor import
cvictory May 28, 2020
7c30fdc
fix review issue
cvictory May 29, 2020
dd36c9c
fix review issue
cvictory May 31, 2020
713fcf9
fix review issue
cvictory Jun 2, 2020
a08d2c7
fix review issue
cvictory Jun 2, 2020
5ba2307
refactor ServiceKey func
cvictory Jun 2, 2020
a10ff4d
Merge pull request #495 from cvictory/getty_reactor
hxmhlt Jun 4, 2020
3d308e4
fix: path is not in param
cvictory Jun 10, 2020
38c9c09
fix: path is not in param
cvictory Jun 10, 2020
fff3011
fix: path is not in param
cvictory Jun 16, 2020
1a42f33
Merge pull request #592 from cvictory/getty_reactor
zouyx Jun 22, 2020
6b93bbc
Fix: resolve conflicts
fangyincheng Jun 27, 2020
0e2de75
Merge remote-tracking branch 'apache/develop' into refact-seri
fangyincheng Jun 27, 2020
9b260cf
Fix: merge stash
fangyincheng Jul 25, 2020
14564b9
Mrg: merge develop
fangyincheng Jul 26, 2020
ff4f2f7
Mod: comment ut for protobuf of dubbo
fangyincheng Aug 5, 2020
9a26d03
resolve conflicts
fangyincheng Aug 5, 2020
ee5e94f
Merge remote-tracking branch 'apache/develop' into refact-seri
fangyincheng Aug 8, 2020
6338a82
Fix: fix
fangyincheng Aug 9, 2020
8f032b7
Mrg: from develop
fangyincheng Aug 15, 2020
5050d26
fix: fix TestDubboProtocol_Export test
Aug 16, 2020
f86865d
fix: testDubboProtocol_Export exporterMap after 'Unexport' url key
Aug 16, 2020
eba6a13
fix: fix TestDubboProtocol_Export test
Aug 16, 2020
2d44241
fix: testDubboProtocol_Export exporterMap after 'Unexport' url key
Aug 16, 2020
d2bdc6f
Mrg:merge develop
fangyincheng Aug 30, 2020
ada3eb6
Merge branch 'refact-seri' of github.com:apache/dubbo-go into refact-…
Aug 31, 2020
566a7e3
Mrg: merge from develop
fangyincheng Sep 5, 2020
3ec9e9f
feat: fix protocol, remoting/getty uint test failure
Sep 5, 2020
d58c37f
Merge branch 'refact-seri' of github.com:apache/dubbo-go into refact-…
Sep 5, 2020
f9f1d7a
feat: format import
Sep 5, 2020
2d8d2f0
feat: rest GetBigPkg
Sep 5, 2020
e21eb40
Merge pull request #736 from georgehao/refact-seri
fangyincheng Sep 5, 2020
e719100
Fix:bug
fangyincheng Sep 5, 2020
05f53c5
fix comments
fangyincheng Sep 5, 2020
1477f22
Merge remote-tracking branch 'apache/develop' into refact-seri
fangyincheng Sep 6, 2020
b33f44d
fix comments
fangyincheng Sep 6, 2020
7d114b0
fixed conflicts with develop
fangyincheng Sep 9, 2020
5a3e744
Merge remote-tracking branch 'apache/develop' into refact-seri
fangyincheng Sep 12, 2020
6e8281f
Fix: fixed some comments
fangyincheng Sep 12, 2020
89db192
fix: resove dev RPCResult struct change
Sep 12, 2020
a35e2b2
fix: add injectTraceCtx to getty
Sep 13, 2020
4ccc705
Merge pull request #754 from georgehao/refact-seri
AlexStocks Sep 13, 2020
48d746f
feat: resolve go.mod conflict
Sep 13, 2020
b5b8c0e
Merge pull request #755 from georgehao/refact-seri
fangyincheng Sep 13, 2020
d366705
feat: format DubboCodec
Sep 14, 2020
8279058
feat: add some comment
Sep 14, 2020
5b06802
Merge pull request #756 from georgehao/refact-seri
zouyx Sep 15, 2020
2f48d10
Merge remote-tracking branch 'apache/develop' into refact-seri
fangyincheng Sep 15, 2020
517f54d
feat: delete dubbo_protocol assert remoting.ExchangeClient
Sep 16, 2020
a24034c
feat: merge one line
Sep 17, 2020
0f12ccb
Merge pull request #760 from georgehao/refact-seri
AlexStocks Sep 17, 2020
4f3d4ff
Mrg: fixed conflicts
fangyincheng Sep 19, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ config_center/zookeeper/zookeeper-4unittest/
registry/zookeeper/zookeeper-4unittest/
metadata/report/zookeeper/zookeeper-4unittest/
registry/consul/agent*
metadata/report/consul/agent*
remoting/consul/agent*
config_center/apollo/mockDubbog.properties.json

# vim stuff
Expand Down
1 change: 1 addition & 0 deletions common/constant/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const (
DEFAULT_REST_CLIENT = "resty"
DEFAULT_REST_SERVER = "go-restful"
DEFAULT_PORT = 20000
DEFAULT_SERIALIZATION = HESSIAN2_SERIALIZATION
)

const (
Expand Down
52 changes: 27 additions & 25 deletions common/constant/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,32 @@ const (
)

const (
PORT_KEY = "port"
GROUP_KEY = "group"
VERSION_KEY = "version"
INTERFACE_KEY = "interface"
PATH_KEY = "path"
PROTOCOL_KEY = "protocol"
SERVICE_KEY = "service"
METHODS_KEY = "methods"
TIMEOUT_KEY = "timeout"
CATEGORY_KEY = "category"
CHECK_KEY = "check"
ENABLED_KEY = "enabled"
SIDE_KEY = "side"
OVERRIDE_PROVIDERS_KEY = "providerAddresses"
BEAN_NAME_KEY = "bean.name"
GENERIC_KEY = "generic"
CLASSIFIER_KEY = "classifier"
TOKEN_KEY = "token"
LOCAL_ADDR = "local-addr"
REMOTE_ADDR = "remote-addr"
PATH_SEPARATOR = "/"
DUBBO_KEY = "dubbo"
RELEASE_KEY = "release"
ANYHOST_KEY = "anyhost"
SSL_ENABLED_KEY = "ssl-enabled"
GROUP_KEY = "group"
VERSION_KEY = "version"
INTERFACE_KEY = "interface"
PATH_KEY = "path"
SERVICE_KEY = "service"
METHODS_KEY = "methods"
TIMEOUT_KEY = "timeout"
CATEGORY_KEY = "category"
CHECK_KEY = "check"
ENABLED_KEY = "enabled"
SIDE_KEY = "side"
OVERRIDE_PROVIDERS_KEY = "providerAddresses"
BEAN_NAME_KEY = "bean.name"
GENERIC_KEY = "generic"
CLASSIFIER_KEY = "classifier"
TOKEN_KEY = "token"
LOCAL_ADDR = "local-addr"
REMOTE_ADDR = "remote-addr"
DEFAULT_REMOTING_TIMEOUT = 3000
RELEASE_KEY = "release"
ANYHOST_KEY = "anyhost"
PORT_KEY = "port"
PROTOCOL_KEY = "protocol"
PATH_SEPARATOR = "/"
DUBBO_KEY = "dubbo"
SSL_ENABLED_KEY = "ssl-enabled"
)

const (
Expand Down Expand Up @@ -81,6 +82,7 @@ const (
EXECUTE_REJECTED_EXECUTION_HANDLER_KEY = "execute.limit.rejected.handler"
PROVIDER_SHUTDOWN_FILTER = "pshutdown"
CONSUMER_SHUTDOWN_FILTER = "cshutdown"
SERIALIZATION_KEY = "serialization"
PID_KEY = "pid"
SYNC_REPORT_KEY = "sync.report"
RETRY_PERIOD_KEY = "retry.period"
Expand Down
28 changes: 28 additions & 0 deletions common/constant/serializtion.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* 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 constant

const (
S_Hessian2 byte = 2
S_Proto byte = 21
)

const (
HESSIAN2_SERIALIZATION = "hessian2"
PROTOBUF_SERIALIZATION = "protobuf"
)
11 changes: 7 additions & 4 deletions common/url.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package common

import (
"bytes"
"encoding/base64"
"fmt"
"math"
Expand Down Expand Up @@ -325,20 +326,22 @@ func (c URL) Key() string {

// ServiceKey gets a unique key of a service.
func (c URL) ServiceKey() string {
intf := c.GetParam(constant.INTERFACE_KEY, strings.TrimPrefix(c.Path, "/"))
return ServiceKey(c.GetParam(constant.INTERFACE_KEY, strings.TrimPrefix(c.Path, "/")),
c.GetParam(constant.GROUP_KEY, ""), c.GetParam(constant.VERSION_KEY, ""))
}

func ServiceKey(intf string, group string, version string) string {
if intf == "" {
return ""
}
var buf strings.Builder
group := c.GetParam(constant.GROUP_KEY, "")
buf := &bytes.Buffer{}
fangyincheng marked this conversation as resolved.
Show resolved Hide resolved
if group != "" {
buf.WriteString(group)
buf.WriteString("/")
}

buf.WriteString(intf)

version := c.GetParam(constant.VERSION_KEY, "")
if version != "" && version != "0.0.0" {
buf.WriteString(":")
buf.WriteString(version)
Expand Down
4 changes: 3 additions & 1 deletion config/service_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ type ServiceConfig struct {
Methods []*MethodConfig `yaml:"methods" json:"methods,omitempty" property:"methods"`
Warmup string `yaml:"warmup" json:"warmup,omitempty" property:"warmup"`
Retries string `yaml:"retries" json:"retries,omitempty" property:"retries"`
Serialization string `yaml:"serialization" json:"serialization" property:"serialization"`
Params map[string]string `yaml:"params" json:"params,omitempty" property:"params"`
Token string `yaml:"token" json:"token,omitempty" property:"token"`
AccessLog string `yaml:"accesslog" json:"accesslog,omitempty" property:"accesslog"`
Expand Down Expand Up @@ -270,7 +271,8 @@ func (c *ServiceConfig) getUrlMap() url.Values {
urlMap.Set(constant.ROLE_KEY, strconv.Itoa(common.PROVIDER))
urlMap.Set(constant.RELEASE_KEY, "dubbo-golang-"+constant.Version)
urlMap.Set(constant.SIDE_KEY, (common.RoleType(common.PROVIDER)).Role())

// todo: move
urlMap.Set(constant.SERIALIZATION_KEY, c.Serialization)
// application info
urlMap.Set(constant.APPLICATION_KEY, providerConfig.ApplicationConfig.Name)
urlMap.Set(constant.ORGANIZATION_KEY, providerConfig.ApplicationConfig.Organization)
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ require (
github.com/emicklei/go-restful/v3 v3.0.0
github.com/frankban/quicktest v1.4.1 // indirect
github.com/fsnotify/fsnotify v1.4.7
github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32 // indirect
github.com/go-co-op/gocron v0.1.1
github.com/go-resty/resty/v2 v2.1.0
github.com/golang/mock v1.3.1
Expand Down
Loading