apache / apache/iotdb

[Cluster-refactor] About refine classes name

Ouverte
#3,881 6 commentaires 2 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Java
Étoiles
6.4k
Forks
1.2k
Merge moyen
1 j 23 h
PR mergées (30 j)
115

Description

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

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par examiner le module cluster sur la branche de développement `cluster-` et par cartographier les classes des couches d’interface Transport et RPC. Déterminez si les classes de transport doivent utiliser `***SubServer` et si les implémentations RPC doivent utiliser `***Service` ou `***RPCHandler` ; le travail est terminé lorsque la nomenclature est convenue et appliquée de manière cohérente dans tout le refactoring.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
java
Domaine
distributed-systems
Type d'issue
Refactorisation
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
20/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.