Skip to content
Snippets Groups Projects
Commit 8d1ef7f2 authored by jerryshao's avatar jerryshao
Browse files

Code style changes

parent 05637de8
No related branches found
No related tags found
No related merge requests found
# syntax: [instance].[sink|source].[name].[options]
#*.sink.console.class=spark.metrics.sink.ConsoleSink
#*.sink.console.period=10
#*.sink.console.unit=second
......
package spark.deploy.master
import com.codahale.metrics.{Gauge,MetricRegistry}
import com.codahale.metrics.{Gauge, MetricRegistry}
import spark.metrics.source.Source
......@@ -10,7 +10,7 @@ private[spark] class MasterSource(val master: Master) extends Source {
// Gauge for worker numbers in cluster
metricRegistry.register(MetricRegistry.name("workers","number"), new Gauge[Int] {
override def getValue: Int = master.workers.size
override def getValue: Int = master.workers.size
})
// Gauge for application numbers in cluster
......
......@@ -3,14 +3,14 @@ package spark.metrics
import java.util.Properties
import java.io.{File, FileInputStream}
import scala.collection.mutable.HashMap
import scala.collection.mutable
import scala.util.matching.Regex
private[spark] class MetricsConfig(val configFile: String) {
val properties = new Properties()
val DEFAULT_PREFIX = "*"
val INSTANCE_REGEX = "^(\\*|[a-zA-Z]+)\\.(.+)".r
var propertyCategories: HashMap[String, Properties] = null
var propertyCategories: mutable.HashMap[String, Properties] = null
private def setDefaultProperties(prop: Properties) {
prop.setProperty("*.sink.jmx.enabled", "default")
......@@ -43,8 +43,8 @@ private[spark] class MetricsConfig(val configFile: String) {
}
}
def subProperties(prop: Properties, regex: Regex): HashMap[String, Properties] = {
val subProperties = new HashMap[String, Properties]
def subProperties(prop: Properties, regex: Regex): mutable.HashMap[String, Properties] = {
val subProperties = new mutable.HashMap[String, Properties]
import scala.collection.JavaConversions._
prop.foreach { kv =>
if (regex.findPrefixOf(kv._1) != None) {
......
......@@ -8,7 +8,6 @@ import java.util.concurrent.TimeUnit
import spark.metrics.MetricsSystem
class ConsoleSink(val property: Properties, val registry: MetricRegistry) extends Sink {
val CONSOLE_DEFAULT_PERIOD = "10"
val CONSOLE_DEFAULT_UNIT = "second"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment