Skip to content

Commit

Permalink
Fixed bugs.
Browse files Browse the repository at this point in the history
  • Loading branch information
tdas committed Apr 17, 2014
1 parent 8533094 commit 91bfa72
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion core/src/main/scala/org/apache/spark/ui/UIUtils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,11 @@ private[spark] object UIUtils extends Logging {
(records, "")
}
}
"%.1f%s".formatLocal(Locale.US, value, unit)
if (unit.isEmpty) {
"%d".formatLocal(Locale.US, value)
} else {
"%.1f%s".formatLocal(Locale.US, value, unit)
}
}

// Yarn has to go through a proxy so the base uri is provided and has to be on all links
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ class KafkaStreamSuite extends TestSuiteBase {
val test3: NetworkInputDStream[(String, String)] =
KafkaUtils.createStream[String, String, StringDecoder, StringDecoder](
ssc, kafkaParams, topics, StorageLevel.MEMORY_AND_DISK_SER_2)
assert(test1.isInstanceOf)

// TODO: Actually test receiving data
ssc.stop()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ private[streaming] abstract class NetworkReceiverExecutor(
}

/** Check if receiver has been marked for stopping */
def isReceiverStarted() = {
def isReceiverStarted() = synchronized {
logDebug("state = " + receiverState)
receiverState == Started
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ private[ui] class StreamingPage(parent: StreamingTab)
val receiverInfo = listener.receiverInfo(receiverId)
val receiverName = receiverInfo.map(_.toString).getOrElse(s"Receiver-$receiverId")
val receiverLocation = receiverInfo.map(_.location).getOrElse(emptyCell)
val receiverLastBatchRecords = formatDurationVerbose(lastBatchReceivedRecord(receiverId))
val receiverLastBatchRecords = formatNumber(lastBatchReceivedRecord(receiverId))
val receivedRecordStats = receivedRecordDistributions(receiverId).map { d =>
d.getQuantiles().map(r => formatDurationVerbose(r.toLong))
d.getQuantiles().map(r => formatNumber(r.toLong))
}.getOrElse {
Seq(emptyCell, emptyCell, emptyCell, emptyCell, emptyCell)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ class TestReceiver extends NetworkReceiver[Int](StorageLevel.MEMORY_ONLY) with L
def onStart() {
val thread = new Thread() {
override def run() {
logInfo("Receiving started")
while (!isStopped) {
store(TestReceiver.counter.getAndIncrement)
}
Expand Down

0 comments on commit 91bfa72

Please sign in to comment.