kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danburk...@apache.org
Subject kudu git commit: KUDU-1812: don't log user data in the Java client
Date Fri, 23 Dec 2016 03:37:59 GMT
Repository: kudu
Updated Branches:
  refs/heads/master 9efb2f864 -> a68779bc4


KUDU-1812: don't log user data in the Java client

I manually inspected a few logs to make sure nothing remained. I wasn't sure
about a few changes, I added comments on those. No new tests since it's the
same functionality.

Change-Id: I1f3dd9dad7bac1d005bd3eead8df33005c7f8c58
Reviewed-on: http://gerrit.cloudera.org:8080/5549
Reviewed-by: Dan Burkert <danburkert@apache.org>
Tested-by: Kudu Jenkins
Tested-by: Dan Burkert <danburkert@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/a68779bc
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/a68779bc
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/a68779bc

Branch: refs/heads/master
Commit: a68779bc4b0187e649ce1210716881f346b05981
Parents: 9efb2f8
Author: Jean-Daniel Cryans <jdcryans@apache.org>
Authored: Mon Dec 19 17:20:10 2016 -0800
Committer: Dan Burkert <danburkert@apache.org>
Committed: Fri Dec 23 03:36:39 2016 +0000

----------------------------------------------------------------------
 .../java/org/apache/kudu/client/AsyncKuduScanner.java   |  5 +----
 .../org/apache/kudu/client/ColumnRangePredicate.java    |  1 +
 .../src/main/java/org/apache/kudu/client/KuduRpc.java   |  9 +++------
 .../src/main/java/org/apache/kudu/client/Operation.java |  8 --------
 .../src/main/java/org/apache/kudu/client/RowError.java  |  1 +
 .../java/org/apache/kudu/client/SecureRpcHelper.java    |  3 ---
 .../main/java/org/apache/kudu/client/TabletClient.java  | 12 +++++-------
 7 files changed, 11 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/a68779bc/java/kudu-client/src/main/java/org/apache/kudu/client/AsyncKuduScanner.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/main/java/org/apache/kudu/client/AsyncKuduScanner.java b/java/kudu-client/src/main/java/org/apache/kudu/client/AsyncKuduScanner.java
index 2de2b7b..b2b73a5 100644
--- a/java/kudu-client/src/main/java/org/apache/kudu/client/AsyncKuduScanner.java
+++ b/java/kudu-client/src/main/java/org/apache/kudu/client/AsyncKuduScanner.java
@@ -279,7 +279,7 @@ public final class AsyncKuduScanner {
     // If the partition pruner has pruned all partitions, then the scan can be
     // short circuited without contacting any tablet servers.
     if (!pruner.hasMorePartitionKeyRanges()) {
-      LOG.debug("Short circuiting scan with predicates: {}", predicates.values());
+      LOG.debug("Short circuiting scan");
       this.hasMore = false;
       this.closed = true;
     }
@@ -790,9 +790,6 @@ public final class AsyncKuduScanner {
       }
 
       ScanRequestPB request = builder.build();
-      if (LOG.isDebugEnabled()) {
-        LOG.debug("Sending scan req: " + request.toString());
-      }
 
       return toChannelBuffer(header, request);
     }

http://git-wip-us.apache.org/repos/asf/kudu/blob/a68779bc/java/kudu-client/src/main/java/org/apache/kudu/client/ColumnRangePredicate.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/main/java/org/apache/kudu/client/ColumnRangePredicate.java
b/java/kudu-client/src/main/java/org/apache/kudu/client/ColumnRangePredicate.java
index 5a2f9e8..c175f0d 100644
--- a/java/kudu-client/src/main/java/org/apache/kudu/client/ColumnRangePredicate.java
+++ b/java/kudu-client/src/main/java/org/apache/kudu/client/ColumnRangePredicate.java
@@ -385,6 +385,7 @@ public class ColumnRangePredicate {
     } catch (InvalidProtocolBufferException e) {
       // We shade our pb dependency so we can't send out the exception above since other
modules
       // won't know what to expect.
+      // Intentionally not redacting the list to make this more useful.
       throw new IllegalArgumentException("Encountered an invalid column range predicate list:
" +
           Bytes.pretty(listBytes), e);
     }

http://git-wip-us.apache.org/repos/asf/kudu/blob/a68779bc/java/kudu-client/src/main/java/org/apache/kudu/client/KuduRpc.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/main/java/org/apache/kudu/client/KuduRpc.java b/java/kudu-client/src/main/java/org/apache/kudu/client/KuduRpc.java
index 0bf5ea9..0f50627 100644
--- a/java/kudu-client/src/main/java/org/apache/kudu/client/KuduRpc.java
+++ b/java/kudu-client/src/main/java/org/apache/kudu/client/KuduRpc.java
@@ -331,7 +331,6 @@ public abstract class KuduRpc<R> {
   }
 
   public String toString() {
-
     final StringBuilder buf = new StringBuilder();
     buf.append("KuduRpc(method=");
     buf.append(method());
@@ -365,8 +364,7 @@ public abstract class KuduRpc<R> {
             " incompatible RPC? Error is: " + builder.getInitializationErrorString());
       }
     } catch (InvalidProtocolBufferException e) {
-      throw new RuntimeException("Invalid RPC response: length=" + length +
-            ", payload=" + Bytes.pretty(payload));
+      throw new RuntimeException("Invalid RPC response: length=" + length, e);
     }
   }
 
@@ -416,11 +414,10 @@ public abstract class KuduRpc<R> {
     if ((length & MAX_BYTE_ARRAY_MASK) != 0) {
       if (length < 0) {
         throw new IllegalArgumentException("Read negative byte array length: " +
-            length + " in buf=" + buf + '=' + Bytes.pretty(buf));
+            length + " in buf=" + buf);
       } else {
         throw new IllegalArgumentException("Read byte array length that's too" +
-            " large: " + length + " > " + ~MAX_BYTE_ARRAY_MASK + " in buf=" +
-            buf + '=' + Bytes.pretty(buf));
+            " large: " + length + " > " + ~MAX_BYTE_ARRAY_MASK + " in buf=" + buf);
       }
     }
   }

http://git-wip-us.apache.org/repos/asf/kudu/blob/a68779bc/java/kudu-client/src/main/java/org/apache/kudu/client/Operation.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/main/java/org/apache/kudu/client/Operation.java b/java/kudu-client/src/main/java/org/apache/kudu/client/Operation.java
index 5d214b7..a8925cf 100644
--- a/java/kudu-client/src/main/java/org/apache/kudu/client/Operation.java
+++ b/java/kudu-client/src/main/java/org/apache/kudu/client/Operation.java
@@ -199,14 +199,6 @@ public abstract class Operation extends KuduRpc<OperationResponse>
{
     tabletStatistics.incrementStatistic(Statistic.BYTES_WRITTEN, getRowOperationSizeBytes());
   }
 
-  @Override
-  public String toString() {
-    StringBuilder sb = new StringBuilder(super.toString());
-    sb.append(' ');
-    sb.append(row.toString());
-    return sb.toString();
-  }
-
   /**
    * Helper method that puts a list of Operations together into a WriteRequestPB.
    * @param operations The list of ops to put together in a WriteRequestPB

http://git-wip-us.apache.org/repos/asf/kudu/blob/a68779bc/java/kudu-client/src/main/java/org/apache/kudu/client/RowError.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/main/java/org/apache/kudu/client/RowError.java b/java/kudu-client/src/main/java/org/apache/kudu/client/RowError.java
index 2b872bb..cd84435 100644
--- a/java/kudu-client/src/main/java/org/apache/kudu/client/RowError.java
+++ b/java/kudu-client/src/main/java/org/apache/kudu/client/RowError.java
@@ -96,6 +96,7 @@ public class RowError {
 
   @Override
   public String toString() {
+    // Intentionally not redacting the row key to make this more useful.
     return "Row error for primary key=" + Bytes.pretty(operation.getRow().encodePrimaryKey())
+
         ", tablet=" + operation.getTablet() +
         ", server=" + tsUUID +

http://git-wip-us.apache.org/repos/asf/kudu/blob/a68779bc/java/kudu-client/src/main/java/org/apache/kudu/client/SecureRpcHelper.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/main/java/org/apache/kudu/client/SecureRpcHelper.java b/java/kudu-client/src/main/java/org/apache/kudu/client/SecureRpcHelper.java
index 34ef397..c0bfe46 100644
--- a/java/kudu-client/src/main/java/org/apache/kudu/client/SecureRpcHelper.java
+++ b/java/kudu-client/src/main/java/org/apache/kudu/client/SecureRpcHelper.java
@@ -183,9 +183,6 @@ public class SecureRpcHelper {
       ret.clear();
       ret.writeInt(wrapped.length);
       ret.writeBytes(wrapped);
-      if (LOG.isDebugEnabled()) {
-        LOG.debug("Wrapped payload: " + Bytes.pretty(ret));
-      }
       return ret;
     } catch (SaslException e) {
       throw new IllegalStateException("Failed to wrap payload", e);

http://git-wip-us.apache.org/repos/asf/kudu/blob/a68779bc/java/kudu-client/src/main/java/org/apache/kudu/client/TabletClient.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/main/java/org/apache/kudu/client/TabletClient.java b/java/kudu-client/src/main/java/org/apache/kudu/client/TabletClient.java
index c710b4c..eb6adf0 100644
--- a/java/kudu-client/src/main/java/org/apache/kudu/client/TabletClient.java
+++ b/java/kudu-client/src/main/java/org/apache/kudu/client/TabletClient.java
@@ -280,7 +280,7 @@ public class TabletClient extends ReplayingDecoder<VoidEnum> {
 
     if (LOG.isDebugEnabled()) {
       LOG.debug(getPeerUuidLoggingString() + chan + " Sending RPC #" + rpcid +
-          ", payload=" + payload + ' ' + Bytes.pretty(payload));
+          ", payload=" + payload);
     }
 
     payload = secureRpcHelper.wrap(payload);
@@ -400,7 +400,7 @@ public class TabletClient extends ReplayingDecoder<VoidEnum> {
     if (!header.hasCallId()) {
       final int size = response.getTotalResponseSize();
       final String msg = getPeerUuidLoggingString() + "RPC response (size: " + size + ")
doesn't" +
-          " have a call ID: " + header + ", buf=" + Bytes.pretty(buf);
+          " have a call ID: " + header;
       LOG.error(msg);
       Status statusIncomplete = Status.Incomplete(msg);
       throw new NonRecoverableException(statusIncomplete);
@@ -411,8 +411,7 @@ public class TabletClient extends ReplayingDecoder<VoidEnum> {
     final KuduRpc rpc = rpcsInflight.get(rpcid);
 
     if (rpc == null) {
-      final String msg = getPeerUuidLoggingString() + "Invalid rpcid: " + rpcid + " found
in " +
-          buf + '=' + Bytes.pretty(buf);
+      final String msg = getPeerUuidLoggingString() + "Invalid rpcid: " + rpcid;
       LOG.error(msg);
       Status statusIllegalState = Status.IllegalState(msg);
       // The problem here is that we don't know which Deferred corresponds to
@@ -524,7 +523,7 @@ public class TabletClient extends ReplayingDecoder<VoidEnum> {
       }
     } catch (Exception e) {
       LOG.debug(getPeerUuidLoggingString() + "Unexpected exception while handling RPC #"
+ rpcid +
-          ", rpc=" + rpc + ", buf=" + Bytes.pretty(buf), e);
+          ", rpc=" + rpc, e);
     }
     if (LOG.isDebugEnabled()) {
       LOG.debug("------------------<< LEAVING  DECODE <<------------------" +
@@ -620,8 +619,7 @@ public class TabletClient extends ReplayingDecoder<VoidEnum> {
         if (buf.readable()) {
           LOG.error(getPeerUuidLoggingString() + "After decoding the last message on " +
chan +
               ", there was still some undecoded bytes in the channel's" +
-              " buffer (which are going to be lost): " +
-              buf + '=' + Bytes.pretty(buf));
+              " buffer (which are going to be lost)");
         }
       }
     } else {


Mime
View raw message