From 9db6ae1a74f5aa05dfa1ccd9550f608c235257e1 Mon Sep 17 00:00:00 2001 From: Ken Takagiwa Date: Sun, 18 May 2014 03:34:30 -0700 Subject: [PATCH] Consistency for naming for Duration toFormattedString should represent formatted millisecond like "10 ms" not simply give back "10" toString should represent string of duration. It should simply give back string of millisecond. Currently like this. duration = Duration(10) duration.toString() >> "10 ms" duration.toFormattedString() >> "10" Should be duration = Duration(10) duration.toString() >> "10" duration.toFormattedString() >> "10 ms" Please explain what does "formatted" mean? Why does it simply give milli second with string foramt --- .../src/main/scala/org/apache/spark/streaming/Duration.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/streaming/src/main/scala/org/apache/spark/streaming/Duration.scala b/streaming/src/main/scala/org/apache/spark/streaming/Duration.scala index 6bf275f5afcb2..96e33dcf884c3 100644 --- a/streaming/src/main/scala/org/apache/spark/streaming/Duration.scala +++ b/streaming/src/main/scala/org/apache/spark/streaming/Duration.scala @@ -46,9 +46,9 @@ case class Duration (private val millis: Long) { def isZero: Boolean = (this.millis == 0) - override def toString: String = (millis.toString + " ms") + override def toString: String = millis.toString - def toFormattedString: String = millis.toString + def toFormattedString: String = (millis.toString + " ms") def milliseconds: Long = millis