@InterfaceAudience.Public @InterfaceStability.Unstable public class DurationInfo extends org.apache.hadoop.util.OperationDuration implements AutoCloseable
close()
call.
This allows it to be used in a try-with-resources clause, and have the
duration automatically logged.Constructor and Description |
---|
DurationInfo(org.slf4j.Logger log,
boolean logAtInfo,
String format,
Object... args)
Create the duration text from a
String.format() code call
and log either at info or debug. |
DurationInfo(org.slf4j.Logger log,
String format,
Object... args)
Create the duration text from a
String.format() code call;
log output at info level. |
Modifier and Type | Method and Description |
---|---|
void |
close() |
String |
toString() |
public DurationInfo(org.slf4j.Logger log, String format, Object... args)
String.format()
code call;
log output at info level.log
- log to write toformat
- format stringargs
- list of argumentspublic DurationInfo(org.slf4j.Logger log, boolean logAtInfo, String format, Object... args)
String.format()
code call
and log either at info or debug.log
- log to write tologAtInfo
- should the log be at info, rather than debugformat
- format stringargs
- list of argumentspublic String toString()
toString
in class org.apache.hadoop.util.OperationDuration
public void close()
close
in interface AutoCloseable
Copyright © 2019 Apache Software Foundation. All rights reserved.