Skip to content

Commit

Permalink
Removed trailing whitespace.
Browse files Browse the repository at this point in the history
Signed-off-by: Jonas Bonér <[email protected]>
  • Loading branch information
jboner committed Aug 29, 2011
1 parent 0e063f0 commit 62f5d47
Show file tree
Hide file tree
Showing 28 changed files with 91 additions and 91 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ object LatchOrder {
case bid: Bid new Bid(order.orderbookSymbol, order.price, order.volume) with LatchMessage { val count = 2 }
case ask: Ask new Ask(order.orderbookSymbol, order.price, order.volume) with LatchMessage { val count = 2 }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ class OrderbookTest extends JUnitSuite {
verify(tradeObserverMock).trade(any(classOf[Bid]), any(classOf[Ask]))
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ object TotalTradeCounter {
def reset() {
counter.set(0)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ class OneWayTradingSystem extends AkkaTradingSystem {
case _ actorOf(Props[OneWayOrderReceiver])
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -234,4 +234,4 @@ object GoogleChartBuilder {
new java.math.BigDecimal(value).setScale(2, java.math.RoundingMode.HALF_EVEN).toString
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -217,4 +217,4 @@ class Report(
"""|</body>"
|</html>""".stripMargin

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ class ListenerSpec extends WordSpec with MustMatchers {
for (a List(broadcast, a1, a2, a3)) a.stop()
}
}
}
}
8 changes: 4 additions & 4 deletions akka-actor/src/main/scala/akka/cluster/ClusterInterface.scala
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ object NodeAddress {
}

/*
* Allows user to access metrics of a different nodes in the cluster. Changing metrics can be monitored
* Allows user to access metrics of a different nodes in the cluster. Changing metrics can be monitored
* using {@link MetricsAlterationMonitor}
* Metrics of the cluster nodes are distributed through ZooKeeper. For better performance, metrics are
* cached internally, and refreshed from ZooKeeper after an interval
Expand All @@ -141,7 +141,7 @@ trait NodeMetricsManager {
def getAllMetrics: Array[NodeMetrics]

/*
* Adds monitor that reacts, when specific conditions are satisfied
* Adds monitor that reacts, when specific conditions are satisfied
*/
def addMonitor(monitor: MetricsAlterationMonitor): Unit

Expand All @@ -166,13 +166,13 @@ trait NodeMetricsManager {
def refreshTimeout: Duration

/*
* Starts metrics manager. When metrics manager is started, it refreshes cache from ZooKeeper
* Starts metrics manager. When metrics manager is started, it refreshes cache from ZooKeeper
* after <code>refreshTimeout</code>, and invokes plugged monitors
*/
def start(): NodeMetricsManager

/*
* Stops metrics manager. Stopped metrics manager doesn't refresh cache from ZooKeeper,
* Stops metrics manager. Stopped metrics manager doesn't refresh cache from ZooKeeper,
* and doesn't invoke plugged monitors
*/
def stop(): Unit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@
package akka.cluster.metrics

/*
* {@link NodeMetricsManager} periodically refershes internal cache with node metrics from MBeans / Sigar.
* Every time local cache is refreshed, monitors plugged to the metrics manager are invoked.
* If updated metrics satisfy conditions, specified in <code>reactsOn</code>,
* {@link NodeMetricsManager} periodically refershes internal cache with node metrics from MBeans / Sigar.
* Every time local cache is refreshed, monitors plugged to the metrics manager are invoked.
* If updated metrics satisfy conditions, specified in <code>reactsOn</code>,
* <code>react</code> is called
*
*
* @exampl {{{
* class PeakCPULoadMonitor extends LocalMetricsAlterationMonitor {
* val id = "peak-cpu-load-monitor"
*
* def reactsOn(metrics: NodeMetrics) =
*
* def reactsOn(metrics: NodeMetrics) =
* metrics.systemLoadAverage > 0.8
*
* def react(metrics: NodeMetrics) =
*
* def react(metrics: NodeMetrics) =
* println("Peak average system load at node [%s] is reached!" format (metrics.nodeName))
* }
* }}}
*
*
*/
trait LocalMetricsAlterationMonitor extends MetricsAlterationMonitor {

/*
/*
* Definies conditions that must be satisfied in order to <code>react<code> on the changed metrics
*/
def reactsOn(metrics: NodeMetrics): Boolean
Expand All @@ -38,27 +38,27 @@ trait LocalMetricsAlterationMonitor extends MetricsAlterationMonitor {
}

/*
* {@link NodeMetricsManager} periodically refershes internal cache with metrics of all nodes in the cluster
* from ZooKeeper. Every time local cache is refreshed, monitors plugged to the metrics manager are invoked.
* If updated metrics satisfy conditions, specified in <code>reactsOn</code>,
* {@link NodeMetricsManager} periodically refershes internal cache with metrics of all nodes in the cluster
* from ZooKeeper. Every time local cache is refreshed, monitors plugged to the metrics manager are invoked.
* If updated metrics satisfy conditions, specified in <code>reactsOn</code>,
* <code>react</code> is called
*
*
* @exampl {{{
* class PeakCPULoadReached extends ClusterMetricsAlterationMonitor {
* val id = "peak-cpu-load-reached"
*
* def reactsOn(metrics: Array[NodeMetrics]) =
*
* def reactsOn(metrics: Array[NodeMetrics]) =
* metrics.forall(_.systemLoadAverage > 0.8)
*
* def react(metrics: Array[NodeMetrics]) =
*
* def react(metrics: Array[NodeMetrics]) =
* println("One of the nodes in the scluster has reached the peak system load!")
* }
* }}}
*
*
*/
trait ClusterMetricsAlterationMonitor extends MetricsAlterationMonitor {

/*
/*
* Definies conditions that must be satisfied in order to <code>react<code> on the changed metrics
*/
def reactsOn(allMetrics: Array[NodeMetrics]): Boolean
Expand All @@ -79,4 +79,4 @@ sealed trait MetricsAlterationMonitor extends Comparable[MetricsAlterationMonito

def compareTo(otherMonitor: MetricsAlterationMonitor) = id.compareTo(otherMonitor.id)

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ trait NodeMetrics {
def usedHeapMemory: Long

/*
* Amount of heap memory guaranteed to be available
* Amount of heap memory guaranteed to be available
*/
def committedHeapMemory: Long

Expand All @@ -35,10 +35,10 @@ trait NodeMetrics {
def avaiableProcessors: Int

/*
* If OS-specific Hyperic Sigar library is plugged, it's used to calculate
* average load on the CPUs in the system. Otherwise, value is retreived from monitoring MBeans.
* If OS-specific Hyperic Sigar library is plugged, it's used to calculate
* average load on the CPUs in the system. Otherwise, value is retreived from monitoring MBeans.
* Hyperic Sigar provides more precise values, and, thus, if the library is provided, it's used by default.
*/
def systemLoadAverage: Double

}
}
2 changes: 1 addition & 1 deletion akka-actor/src/main/scala/akka/dispatch/Dispatchers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -230,4 +230,4 @@ class BalancingDispatcherConfigurator extends MessageDispatcherConfigurator {
mailboxType(config),
threadPoolConfig)).build
}
}
}
2 changes: 1 addition & 1 deletion akka-actor/src/main/scala/akka/util/Index.scala
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,4 @@ class Index[K <: AnyRef, V <: AnyRef: Manifest] {
* Removes all keys and all values
*/
def clear = foreach { case (k, v) remove(k, v) }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ private[camel] object TypedCamel {

private def registerPublishRequestor: Unit = registry.addListener(publishRequestor)
private def unregisterPublishRequestor: Unit = registry.removeListener(publishRequestor)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ private[camel] object TypedCamelAccess {
None
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ package akka.camel

import org.scalatest.junit.JUnitSuite

class ConsumerJavaTest extends ConsumerJavaTestBase with JUnitSuite
class ConsumerJavaTest extends ConsumerJavaTestBase with JUnitSuite
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ import org.I0Itec.zkclient.exception.ZkNoNodeException
import akka.event.EventHandler

/*
* Instance of the metrics manager running on the node. To keep the fine performance, metrics of all the
* Instance of the metrics manager running on the node. To keep the fine performance, metrics of all the
* nodes in the cluster are cached internally, and refreshed from monitoring MBeans / Sigar (when if's local node),
* of ZooKeeper (if it's metrics of all the nodes in the cluster) after a specified timeout -
* of ZooKeeper (if it's metrics of all the nodes in the cluster) after a specified timeout -
* <code>metricsRefreshTimeout</code>
* <code>metricsRefreshTimeout</code> defaults to 2 seconds, and can be declaratively defined through
* akka.conf:
*
*
* @exampl {{{
* akka.cluster.metrics-refresh-timeout = 2
* }}}
Expand Down Expand Up @@ -55,7 +55,7 @@ In order to get better metrics, please put "sigar.jar" to the classpath, and add
@volatile
private var _refreshTimeout = metricsRefreshTimeout

/*
/*
* Plugged monitors (both local and cluster-wide)
*/
private val alterationMonitors = new ConcurrentSkipListSet[MetricsAlterationMonitor]
Expand All @@ -68,7 +68,7 @@ In order to get better metrics, please put "sigar.jar" to the classpath, and add
def isRunning = _isRunning.isOn

/*
* Starts metrics manager. When metrics manager is started, it refreshes cache from ZooKeeper
* Starts metrics manager. When metrics manager is started, it refreshes cache from ZooKeeper
* after <code>refreshTimeout</code>, and invokes plugged monitors
*/
def start() = {
Expand All @@ -79,7 +79,7 @@ In order to get better metrics, please put "sigar.jar" to the classpath, and add
private[cluster] def metricsForNode(nodeName: String): String = "%s/%s".format(node.NODE_METRICS, nodeName)

/*
* Adds monitor that reacts, when specific conditions are satisfied
* Adds monitor that reacts, when specific conditions are satisfied
*/
def addMonitor(monitor: MetricsAlterationMonitor) = alterationMonitors add monitor

Expand Down Expand Up @@ -181,7 +181,7 @@ In order to get better metrics, please put "sigar.jar" to the classpath, and add
}

// RACY: metrics for the node might have been removed both from ZK and local cache by the moment,
// but will be re-cached, since they're still present in allMetricsFromZK snapshot. Not important, because
// but will be re-cached, since they're still present in allMetricsFromZK snapshot. Not important, because
// cache will be fixed soon, at the next iteration of refresh
allMetricsFromZK map {
case (node, metrics)
Expand All @@ -199,8 +199,8 @@ In order to get better metrics, please put "sigar.jar" to the classpath, and add
val localNodeMetrics = clusterNodesMetrics.find(_.nodeName == nodeAddress.nodeName)
val iterator = alterationMonitors.iterator

// RACY: there might be new monitors added after the iterator has been obtained. Not important,
// becuse refresh interval is meant to be very short, and all the new monitors will be called ad the
// RACY: there might be new monitors added after the iterator has been obtained. Not important,
// becuse refresh interval is meant to be very short, and all the new monitors will be called ad the
// next refresh iteration
while (iterator.hasNext) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ import akka.util.Switch

/*
* Snapshot of the JVM / system that's the node is running on
*
*
* @param nodeName name of the node, where metrics are gathered at
* @param usedHeapMemory amount of heap memory currently used
* @param committedHeapMemory amount of heap memory guaranteed to be available
* @param committedHeapMemory amount of heap memory guaranteed to be available
* @param maxHeapMemory maximum amount of heap memory that can be used
* @param avaiableProcessors number of the processors avalable to the JVM
* @param systemLoadAverage system load average. If OS-specific Sigar's native library is plugged,
* it's used to calculate average load on the CPUs in the system. Otherwise, value is retreived from monitoring
* @param systemLoadAverage system load average. If OS-specific Sigar's native library is plugged,
* it's used to calculate average load on the CPUs in the system. Otherwise, value is retreived from monitoring
* MBeans. Hyperic Sigar provides more precise values, and, thus, if the library is provided, it's used by default.
*
*
*/
case class DefaultNodeMetrics(nodeName: String,
usedHeapMemory: Long,
Expand Down Expand Up @@ -74,7 +74,7 @@ class JMXMetricsProvider extends MetricsProvider {

/*
* Validates and calculates system load average
*
*
* @param avg system load average obtained from a specific monitoring provider (may be incorrect)
* @return system load average, or default value(<code>0.5</code>), if passed value was out of permitted
* bounds (0.0 to 1.0)
Expand All @@ -97,7 +97,7 @@ class JMXMetricsProvider extends MetricsProvider {

/*
* Loads wider range of metrics of a better quality with Hyperic Sigar (native library)
*
*
* @param refreshTimeout Sigar gathers metrics during this interval
*/
class SigarMetricsProvider private (private val sigarInstance: AnyRef) extends JMXMetricsProvider {
Expand All @@ -109,7 +109,7 @@ class SigarMetricsProvider private (private val sigarInstance: AnyRef) extends J

/*
* Wraps reflective calls to Hyperic Sigar
*
*
* @param f reflective call to Hyperic Sigar
* @param fallback function, which is invoked, if call to Sigar has been finished with exception
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,4 +363,4 @@ final class InMemoryStorage extends Storage {
// def update(key: String, bytes: Array[Byte]) {
// throw new UnsupportedOperationException()
// }
//}
//}
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,4 @@ class RoundRobin2ReplicasMultiJvmNode2 extends ClusterTestNode {
node.shutdown()
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -224,4 +224,4 @@ class PongNode(number: Int) {
node.stop
}
}
*/
*/
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,4 @@ object ClusteredPingPongSample {
Cluster.shutdownLocalCluster()
}
}
*/
*/
Original file line number Diff line number Diff line change
Expand Up @@ -238,4 +238,4 @@ class InMemoryStorageSpec extends WordSpec with MustMatchers {
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ object StorageTestUtils {
val found = storage.load(key)
org.junit.Assert.assertArrayEquals(expectedData, found.data)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,4 @@ class ZooKeeperStorageSpec extends WordSpec with MustMatchers with BeforeAndAfte
}
} */

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ object BSONSerializableMailbox extends SerializableBSONObject[MongoDurableMessag
serializer.putObject(doc)
}

/*
/*
* TODO - Implement some object pooling for the Encoders/decoders
*/
def encode(msg: MongoDurableMessage, out: OutputBuffer) = {
Expand Down
Loading

0 comments on commit 62f5d47

Please sign in to comment.