Skip to content
Closed
6 changes: 3 additions & 3 deletions core/src/main/scala/org/apache/spark/status/api/v1/api.scala
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ case class ApplicationInfo private[spark](
maxCores: Option[Int],
coresPerExecutor: Option[Int],
memoryPerExecutorMB: Option[Int],
attempts: Seq[ApplicationAttemptInfo])
attempts: collection.Seq[ApplicationAttemptInfo])

@JsonIgnoreProperties(
value = Array("startTimeEpoch", "endTimeEpoch", "lastUpdatedEpoch"),
Expand Down Expand Up @@ -220,7 +220,7 @@ class RDDStorageInfo private[spark](
val storageLevel: String,
val memoryUsed: Long,
val diskUsed: Long,
val dataDistribution: Option[Seq[RDDDataDistribution]],
val dataDistribution: Option[collection.Seq[RDDDataDistribution]],
val partitions: Option[Seq[RDDPartitionInfo]])

class RDDDataDistribution private[spark](
Expand Down Expand Up @@ -461,7 +461,7 @@ class ApplicationEnvironmentInfo private[spark] (
val systemProperties: Seq[(String, String)],
val metricsProperties: Seq[(String, String)],
val classpathEntries: Seq[(String, String)],
val resourceProfiles: Seq[ResourceProfileInfo])
val resourceProfiles: collection.Seq[ResourceProfileInfo])
Comment thread
LuciferYang marked this conversation as resolved.

class RuntimeInfo private[spark](
val javaVersion: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class ApplicationEnvironmentInfoWrapperSerializer extends ProtobufSerDe {
metricsProperties = info.getMetricsPropertiesList.asScala.map(pairSSToTuple).toSeq,
classpathEntries = info.getClasspathEntriesList.asScala.map(pairSSToTuple).toSeq,
resourceProfiles =
info.getResourceProfilesList.asScala.map(deserializeResourceProfileInfo).toSeq
info.getResourceProfilesList.asScala.map(deserializeResourceProfileInfo)
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class ApplicationInfoWrapperSerializer extends ProtobufSerDe {
val maxCores = getOptional(info.hasMaxCores, info.getMaxCores)
val coresPerExecutor = getOptional(info.hasCoresPerExecutor, info.getCoresPerExecutor)
val memoryPerExecutorMB = getOptional(info.hasMemoryPerExecutorMb, info.getMemoryPerExecutorMb)
val attempts = info.getAttemptsList.asScala.map(deserializeApplicationAttemptInfo).toSeq
val attempts = info.getAttemptsList.asScala.map(deserializeApplicationAttemptInfo)
ApplicationInfo(
id = info.getId,
name = info.getName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class RDDStorageInfoWrapperSerializer extends ProtobufSerDe {
if (info.getDataDistributionList.isEmpty) {
None
} else {
Some(info.getDataDistributionList.asScala.map(deserializeRDDDataDistribution).toSeq)
Some(info.getDataDistributionList.asScala.map(deserializeRDDDataDistribution))
},
partitions =
Some(info.getPartitionsList.asScala.map(deserializeRDDPartitionInfo).toSeq)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ private class LiveExecutionData(val executionId: Long) extends LiveEntity {
var details: String = null
var physicalPlanDescription: String = null
var modifiedConfigs: Map[String, String] = _
var metrics = Seq[SQLPlanMetric]()
var metrics = scala.collection.Seq[SQLPlanMetric]()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just collection.Seq?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

var submissionTime = -1L
var completionTime: Option[Date] = None
var errorMessage: Option[String] = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class SQLExecutionUIData(
val details: String,
val physicalPlanDescription: String,
val modifiedConfigs: Map[String, String],
val metrics: Seq[SQLPlanMetric],
val metrics: collection.Seq[SQLPlanMetric],
val submissionTime: Long,
val completionTime: Option[Date],
val errorMessage: Option[String],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class SQLExecutionUIDataSerializer extends ProtobufSerDe {
getOptional(ui.hasCompletionTime, () => new Date(ui.getCompletionTime))
val errorMessage = getOptional(ui.hasErrorMessage, () => ui.getErrorMessage)
val metrics =
ui.getMetricsList.asScala.map(m => SQLPlanMetricSerializer.deserialize(m)).toSeq
ui.getMetricsList.asScala.map(m => SQLPlanMetricSerializer.deserialize(m))

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If no toSeq, one operation is about 10ns. After adding toSeq, the delay will increase linearly with the length of the original data:

  • 240ns when input length is 10
  • 1740ns when input length is 100
  • 16600ns when input length is 1000

val jobs = ui.getJobsMap.asScala.map {
case (jobId, status) => jobId.toInt -> JobExecutionStatus.valueOf(status.toString)
}.toMap
Expand Down