apache / apache/iotdb

[Cluster-refactor] About refine classes name

Đang mở
#3,881 6 bình luận 2 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Java
Star
6.4k
Fork
1.2k
Merge trung bình
1 ngày 23 giờ
Pull request đã merge (30 ngày)
115

Mô tả

> Background: we're working together with @jixuan1989 to refactor cluster module. The dev branch is `cluster-`

## Why

When I first looked at the codes of IoTDB, I lost in the kinds of `***Services`, I want to make it clear to let more dev can hand on codes a bit easier by the opportunity.

After reviewing the code, I think the request process flow could be divided into 3 layers as show in the image. The structure is clear but not classes name. So, I think we can refine the class names in **Transport layer** and **RPC interface layer** to make codes clearer.

![IoTDB-cluster-structure-layer](https://user-images.githubusercontent.com/6150814/131610155-c3ced2b0-c61e-4688-8c10-a9bb8db1fa1c.png)

## Suggestions

I don't align the suggestion changes with the class names in the server module because I don't think sever module is clear enough according to my understanding. And let's go through these layers.

### Cluster Instance
`ClusterIoTDB` is the server instance which control the sub servers lifecycle.

### Transport Layer
I call this layer as transport layer because the instances in the layer take charge of setup port listening, setup TCP work threads, establish connection, hand over requests... via thrift APIs.

Right now the class in this layer are called `***Service` which I don't think is clear. An idea is rename the classes as `***SubServer`.

### RPC interface Layer

The classes in this layer are the implementation of thrift RPC interfaces which handle the RPC call from thrift client.

Right now the class in this layer are called `***Service`. If we can change the classes name in the `transport port` layer, I think `***Service` here is acceptable. A suggestion is `***RPCHandler` which is better than `***Service` in current implementation IMO. `***Service` could be used to hide the concrete RPC framework like thrift but right now we don't have that layer.

### Executor Layer

The classes in the layer encapsulate the concrete execution logic. Won' analysis here.

Finally, welcome join the discussion and every idea is import for us.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu bằng cách xem xét module cluster trên dev branch `cluster-` và lập sơ đồ các lớp trong các tầng giao diện Transport và RPC. Xác định liệu các lớp transport nên sử dụng `***SubServer` và các triển khai RPC nên sử dụng `***Service` hay `***RPCHandler`; công việc được xem là hoàn tất khi cách đặt tên đã được thống nhất và áp dụng nhất quán trong toàn bộ quá trình refactor.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
java
Lĩnh vực
distributed-systems
Loại issue
Tái cấu trúc
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
20/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.