allisonwang-db commented on a change in pull request #33529: URL: https://github.com/apache/spark/pull/33529#discussion_r678522798
########## File path: core/src/main/scala/org/apache/spark/errors/SparkCoreErrors.scala ########## @@ -0,0 +1,97 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.errors + +import java.util.concurrent.TimeoutException + +import org.apache.spark.{SparkException, TaskNotSerializableException} +import org.apache.spark.scheduler.{BarrierJobRunWithDynamicAllocationException, BarrierJobSlotsNumberCheckFailed, BarrierJobUnsupportedRDDChainException} + +/** + * Object for grouping error messages from (most) exceptions thrown during query execution. + */ +object SparkCoreErrors { + def askStandaloneSchedulerToShutDownExecutorsError(e: Exception): Throwable = { + new SparkException("Error asking standalone scheduler to shut down executors", e) + } + + def stopStandaloneSchedulerDriverEndpointError(e: Exception): Throwable = { + new SparkException("Error stopping standalone scheduler's driver endpoint", e) + } + + def noExecutorIdleError(id: String): Throwable = { + new NoSuchElementException(id) + } + + def barrierStageWithRDDChainPatternError(): Throwable = { + new BarrierJobUnsupportedRDDChainException + } + + def barrierStageWithDynamicAllocationError(): Throwable = { + new BarrierJobRunWithDynamicAllocationException + } + + def numPartitionsGreaterThanMaxNumConcurrentTasksError( + numPartitions: Int, + maxNumConcurrentTasks: Int): Throwable = { + new BarrierJobSlotsNumberCheckFailed(numPartitions, maxNumConcurrentTasks) + } + + def nonPartitionError(): Throwable = { + new SparkException("Can't run submitMapStage on RDD with 0 partitions") + } + + def nonExistentAccumulatorError(id: Long): Throwable = { Review comment: accessNonExistentAccumulatorError ########## File path: core/src/main/scala/org/apache/spark/errors/SparkCoreErrors.scala ########## @@ -0,0 +1,97 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.errors + +import java.util.concurrent.TimeoutException + +import org.apache.spark.{SparkException, TaskNotSerializableException} +import org.apache.spark.scheduler.{BarrierJobRunWithDynamicAllocationException, BarrierJobSlotsNumberCheckFailed, BarrierJobUnsupportedRDDChainException} + +/** + * Object for grouping error messages from (most) exceptions thrown during query execution. + */ +object SparkCoreErrors { + def askStandaloneSchedulerToShutDownExecutorsError(e: Exception): Throwable = { + new SparkException("Error asking standalone scheduler to shut down executors", e) + } + + def stopStandaloneSchedulerDriverEndpointError(e: Exception): Throwable = { + new SparkException("Error stopping standalone scheduler's driver endpoint", e) + } + + def noExecutorIdleError(id: String): Throwable = { + new NoSuchElementException(id) + } + + def barrierStageWithRDDChainPatternError(): Throwable = { + new BarrierJobUnsupportedRDDChainException + } + + def barrierStageWithDynamicAllocationError(): Throwable = { + new BarrierJobRunWithDynamicAllocationException + } + + def numPartitionsGreaterThanMaxNumConcurrentTasksError( + numPartitions: Int, + maxNumConcurrentTasks: Int): Throwable = { + new BarrierJobSlotsNumberCheckFailed(numPartitions, maxNumConcurrentTasks) + } + + def nonPartitionError(): Throwable = { Review comment: cannotRunSubmitMapStageOnZeroPartitionRDDError ########## File path: core/src/main/scala/org/apache/spark/scheduler/TaskSchedulerImpl.scala ########## @@ -916,7 +918,7 @@ private[spark] class TaskSchedulerImpl( // No task sets are active but we still got an error. Just exit since this // must mean the error is during registration. // It might be good to do something smarter here in the future. - throw new SparkException(s"Exiting due to error from cluster scheduler: $message") + throw SparkCoreErrors.clusterSchedulerError(message) Review comment: The error message seems changed here. ########## File path: core/src/main/scala/org/apache/spark/errors/SparkCoreErrors.scala ########## @@ -0,0 +1,97 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.errors + +import java.util.concurrent.TimeoutException + +import org.apache.spark.{SparkException, TaskNotSerializableException} +import org.apache.spark.scheduler.{BarrierJobRunWithDynamicAllocationException, BarrierJobSlotsNumberCheckFailed, BarrierJobUnsupportedRDDChainException} + +/** + * Object for grouping error messages from (most) exceptions thrown during query execution. + */ +object SparkCoreErrors { + def askStandaloneSchedulerToShutDownExecutorsError(e: Exception): Throwable = { + new SparkException("Error asking standalone scheduler to shut down executors", e) + } + + def stopStandaloneSchedulerDriverEndpointError(e: Exception): Throwable = { + new SparkException("Error stopping standalone scheduler's driver endpoint", e) + } + + def noExecutorIdleError(id: String): Throwable = { + new NoSuchElementException(id) + } + + def barrierStageWithRDDChainPatternError(): Throwable = { + new BarrierJobUnsupportedRDDChainException + } + + def barrierStageWithDynamicAllocationError(): Throwable = { + new BarrierJobRunWithDynamicAllocationException + } + + def numPartitionsGreaterThanMaxNumConcurrentTasksError( + numPartitions: Int, + maxNumConcurrentTasks: Int): Throwable = { + new BarrierJobSlotsNumberCheckFailed(numPartitions, maxNumConcurrentTasks) + } + + def nonPartitionError(): Throwable = { + new SparkException("Can't run submitMapStage on RDD with 0 partitions") + } + + def nonExistentAccumulatorError(id: Long): Throwable = { + new SparkException(s"attempted to access non-existent accumulator $id") + } + + def sendResubmittedTaskStatusForShuffleMapStagesOnlyError(): Throwable = { + new SparkException("TaskSetManagers should only send Resubmitted task " + + "statuses for tasks in ShuffleMapStages.") + } + + def emptyEventQueueTimeoutError(timeoutMillis: Long): Throwable = { + new TimeoutException(s"The event queue is not empty after $timeoutMillis ms.") + } + + def durationOperationUnsupportedOnUnfinishedTaskError(): Throwable = { + new UnsupportedOperationException("duration() called on unfinished task") + } + + def unrecognizedSchedulerModePropertyError( + schedulerModeProperty: String, + schedulingModeConf: String): Throwable = { + new SparkException(s"Unrecognized $schedulerModeProperty: $schedulingModeConf") + } + + def failResourceOffersForBarrierStageError(errorMsg: String): Throwable = { + new SparkException(errorMsg) + } + + def markExecutorAsFailedError(errorMsg: String): Throwable = { + new SparkException(errorMsg) + } + + def clusterSchedulerError(message: String): Throwable = { + new SparkException(message) + } + + def serializationTaskError(e: Throwable): Throwable = { Review comment: failToSerializeTaskError ########## File path: core/src/main/scala/org/apache/spark/errors/SparkCoreErrors.scala ########## @@ -0,0 +1,97 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.errors + +import java.util.concurrent.TimeoutException + +import org.apache.spark.{SparkException, TaskNotSerializableException} +import org.apache.spark.scheduler.{BarrierJobRunWithDynamicAllocationException, BarrierJobSlotsNumberCheckFailed, BarrierJobUnsupportedRDDChainException} + +/** + * Object for grouping error messages from (most) exceptions thrown during query execution. + */ +object SparkCoreErrors { + def askStandaloneSchedulerToShutDownExecutorsError(e: Exception): Throwable = { + new SparkException("Error asking standalone scheduler to shut down executors", e) + } + + def stopStandaloneSchedulerDriverEndpointError(e: Exception): Throwable = { + new SparkException("Error stopping standalone scheduler's driver endpoint", e) + } + + def noExecutorIdleError(id: String): Throwable = { + new NoSuchElementException(id) + } + + def barrierStageWithRDDChainPatternError(): Throwable = { + new BarrierJobUnsupportedRDDChainException + } + + def barrierStageWithDynamicAllocationError(): Throwable = { + new BarrierJobRunWithDynamicAllocationException + } + + def numPartitionsGreaterThanMaxNumConcurrentTasksError( + numPartitions: Int, + maxNumConcurrentTasks: Int): Throwable = { + new BarrierJobSlotsNumberCheckFailed(numPartitions, maxNumConcurrentTasks) + } + + def nonPartitionError(): Throwable = { + new SparkException("Can't run submitMapStage on RDD with 0 partitions") + } + + def nonExistentAccumulatorError(id: Long): Throwable = { + new SparkException(s"attempted to access non-existent accumulator $id") + } + + def sendResubmittedTaskStatusForShuffleMapStagesOnlyError(): Throwable = { + new SparkException("TaskSetManagers should only send Resubmitted task " + + "statuses for tasks in ShuffleMapStages.") + } + + def emptyEventQueueTimeoutError(timeoutMillis: Long): Throwable = { Review comment: nonEmptyEventQueueAfterTimeoutError ########## File path: core/src/main/scala/org/apache/spark/errors/SparkCoreErrors.scala ########## @@ -0,0 +1,97 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.errors + +import java.util.concurrent.TimeoutException + +import org.apache.spark.{SparkException, TaskNotSerializableException} +import org.apache.spark.scheduler.{BarrierJobRunWithDynamicAllocationException, BarrierJobSlotsNumberCheckFailed, BarrierJobUnsupportedRDDChainException} + +/** + * Object for grouping error messages from (most) exceptions thrown during query execution. + */ +object SparkCoreErrors { + def askStandaloneSchedulerToShutDownExecutorsError(e: Exception): Throwable = { + new SparkException("Error asking standalone scheduler to shut down executors", e) + } + + def stopStandaloneSchedulerDriverEndpointError(e: Exception): Throwable = { + new SparkException("Error stopping standalone scheduler's driver endpoint", e) + } + + def noExecutorIdleError(id: String): Throwable = { + new NoSuchElementException(id) + } + + def barrierStageWithRDDChainPatternError(): Throwable = { + new BarrierJobUnsupportedRDDChainException + } + + def barrierStageWithDynamicAllocationError(): Throwable = { + new BarrierJobRunWithDynamicAllocationException + } + + def numPartitionsGreaterThanMaxNumConcurrentTasksError( + numPartitions: Int, + maxNumConcurrentTasks: Int): Throwable = { + new BarrierJobSlotsNumberCheckFailed(numPartitions, maxNumConcurrentTasks) + } + + def nonPartitionError(): Throwable = { + new SparkException("Can't run submitMapStage on RDD with 0 partitions") + } + + def nonExistentAccumulatorError(id: Long): Throwable = { + new SparkException(s"attempted to access non-existent accumulator $id") + } + + def sendResubmittedTaskStatusForShuffleMapStagesOnlyError(): Throwable = { + new SparkException("TaskSetManagers should only send Resubmitted task " + + "statuses for tasks in ShuffleMapStages.") + } + + def emptyEventQueueTimeoutError(timeoutMillis: Long): Throwable = { + new TimeoutException(s"The event queue is not empty after $timeoutMillis ms.") + } + + def durationOperationUnsupportedOnUnfinishedTaskError(): Throwable = { Review comment: durationCalledOnUnfinishedTaskError -- 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]
