Skip to content

Commit

Permalink
Fix my broken rebase.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcelo Vanzin committed Apr 8, 2015
1 parent 318525a commit 5fd5c6f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 19 deletions.
20 changes: 10 additions & 10 deletions core/src/main/scala/org/apache/spark/deploy/master/Master.scala
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private[master] class Master(
private val hadoopConf = SparkHadoopUtil.get.newConfiguration(conf)

private def createDateFormat = new SimpleDateFormat("yyyyMMddHHmmss") // For application IDs

private val WORKER_TIMEOUT = conf.getLong("spark.worker.timeout", 60) * 1000
private val RETAINED_APPLICATIONS = conf.getInt("spark.deploy.retainedApplications", 200)
private val RETAINED_DRIVERS = conf.getInt("spark.deploy.retainedDrivers", 200)
Expand All @@ -86,7 +86,7 @@ private[master] class Master(
private val drivers = new HashSet[DriverInfo]
private val completedDrivers = new ArrayBuffer[DriverInfo]
// Drivers currently spooled for scheduling
private val waitingDrivers = new ArrayBuffer[DriverInfo]
private val waitingDrivers = new ArrayBuffer[DriverInfo]
private var nextDriverNumber = 0

Utils.checkHost(host, "Expected hostname")
Expand Down Expand Up @@ -753,24 +753,24 @@ private[master] class Master(
app.desc.appUiUrl = notFoundBasePath
return false
}

val eventLogFilePrefix = EventLoggingListener.getLogPath(
eventLogDir, app.id, app.desc.eventLogCodec)
eventLogDir, app.id, "", app.desc.eventLogCodec)
val fs = Utils.getHadoopFileSystem(eventLogDir, hadoopConf)
val inProgressExists = fs.exists(new Path(eventLogFilePrefix +
val inProgressExists = fs.exists(new Path(eventLogFilePrefix +
EventLoggingListener.IN_PROGRESS))

if (inProgressExists) {
// Event logging is enabled for this application, but the application is still in progress
logWarning(s"Application $appName is still in progress, it may be terminated abnormally.")
}

val (eventLogFile, status) = if (inProgressExists) {
(eventLogFilePrefix + EventLoggingListener.IN_PROGRESS, " (in progress)")
} else {
(eventLogFilePrefix, " (completed)")
}

val logInput = EventLoggingListener.openEventLog(new Path(eventLogFile), fs)
val replayBus = new ReplayListenerBus()
val ui = SparkUI.createHistoryUI(new SparkConf, replayBus, new SecurityManager(conf),
Expand Down Expand Up @@ -854,8 +854,8 @@ private[master] class Master(
}

private def removeDriver(
driverId: String,
finalState: DriverState,
driverId: String,
finalState: DriverState,
exception: Option[Exception]) {
drivers.find(d => d.id == driverId) match {
case Some(driver) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ private[spark] class EventLoggingListener(
private[scheduler] val loggedEvents = new ArrayBuffer[JValue]

// Visible for tests only.
private[scheduler] val logPath = getLogPath(logBaseDir, appId, compressionCodecName, appAttemptId)
private[scheduler] val logPath = getLogPath(logBaseDir, appId, appAttemptId, compressionCodecName)

/**
* Creates the log file in the configured log directory.
Expand Down Expand Up @@ -261,7 +261,7 @@ private[spark] object EventLoggingListener extends Logging {
* @return A path which consists of file-system-safe characters.
*/
def getLogPath(
logBaseDir: String,
logBaseDir: URI,
appId: String,
appAttemptId: String,
compressionCodecName: Option[String] = None): String = {
Expand All @@ -273,13 +273,6 @@ private[spark] object EventLoggingListener extends Logging {
}
}

def getLogPath(
logBaseDir: String,
appId: String,
compressionCodecName: Option[String] = None): String = {
getLogPath(logBaseDir, appId, "", compressionCodecName)
}

/**
* Opens an event log file and returns an input stream that contains the event data.
*
Expand Down

0 comments on commit 5fd5c6f

Please sign in to comment.