bozhang2820 commented on a change in pull request #35643:
URL: https://github.com/apache/spark/pull/35643#discussion_r814376154
##########
File path: core/src/main/scala/org/apache/spark/metrics/sink/GraphiteSink.scala
##########
@@ -42,11 +43,13 @@ private[spark] class GraphiteSink(
def propertyToOption(prop: String): Option[String] =
Option(property.getProperty(prop))
if (!propertyToOption(GRAPHITE_KEY_HOST).isDefined) {
- throw new Exception("Graphite sink requires 'host' property.")
+ throw new SparkException(errorClass = "GRAPHITE_SINK_PROPERTY_MISSING",
Review comment:
Sure. Will do.
##########
File path: core/src/main/scala/org/apache/spark/metrics/sink/GraphiteSink.scala
##########
@@ -42,11 +43,13 @@ private[spark] class GraphiteSink(
def propertyToOption(prop: String): Option[String] =
Option(property.getProperty(prop))
if (!propertyToOption(GRAPHITE_KEY_HOST).isDefined) {
- throw new Exception("Graphite sink requires 'host' property.")
+ throw new SparkException(errorClass = "GRAPHITE_SINK_PROPERTY_MISSING",
Review comment:
Sure. Will do.
##########
File path:
core/src/test/scala/org/apache/spark/metrics/sink/GraphiteSinkSuite.scala
##########
@@ -79,4 +79,42 @@ class GraphiteSinkSuite extends SparkFunSuite {
assert(metricKeys.equals(filteredMetricKeys),
"Should contain only metrics matches regex filter")
}
+
+ test("GraphiteSink without host") {
Review comment:
I think that's going to be hard since the ways to trigger spark-core
errors in tests (so that we can catch and verify them) varies a lot.
--
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]