mirror of
https://github.com/wassname/ray.git
synced 2026-07-03 04:20:14 +08:00
Increase TaskID size by 2 bytes, taken from JobID (#6425)
* Increase TaskID size by 2 bytes, taken from JobID * comments * check max job id * fix doc * fix local mode
This commit is contained in:
@@ -360,7 +360,7 @@ ObjectID ObjectID::GenerateObjectId(const std::string &task_id_binary,
|
||||
return ret;
|
||||
}
|
||||
|
||||
JobID JobID::FromInt(uint32_t value) {
|
||||
JobID JobID::FromInt(uint16_t value) {
|
||||
std::vector<uint8_t> data(JobID::Size(), 0);
|
||||
std::memcpy(data.data(), &value, JobID::Size());
|
||||
return JobID::FromBinary(
|
||||
|
||||
+3
-3
@@ -99,9 +99,9 @@ class UniqueID : public BaseID<UniqueID> {
|
||||
|
||||
class JobID : public BaseID<JobID> {
|
||||
public:
|
||||
static constexpr int64_t kLength = 4;
|
||||
static constexpr int64_t kLength = 2;
|
||||
|
||||
static JobID FromInt(uint32_t value);
|
||||
static JobID FromInt(uint16_t value);
|
||||
|
||||
static size_t Size() { return kLength; }
|
||||
|
||||
@@ -161,7 +161,7 @@ class ActorID : public BaseID<ActorID> {
|
||||
|
||||
class TaskID : public BaseID<TaskID> {
|
||||
private:
|
||||
static constexpr size_t kUniqueBytesLength = 6;
|
||||
static constexpr size_t kUniqueBytesLength = 8;
|
||||
|
||||
public:
|
||||
static constexpr size_t kLength = kUniqueBytesLength + ActorID::kLength;
|
||||
|
||||
@@ -5,17 +5,17 @@ Ray ID Specification
|
||||
high bits low bits
|
||||
<--------------------------------------------------------------------------------------------
|
||||
|
||||
4B
|
||||
2B
|
||||
+-----------------+
|
||||
| unique bytes | JobID 4B
|
||||
| unique bytes | JobID 2B
|
||||
+-----------------+
|
||||
|
||||
4B 4B
|
||||
4B 2B
|
||||
+-----------------+-----------------+
|
||||
| unique bytes | JobID | ActorID 8B
|
||||
| unique bytes | JobID | ActorID 6B
|
||||
+-----------------+-----------------+
|
||||
|
||||
6B 8B
|
||||
8B 6B
|
||||
+---------------------------+-----------------------------------+
|
||||
| unique bytes | ActorID | TaskID 14B
|
||||
+---------------------------+-----------------------------------+
|
||||
@@ -26,14 +26,14 @@ Ray ID Specification
|
||||
+---------------------------+---------------------------------------------------------------+
|
||||
|
||||
```
|
||||
#### JobID (4 bytes)
|
||||
`JobID` is generated by `GCS` to ensure uniqueness. Its length is 4 bytes.
|
||||
#### JobID (2 bytes)
|
||||
`JobID` is generated by `GCS` to ensure uniqueness. Its length is 2 bytes.
|
||||
|
||||
#### ActorID (8 bytes)
|
||||
An `ActorID` contains two parts: 1) 4 unique bytes, and 2) its `JobID`.
|
||||
|
||||
#### TaskID (14 bytes)
|
||||
A `TaskID` contains two parts: 1) 6 unique bytes, and 2) its `ActorID`.
|
||||
A `TaskID` contains two parts: 1) 8 unique bytes, and 2) its `ActorID`.
|
||||
If the task is a normal task or a driver task, the part 2 is its dummy actor id.
|
||||
|
||||
The following table shows the layouts of all kinds of task id.
|
||||
|
||||
Reference in New Issue
Block a user