Author: liyin Date: Fri Mar 14 18:09:46 2014 New Revision: 1577639 URL: http://svn.apache.org/r1577639 Log: [HBASE-7099][89-fb] Debugging why compaction hook is not populating kvsConverted, but populates bytesSaved
Author: adela Summary: added some more logging and change differenceInBytes method Test Plan: ran TestLowerToUpperCompactionHook Reviewers: gauravm, manukranthk, aaiyer Reviewed By: gauravm CC: hbase-eng@ Differential Revision: https://phabricator.fb.com/D1208280 Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/RestrictedKeyValue.java hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/RestrictedKeyValue.java URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/RestrictedKeyValue.java?rev=1577639&r1=1577638&r2=1577639&view=diff ============================================================================== --- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/RestrictedKeyValue.java (original) +++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/RestrictedKeyValue.java Fri Mar 14 18:09:46 2014 @@ -84,7 +84,7 @@ public class RestrictedKeyValue { /** * Compare how many bytes the value of this keyvalue is taking comparing to - * the other. Negative value is good, positive is bad! + * the other. Positive value is good, negative is bad! * * @param other * @return @@ -93,11 +93,11 @@ public class RestrictedKeyValue { if (keyValue == null && other == null) { return 0; } else if (keyValue == null) { - return -other.getLength(); + return other.getLength(); } else if (other == null) { - return keyValue.getLength(); + return -keyValue.getLength(); } else { - return this.keyValue.getValueLength() - other.getValueLength(); + return other.getValueLength() - this.keyValue.getValueLength(); } } Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java?rev=1577639&r1=1577638&r2=1577639&view=diff ============================================================================== --- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java (original) +++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java Fri Mar 14 18:09:46 2014 @@ -1435,11 +1435,19 @@ public class Store extends SchemaConfigu bytesSaved += modifiedKv.differenceInBytes(kv); } else { if (kv != null) { + // TODO: adela check if we are too spamy with this logging + LOG.info("Skipping keyvalue during compaction, due to compaction hook decision: " + + kv); bytesSaved += kv.getLength(); } } if (!restrictedKv.equals(modifiedKv)) { kvsConverted++; + } else { + // TODO: adela check if we are too spamy with this logging + LOG.info("Keyvalue is not modified by compaction hook!" + + " modified: " + modifiedKv + "original: " + + restrictedKv); } } catch (Exception e) { // if exception happened just write unmodified keyvalue
