public class UIUtils
extends java.lang.Object
Constructor and Description |
---|
UIUtils() |
Modifier and Type | Method and Description |
---|---|
static double |
convertToTimeUnit(long milliseconds,
java.util.concurrent.TimeUnit unit)
Convert
milliseconds to the specified unit . |
static java.lang.String |
createOutputOperationFailureForUI(java.lang.String failure) |
static scala.collection.Seq<scala.xml.Node> |
failureReasonCell(java.lang.String failureReason,
int rowspan,
boolean includeFirstLineInExpandDetails) |
static java.lang.String |
formatBatchTime(long batchTime,
long batchInterval,
boolean showYYYYMMSS,
java.util.TimeZone timezone)
If
batchInterval is less than 1 second, format batchTime with milliseconds. |
static scala.Tuple2<java.lang.Object,java.util.concurrent.TimeUnit> |
normalizeDuration(long milliseconds)
Find the best
TimeUnit for converting milliseconds to a friendly string. |
static java.lang.String |
shortTimeUnitString(java.util.concurrent.TimeUnit unit)
Return the short string for a
TimeUnit . |
public static java.lang.String shortTimeUnitString(java.util.concurrent.TimeUnit unit)
TimeUnit
.unit
- (undocumented)public static scala.Tuple2<java.lang.Object,java.util.concurrent.TimeUnit> normalizeDuration(long milliseconds)
TimeUnit
for converting milliseconds to a friendly string. Return the value
after converting, also with its TimeUnit.milliseconds
- (undocumented)public static double convertToTimeUnit(long milliseconds, java.util.concurrent.TimeUnit unit)
milliseconds
to the specified unit
. We cannot use TimeUnit.convert
because it
will discard the fractional part.milliseconds
- (undocumented)unit
- (undocumented)public static java.lang.String formatBatchTime(long batchTime, long batchInterval, boolean showYYYYMMSS, java.util.TimeZone timezone)
batchInterval
is less than 1 second, format batchTime
with milliseconds. Otherwise,
format batchTime
without milliseconds.
batchTime
- the batch time to be formattedbatchInterval
- the batch intervalshowYYYYMMSS
- if showing the yyyy/MM/dd
part. If it's false, the return value wll be
only HH:mm:ss
or HH:mm:ss.SSS
depending on batchInterval
timezone
- only for testpublic static java.lang.String createOutputOperationFailureForUI(java.lang.String failure)
public static scala.collection.Seq<scala.xml.Node> failureReasonCell(java.lang.String failureReason, int rowspan, boolean includeFirstLineInExpandDetails)