You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/07/28 07:37:08 UTC
[GitHub] [spark] dgd-contributor opened a new pull request #33555: [SPARK-36100][CORE] Grouping exception in core/status
dgd-contributor opened a new pull request #33555:
URL: https://github.com/apache/spark/pull/33555
### What changes were proposed in this pull request?
This PR group exception messages in core/src/main/scala/org/apache/spark/status
### Why are the changes needed?
It will largely help with standardization of error messages and its maintenance.
### Does this PR introduce _any_ user-facing change?
No. Error messages remain unchanged.
### How was this patch tested?
No new tests - pass all original tests to make sure it doesn't break any existing behavior.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dgd-contributor closed pull request #33555: [SPARK-36100][CORE] Grouping exception in core/status
Posted by GitBox <gi...@apache.org>.
dgd-contributor closed pull request #33555:
URL: https://github.com/apache/spark/pull/33555
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] mridulm edited a comment on pull request #33555: [SPARK-36100][CORE] Grouping exception in core/status
Posted by GitBox <gi...@apache.org>.
mridulm edited a comment on pull request #33555:
URL: https://github.com/apache/spark/pull/33555#issuecomment-888457574
I have not followed on this work, but looking at this pr a general comment, please use as specific a subclass as possible without loosing generalizability while defining interfaces.
For example, use `Exception` instead of `Throwable` - or relevant subclass is possible.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #33555: [SPARK-36100][CORE] Grouping exception in core/status
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #33555:
URL: https://github.com/apache/spark/pull/33555#issuecomment-888087357
Can one of the admins verify this patch?
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dgd-contributor commented on pull request #33555: [SPARK-36100][CORE] Grouping exception in core/status
Posted by GitBox <gi...@apache.org>.
dgd-contributor commented on pull request #33555:
URL: https://github.com/apache/spark/pull/33555#issuecomment-935316087
Please see PR [#34191](https://github.com/apache/spark/pull/34191)
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] mridulm commented on pull request #33555: [SPARK-36100][CORE] Grouping exception in core/status
Posted by GitBox <gi...@apache.org>.
mridulm commented on pull request #33555:
URL: https://github.com/apache/spark/pull/33555#issuecomment-888457574
I have not followed on this work, but looking at this pr a general comment, please use as specific a subclass as possible without loosing generalizability while defining interfaces.
For example, use Exception instead of Throwable - or relevant subclass is possible.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] cloud-fan commented on pull request #33555: [SPARK-36100][CORE] Grouping exception in core/status
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on pull request #33555:
URL: https://github.com/apache/spark/pull/33555#issuecomment-891136747
> please use as specific a subclass as possible without loosing generalizability while defining interfaces.
Yea I think this is the policy. The recent work is just to centralize all the errors into one or a few files. The error message and exception class should not be changed for now.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dgd-contributor edited a comment on pull request #33555: [SPARK-36100][CORE] Grouping exception in core/status
Posted by GitBox <gi...@apache.org>.
dgd-contributor edited a comment on pull request #33555:
URL: https://github.com/apache/spark/pull/33555#issuecomment-935237618
Thanks for your reviews. As we and @HyukjinKwon discussed contributing by sharing accounts, we will close this PR and recreate another by individual account.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] mridulm edited a comment on pull request #33555: [SPARK-36100][CORE] Grouping exception in core/status
Posted by GitBox <gi...@apache.org>.
mridulm edited a comment on pull request #33555:
URL: https://github.com/apache/spark/pull/33555#issuecomment-888457574
I have not followed on this work, but looking at this pr a general comment, please use as specific a subclass as possible without loosing generalizability while defining interfaces.
For example, use `Exception` instead of `Throwable` - or relevant subclass if relevant.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] mridulm edited a comment on pull request #33555: [SPARK-36100][CORE] Grouping exception in core/status
Posted by GitBox <gi...@apache.org>.
mridulm edited a comment on pull request #33555:
URL: https://github.com/apache/spark/pull/33555#issuecomment-888457574
I have not followed on this work, but looking at this pr a general comment, please use as specific a subclass as possible without loosing generalizability while defining interfaces.
For example, use `Exception` instead of `Throwable` - or a relevant subclass, like `SparkException`, as relevant.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dgd-contributor commented on pull request #33555: [SPARK-36100][CORE] Grouping exception in core/status
Posted by GitBox <gi...@apache.org>.
dgd-contributor commented on pull request #33555:
URL: https://github.com/apache/spark/pull/33555#issuecomment-935237618
Thanks for your reviews.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] allisonwang-db commented on a change in pull request #33555: [SPARK-36100][CORE] Grouping exception in core/status
Posted by GitBox <gi...@apache.org>.
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org