.../org/apache/hadoop/hive/metastore/HiveMetaStore.java | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java b/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java index e886540..bde1d55 100644 --- a/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java +++ b/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java @@ -32,7 +32,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; -import java.util.Formatter; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -277,19 +276,8 @@ protected Configuration initialValue() { private static ExecutorService threadPool; - public static final String AUDIT_FORMAT = - "ugi=%s\t" + // ugi - "ip=%s\t" + // remote IP - "cmd=%s\t"; // command public static final Logger auditLog = LoggerFactory.getLogger( HiveMetaStore.class.getName() + ".audit"); - private static final ThreadLocal auditFormatter = - new ThreadLocal() { - @Override - protected Formatter initialValue() { - return new Formatter(new StringBuilder(AUDIT_FORMAT.length() * 4)); - } - }; private static final void logAuditEvent(String cmd) { if (cmd == null) { @@ -302,16 +290,13 @@ private static final void logAuditEvent(String cmd) { } catch (Exception ex) { throw new RuntimeException(ex); } - final Formatter fmt = auditFormatter.get(); - ((StringBuilder) fmt.out()).setLength(0); String address = getIPAddress(); if (address == null) { address = "unknown-ip-addr"; } - auditLog.info(fmt.format(AUDIT_FORMAT, ugi.getUserName(), - address, cmd).toString()); + auditLog.info("ugi={} ip={} cmd={} ", ugi.getUserName(), address, cmd); } private static String getIPAddress() {