Skip to content

[SPARK-36096][CORE] Grouping exception in core/resource#33554

Closed
dgd-contributor wants to merge 6 commits intoapache:masterfrom
dgd-contributor:SPARK-36096
Closed

[SPARK-36096][CORE] Grouping exception in core/resource#33554
dgd-contributor wants to merge 6 commits intoapache:masterfrom
dgd-contributor:SPARK-36096

Conversation

@dgd-contributor
Copy link

What changes were proposed in this pull request?

This PR group exception messages in core/src/main/scala/org/apache/spark/resource

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.

@AmplabJenkins
Copy link

Can one of the admins verify this patch?

@github-actions github-actions bot added the CORE label Jul 28, 2021
new SparkException("Checkpoint dir must be specified.")
}

def acquireAnAddressNotExistError(resourceName: String, address: String): Throwable = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

acquireNonExistingAddressError

s"address $address doesn't exist.")
}

def acquireAnAddressNotAvailableError(resourceName: String, address: String): Throwable = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

acquireUnavailableAddressError

s"$resourceName address $address is not available.")
}

def releaseAnAddressNotExistError(resourceName: String, address: String): Throwable = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

releaseNonExistingAddressError

s"address $address doesn't exist.")
}

def releaseAnAddressNotAssignedError(resourceName: String, address: String): Throwable = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

releaseUnassignedAddressError

"doesn't exist!")
}

def expectUseResourceButNotSpecifyADiscoveryScriptError(resourceName: String): Throwable = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noDiscoveryScriptSpecifiedError

new SparkException(s"You must specify an amount for ${str}")
}

def tasksSupportFractionalResourceError(componentName: String): Throwable = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fractionalResourcesUnsupportedError

s"Only tasks support fractional resources, please check your $componentName settings")
}

def ParsingResourceFileError(resourcesFile: String, e: Throwable): Throwable = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

failToParseResourceFileError

new SparkException(s"Error parsing resources file $resourcesFile", e)
}

def conditionOfTheNumberOfCoresPerExecutorError(execCores: Int, taskCpus: Int): Throwable = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

numCoresPerExecutorLessThanNumCPUsPerTaskError

s"${str}")
}

def adjustConfigurationError(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adjustConfigurationofCoresError

""".stripMargin.replaceAll("\n", " "))
}

def adjustConfigurationError(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adjustConfigurationOfResourceError

@dgd-contributor
Copy link
Author

cc @mridulm @cloud-fan can you review this

@dgd-contributor
Copy link
Author

Thanks for your reviews. As we and @HyukjinKwon discussed contributing by sharing accounts, we will close this PR and recreate another by individual account. Please see PR #34192

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants