allisonwang-db commented on a change in pull request #33555:
URL: https://github.com/apache/spark/pull/33555#discussion_r691649390



##########
File path: core/src/main/scala/org/apache/spark/errors/SparkCoreErrors.scala
##########
@@ -141,4 +146,102 @@ object SparkCoreErrors {
   def mustSpecifyCheckpointDirError(): Throwable = {
     new SparkException("Checkpoint dir must be specified.")
   }
+
+  def failToGetApplicationInfoError(): Throwable = {
+    new NoSuchElementException("Failed to get the application information. " +
+      "If you are starting up Spark, please wait a while until it's ready.")
+  }
+
+  def noStageWithIdError(stageId: Int): Throwable = {
+    new NoSuchElementException(s"No stage with id $stageId")
+  }
+
+  def failToGetApplicationSummaryError(): Throwable = {
+    new NoSuchElementException("Failed to get the application summary. " +
+      "If you are starting up Spark, please wait a while until it's ready.")
+  }
+
+  def metadataMismatchError(): Throwable = {
+    new MetadataMismatchException()
+  }
+
+  def indexOutOfBoundError(idx: Int): Throwable = {
+    new IndexOutOfBoundsException(idx.toString)
+  }
+
+  def notAuthorizedUserError(user: String): Throwable = {
+    new ForbiddenException(s"""user "$user" is not authorized""")
+  }
+
+  def notFoundAppKeyError(appKey: String): Throwable = {
+    new NotFoundException(s"no such app: $appKey")
+  }
+
+  def notFoundJobIdError(jobId: Int): Throwable = {
+    new NotFoundException(s"unknown job: $jobId")
+  }
+
+  def invalidExecutorIdError(url: String): Throwable = {
+    new BadParameterException(s"Invalid executorId: neither '$url' nor 
number.")
+  }
+
+  def threadDumpsNotAvailableError(): Throwable = {
+    new ServiceUnavailable("Thread dumps not available through the history 
server.")
+  }
+
+  def noThreadDumpAvailableError(): Throwable = {
+    new NotFoundException("No thread dump is available.")
+  }
+
+  def notFoundHttpRequestError(uri: String): Throwable = {
+    new NotFoundException(uri)
+  }
+
+  def executorNotExistError(): Throwable = {
+    new NotFoundException("Executor does not exist.")
+  }
+
+  def executorIsNotActiveError(): Throwable = {
+    new BadParameterException("Executor is not active.")
+  }
+
+  def noRddFoundError(rddId: Int): Throwable = {
+    new NotFoundException(s"no rdd found w/ id $rddId")
+  }
+
+  def eventLogsNotAvailableError(appId: String): Throwable = {
+    new ServiceUnavailable(s"Event logs are not available for app: $appId.")
+  }
+
+  def unknownAppError(appId: String): Throwable = {
+    new NotFoundException(s"unknown app: $appId")
+  }
+
+  def notFoundAppWithAttemptError(appId: String, attemptId: String): Throwable 
= {
+    new NotFoundException(s"unknown app $appId, attempt $attemptId")
+  }
+
+  def unknownStageError(stageId: Int): Throwable = {
+    new NotFoundException(s"unknown stage: $stageId")
+  }
+
+  def unknownAttemptForStageError(stageId: Int, msg: String): Throwable = {
+    new NotFoundException(s"unknown attempt for stage $stageId.  Found 
attempts: [$msg]")
+  }
+
+  def noTasksReportMetricsError(stageId: Int, stageAttemptId: Int): Throwable 
= {
+    new NotFoundException(s"No tasks reported metrics for $stageId / 
$stageAttemptId yet.")
+  }
+
+  def badParameterErrors(param: String, exp: String, actual: String): 
Throwable = {

Review comment:
       badParameterError

##########
File path: core/src/main/scala/org/apache/spark/errors/SparkCoreErrors.scala
##########
@@ -141,4 +146,102 @@ object SparkCoreErrors {
   def mustSpecifyCheckpointDirError(): Throwable = {
     new SparkException("Checkpoint dir must be specified.")
   }
+
+  def failToGetApplicationInfoError(): Throwable = {
+    new NoSuchElementException("Failed to get the application information. " +
+      "If you are starting up Spark, please wait a while until it's ready.")
+  }
+
+  def noStageWithIdError(stageId: Int): Throwable = {
+    new NoSuchElementException(s"No stage with id $stageId")
+  }
+
+  def failToGetApplicationSummaryError(): Throwable = {
+    new NoSuchElementException("Failed to get the application summary. " +
+      "If you are starting up Spark, please wait a while until it's ready.")
+  }
+
+  def metadataMismatchError(): Throwable = {
+    new MetadataMismatchException()
+  }
+
+  def indexOutOfBoundError(idx: Int): Throwable = {
+    new IndexOutOfBoundsException(idx.toString)
+  }
+
+  def notAuthorizedUserError(user: String): Throwable = {
+    new ForbiddenException(s"""user "$user" is not authorized""")
+  }
+
+  def notFoundAppKeyError(appKey: String): Throwable = {
+    new NotFoundException(s"no such app: $appKey")
+  }
+
+  def notFoundJobIdError(jobId: Int): Throwable = {

Review comment:
       unknownJobError

##########
File path: core/src/main/scala/org/apache/spark/errors/SparkCoreErrors.scala
##########
@@ -141,4 +146,102 @@ object SparkCoreErrors {
   def mustSpecifyCheckpointDirError(): Throwable = {
     new SparkException("Checkpoint dir must be specified.")
   }
+
+  def failToGetApplicationInfoError(): Throwable = {
+    new NoSuchElementException("Failed to get the application information. " +
+      "If you are starting up Spark, please wait a while until it's ready.")
+  }
+
+  def noStageWithIdError(stageId: Int): Throwable = {
+    new NoSuchElementException(s"No stage with id $stageId")
+  }
+
+  def failToGetApplicationSummaryError(): Throwable = {
+    new NoSuchElementException("Failed to get the application summary. " +
+      "If you are starting up Spark, please wait a while until it's ready.")
+  }
+
+  def metadataMismatchError(): Throwable = {
+    new MetadataMismatchException()
+  }
+
+  def indexOutOfBoundError(idx: Int): Throwable = {
+    new IndexOutOfBoundsException(idx.toString)
+  }
+
+  def notAuthorizedUserError(user: String): Throwable = {
+    new ForbiddenException(s"""user "$user" is not authorized""")
+  }
+
+  def notFoundAppKeyError(appKey: String): Throwable = {

Review comment:
       appNotFoundError

##########
File path: core/src/main/scala/org/apache/spark/errors/SparkCoreErrors.scala
##########
@@ -141,4 +146,102 @@ object SparkCoreErrors {
   def mustSpecifyCheckpointDirError(): Throwable = {
     new SparkException("Checkpoint dir must be specified.")
   }
+
+  def failToGetApplicationInfoError(): Throwable = {
+    new NoSuchElementException("Failed to get the application information. " +
+      "If you are starting up Spark, please wait a while until it's ready.")
+  }
+
+  def noStageWithIdError(stageId: Int): Throwable = {
+    new NoSuchElementException(s"No stage with id $stageId")
+  }
+
+  def failToGetApplicationSummaryError(): Throwable = {
+    new NoSuchElementException("Failed to get the application summary. " +
+      "If you are starting up Spark, please wait a while until it's ready.")
+  }
+
+  def metadataMismatchError(): Throwable = {
+    new MetadataMismatchException()
+  }
+
+  def indexOutOfBoundError(idx: Int): Throwable = {
+    new IndexOutOfBoundsException(idx.toString)
+  }
+
+  def notAuthorizedUserError(user: String): Throwable = {
+    new ForbiddenException(s"""user "$user" is not authorized""")
+  }
+
+  def notFoundAppKeyError(appKey: String): Throwable = {
+    new NotFoundException(s"no such app: $appKey")
+  }
+
+  def notFoundJobIdError(jobId: Int): Throwable = {
+    new NotFoundException(s"unknown job: $jobId")
+  }
+
+  def invalidExecutorIdError(url: String): Throwable = {
+    new BadParameterException(s"Invalid executorId: neither '$url' nor 
number.")
+  }
+
+  def threadDumpsNotAvailableError(): Throwable = {
+    new ServiceUnavailable("Thread dumps not available through the history 
server.")
+  }
+
+  def noThreadDumpAvailableError(): Throwable = {
+    new NotFoundException("No thread dump is available.")
+  }
+
+  def notFoundHttpRequestError(uri: String): Throwable = {

Review comment:
       uriNotFoundError

##########
File path: core/src/main/scala/org/apache/spark/errors/SparkCoreErrors.scala
##########
@@ -141,4 +146,102 @@ object SparkCoreErrors {
   def mustSpecifyCheckpointDirError(): Throwable = {
     new SparkException("Checkpoint dir must be specified.")
   }
+
+  def failToGetApplicationInfoError(): Throwable = {
+    new NoSuchElementException("Failed to get the application information. " +
+      "If you are starting up Spark, please wait a while until it's ready.")
+  }
+
+  def noStageWithIdError(stageId: Int): Throwable = {
+    new NoSuchElementException(s"No stage with id $stageId")
+  }
+
+  def failToGetApplicationSummaryError(): Throwable = {
+    new NoSuchElementException("Failed to get the application summary. " +
+      "If you are starting up Spark, please wait a while until it's ready.")
+  }
+
+  def metadataMismatchError(): Throwable = {
+    new MetadataMismatchException()
+  }
+
+  def indexOutOfBoundError(idx: Int): Throwable = {
+    new IndexOutOfBoundsException(idx.toString)
+  }
+
+  def notAuthorizedUserError(user: String): Throwable = {
+    new ForbiddenException(s"""user "$user" is not authorized""")
+  }
+
+  def notFoundAppKeyError(appKey: String): Throwable = {
+    new NotFoundException(s"no such app: $appKey")
+  }
+
+  def notFoundJobIdError(jobId: Int): Throwable = {
+    new NotFoundException(s"unknown job: $jobId")
+  }
+
+  def invalidExecutorIdError(url: String): Throwable = {
+    new BadParameterException(s"Invalid executorId: neither '$url' nor 
number.")
+  }
+
+  def threadDumpsNotAvailableError(): Throwable = {
+    new ServiceUnavailable("Thread dumps not available through the history 
server.")
+  }
+
+  def noThreadDumpAvailableError(): Throwable = {
+    new NotFoundException("No thread dump is available.")
+  }
+
+  def notFoundHttpRequestError(uri: String): Throwable = {
+    new NotFoundException(uri)
+  }
+
+  def executorNotExistError(): Throwable = {
+    new NotFoundException("Executor does not exist.")
+  }
+
+  def executorIsNotActiveError(): Throwable = {
+    new BadParameterException("Executor is not active.")
+  }
+
+  def noRddFoundError(rddId: Int): Throwable = {
+    new NotFoundException(s"no rdd found w/ id $rddId")
+  }
+
+  def eventLogsNotAvailableError(appId: String): Throwable = {
+    new ServiceUnavailable(s"Event logs are not available for app: $appId.")
+  }
+
+  def unknownAppError(appId: String): Throwable = {
+    new NotFoundException(s"unknown app: $appId")
+  }
+
+  def notFoundAppWithAttemptError(appId: String, attemptId: String): Throwable 
= {
+    new NotFoundException(s"unknown app $appId, attempt $attemptId")
+  }
+
+  def unknownStageError(stageId: Int): Throwable = {
+    new NotFoundException(s"unknown stage: $stageId")
+  }
+
+  def unknownAttemptForStageError(stageId: Int, msg: String): Throwable = {
+    new NotFoundException(s"unknown attempt for stage $stageId.  Found 
attempts: [$msg]")
+  }
+
+  def noTasksReportMetricsError(stageId: Int, stageAttemptId: Int): Throwable 
= {

Review comment:
       noTaskReportedMetricsError

##########
File path: core/src/main/scala/org/apache/spark/errors/SparkCoreErrors.scala
##########
@@ -141,4 +146,102 @@ object SparkCoreErrors {
   def mustSpecifyCheckpointDirError(): Throwable = {
     new SparkException("Checkpoint dir must be specified.")
   }
+
+  def failToGetApplicationInfoError(): Throwable = {
+    new NoSuchElementException("Failed to get the application information. " +
+      "If you are starting up Spark, please wait a while until it's ready.")
+  }
+
+  def noStageWithIdError(stageId: Int): Throwable = {
+    new NoSuchElementException(s"No stage with id $stageId")
+  }
+
+  def failToGetApplicationSummaryError(): Throwable = {
+    new NoSuchElementException("Failed to get the application summary. " +
+      "If you are starting up Spark, please wait a while until it's ready.")
+  }
+
+  def metadataMismatchError(): Throwable = {
+    new MetadataMismatchException()
+  }
+
+  def indexOutOfBoundError(idx: Int): Throwable = {
+    new IndexOutOfBoundsException(idx.toString)
+  }
+
+  def notAuthorizedUserError(user: String): Throwable = {
+    new ForbiddenException(s"""user "$user" is not authorized""")
+  }
+
+  def notFoundAppKeyError(appKey: String): Throwable = {
+    new NotFoundException(s"no such app: $appKey")
+  }
+
+  def notFoundJobIdError(jobId: Int): Throwable = {
+    new NotFoundException(s"unknown job: $jobId")
+  }
+
+  def invalidExecutorIdError(url: String): Throwable = {
+    new BadParameterException(s"Invalid executorId: neither '$url' nor 
number.")
+  }
+
+  def threadDumpsNotAvailableError(): Throwable = {
+    new ServiceUnavailable("Thread dumps not available through the history 
server.")
+  }
+
+  def noThreadDumpAvailableError(): Throwable = {
+    new NotFoundException("No thread dump is available.")
+  }
+
+  def notFoundHttpRequestError(uri: String): Throwable = {
+    new NotFoundException(uri)
+  }
+
+  def executorNotExistError(): Throwable = {
+    new NotFoundException("Executor does not exist.")
+  }
+
+  def executorIsNotActiveError(): Throwable = {
+    new BadParameterException("Executor is not active.")
+  }
+
+  def noRddFoundError(rddId: Int): Throwable = {
+    new NotFoundException(s"no rdd found w/ id $rddId")
+  }
+
+  def eventLogsNotAvailableError(appId: String): Throwable = {
+    new ServiceUnavailable(s"Event logs are not available for app: $appId.")
+  }
+
+  def unknownAppError(appId: String): Throwable = {
+    new NotFoundException(s"unknown app: $appId")
+  }
+
+  def notFoundAppWithAttemptError(appId: String, attemptId: String): Throwable 
= {

Review comment:
       unknownAppWithAttemptError




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to