bitflicker64 commented on issue #3086:
URL: https://github.com/apache/hugegraph/issues/3086#issuecomment-4923389461

   ## Implementation Plan  
     
   Splitting into 3 PRs ordered by risk. Each PR is independently reviewable 
and mergeable.  
     
   ---  
     
   ### PR A — Remove deprecated config warnings + transition tests  
     
   **Files to change:**  
     
   - 
`hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/StandardHugeGraph.java`
  
     - Delete the `task.scheduler_type` `containsKey` warning block (~lines 
229-234)  
     
   - 
`hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/core/GraphManager.java`
  
     - In `initNodeRole()`: remove the `enableRoleElection` local variable and 
the `if (enableRoleElection)` warning block; keep only the `SERVER_ROLE` read 
and `initNodeRole()` call  
     
   - 
`hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/config/ServerOptions.java`
  
     - Delete the `ENABLE_SERVER_ROLE_ELECTION` config key declaration  
     
   - `hugegraph-server/hugegraph-test/.../core/MultiGraphsTest.java`  
     - Delete `testOpenGraphWithDeprecatedTaskSchedulerType`  
     
   - 
`hugegraph-server/hugegraph-test/.../unit/core/TaskSchedulerServerInfoTest.java`
  
     - Delete `testGraphManagerWarnsOnRoleElection`  
     
   No interface changes. Compile + existing tests should pass as-is.  
     
   ---  
     
   ### PR B — Remove role election infrastructure  
     
   **Files to change:**  
     
   - `StandardHugeGraph.java`  
     - In `serverStarted()`: remove the 
`this.initRoleStateMachine(nodeInfo.nodeId())` call (keep `initServerInfo`)  
     - Delete the entire `initRoleStateMachine(Id serverId)` private method  
     - Delete the `roleElectionStateMachine` field declaration  
     - Delete the `roleElectionStateMachine()` public method  
     
   - `HugeGraph.java` (interface)  
     - Remove the `roleElectionStateMachine()` method declaration  
     
   - `HugeGraphAuthProxy.java`  
     - Remove the `roleElectionStateMachine()` override and its delegate call  
     
   - `GraphManager.java`  
     - Delete `initRoleStateMachine()` method entirely (never called)  
     - Delete `supportRoleElection()` method entirely (never called)  
     - In `serverStarted()`: delete the dead `if 
(!this.globalNodeRoleInfo.nodeRole().computer() && ...)` block  
     
   - `TaskManager.java`  
     - Delete `onAsRoleMaster()` and `onAsRoleWorker()` no-op methods  
     - Delete `schedulerExecutor` field and `TASK_SCHEDULER` constant  
     - Delete `schedulerExecutor` allocation in constructor  
     - Delete `closeSchedulerTx()` private method  
     - Remove `closeSchedulerTx(graph)` call inside `closeScheduler()`  
     - Delete `schedulerExecutor` shutdown block in `shutdown()`  
     
   - `StandardRoleListener.java` — **delete entire file**  
     
   - `RoleElectionOptions.java` — remove all config key declarations (or delete 
the class if nothing else references it; grep first)  
     
   **Verify:** `HugeGraph` interface has multiple implementations — make sure 
all of them compile after removing `roleElectionStateMachine()`.  
     
   ---  
     
   ### PR C — Slim `ServerInfoManager`, delete `HugeServerInfo`, drop 
`serverInfoDbExecutor`  
     
   **Important constraint:** `ServerInfoManager` is NOT deleted. 
`DistributedTaskScheduler` still uses `selfNodeId()` and `selfIsMaster()`. The 
`serverManager()` method on the `TaskScheduler` interface stays.  
     
   **Files to change:**  
     
   - `ServerInfoManager.java`  
     - Remove `dbExecutor` field  
     - Remove `dbExecutor` parameter from constructor (and its `E.checkNotNull` 
guard)  
     - Delete `init()` method  
     - Delete `heartbeat()` method  
     - Delete `tx()` private method  
     - Delete `call()` private method  
     - Remove dead imports (`Callable`, `ExecutorService`, `GraphTransaction`, 
`HugeException`)  
     - `close()` stays but simplify to just `this.closed = true`  
     
   - `StandardTaskScheduler.java`  
     - Remove `serverInfoDbExecutor` parameter from constructor  
     - Change `new ServerInfoManager(graph, serverInfoDbExecutor)` → `new 
ServerInfoManager(graph)`  
     - If `synchronized (this.serverManager)` is used as a monitor in `tx()`, 
replace with `synchronized (this)` or a dedicated lock field  
     
   - `TaskAndResultScheduler.java`  
     - Remove `serverInfoDbExecutor` parameter from constructor  
     - Change `new ServerInfoManager(graph, serverInfoDbExecutor)` → `new 
ServerInfoManager(graph)`  
     
   - `DistributedTaskScheduler.java`  
     - Remove `serverInfoDbExecutor` parameter from constructor  
     - Update `super(graph, serverInfoDbExecutor)` → `super(graph)`  
     
   - `TaskManager.java`  
     - Delete `serverInfoDbExecutor` field and `SERVER_INFO_DB_WORKER` constant 
 
     - Delete `serverInfoDbExecutor` allocation in constructor  
     - Remove `serverInfoDbExecutor` argument from both `addScheduler()` 
constructor calls  
     - Delete `serverInfoDbExecutor` shutdown block in `shutdown()`  
     
   - `HugeVertex.java`  
     - Audit for `HugeServerInfo` references (2 matches) — likely a 
`fromVertex` dispatch case; remove it  
     
   - `StandardHugeGraph.java`  
     - Audit for `initSchemaIfNeeded()` call on `HugeServerInfo.Schema` in 
`initSystemInfo()` — remove it  
     
   - `HugeServerInfo.java` — **delete entire file** (after removing all call 
sites above)  
     
   - `ServerInfoManagerTest.java`  
     - Delete `testInitDoesNotAccessBackendStore` (method no longer exists)  
     - Update constructor calls: remove the `executor` argument everywhere  
     
   - `TaskSchedulerServerInfoTest.java`  
     - Remove `serverInfoDbExecutor` local variable, its `shutdownNow()` call, 
and the constructor argument from the remaining tests  
     
   - `TaskAndResultSchedulerTest.java`  
     - Same: remove `serverInfoDbExecutor` from all constructor calls (~10 
occurrences)  
     
   ---  
     
   ### Checklist before each PR merges  
   - [ ] `mvn compile` passes  
   - [ ] `mvn test -pl hugegraph-server/hugegraph-test` passes  
   - [ ] No remaining references to deleted classes/methods (grep for 
`HugeServerInfo`, `roleElectionStateMachine`, `schedulerExecutor`, 
`serverInfoDbExecutor` as appropriate)
   
   
   
   


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