You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by an...@apache.org on 2016/05/16 06:47:23 UTC
[3/3] phoenix git commit: PHOENIX-2887 Uberjar application fail with
'IllegalAccessError: class com.google.protobuf.ZeroCopyLiteralByteString
cannot access its superclass com.google.protobuf.LiteralByteString'
PHOENIX-2887 Uberjar application fail with 'IllegalAccessError: class com.google.protobuf.ZeroCopyLiteralByteString cannot access its superclass com.google.protobuf.LiteralByteString'
Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/5d641ad3
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/5d641ad3
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/5d641ad3
Branch: refs/heads/master
Commit: 5d641ad34207b8e87b1f460a168664387f143286
Parents: 20ce95b
Author: Ankit Singhal <an...@gmail.com>
Authored: Mon May 16 12:17:05 2016 +0530
Committer: Ankit Singhal <an...@gmail.com>
Committed: Mon May 16 12:17:05 2016 +0530
----------------------------------------------------------------------
dev/test-patch.properties | 1 +
dev/test-patch.sh | 32 ++++++++++++++++++++
.../apache/phoenix/cache/ServerCacheClient.java | 3 +-
.../org/apache/phoenix/schema/PTableImpl.java | 8 ++---
4 files changed, 37 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/phoenix/blob/5d641ad3/dev/test-patch.properties
----------------------------------------------------------------------
diff --git a/dev/test-patch.properties b/dev/test-patch.properties
index 53f2ad4..8d1e2ed 100644
--- a/dev/test-patch.properties
+++ b/dev/test-patch.properties
@@ -33,3 +33,4 @@ BRANCH_NAMES="4.4-HBase-0.98 4.4-HBase-1.0 4.4-HBase-1.1 4.x-HBase-0.98 4.x-HBas
# All supported Hadoop versions that we want to test the compilation with
HADOOP2_VERSIONS="2.4.1 2.5.2 2.6.0"
HADOOP3_VERSIONS="3.0.0-SNAPSHOT"
+INCOMPATIBLE_CLASSES="com.google.protobuf.HBaseZeroCopyByteString"
http://git-wip-us.apache.org/repos/asf/phoenix/blob/5d641ad3/dev/test-patch.sh
----------------------------------------------------------------------
diff --git a/dev/test-patch.sh b/dev/test-patch.sh
index 5ee1607..4454e13 100755
--- a/dev/test-patch.sh
+++ b/dev/test-patch.sh
@@ -520,6 +520,36 @@ checkAntiPatterns () {
}
###############################################################################
+### Check against use of known incompatible classes
+checkUseOfIncompatibleClasses () {
+ echo ""
+ echo ""
+ echo "======================================================================"
+ echo "======================================================================"
+ echo " Checking against use of known incompatible classes."
+ echo "======================================================================"
+ echo "======================================================================"
+ echo ""
+ echo ""
+ for INCOMPATIBLE_CLASS in $INCOMPATIBLE_CLASSES ; do
+ warning=`$GREP "+import $INCOMPATIBLE_CLASS" $PATCH_DIR/patch`
+ if [[ $warning != "" ]]; then
+ warnings="$warnings
+ $INCOMPATIBLE_CLASS"
+ (( count = count + 1 ))
+ fi
+ done
+ if [[ $warnings != "" ]]; then
+ JIRA_COMMENT="$JIRA_COMMENT
+
+ {color:red}-1 Known Incompatible class{color}. The patch appears to have $count incompatible classes:
+ $warnings."
+ return 1
+ fi
+ return 0
+}
+
+###############################################################################
### Check that there are no incorrect annotations
checkInterfaceAudience () {
echo ""
@@ -1050,6 +1080,8 @@ fi
checkAntiPatterns
(( RESULT = RESULT + $? ))
+checkUseOfIncompatibleClasses
+(( RESULT = RESULT + $? ))
# checkBuildWithHadoopVersions
# (( RESULT = RESULT + $? ))
checkJavacWarnings
http://git-wip-us.apache.org/repos/asf/phoenix/blob/5d641ad3/phoenix-core/src/main/java/org/apache/phoenix/cache/ServerCacheClient.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/cache/ServerCacheClient.java b/phoenix-core/src/main/java/org/apache/phoenix/cache/ServerCacheClient.java
index 424482a..aea15c2 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/cache/ServerCacheClient.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/cache/ServerCacheClient.java
@@ -71,7 +71,6 @@ import org.apache.phoenix.util.SQLCloseables;
import org.apache.phoenix.util.ScanUtil;
import com.google.common.collect.ImmutableSet;
-import com.google.protobuf.HBaseZeroCopyByteString;
/**
*
@@ -214,7 +213,7 @@ public class ServerCacheClient {
ServerCacheFactoryProtos.ServerCacheFactory.Builder svrCacheFactoryBuider = ServerCacheFactoryProtos.ServerCacheFactory.newBuilder();
svrCacheFactoryBuider.setClassName(cacheFactory.getClass().getName());
builder.setCacheFactory(svrCacheFactoryBuider.build());
- builder.setTxState(HBaseZeroCopyByteString.wrap(txState));
+ builder.setTxState(ByteStringer.wrap(txState));
instance.addServerCache(controller, builder.build(), rpcCallback);
if(controller.getFailedOn() != null) {
throw controller.getFailedOn();
http://git-wip-us.apache.org/repos/asf/phoenix/blob/5d641ad3/phoenix-core/src/main/java/org/apache/phoenix/schema/PTableImpl.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/schema/PTableImpl.java b/phoenix-core/src/main/java/org/apache/phoenix/schema/PTableImpl.java
index 70414d5..bd23ab8 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/schema/PTableImpl.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/schema/PTableImpl.java
@@ -66,8 +66,6 @@ import org.apache.phoenix.util.SizedUtil;
import org.apache.phoenix.util.StringUtil;
import org.apache.phoenix.util.TrustedByteArrayOutputStream;
-import co.cask.tephra.TxConstants;
-
import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
import com.google.common.collect.ArrayListMultimap;
@@ -77,9 +75,10 @@ import com.google.common.collect.ImmutableSortedMap;
import com.google.common.collect.ListMultimap;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
-import com.google.protobuf.HBaseZeroCopyByteString;
import com.sun.istack.NotNull;
+import co.cask.tephra.TxConstants;
+
/**
*
* Base class for PTable implementors. Provides abstraction for
@@ -1069,8 +1068,7 @@ public class PTableImpl implements PTable {
int maxLength = pGuidePosts.getMaxLength();
int guidePostsCount = pGuidePosts.getEncodedGuidePostsCount();
GuidePostsInfo info = new GuidePostsInfo(pGuidePosts.getByteCountsList(),
- new ImmutableBytesWritable(
- HBaseZeroCopyByteString.zeroCopyGetBytes(pGuidePosts.getEncodedGuidePosts())),
+ new ImmutableBytesWritable(pGuidePosts.getEncodedGuidePosts().toByteArray()),
pGuidePosts.getRowCountsList(), maxLength, guidePostsCount);
tableGuidePosts.put(pTableStatsProto.getKey().toByteArray(), info);
}