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

Feat: cluster and extension #185

Merged
merged 70 commits into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
2192217
feat(dubbo): add unix feature
yang20150702 Dec 7, 2022
ea06ca1
Rft: replace feature with target_os cfg
yang20150702 Dec 8, 2022
f172c25
Merge branch 'apache:main' into main
yang20150702 Dec 8, 2022
d40ea72
Merge branch 'apache:main' into main
yang20150702 Dec 9, 2022
5f5b31f
Rft(dubbo): add ClientBuilder for client
yang20150702 Dec 9, 2022
176cb57
Rftï(dubbo-build): add build api for client
yang20150702 Dec 9, 2022
b4db021
style(examples): cargo fmt
yang20150702 Dec 9, 2022
e9e0a67
Rft: move connection from client to transport mod
yang20150702 Dec 20, 2022
e67e59e
Rft(dubbo): add default timeout for client
yang20150702 Dec 26, 2022
7ab187f
Merge branch 'apache:main' into main
yang20150702 Dec 26, 2022
6e8c95e
Merge branch 'apache:main' into main
yang20150702 Dec 27, 2022
e066505
Ftr: add serverBuilder for Server, support multiple ways to start server
yang20150702 Dec 27, 2022
bd4be4e
Rft(examples): update yaml
yang20150702 Dec 27, 2022
80f3502
refactor(dubbo): update invoker trait
yang20150702 Jan 16, 2023
1022b8e
Merge branch 'main' into main
yang20150702 Jan 20, 2023
f403481
Merge branch 'apache:main' into main
yang20150702 Jan 28, 2023
fb6d30c
Merge branch 'apache:main' into main
yang20150702 Feb 9, 2023
00a90ff
Merge branch 'apache:main' into main
yang20150702 Feb 15, 2023
25903fa
Merge branch 'apache:main' into main
yang20150702 Feb 16, 2023
a03b0b5
Merge branch 'apache:main' into main
yang20150702 Feb 20, 2023
41d2ddd
Merge branch 'apache:main' into main
yang20150702 Apr 11, 2023
cfd1652
Merge branch 'apache:main' into main
yang20150702 May 10, 2023
0fcb29f
refactor(cluster): add Cluster MockImpl
yang20150702 May 11, 2023
2cd76b6
refactor(triple): use ClientBuilder to init Cluster ability
yang20150702 May 11, 2023
3cba7dc
Update builder.rs
yang20150702 May 16, 2023
1e7285e
Update triple.rs
yang20150702 May 16, 2023
2c567a7
Update mod.rs
yang20150702 May 16, 2023
695a880
refactor(triple): rm unused var in clientBuilder
yang20150702 May 16, 2023
e9a9935
refactor(dubbo): delete some codes
yang20150702 May 16, 2023
1c79aee
refactor(cluster): rm some duplicate codes
yang20150702 May 18, 2023
06cb969
refactor(registry): rm unused import
yang20150702 May 18, 2023
18a6140
refactor(triple): use two build func for different usage
yang20150702 May 18, 2023
86de421
Merge branch 'main' into feat/cluster
yang20150702 May 18, 2023
7dbe5f3
style: cargo fmt --all
yang20150702 May 18, 2023
58c6f7d
refactor(cluster): rm registryWrapper
yang20150702 May 19, 2023
157b6c4
refactor(cluster): delete print
yang20150702 May 19, 2023
aa554fe
chore(dubbo): upgrade hyper version in cargo.toml
yang20150702 May 20, 2023
254fe59
refactor(cluster): comment the logic of clone body
yang20150702 May 22, 2023
b24e730
Rft(triple): remove Clone of Invoker
yang20150702 Jul 29, 2023
6999bbb
Rft(cluster): use ready_cache to manage Invokers, add ready_cache in …
yang20150702 Jul 29, 2023
0a5ee22
Rft(protocol): use interface Inheritance to redesign Invoker
yang20150702 Jul 29, 2023
ebfe5c1
Merge branch 'apache:main' into main
yang20150702 Jul 29, 2023
29f83c4
Merge branch 'main' into feat/cluster
yang20150702 Jul 29, 2023
b2e829c
Feat(cluster): Cluster Policy Impl (#146)
yang20150702 Aug 1, 2023
4eff1ad
Merge branch 'apache:feat/cluster' into feat/cluster
yang20150702 Aug 16, 2023
df0e0e5
chore(github): rm workflow_dispatch in workflow (#149)
yang20150702 Aug 16, 2023
c07b96d
feat: Add Router Module(#144) (#153)
AdachiAndShimamura Sep 1, 2023
556d8b7
Ftr: failover cluster (#156)
onewe Sep 16, 2023
4eafa33
Ftr: add ServiceNameDirectory (#157)
onewe Sep 19, 2023
4052281
Merge branch 'apache:main' into main
yang20150702 Sep 19, 2023
a957c54
Feat/cluster Optimized the Router module (#160)
AdachiAndShimamura Oct 7, 2023
29dc290
Refactor: refactor Cluster component (#165)
onewe Nov 17, 2023
a0c7516
Tst: local test passed (#166)
onewe Nov 23, 2023
e7f2791
style(dubbo): cargo fmt --all
yang20150702 Nov 23, 2023
74f915e
style(dubbo): cargo fix --lib -p dubbo --allow-dirty
yang20150702 Dec 7, 2023
637c7f2
chore(github): update branch in pr
yang20150702 Dec 8, 2023
9b93de5
Mod: format code and fix some warnings (#167)
yang20150702 Dec 10, 2023
b90dff8
Merge remote-tracking branch 'origin/refact/cluster' into refact/cluster
yang20150702 Dec 10, 2023
ab18d57
Rft: adapt nacos registry and zookeeper registry (#169)
onewe Dec 28, 2023
8b8d71b
Merge branch 'refact/cluster' of https://github.com/apache/dubbo-rust…
yang20150702 Dec 28, 2023
7ee9e73
Ftr: add extension module (#181)
onewe Mar 15, 2024
2a7a453
Merge branch 'apache:main' into main
yang20150702 Mar 15, 2024
c8cf3a1
Fix: get stuck when load extension in the concurrency environment (#184)
onewe Mar 20, 2024
c6fc7bd
Merge branch 'refact/cluster' of https://github.com/apache/dubbo-rust…
yang20150702 Mar 21, 2024
17faec8
Merge branch 'refact/cluster'
yang20150702 Mar 21, 2024
110c7df
refeat(extensions): add sync for Registry trait
yang20150702 Mar 21, 2024
6a2091a
chore: cargo fmt
yang20150702 Mar 22, 2024
8984192
chore: cargo fmt
yang20150702 Mar 22, 2024
db28e46
chore: cargo fmt
yang20150702 Mar 22, 2024
bd2a0b1
chore: cargo fmt
yang20150702 Mar 22, 2024
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
12 changes: 10 additions & 2 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ on:
push:
branches: ["*"]
pull_request:
branches: ["*"]
branches:
- '*'
- 'refact/*'

workflow_dispatch:

jobs:
check:
Expand Down Expand Up @@ -59,6 +60,13 @@ jobs:
- 2181:2181
env:
ZOO_MY_ID: 1
nacos:
image: nacos/nacos-server:v2.3.1
ports:
- 8848:8848
- 9848:9848
env:
MODE: standalone
steps:
- uses: actions/checkout@main
- uses: actions-rs/toolchain@v1
Expand Down
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[workspace]
resolver = "2"
members = [
"common/logger",
"common/utils",
Expand Down Expand Up @@ -59,5 +60,7 @@ itertools = "0.10.1"
bytes = "1.0"
prost-serde = "0.3.0"
prost-serde-derive = "0.1.2"
url = "2.5.0"



7 changes: 6 additions & 1 deletion application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,9 @@ dubbo:
references:
GreeterClientImpl:
url: tri://localhost:20000
protocol: tri
protocol: tri
routers:
consumer:
- service: "org.apache.dubbo.sample.tri.Greeter"
url: tri://127.0.0.1:20000
protocol: triple
5 changes: 2 additions & 3 deletions common/base/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
urlencoding.workspace = true
http = "0.2"
dubbo-logger.workspace = true
dubbo-logger.workspace = true
url.workspace = true
85 changes: 85 additions & 0 deletions common/base/src/extension_param.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
/*
* 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.
*/
use crate::{url::UrlParam, StdError};
use std::{borrow::Cow, convert::Infallible, str::FromStr};

pub struct ExtensionName(String);

impl ExtensionName {
pub fn new(name: String) -> Self {
ExtensionName(name)
}
}

impl UrlParam for ExtensionName {
type TargetType = String;

fn name() -> &'static str {
"extension-name"
}

fn value(&self) -> Self::TargetType {
self.0.clone()
}

fn as_str(&self) -> Cow<str> {
self.0.as_str().into()
}
}

impl FromStr for ExtensionName {
type Err = StdError;

fn from_str(s: &str) -> Result<Self, Self::Err> {
Ok(ExtensionName::new(s.to_string()))
}
}

pub enum ExtensionType {
Registry,
}

impl UrlParam for ExtensionType {
type TargetType = String;

fn name() -> &'static str {
"extension-type"
}

fn value(&self) -> Self::TargetType {
match self {
ExtensionType::Registry => "registry".to_owned(),
}
}

fn as_str(&self) -> Cow<str> {
match self {
ExtensionType::Registry => Cow::Borrowed("registry"),
}
}
}

impl FromStr for ExtensionType {
type Err = Infallible;

fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"registry" => Ok(ExtensionType::Registry),
_ => panic!("the extension type enum is not in range"),
}
}
}
4 changes: 4 additions & 0 deletions common/base/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@
allow(dead_code, unused_imports, unused_variables, unused_mut)
)]
pub mod constants;
pub mod extension_param;
pub mod node;
pub mod registry_param;
pub mod url;

pub use node::Node;
pub use url::Url;

pub type StdError = Box<dyn std::error::Error + Send + Sync + 'static>;
Loading
Loading