Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace ReturnIds with NumReturns in TaskInfo to reduce the size #4854

Merged
merged 5 commits into from
May 28, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix
Yuhong Guo committed May 27, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit b643f182bd7a20512422b1e55299f23c952cfcee
Original file line number Diff line number Diff line change
@@ -154,6 +154,7 @@ private static TaskSpec parseTaskSpecFromFlatbuffer(ByteBuffer bb) {
UniqueId actorId = UniqueId.fromByteBuffer(info.actorIdAsByteBuffer());
UniqueId actorHandleId = UniqueId.fromByteBuffer(info.actorHandleIdAsByteBuffer());
int actorCounter = info.actorCounter();
int numReturns = info.numReturns();

// Deserialize new actor handles
UniqueId[] newActorHandles = IdUtil.getUniqueIdsFromByteBuffer(
@@ -177,8 +178,6 @@ private static TaskSpec parseTaskSpecFromFlatbuffer(ByteBuffer bb) {
args[i] = FunctionArg.passByValue(data);
}
}
// Deserialize return ids
int numReturns = info.numReturns();

// Deserialize required resources;
Map<String, Double> resources = new HashMap<>();
@@ -211,6 +210,7 @@ private static ByteBuffer convertTaskSpecToFlatbuffer(TaskSpec task) {
final int actorIdOffset = fbb.createString(task.actorId.toByteBuffer());
final int actorHandleIdOffset = fbb.createString(task.actorHandleId.toByteBuffer());
final int actorCounter = task.actorCounter;
final int numReturnsOffset = task.numReturns;

// Serialize the new actor handles.
int newActorHandlesOffset
@@ -234,9 +234,6 @@ private static ByteBuffer convertTaskSpecToFlatbuffer(TaskSpec task) {
}
int argsOffset = fbb.createVectorOfTables(argsOffsets);

// Serialize returns
int returnsOffset = fbb.createString(IdUtil.concatIds(task.returnIds));

// Serialize required resources
// The required_resources vector indicates the quantities of the different
// resources required by this task. The index in this vector corresponds to
@@ -292,7 +289,7 @@ private static ByteBuffer convertTaskSpecToFlatbuffer(TaskSpec task) {
actorCounter,
newActorHandlesOffset,
argsOffset,
returnsOffset,
numReturnsOffset,
requiredResourcesOffset,
requiredPlacementResourcesOffset,
language,
Original file line number Diff line number Diff line change
@@ -121,7 +121,7 @@ public TaskSpec(
this.executionDependencies = new ArrayList<>();
returnIds = new ObjectId[numReturns];
for (int i = 0; i < numReturns; ++i) {
returnIds[i] = IdUtil.computeReturnId(taskId, i);
returnIds[i] = IdUtil.computeReturnId(taskId, i + 1);
}
}