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

WIP: refactor(cluster): refactor cluster package #1506

Closed
wants to merge 5 commits into from

Conversation

justxuewei
Copy link
Member

@justxuewei justxuewei commented Oct 7, 2021

What this PR does:

The new directory structure is shown at below.

├── cluster              // abstract cluster
│   ├── cluster          // cluster interface & implementation
│   │   ├── available    // available cluster implementation
│   │   │   ├── ...
│   │   ├── base         // base cluster implementation
│   │   │   ├── ...
│   │   ├── broadcast    // broadcast cluster implementation
│   │   │   ├── ...
│   │   ├── failback     // failback cluster implementation
│   │   │   ├── ...
│   │   ├── failfast     // failfast cluster implementation
│   │   │   ├── ...
│   │   ├── failover     // failover cluster implementation
│   │   │   ├── ...
│   │   ├── failsafe     // failsafe cluster implementation
│   │   │   ├── ...
│   │   ├── forking      // forking cluster implementation
│   │   │   ├── ...
│   │   └── zoneaware    // zoneaware cluster implementation
│   │       ├── ...
│   ├── cluster_impl     // compatible with legacy imports, will be REMOVED in the future
│   │   └── import.go
│   ├── directory        // directory interface & implementation
│   │   ├── base
│   │   │   ├── ...
│   │   └── static
│   │       ├── ...
│   ├── loadbalance      // load balance interface & implementation
│   │   ├── consistenthashing   // consistenthashing load balance implementation
│   │   │   ├── ...
│   │   ├── leastactive  // leastactive load balance implementation
│   │   │   ├── ...
│   │   ├── random       // random load balance implementation
│   │   │   ├── ...
│   │   ├── roundrobin   // roundrobin load balance implementation
│   │   │   ├── ...
│   └── router           // NOT modified in this PR
│       ├── ...

PS: This refactor will be transparent for Dubbo-Go users.

Which issue(s) this PR fixes:

Fixes #1503

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Please note that importing "_ dubbo.apache.org/dubbo-go/v3/cluster/loadbalance" for loadbalance initialization couldn't work anymore.

Users must import used loadbalances respectively, or import `_ dubbo.apache.org/dubbo-go/v3/imports`(highly recommended way) instead.

Here are an example of importing all of loadbalances respectively:
import (
    _ "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance/consistenthashing"
    _ "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance/leastactive"
    _ "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance/random"
    _ "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance/roundrobin"
)

@justxuewei justxuewei changed the base branch from master to 3.0 October 9, 2021 05:40
@justxuewei justxuewei closed this Oct 9, 2021
@justxuewei justxuewei deleted the refactor/cluster branch October 9, 2021 07:32
@justxuewei justxuewei restored the refactor/cluster branch October 9, 2021 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor: Cluster package
2 participants