-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-31801][API][SHUFFLE] Register map output metadata #30763
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
31 commits
Select commit
Hold shift + click to select a range
f427ab5
Register map output metadata upon committing shuffle map tasks.
mccheah 65d077d
Add a mock version for tests.
mccheah c2882ab
Update manifests
mccheah dc6f853
Add a test for specifically checking map output registration and backup
mccheah 529122f
Return map output commit message from single spill writer
mccheah d20a0ee
Address comments and fix build
mccheah dc8d15c
Temporarily remove tests
mccheah e340bca
Address comments
mccheah edd5c05
Merge remote-tracking branch 'origin/master' into register-map-output…
mccheah 7baa3d2
Fix Java linting errors
mccheah cce67ab
Fix infinite loop.
mccheah 409bebb
Fix checkstyle
mccheah a6fabd2
Fix test
mccheah 3c66353
Invoke super.afterEach in ShuffleDriverComponentsSuite
mccheah b88d724
Fix build
mccheah 3505af8
Merge remote-tracking branch 'origin/master' into register-map-output…
mccheah 89bb528
Address comments.
mccheah 0da9e22
Address comments
mccheah 2b5108f
Merge remote-tracking branch 'origin/master' into register-map-output…
mccheah 1e10577
Merge branch 'master' into pr/28618
attilapiros cac0e9e
apply Attila's review comments
attilapiros 861f089
remove unused import
attilapiros e210160
fix mima
attilapiros 1fc86f6
forgotten commas
attilapiros a09ced3
Merge branch 'master' into updated_28618
attilapiros 3835ed8
applying review comments
attilapiros 88d370e
Merge remote-tracking branch 'parent/master' into updated_28618
attilapiros 6f571a2
fix unidoc's Java API documentation generation
attilapiros b350258
Merge branch 'master' into updated_28618
attilapiros abcf8f3
Merge branch 'master' into updated_28618
attilapiros 8e54b41
update mima excludes
attilapiros 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
37 changes: 37 additions & 0 deletions
37
core/src/main/java/org/apache/spark/shuffle/api/metadata/NoOpShuffleOutputTracker.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,37 @@ | ||
| /* | ||
| * 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.shuffle.api.metadata; | ||
|
|
||
| /** | ||
| * An implementation of shuffle output tracking that does not keep track of any shuffle state. | ||
| */ | ||
| public class NoOpShuffleOutputTracker implements ShuffleOutputTracker { | ||
|
|
||
| @Override | ||
| public void registerShuffle(int shuffleId) {} | ||
|
|
||
| @Override | ||
| public void unregisterShuffle(int shuffleId, boolean blocking) {} | ||
|
|
||
| @Override | ||
| public void registerMapOutput( | ||
| int shuffleId, int mapIndex, long mapId, MapOutputMetadata mapOutputMetadata) {} | ||
|
|
||
| @Override | ||
| public void removeMapOutput(int shuffleId, int mapIndex, long mapId) {} | ||
| } |
85 changes: 85 additions & 0 deletions
85
core/src/main/java/org/apache/spark/shuffle/api/metadata/ShuffleOutputTracker.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,85 @@ | ||
| /* | ||
| * 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.shuffle.api.metadata; | ||
|
|
||
| import org.apache.spark.annotation.Private; | ||
|
|
||
| /** | ||
| * :: Private :: | ||
| * | ||
| * A plugin that can monitor the storage of shuffle data from map tasks, and can provide | ||
| * metadata to shuffle readers to aid their reading of shuffle blocks in reduce tasks. | ||
| * <p> | ||
| * {@link MapOutputMetadata} instances provided from the plugin tree's implementation of | ||
| * {@link org.apache.spark.shuffle.api.ShuffleMapOutputWriter} are sent to this module's map output | ||
| * metadata registration method in {@link #registerMapOutput(int, int, long, MapOutputMetadata)}. | ||
| * <p> | ||
| * Implementations MUST be thread-safe. Spark will invoke methods in this module in parallel. | ||
| * <p> | ||
| * A singleton instance of this module is instantiated on the driver via | ||
| * {@link org.apache.spark.shuffle.api.ShuffleDriverComponents#shuffleOutputTracker()}. | ||
| */ | ||
| @Private | ||
| public interface ShuffleOutputTracker { | ||
|
|
||
| /** | ||
| * Called when a new shuffle stage is going to be run. | ||
| * | ||
| * @param shuffleId the unique identifier for the new shuffle stage | ||
| */ | ||
| void registerShuffle(int shuffleId); | ||
|
|
||
| /** | ||
| * Called when the shuffle with the given id is unregistered because it will no longer | ||
| * be used by Spark tasks. | ||
| * | ||
| * @param shuffleId the unique identifier for the shuffle stage to be unregistered | ||
| */ | ||
| void unregisterShuffle(int shuffleId, boolean blocking); | ||
|
|
||
| /** | ||
| * Called when a map task completes, and the map output writer has provided metadata to be | ||
| * persisted by this shuffle output tracker. | ||
| * | ||
| * @param shuffleId the unique identifier for the shuffle stage that the map task is a | ||
| * part of | ||
| * @param mapIndex the map index of the map task in its shuffle map stage - not | ||
| * necessarily unique across multiple attempts of this task | ||
| * @param mapId the identifier for this map task, which is unique even across | ||
| * multiple attempts at this task | ||
| * @param mapOutputMetadata metadata about the map output data's storage returned by the map | ||
| * task's writer | ||
| * | ||
| */ | ||
| void registerMapOutput( | ||
| int shuffleId, int mapIndex, long mapId, MapOutputMetadata mapOutputMetadata); | ||
|
|
||
| /** | ||
| * Called when the given map output is discarded, and will not longer be used in future Spark | ||
| * shuffles. | ||
| * | ||
| * @param shuffleId the unique identifier for the shuffle stage that the map task is a | ||
| * part of | ||
| * @param mapIndex the map index of the map task which is having its output being | ||
| * discarded - not necessarily unique across multiple attempts of this | ||
| * task | ||
| * @param mapId the identifier for the map task which is having its output being | ||
| * discarded, which is unique even across multiple attempts at this task | ||
| */ | ||
| void removeMapOutput(int shuffleId, int mapIndex, long mapId); | ||
| } | ||
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.