-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-40480][SHUFFLE] Remove push-based shuffle data after query finished #37922
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
Closed
Closed
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
b91a344
[SPARK-40480][SHUFFLE]Remove push-based shuffle data after query fini…
wankunde 6fb184d
[SPARK-40480][SHUFFLE]Remove push-based shuffle data after query fini…
wankunde 75e2013
[SPARK-40480][SHUFFLE]Remove push-based shuffle data after query fini…
wankunde 5b39ba3
[SPARK-40480][SHUFFLE]Remove push-based shuffle data after query fini…
wankunde 7cff74d
Fix UT
wankunde d4132b3
Update code
wankunde 3a0b6a4
Fix UT
wankunde 0a9730d
fix UT
wankunde 0f24bb9
Update comment
wankunde c848da6
update RemoteBlockPushResolver.removeShuffleMerge() code
wankunde e54bb75
Save the latest shuffle merge id in appShuffleInfo.shuffles
wankunde 4d2b940
Update code
wankunde 5d3aa2d
Fix UT
wankunde d034985
Update code
wankunde 11e7d9a
Fix UT
wankunde 29f4918
Format codestyle
wankunde 3a7d99c
move writeAppAttemptShuffleMergeInfoToDB to main thread
wankunde 613a99a
remove try catch for file.delete()
wankunde 96ba7e1
Simplify the code and update some comments
wankunde e06ef76
Add UT
wankunde 43085d1
Update common/network-shuffle/src/main/java/org/apache/spark/network/…
wankunde 371feae
Format code
wankunde 6975bcc
Add a TODO for RemoveShuffleMerge RPC
wankunde 475f8bd
Fix bug and backport UT
wankunde 0f1f5eb
Change log level to debug
wankunde 7284b8f
Change log level to debug
wankunde 3181e64
Bug fix
wankunde File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
102 changes: 102 additions & 0 deletions
102
...k-shuffle/src/main/java/org/apache/spark/network/shuffle/protocol/RemoveShuffleMerge.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package org.apache.spark.network.shuffle.protocol; | ||
|
|
||
| import com.google.common.base.Objects; | ||
| import io.netty.buffer.ByteBuf; | ||
| import org.apache.commons.lang3.builder.ToStringBuilder; | ||
| import org.apache.commons.lang3.builder.ToStringStyle; | ||
|
|
||
| import org.apache.spark.network.protocol.Encoders; | ||
|
|
||
| /** | ||
| * Remove the merged data for a given shuffle. | ||
| * Returns {@link Boolean} | ||
| * | ||
| * @since 3.4.0 | ||
| */ | ||
| public class RemoveShuffleMerge extends BlockTransferMessage { | ||
| public final String appId; | ||
wankunde marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| public final int appAttemptId; | ||
| public final int shuffleId; | ||
| public final int shuffleMergeId; | ||
|
|
||
| public RemoveShuffleMerge( | ||
| String appId, | ||
| int appAttemptId, | ||
| int shuffleId, | ||
| int shuffleMergeId) { | ||
| this.appId = appId; | ||
| this.appAttemptId = appAttemptId; | ||
| this.shuffleId = shuffleId; | ||
| this.shuffleMergeId = shuffleMergeId; | ||
| } | ||
|
|
||
| @Override | ||
| protected Type type() { | ||
| return Type.REMOVE_SHUFFLE_MERGE; | ||
| } | ||
|
|
||
| @Override | ||
| public int hashCode() { | ||
| return Objects.hashCode(appId, appAttemptId, shuffleId, shuffleMergeId); | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE) | ||
| .append("appId", appId) | ||
| .append("attemptId", appAttemptId) | ||
| .append("shuffleId", shuffleId) | ||
| .append("shuffleMergeId", shuffleMergeId) | ||
| .toString(); | ||
| } | ||
|
|
||
| @Override | ||
| public boolean equals(Object other) { | ||
| if (other != null && other instanceof RemoveShuffleMerge) { | ||
| RemoveShuffleMerge o = (RemoveShuffleMerge) other; | ||
| return Objects.equal(appId, o.appId) | ||
| && appAttemptId == o.appAttemptId | ||
| && shuffleId == o.shuffleId | ||
| && shuffleMergeId == o.shuffleMergeId; | ||
| } | ||
| return false; | ||
| } | ||
|
|
||
| @Override | ||
| public int encodedLength() { | ||
| return Encoders.Strings.encodedLength(appId) + 4 + 4 + 4; | ||
| } | ||
|
|
||
| @Override | ||
| public void encode(ByteBuf buf) { | ||
| Encoders.Strings.encode(buf, appId); | ||
| buf.writeInt(appAttemptId); | ||
| buf.writeInt(shuffleId); | ||
| buf.writeInt(shuffleMergeId); | ||
| } | ||
|
|
||
| public static RemoveShuffleMerge decode(ByteBuf buf) { | ||
| String appId = Encoders.Strings.decode(buf); | ||
| int attemptId = buf.readInt(); | ||
| int shuffleId = buf.readInt(); | ||
| int shuffleMergeId = buf.readInt(); | ||
| return new RemoveShuffleMerge(appId, attemptId, shuffleId, shuffleMergeId); | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.