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
11 changes: 10 additions & 1 deletion project/MimaExcludes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,16 @@ object MimaExcludes {
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.spark.storage.BlockManagerMessages#RegisterBlockManager.copy"),
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.spark.storage.BlockManagerMessages#RegisterBlockManager.this"),
ProblemFilters.exclude[MissingTypesProblem]("org.apache.spark.storage.BlockManagerMessages$RegisterBlockManager$"),
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.spark.storage.BlockManagerMessages#RegisterBlockManager.apply")
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.spark.storage.BlockManagerMessages#RegisterBlockManager.apply"),

// [SPARK-41709][CORE][SQL][UI] Explicitly define Seq as collection.Seq to avoid toSeq when create ui objects from protobuf objects for Scala 2.13
ProblemFilters.exclude[IncompatibleResultTypeProblem]("org.apache.spark.status.api.v1.ApplicationEnvironmentInfo.resourceProfiles"),

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.

Need to add MimaExcludes for Scala 2.13, should we close this one

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 this is acceptable, I will make more changes, otherwise I will close this pr

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.

I think those are all internal methods right? people wouldn't call these classes in code

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.

Yes, the mima filters to be added are all internal apis

ProblemFilters.exclude[IncompatibleMethTypeProblem]("org.apache.spark.status.api.v1.ApplicationInfo.apply"),
ProblemFilters.exclude[IncompatibleResultTypeProblem]("org.apache.spark.status.api.v1.ApplicationInfo.attempts"),
ProblemFilters.exclude[IncompatibleMethTypeProblem]("org.apache.spark.status.api.v1.ApplicationInfo.copy"),
ProblemFilters.exclude[IncompatibleResultTypeProblem]("org.apache.spark.status.api.v1.ApplicationInfo.copy$default$7"),
ProblemFilters.exclude[IncompatibleMethTypeProblem]("org.apache.spark.status.api.v1.ApplicationInfo.this"),
ProblemFilters.exclude[IncompatibleMethTypeProblem]("org.apache.spark.status.api.v1.ApplicationInfo.apply")
)

// Defulat exclude rules
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 = collection.Seq[SQLPlanMetric]()
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