apache / apache/iotdb

[Cluster-refactor] About refine classes name

オープン
#3,881 コメント 6 件 リアクション 2 件 担当者 0 名 GitHub で見る
主要言語
Java
スター
6.4k
フォーク
1.2k
平均マージ
1日 23時間
マージ済み PR(30日)
115

説明

> 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.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず `cluster-` dev ブランチの cluster モジュールを確認し、Transport および RPC インターフェース層のクラスをマッピングします。Transport クラスで `***SubServer` を使用すべきか、RPC 実装で `***Service` または `***RPCHandler` を使用すべきかを解決します。完了とは、命名方針が合意され、リファクタリング全体で一貫して適用されていることを意味します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
distributed-systems
issue の種類
リファクタリング
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
20/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。