You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by bu...@apache.org on 2015/06/23 07:37:19 UTC
[1/2] hbase git commit: Revert "Use ProtobufMagic methods in
ProtobufUtil"
Repository: hbase
Updated Branches:
refs/heads/master b636c6b1c -> 6a537eb85
Revert "Use ProtobufMagic methods in ProtobufUtil"
This reverts commit 6b37f26280ea7e2f475f9813301543411e71383b.
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/abc2e61e
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/abc2e61e
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/abc2e61e
Branch: refs/heads/master
Commit: abc2e61eb17f911f6beff2592b81b1165744e16f
Parents: b636c6b
Author: Sean Busbey <bu...@apache.org>
Authored: Tue Jun 23 00:30:25 2015 -0500
Committer: Sean Busbey <bu...@apache.org>
Committed: Tue Jun 23 00:30:25 2015 -0500
----------------------------------------------------------------------
.../org/apache/hadoop/hbase/protobuf/ProtobufUtil.java | 11 +++++++----
.../org/apache/hadoop/hbase/protobuf/ProtobufMagic.java | 2 ++
2 files changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/abc2e61e/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java
index b72f0bb..1bcf1e6 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java
@@ -264,7 +264,8 @@ public final class ProtobufUtil {
* @return True if passed <code>bytes</code> has {@link ProtobufMagic#PB_MAGIC} for a prefix.
*/
public static boolean isPBMagicPrefix(final byte [] bytes) {
- return ProtobufMagic.isPBMagicPrefix(bytes);
+ if (bytes == null) return false;
+ return isPBMagicPrefix(bytes, 0, bytes.length);
}
/**
@@ -274,7 +275,9 @@ public final class ProtobufUtil {
* @return True if passed <code>bytes</code> has {@link ProtobufMagic#PB_MAGIC} for a prefix.
*/
public static boolean isPBMagicPrefix(final byte [] bytes, int offset, int len) {
- return ProtobufMagic.isPBMagicPrefix(bytes, offset, len);
+ if (bytes == null || len < ProtobufMagic.PB_MAGIC.length) return false;
+ return Bytes.compareTo(ProtobufMagic.PB_MAGIC, 0, ProtobufMagic.PB_MAGIC.length,
+ bytes, offset, ProtobufMagic.PB_MAGIC.length) == 0;
}
/**
@@ -289,10 +292,10 @@ public final class ProtobufUtil {
}
/**
- * @return Length of {@link ProtobufMagic#lengthOfPBMagic()}
+ * @return Length of {@link ProtobufMagic#PB_MAGIC}
*/
public static int lengthOfPBMagic() {
- return ProtobufMagic.lengthOfPBMagic();
+ return ProtobufMagic.PB_MAGIC.length;
}
/**
http://git-wip-us.apache.org/repos/asf/hbase/blob/abc2e61e/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufMagic.java
----------------------------------------------------------------------
diff --git a/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufMagic.java b/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufMagic.java
index 7bd1bf9..bf94757 100644
--- a/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufMagic.java
+++ b/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufMagic.java
@@ -22,6 +22,8 @@ import org.apache.hadoop.hbase.classification.InterfaceAudience;
/**
* Protobufs utility.
*/
+@edu.umd.cs.findbugs.annotations.SuppressWarnings(value="DP_CREATE_CLASSLOADER_INSIDE_DO_PRIVILEGED",
+ justification="None. Address sometime.")
@InterfaceAudience.Private
public class ProtobufMagic {
[2/2] hbase git commit: HBASE-13900 Use ProtobufMagic methods in
ProtobufUtil
Posted by bu...@apache.org.
HBASE-13900 Use ProtobufMagic methods in ProtobufUtil
Signed-off-by: Andrew Purtell <ap...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/6a537eb8
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/6a537eb8
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/6a537eb8
Branch: refs/heads/master
Commit: 6a537eb8545c7dd6c01c0d911ad12e789eeab3ae
Parents: abc2e61
Author: Gábor Lipták <gl...@gmail.com>
Authored: Tue Jun 16 21:13:58 2015 -0400
Committer: Sean Busbey <bu...@apache.org>
Committed: Tue Jun 23 00:32:23 2015 -0500
----------------------------------------------------------------------
.../org/apache/hadoop/hbase/protobuf/ProtobufUtil.java | 11 ++++-------
.../org/apache/hadoop/hbase/protobuf/ProtobufMagic.java | 2 --
2 files changed, 4 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/6a537eb8/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java
index 1bcf1e6..b72f0bb 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java
@@ -264,8 +264,7 @@ public final class ProtobufUtil {
* @return True if passed <code>bytes</code> has {@link ProtobufMagic#PB_MAGIC} for a prefix.
*/
public static boolean isPBMagicPrefix(final byte [] bytes) {
- if (bytes == null) return false;
- return isPBMagicPrefix(bytes, 0, bytes.length);
+ return ProtobufMagic.isPBMagicPrefix(bytes);
}
/**
@@ -275,9 +274,7 @@ public final class ProtobufUtil {
* @return True if passed <code>bytes</code> has {@link ProtobufMagic#PB_MAGIC} for a prefix.
*/
public static boolean isPBMagicPrefix(final byte [] bytes, int offset, int len) {
- if (bytes == null || len < ProtobufMagic.PB_MAGIC.length) return false;
- return Bytes.compareTo(ProtobufMagic.PB_MAGIC, 0, ProtobufMagic.PB_MAGIC.length,
- bytes, offset, ProtobufMagic.PB_MAGIC.length) == 0;
+ return ProtobufMagic.isPBMagicPrefix(bytes, offset, len);
}
/**
@@ -292,10 +289,10 @@ public final class ProtobufUtil {
}
/**
- * @return Length of {@link ProtobufMagic#PB_MAGIC}
+ * @return Length of {@link ProtobufMagic#lengthOfPBMagic()}
*/
public static int lengthOfPBMagic() {
- return ProtobufMagic.PB_MAGIC.length;
+ return ProtobufMagic.lengthOfPBMagic();
}
/**
http://git-wip-us.apache.org/repos/asf/hbase/blob/6a537eb8/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufMagic.java
----------------------------------------------------------------------
diff --git a/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufMagic.java b/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufMagic.java
index bf94757..7bd1bf9 100644
--- a/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufMagic.java
+++ b/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufMagic.java
@@ -22,8 +22,6 @@ import org.apache.hadoop.hbase.classification.InterfaceAudience;
/**
* Protobufs utility.
*/
-@edu.umd.cs.findbugs.annotations.SuppressWarnings(value="DP_CREATE_CLASSLOADER_INSIDE_DO_PRIVILEGED",
- justification="None. Address sometime.")
@InterfaceAudience.Private
public class ProtobufMagic {