Skip to content

Commit

Permalink
[CELEBORN-1065] Prevent the local variable 'time' declared in one 'sw…
Browse files Browse the repository at this point in the history
…itch' branch and used in another

### What changes were proposed in this pull request?
- Minor code improvement in `MetaHandler`
  - Local variable 'time' declared in one 'switch' branch `AppHeartbeat` and used in another branch `WorkerHeartbeat`

### Why are the changes needed?

- Incorrect code pattern.

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

CI tests.

Closes apache#2012 from bowenliang123/time.

Authored-by: liangbowen <[email protected]>
Signed-off-by: zky.zhoukeyong <[email protected]>
  • Loading branch information
bowenliang123 authored and waitinfuture committed Oct 22, 2023
1 parent 86db266 commit 789dd35
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ public ResourceResponse handleWriteRequest(ResourceProtos.ResourceRequest reques
replicatePort,
diskInfos,
userResourceConsumption);
time = request.getWorkerHeartbeatRequest().getTime();
metaSystem.updateWorkerHeartbeatMeta(
host,
rpcPort,
Expand All @@ -183,7 +182,7 @@ public ResourceResponse handleWriteRequest(ResourceProtos.ResourceRequest reques
diskInfos,
userResourceConsumption,
estimatedAppDiskUsage,
time,
request.getWorkerHeartbeatRequest().getTime(),
highWorkload);
break;

Expand Down

0 comments on commit 789dd35

Please sign in to comment.