Skip to content

Commit

Permalink
Code style changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jerryshao committed Jul 24, 2013
1 parent 05637de commit 8d1ef7f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 2 additions & 0 deletions conf/metrics.properties.template
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# syntax: [instance].[sink|source].[name].[options]

#*.sink.console.class=spark.metrics.sink.ConsoleSink

#*.sink.console.period=10

#*.sink.console.unit=second
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/scala/spark/deploy/master/MasterSource.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package spark.deploy.master

import com.codahale.metrics.{Gauge,MetricRegistry}
import com.codahale.metrics.{Gauge, MetricRegistry}

import spark.metrics.source.Source

Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions core/src/main/scala/spark/metrics/MetricsConfig.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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) {
Expand Down
1 change: 0 additions & 1 deletion core/src/main/scala/spark/metrics/sink/ConsoleSink.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit 8d1ef7f

Please sign in to comment.