Skip to content

Commit

Permalink
Add getJobId API for ActorId (ray-project#23770)
Browse files Browse the repository at this point in the history
  • Loading branch information
jovany-wang authored Apr 8, 2022
1 parent 4aa854a commit e0ea756
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions java/api/src/main/java/io/ray/api/id/ActorId.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,10 @@ public static ActorId fromRandom() {
public int size() {
return LENGTH;
}

public JobId getJobId() {
byte[] actorBytes = getBytes();
ByteBuffer bf = ByteBuffer.wrap(actorBytes, UNIQUE_BYTES_LENGTH, JobId.LENGTH);
return JobId.fromByteBuffer(bf);
}
}

0 comments on commit e0ea756

Please sign in to comment.