-
Notifications
You must be signed in to change notification settings - Fork 527
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
feat(pd): integrate pd-core
into hugegraph
#2478
Conversation
…to hugegraph (#2460) subtask of #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 --------- Co-authored-by: imbajin <[email protected]>
hugegraph-pd/hg-pd-core/src/main/java/org/apache/hugegraph/pd/raft/ZipUtils.java
Fixed
Show fixed
Hide fixed
hugegraph-pd/hg-pd-core/src/main/java/org/apache/hugegraph/pd/config/PDConfig.java
Dismissed
Show resolved
Hide resolved
@imbajin Do we need to address the Code scanning issues in this PR? |
miss the context, any details? |
https://github.com/apache/incubator-hugegraph/pull/2478/checks?check_run_id=22664435037 |
|
||
@Override | ||
public void close() { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing close
|
||
import com.google.protobuf.Parser; | ||
|
||
public abstract class MetadataStoreBase { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prefer interface MetadataStore
* 分区信息管理 | ||
*/ | ||
@Slf4j | ||
public class PartitionMeta extends MetadataRocksDBStore { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we let PartitionMeta hold a MetadataRocksDBStore instead?
|
||
public class QueueStore extends MetadataRocksDBStore { | ||
|
||
QueueStore(PDConfig pdConfig) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we keep public/protected mark explicitly
import org.apache.hugegraph.pd.raft.RaftEngine; | ||
import org.apache.hugegraph.pd.store.RaftKVStore; | ||
|
||
public class QueueStore extends MetadataRocksDBStore { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we keep a consistent naming style: QueueMetaStore or QueueMeta
|
||
@Slf4j | ||
@Service | ||
public class LogService { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we clarify XxLogService
|
||
import org.apache.hugegraph.pd.grpc.Metapb; | ||
|
||
public interface StoreStatusListener { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does the Store mean StoreNode? if yes we can keep StoreNodeStatusListener.
* 4、监测Partition是否需要分裂,监测分裂是否完成 | ||
*/ | ||
@Slf4j | ||
public class TaskScheduleService { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems it's not a service, prefer to keep TaskScheduler name, and also move to a package
like pd.task
|
||
import org.apache.hugegraph.pd.grpc.Metapb; | ||
|
||
public interface ShardGroupStatusListener { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we move all the Listener files to package pd.listener, and move all the Service files to package pd.service
}); | ||
return movedPartitions; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useless blank line
One more suggestion, we can split the files under the pd client into multiple directories according to functions, and provide Clients.java for navigation(like |
The code-style related issues(name/comment/format/clean) may list first(although we already cleaned a lot of them..), the style problems are better to be modified together after reaching TODOs to avoid more inconsistencies under version merge. |
merge directly into the master branch after #2498... |
pd-core
into hugegraphpd-core
into hugegraph
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2478 +/- ##
============================================
- Coverage 65.64% 57.13% -8.52%
Complexity 827 827
============================================
Files 518 605 +87
Lines 42987 49334 +6347
Branches 5976 6639 +663
============================================
- Hits 28218 28186 -32
- Misses 11957 18333 +6376
- Partials 2812 2815 +3 ☔ View full report in Codecov by Sentry. |
@imbajin All Code scanning warning have been fixed except for this one: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
THX ❤️~
subtask of #2265
The corresponding tests will be merged after
pd-service
For detailed module analysis documentation, please refer to this link.