Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-25655] [BUILD] Add -Pspark-ganglia-lgpl to the scala style check. #22647

Closed
wants to merge 2 commits into from
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
1 change: 1 addition & 0 deletions dev/scalastyle
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ ERRORS=$(echo -e "q\n" \
-Pflume \
-Phive \
-Phive-thriftserver \
-Pspark-ganglia-lgpl \
scalastyle test:scalastyle \
| awk '{if($1~/error/)print}' \
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

package org.apache.spark.metrics.sink

import java.util.Properties
import java.util.{Locale, Properties}
import java.util.concurrent.TimeUnit

import com.codahale.metrics.MetricRegistry
Expand Down Expand Up @@ -64,11 +64,12 @@ class GangliaSink(val property: Properties, val registry: MetricRegistry,
val ttl = propertyToOption(GANGLIA_KEY_TTL).map(_.toInt).getOrElse(GANGLIA_DEFAULT_TTL)
val dmax = propertyToOption(GANGLIA_KEY_DMAX).map(_.toInt).getOrElse(GANGLIA_DEFAULT_DMAX)
val mode: UDPAddressingMode = propertyToOption(GANGLIA_KEY_MODE)
.map(u => GMetric.UDPAddressingMode.valueOf(u.toUpperCase)).getOrElse(GANGLIA_DEFAULT_MODE)
.map(u => GMetric.UDPAddressingMode.valueOf(u.toUpperCase(Locale.Root)))
Copy link
Contributor

Choose a reason for hiding this comment

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

it should be Locale.ROOT

I don't know how the jenkins passed the test, can someone check the jenkins script and see if this ganglia module is totally skipped by jenkins?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

That's odd. Let me check soon within few days.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed in #22658

.getOrElse(GANGLIA_DEFAULT_MODE)
val pollPeriod = propertyToOption(GANGLIA_KEY_PERIOD).map(_.toInt)
.getOrElse(GANGLIA_DEFAULT_PERIOD)
val pollUnit: TimeUnit = propertyToOption(GANGLIA_KEY_UNIT)
.map(u => TimeUnit.valueOf(u.toUpperCase))
.map(u => TimeUnit.valueOf(u.toUpperCase(Locale.Root)))
.getOrElse(GANGLIA_DEFAULT_UNIT)

MetricsSystem.checkMinimalPollingPeriod(pollUnit, pollPeriod)
Expand Down