apache / incubator-hugegraph

A graph database that supports more than 100+ billion data, high performance and scalability (Include OLTP Engine & REST-API & Backends)
https://hugegraph.apache.org
Apache License 2.0
2.58k stars 512 forks source link

chore(pd-store-dev): integrate `pd-grpc`, `pd-common`, `pd-client` into hugegraph #2460

Closed VGalaxies closed 4 months ago

VGalaxies commented 4 months ago

subtask of https://github.com/apache/incubator-hugegraph/issues/2265


During the code review, I found the following issues:

  1. Similar functionality appears multiple times, such as stub connection-related code, with redundancy between PDClient.StubProxy and AbstractClientStubProxy.
  2. Package partitioning:
    1. PDPulse, PDPulseImpl should in pulse
    2. PDWatch, PDWatchImpl should in watch
  3. Unused code, see below

For the pd-client submodule, its structure is as follows:

.
├── client
│  ├── AbstractClient.java // Encapsulation of RPC calls and error handling
│  ├── AbstractClientStubProxy.java // Management of multiple host stubs
│  ├── Channels.java // Maintenance of host -> ManagedChannel
│  ├── ClientCache.java // Cache for store, partition, shard group, graph
│  ├── Discoverable.java // unused
│  ├── DiscoveryClient.java // unused
│  ├── DiscoveryClientImpl.java // unused
│  ├── KvClient.java // Encapsulation of kv.proto RPC calls, inherits from AbstractClient
│  ├── LicenseClient.java // unused
│  ├── PDClient.java // Encapsulation of pdpb.proto RPC calls, encapsulates PDWatch
│  ├── PDConfig.java // Configuration of PD RPC port
│  ├── PDPulse.java // pd_pulse.proto, Partition heartbeat, Bidirectional communication interface of pd-client and pd-server
│  ├── PDPulseImpl.java
│  ├── PDWatch.java // pd_watch.proto, Listen for changes in store, partition, shard group, graph
│  └── PDWatchImpl.java
├── pulse
│  ├── PartitionNotice.java
│  └── PulseServerNotice.java
└── watch
   ├── NodeEvent.java // Store node event
   ├── PartitionEvent.java // Partition event
   ├── PDWatcher.java // unused
   └── WatchType.java // unused

TODO:

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 0% with 339 lines in your changes are missing coverage. Please review.

Project coverage is 63.23%. Comparing base (47a68f0) to head (19a7184).

Files Patch % Lines
...org/apache/hugegraph/pd/common/PartitionCache.java 0.00% 218 Missing :warning:
.../java/org/apache/hugegraph/pd/common/HgAssert.java 0.00% 44 Missing :warning:
...in/java/org/apache/hugegraph/pd/common/KVPair.java 0.00% 20 Missing :warning:
...ava/org/apache/hugegraph/pd/common/GraphCache.java 0.00% 16 Missing :warning:
...apache/hugegraph/pd/common/PDRuntimeException.java 0.00% 14 Missing :warning:
...org/apache/hugegraph/pd/common/PartitionUtils.java 0.00% 14 Missing :warning:
...va/org/apache/hugegraph/pd/common/PDException.java 0.00% 13 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## pd-store-dev #2460 +/- ## ================================================== - Coverage 63.80% 63.23% -0.57% + Complexity 829 827 -2 ================================================== Files 511 518 +7 Lines 42622 42959 +337 Branches 5947 5981 +34 ================================================== - Hits 27193 27164 -29 - Misses 12679 13040 +361 - Partials 2750 2755 +5 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.