mirror of
https://github.com/vale981/ray
synced 2025-03-06 02:21:39 -05:00
[GCS] fix gcs table get all nodes npe (#9927)
This commit is contained in:
parent
538ad04e96
commit
9b5b16ef11
1 changed files with 6 additions and 13 deletions
|
@ -68,19 +68,12 @@ public class GcsClient {
|
|||
final UniqueId nodeId = UniqueId
|
||||
.fromByteBuffer(data.getNodeId().asReadOnlyByteBuffer());
|
||||
|
||||
if (data.getState() == GcsNodeInfo.GcsNodeState.ALIVE) {
|
||||
//Code path of node insertion.
|
||||
// NOTE(lingxuan.zlx): we assume no duplicated node id in fetched node list
|
||||
// and it's only one final state for each node in recorded table.
|
||||
NodeInfo nodeInfo = new NodeInfo(
|
||||
nodeId, data.getNodeManagerAddress(),
|
||||
data.getNodeManagerHostname(),
|
||||
true, new HashMap<>());
|
||||
nodeId, data.getNodeManagerAddress(), data.getNodeManagerHostname(),
|
||||
data.getState() == GcsNodeInfo.GcsNodeState.ALIVE, new HashMap<>());
|
||||
nodes.put(nodeId, nodeInfo);
|
||||
} else {
|
||||
// Code path of node deletion.
|
||||
NodeInfo nodeInfo = new NodeInfo(nodeId, nodes.get(nodeId).nodeAddress,
|
||||
nodes.get(nodeId).nodeHostname, false, new HashMap<>());
|
||||
nodes.put(nodeId, nodeInfo);
|
||||
}
|
||||
}
|
||||
|
||||
// Fill resources.
|
||||
|
|
Loading…
Add table
Reference in a new issue