byteayan opened a new pull request, #3380:
URL: https://github.com/apache/hugegraph/pull/3380

   ## Purpose of the PR
   
   - close #2655
   
   `RaftEngine` is a singleton reached through `RaftEngine.getInstance()`, but 
its constructor is public, so code can create a second engine that never joins 
the raft group.
   
   
   ## Main Changes
   
   - `RaftEngine()` is now `private`.
   - `RaftEngineReadinessTest` and `RaftKVStoreTest` built private engines with 
`new RaftEngine()`; they now use the same reflective `newEngine()` helper 
`PDNativeOwnerTest` already uses. Their behaviour is unchanged.
   
   Nothing else constructs `RaftEngine`: production code and other tests use 
`getInstance()` or `mock(RaftEngine.class)` (Mockito creates mocks without 
calling the constructor). Store only depends on `RaftReflectionUtil` from 
hg-pd-core.
   
   ## Verifying these changes
   
   - [ ] Trivial rework / code cleanup without any test coverage. (No Need)
   - [x] Already covered by existing tests, such as `RaftEngineReadinessTest`, 
`RaftKVStoreTest`, `PDNativeOwnerTest`.
   - [ ] Need tests and can be verified as follows:
   
   Ran locally: `mvn test -pl hugegraph-pd/hg-pd-test -am -P pd-core-test` (190 
tests, 0 failures, 2 skipped) and `mvn editorconfig:check` on hg-pd-core and 
hg-pd-test.
   
   ## Does this PR potentially affect the following parts?
   
   - [ ]  Dependencies
   - [ ]  Modify configurations
   - [ ]  The public API
   - [ ]  Other affects (typed here)
   - [x]  Nope
   
   ## Documentation Status
   
   - [ ] `Doc - TODO`: required documentation is pending; complete it before 
merging.
   - [ ] `Doc - Done`: documentation is included here or linked below.
   - [x] `Doc - No Need`: no user-visible documentation is affected.
   
   Documentation files in this PR or paired hugegraph-doc PR:
   
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to