-
Notifications
You must be signed in to change notification settings - Fork 418
Pinterest open source: early shuffle deletion #3564
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
Changes from all commits
8ded106
c0c4019
cb50921
4d2fd7e
b8f87e1
85699d8
43cc7c3
74f7d28
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| /* | ||
| * 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 | ||
|
|
||
| import scala.collection.JavaConverters._ | ||
|
|
||
| import org.apache.spark.scheduler.{EventLoggingListener, SparkListenerInterface} | ||
|
|
||
| object CelebornSparkContextHelper { | ||
|
|
||
| def eventLogger: Option[EventLoggingListener] = SparkContext.getActive.get.eventLogger | ||
|
|
||
| def env: SparkEnv = { | ||
| assert(SparkContext.getActive.isDefined) | ||
| SparkContext.getActive.get.env | ||
| } | ||
|
|
||
| def activeSparkContext(): Option[SparkContext] = { | ||
| SparkContext.getActive | ||
| } | ||
|
|
||
| def getListener(listenerClass: String): SparkListenerInterface = { | ||
| activeSparkContext().get.listenerBus.listeners.asScala.find(l => | ||
| l.getClass.getCanonicalName.contains(listenerClass)).getOrElse( | ||
| throw new RuntimeException( | ||
| s"cannot find any listener containing $listenerClass in class name")) | ||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| /* | ||
| * 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.scheduler | ||
|
|
||
| import org.apache.spark.SparkContext | ||
|
|
||
| trait RunningStageManager { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where is this being used ? |
||
| def isRunningStage(stageId: Int): Boolean | ||
| } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is a version based on the original implementation of that PR, I will clean it up to merge to master branch |
||
|
|
||
| class RunningStageManagerImpl extends RunningStageManager { | ||
|
|
||
| private def dagScheduler = SparkContext.getActive.get.dagScheduler | ||
|
|
||
| override def isRunningStage(stageId: Int): Boolean = { | ||
| dagScheduler.runningStages.map(_.id).contains(stageId) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is unsafe - |
||
| } | ||
| } | ||

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cleanup methods from this object which are not required ?
It looks like the only thing needed is
eventLoggerright now.