You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by xu...@apache.org on 2015/02/06 04:33:41 UTC

svn commit: r1657742 - /hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/lazy/LazyBinary.java

Author: xuefu
Date: Fri Feb  6 03:33:41 2015
New Revision: 1657742

URL: http://svn.apache.org/r1657742
Log:
HIVE-9586: Too verbose log can hurt performance, we should always check log level first (Rui via Xuefu)

Modified:
    hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/lazy/LazyBinary.java

Modified: hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/lazy/LazyBinary.java
URL: http://svn.apache.org/viewvc/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/lazy/LazyBinary.java?rev=1657742&r1=1657741&r2=1657742&view=diff
==============================================================================
--- hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/lazy/LazyBinary.java (original)
+++ hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/lazy/LazyBinary.java Fri Feb  6 03:33:41 2015
@@ -27,6 +27,7 @@ import org.apache.hadoop.io.BytesWritabl
 public class LazyBinary extends LazyPrimitive<LazyBinaryObjectInspector, BytesWritable> {
 
   private static final Log LOG = LogFactory.getLog(LazyBinary.class);
+  private static final boolean DEBUG_LOG_ENABLED = LOG.isDebugEnabled();
 
   LazyBinary(LazyBinaryObjectInspector oi) {
     super(oi);
@@ -55,7 +56,7 @@ public class LazyBinary extends LazyPrim
   // todo this should be configured in serde
   private byte[] decodeIfNeeded(byte[] recv) {
     boolean arrayByteBase64 = Base64.isArrayByteBase64(recv);
-    if (arrayByteBase64) {
+    if (DEBUG_LOG_ENABLED && arrayByteBase64) {
       LOG.debug("Data only contains Base64 alphabets only so try to decode the data.");
     }
     return arrayByteBase64 ? Base64.decodeBase64(recv) : recv;