Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions core/src/main/scala/org/apache/spark/util/AccumulatorV2.scala
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ abstract class AccumulatorV2[IN, OUT] extends Serializable {

private def assertMetadataNotNull(): Unit = {
if (metadata == null) {
throw new IllegalAccessError("The metadata of this accumulator has not been assigned yet.")
throw new IllegalStateException("The metadata of this accumulator has not been assigned yet.")
}
}

Expand Down Expand Up @@ -265,7 +265,7 @@ private[spark] object AccumulatorContext {
// Since we are storing weak references, we must check whether the underlying data is valid.
val acc = ref.get
if (acc eq null) {
throw new IllegalAccessError(s"Attempted to access garbage collected accumulator $id")
throw new IllegalStateException(s"Attempted to access garbage collected accumulator $id")
}
acc
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ class AccumulatorSuite extends SparkFunSuite with Matchers with LocalSparkContex
assert(ref.get.isEmpty)

// Getting a garbage collected accum should throw error
intercept[IllegalAccessError] {
intercept[IllegalStateException] {
AccumulatorContext.get(accId)
}

Expand Down