hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndimi...@apache.org
Subject [1/2] HBASE-11118 non environment variable solution for "IllegalAccessError: class com.google.protobuf.ZeroCopyLiteralByteString cannot access its superclass com.google.protobuf.LiteralByteString"
Date Fri, 11 Jul 2014 23:55:59 GMT
Repository: hbase
Updated Branches:
  refs/heads/master c6ddc0336 -> c01e7e50c


http://git-wip-us.apache.org/repos/asf/hbase/blob/c01e7e50/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
index fb457ed..06e75b4 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
@@ -121,6 +121,7 @@ import org.apache.hadoop.hbase.regionserver.wal.HLogUtil;
 import org.apache.hadoop.hbase.regionserver.wal.WALActionsListener;
 import org.apache.hadoop.hbase.security.UserProvider;
 import org.apache.hadoop.hbase.trace.SpanReceiverHost;
+import org.apache.hadoop.hbase.util.ByteStringer;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.CompressionTest;
 import org.apache.hadoop.hbase.util.ConfigUtil;
@@ -149,7 +150,6 @@ import org.apache.zookeeper.data.Stat;
 
 import com.google.common.annotations.VisibleForTesting;
 import com.google.protobuf.BlockingRpcChannel;
-import com.google.protobuf.HBaseZeroCopyByteString;
 import com.google.protobuf.ServiceException;
 
 /**
@@ -1271,7 +1271,7 @@ public class HRegionServer extends HasThread implements
       regionSpecifier = RegionSpecifier.newBuilder();
     }
     regionSpecifier.setType(RegionSpecifierType.REGION_NAME);
-    regionSpecifier.setValue(HBaseZeroCopyByteString.wrap(name));
+    regionSpecifier.setValue(ByteStringer.wrap(name));
     regionLoadBldr.setRegionSpecifier(regionSpecifier.build())
       .setStores(stores)
       .setStorefiles(storefiles)

http://git-wip-us.apache.org/repos/asf/hbase/blob/c01e7e50/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLogKey.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLogKey.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLogKey.java
index 5019ff5..770a588 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLogKey.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLogKey.java
@@ -35,8 +35,7 @@ import java.util.UUID;
 import java.util.concurrent.CountDownLatch;
 
 
-import com.google.protobuf.HBaseZeroCopyByteString;
-
+import org.apache.hadoop.hbase.util.ByteStringer;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.classification.InterfaceAudience;
@@ -543,8 +542,8 @@ public class HLogKey implements WritableComparable<HLogKey>, SequenceNumber
{
   throws IOException {
     WALKey.Builder builder = WALKey.newBuilder();
     if (compressionContext == null) {
-      builder.setEncodedRegionName(HBaseZeroCopyByteString.wrap(this.encodedRegionName));
-      builder.setTableName(HBaseZeroCopyByteString.wrap(this.tablename.getName()));
+      builder.setEncodedRegionName(ByteStringer.wrap(this.encodedRegionName));
+      builder.setTableName(ByteStringer.wrap(this.tablename.getName()));
     } else {
       builder.setEncodedRegionName(compressor.compress(this.encodedRegionName,
         compressionContext.regionDict));
@@ -570,8 +569,7 @@ public class HLogKey implements WritableComparable<HLogKey>, SequenceNumber
{
     }
     if (scopes != null) {
       for (Map.Entry<byte[], Integer> e : scopes.entrySet()) {
-        ByteString family = (compressionContext == null) ?
-            HBaseZeroCopyByteString.wrap(e.getKey())
+        ByteString family = (compressionContext == null) ? ByteStringer.wrap(e.getKey())
             : compressor.compress(e.getKey(), compressionContext.familyDict);
         builder.addScopes(FamilyScope.newBuilder()
             .setFamily(family).setScopeType(ScopeType.valueOf(e.getValue())));

http://git-wip-us.apache.org/repos/asf/hbase/blob/c01e7e50/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/SecureProtobufLogWriter.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/SecureProtobufLogWriter.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/SecureProtobufLogWriter.java
index 8a09af4..ee100fd 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/SecureProtobufLogWriter.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/SecureProtobufLogWriter.java
@@ -24,7 +24,7 @@ import java.security.SecureRandom;
 
 import javax.crypto.spec.SecretKeySpec;
 
-import com.google.protobuf.HBaseZeroCopyByteString;
+import org.apache.hadoop.hbase.util.ByteStringer;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.hbase.HConstants;
@@ -57,7 +57,7 @@ public class SecureProtobufLogWriter extends ProtobufLogWriter {
       byte[] keyBytes = new byte[cipher.getKeyLength()];
       rng.nextBytes(keyBytes);
       Key key = new SecretKeySpec(keyBytes, cipher.getName());
-      builder.setEncryptionKey(HBaseZeroCopyByteString.wrap(EncryptionUtil.wrapKey(conf,
+      builder.setEncryptionKey(ByteStringer.wrap(EncryptionUtil.wrapKey(conf,
           conf.get(HConstants.CRYPTO_WAL_KEY_NAME_CONF_KEY,
               conf.get(HConstants.CRYPTO_MASTERKEY_NAME_CONF_KEY,
                   User.getCurrent().getShortName())),

http://git-wip-us.apache.org/repos/asf/hbase/blob/c01e7e50/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/model/CellModel.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/model/CellModel.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/model/CellModel.java
index c01359d..66fb85a 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/model/CellModel.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/model/CellModel.java
@@ -28,7 +28,7 @@ import javax.xml.bind.annotation.XmlAttribute;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlValue;
 
-import com.google.protobuf.HBaseZeroCopyByteString;
+import org.apache.hadoop.hbase.util.ByteStringer;
 import org.apache.hadoop.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.KeyValue;
@@ -184,8 +184,8 @@ public class CellModel implements ProtobufMessageHandler, Serializable
{
   @Override
   public byte[] createProtobufOutput() {
     Cell.Builder builder = Cell.newBuilder();
-    builder.setColumn(HBaseZeroCopyByteString.wrap(getColumn()));
-    builder.setData(HBaseZeroCopyByteString.wrap(getValue()));
+    builder.setColumn(ByteStringer.wrap(getColumn()));
+    builder.setData(ByteStringer.wrap(getValue()));
     if (hasUserTimestamp()) {
       builder.setTimestamp(getTimestamp());
     }

http://git-wip-us.apache.org/repos/asf/hbase/blob/c01e7e50/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/model/CellSetModel.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/model/CellSetModel.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/model/CellSetModel.java
index 5261484..143c1d6 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/model/CellSetModel.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/model/CellSetModel.java
@@ -29,7 +29,7 @@ import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 
-import com.google.protobuf.HBaseZeroCopyByteString;
+import org.apache.hadoop.hbase.util.ByteStringer;
 import org.apache.hadoop.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.rest.ProtobufMessageHandler;
@@ -114,11 +114,11 @@ public class CellSetModel implements Serializable, ProtobufMessageHandler
{
     CellSet.Builder builder = CellSet.newBuilder();
     for (RowModel row: getRows()) {
       CellSet.Row.Builder rowBuilder = CellSet.Row.newBuilder();
-      rowBuilder.setKey(HBaseZeroCopyByteString.wrap(row.getKey()));
+      rowBuilder.setKey(ByteStringer.wrap(row.getKey()));
       for (CellModel cell: row.getCells()) {
         Cell.Builder cellBuilder = Cell.newBuilder();
-        cellBuilder.setColumn(HBaseZeroCopyByteString.wrap(cell.getColumn()));
-        cellBuilder.setData(HBaseZeroCopyByteString.wrap(cell.getValue()));
+        cellBuilder.setColumn(ByteStringer.wrap(cell.getColumn()));
+        cellBuilder.setData(ByteStringer.wrap(cell.getValue()));
         if (cell.hasUserTimestamp()) {
           cellBuilder.setTimestamp(cell.getTimestamp());
         }

http://git-wip-us.apache.org/repos/asf/hbase/blob/c01e7e50/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/model/ScannerModel.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/model/ScannerModel.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/model/ScannerModel.java
index 7950f55..2fa53f4 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/model/ScannerModel.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/model/ScannerModel.java
@@ -75,7 +75,7 @@ import org.apache.hadoop.hbase.util.Base64;
 import org.apache.hadoop.hbase.util.Bytes;
 
 import com.google.protobuf.ByteString;
-import com.google.protobuf.HBaseZeroCopyByteString;
+import org.apache.hadoop.hbase.util.ByteStringer;
 import com.sun.jersey.api.json.JSONConfiguration;
 import com.sun.jersey.api.json.JSONJAXBContext;
 import com.sun.jersey.api.json.JSONMarshaller;
@@ -781,13 +781,13 @@ public class ScannerModel implements ProtobufMessageHandler, Serializable
{
   public byte[] createProtobufOutput() {
     Scanner.Builder builder = Scanner.newBuilder();
     if (!Bytes.equals(startRow, HConstants.EMPTY_START_ROW)) {
-      builder.setStartRow(HBaseZeroCopyByteString.wrap(startRow));
+      builder.setStartRow(ByteStringer.wrap(startRow));
     }
     if (!Bytes.equals(endRow, HConstants.EMPTY_START_ROW)) {
-      builder.setEndRow(HBaseZeroCopyByteString.wrap(endRow));
+      builder.setEndRow(ByteStringer.wrap(endRow));
     }
     for (byte[] column: columns) {
-      builder.addColumns(HBaseZeroCopyByteString.wrap(column));
+      builder.addColumns(ByteStringer.wrap(column));
     }
     if (startTime != 0) {
       builder.setStartTime(startTime);

http://git-wip-us.apache.org/repos/asf/hbase/blob/c01e7e50/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/model/StorageClusterStatusModel.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/model/StorageClusterStatusModel.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/model/StorageClusterStatusModel.java
index 3c77925..dd9f04e 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/model/StorageClusterStatusModel.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/model/StorageClusterStatusModel.java
@@ -29,7 +29,7 @@ import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlElementWrapper;
 import javax.xml.bind.annotation.XmlRootElement;
 
-import com.google.protobuf.HBaseZeroCopyByteString;
+import org.apache.hadoop.hbase.util.ByteStringer;
 import org.apache.hadoop.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.rest.ProtobufMessageHandler;
 import org.apache.hadoop.hbase.rest.protobuf.generated.StorageClusterStatusMessage.StorageClusterStatus;
@@ -721,7 +721,7 @@ public class StorageClusterStatusModel
       for (Node.Region region: node.regions) {
         StorageClusterStatus.Region.Builder regionBuilder =
           StorageClusterStatus.Region.newBuilder();
-        regionBuilder.setName(HBaseZeroCopyByteString.wrap(region.name));
+        regionBuilder.setName(ByteStringer.wrap(region.name));
         regionBuilder.setStores(region.stores);
         regionBuilder.setStorefiles(region.storefiles);
         regionBuilder.setStorefileSizeMB(region.storefileSizeMB);

http://git-wip-us.apache.org/repos/asf/hbase/blob/c01e7e50/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/model/TableInfoModel.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/model/TableInfoModel.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/model/TableInfoModel.java
index 63502e1..0847be9 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/model/TableInfoModel.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/model/TableInfoModel.java
@@ -28,7 +28,7 @@ import javax.xml.bind.annotation.XmlAttribute;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 
-import com.google.protobuf.HBaseZeroCopyByteString;
+import org.apache.hadoop.hbase.util.ByteStringer;
 import org.apache.hadoop.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.rest.ProtobufMessageHandler;
 import org.apache.hadoop.hbase.rest.protobuf.generated.TableInfoMessage.TableInfo;
@@ -134,8 +134,8 @@ public class TableInfoModel implements Serializable, ProtobufMessageHandler
{
       TableInfo.Region.Builder regionBuilder = TableInfo.Region.newBuilder();
       regionBuilder.setName(aRegion.getName());
       regionBuilder.setId(aRegion.getId());
-      regionBuilder.setStartKey(HBaseZeroCopyByteString.wrap(aRegion.getStartKey()));
-      regionBuilder.setEndKey(HBaseZeroCopyByteString.wrap(aRegion.getEndKey()));
+      regionBuilder.setStartKey(ByteStringer.wrap(aRegion.getStartKey()));
+      regionBuilder.setEndKey(ByteStringer.wrap(aRegion.getEndKey()));
       regionBuilder.setLocation(aRegion.getLocation());
       builder.addRegions(regionBuilder);
     }

http://git-wip-us.apache.org/repos/asf/hbase/blob/c01e7e50/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityController.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityController.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityController.java
index 39f65db..f779ee4 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityController.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityController.java
@@ -122,7 +122,7 @@ import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
 import com.google.common.collect.Lists;
 import com.google.common.collect.MapMaker;
 import com.google.protobuf.ByteString;
-import com.google.protobuf.HBaseZeroCopyByteString;
+import org.apache.hadoop.hbase.util.ByteStringer;
 import com.google.protobuf.RpcCallback;
 import com.google.protobuf.RpcController;
 import com.google.protobuf.Service;
@@ -1427,7 +1427,7 @@ public class VisibilityController extends BaseRegionObserver implements
MasterOb
     try {
       List<String> labels = getUserAuthsFromLabelsTable(user);
       for (String label : labels) {
-        response.addAuth(HBaseZeroCopyByteString.wrap(Bytes.toBytes(label)));
+        response.addAuth(ByteStringer.wrap(Bytes.toBytes(label)));
       }
     } catch (IOException e) {
       ResponseConverter.setControllerException(controller, e);

http://git-wip-us.apache.org/repos/asf/hbase/blob/c01e7e50/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityUtils.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityUtils.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityUtils.java
index b87f59a..37976df 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityUtils.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityUtils.java
@@ -39,11 +39,11 @@ import org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos.MultiUs
 import org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos.UserAuthorizations;
 import org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos.VisibilityLabel;
 import org.apache.hadoop.hbase.protobuf.generated.VisibilityLabelsProtos.VisibilityLabelsRequest;
+import org.apache.hadoop.hbase.util.ByteStringer;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.Pair;
 import org.apache.hadoop.util.ReflectionUtils;
 
-import com.google.protobuf.HBaseZeroCopyByteString;
 import com.google.protobuf.InvalidProtocolBufferException;
 
 /**
@@ -71,7 +71,7 @@ public class VisibilityUtils {
     VisibilityLabelsRequest.Builder visReqBuilder = VisibilityLabelsRequest.newBuilder();
     for (Entry<String, Integer> entry : existingLabels.entrySet()) {
       VisibilityLabel.Builder visLabBuilder = VisibilityLabel.newBuilder();
-      visLabBuilder.setLabel(HBaseZeroCopyByteString.wrap(Bytes.toBytes(entry.getKey())));
+      visLabBuilder.setLabel(ByteStringer.wrap(Bytes.toBytes(entry.getKey())));
       visLabBuilder.setOrdinal(entry.getValue());
       visReqBuilder.addVisLabel(visLabBuilder.build());
     }
@@ -87,7 +87,7 @@ public class VisibilityUtils {
     MultiUserAuthorizations.Builder builder = MultiUserAuthorizations.newBuilder();
     for (Entry<String, List<Integer>> entry : userAuths.entrySet()) {
       UserAuthorizations.Builder userAuthsBuilder = UserAuthorizations.newBuilder();
-      userAuthsBuilder.setUser(HBaseZeroCopyByteString.wrap(Bytes.toBytes(entry.getKey())));
+      userAuthsBuilder.setUser(ByteStringer.wrap(Bytes.toBytes(entry.getKey())));
       for (Integer label : entry.getValue()) {
         userAuthsBuilder.addAuth(label);
       }

http://git-wip-us.apache.org/repos/asf/hbase/blob/c01e7e50/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestBatchCoprocessorEndpoint.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestBatchCoprocessorEndpoint.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestBatchCoprocessorEndpoint.java
index be5f79d..655d663 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestBatchCoprocessorEndpoint.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestBatchCoprocessorEndpoint.java
@@ -19,14 +19,13 @@
 package org.apache.hadoop.hbase.coprocessor;
 
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
 import java.util.Collections;
 import java.util.Map;
 import java.util.TreeMap;
 
-import com.google.protobuf.HBaseZeroCopyByteString;
+import org.apache.hadoop.hbase.util.ByteStringer;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
@@ -111,9 +110,9 @@ public class TestBatchCoprocessorEndpoint {
     ColumnAggregationWithNullResponseProtos.SumRequest.Builder builder =
         ColumnAggregationWithNullResponseProtos.SumRequest
         .newBuilder();
-    builder.setFamily(HBaseZeroCopyByteString.wrap(TEST_FAMILY));
+    builder.setFamily(ByteStringer.wrap(TEST_FAMILY));
     if (TEST_QUALIFIER != null && TEST_QUALIFIER.length > 0) {
-      builder.setQualifier(HBaseZeroCopyByteString.wrap(TEST_QUALIFIER));
+      builder.setQualifier(ByteStringer.wrap(TEST_QUALIFIER));
     }
     Map<byte[], ColumnAggregationWithNullResponseProtos.SumResponse> results =
         table.batchCoprocessorService(
@@ -149,9 +148,9 @@ public class TestBatchCoprocessorEndpoint {
       Throwable {
     ColumnAggregationProtos.SumRequest.Builder builder = ColumnAggregationProtos.SumRequest
         .newBuilder();
-    builder.setFamily(HBaseZeroCopyByteString.wrap(family));
+    builder.setFamily(ByteStringer.wrap(family));
     if (qualifier != null && qualifier.length > 0) {
-      builder.setQualifier(HBaseZeroCopyByteString.wrap(qualifier));
+      builder.setQualifier(ByteStringer.wrap(qualifier));
     }
     return table.batchCoprocessorService(
         ColumnAggregationProtos.ColumnAggregationService.getDescriptor().findMethodByName("sum"),
@@ -238,9 +237,9 @@ public class TestBatchCoprocessorEndpoint {
     ColumnAggregationWithErrorsProtos.SumRequest.Builder builder =
         ColumnAggregationWithErrorsProtos.SumRequest
         .newBuilder();
-    builder.setFamily(HBaseZeroCopyByteString.wrap(TEST_FAMILY));
+    builder.setFamily(ByteStringer.wrap(TEST_FAMILY));
     if (TEST_QUALIFIER != null && TEST_QUALIFIER.length > 0) {
-      builder.setQualifier(HBaseZeroCopyByteString.wrap(TEST_QUALIFIER));
+      builder.setQualifier(ByteStringer.wrap(TEST_QUALIFIER));
     }
 
     boolean hasError = false;

http://git-wip-us.apache.org/repos/asf/hbase/blob/c01e7e50/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorEndpoint.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorEndpoint.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorEndpoint.java
index 3cc73c1..c121c57 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorEndpoint.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorEndpoint.java
@@ -30,7 +30,7 @@ import java.util.Map;
 import java.util.NavigableMap;
 import java.util.TreeMap;
 
-import com.google.protobuf.HBaseZeroCopyByteString;
+import org.apache.hadoop.hbase.util.ByteStringer;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
@@ -125,9 +125,9 @@ public class TestCoprocessorEndpoint {
               new BlockingRpcCallback<ColumnAggregationProtos.SumResponse>();
           ColumnAggregationProtos.SumRequest.Builder builder =
             ColumnAggregationProtos.SumRequest.newBuilder();
-          builder.setFamily(HBaseZeroCopyByteString.wrap(family));
+          builder.setFamily(ByteStringer.wrap(family));
           if (qualifier != null && qualifier.length > 0) {
-            builder.setQualifier(HBaseZeroCopyByteString.wrap(qualifier));
+            builder.setQualifier(ByteStringer.wrap(qualifier));
           }
           instance.sum(null, builder.build(), rpcCallback);
           return rpcCallback.get().getSum();

http://git-wip-us.apache.org/repos/asf/hbase/blob/c01e7e50/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRowProcessorEndpoint.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRowProcessorEndpoint.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRowProcessorEndpoint.java
index 8a76967..0a70543 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRowProcessorEndpoint.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRowProcessorEndpoint.java
@@ -33,7 +33,7 @@ import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicLong;
 
-import com.google.protobuf.HBaseZeroCopyByteString;
+import org.apache.hadoop.hbase.util.ByteStringer;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.Cell;
 import org.apache.hadoop.hbase.CellUtil;
@@ -366,7 +366,7 @@ public class TestRowProcessorEndpoint {
       public IncCounterProcessorRequest getRequestData() throws IOException {
         IncCounterProcessorRequest.Builder builder = IncCounterProcessorRequest.newBuilder();
         builder.setCounter(counter);
-        builder.setRow(HBaseZeroCopyByteString.wrap(row));
+        builder.setRow(ByteStringer.wrap(row));
         return builder.build();
       }
 
@@ -445,8 +445,8 @@ public class TestRowProcessorEndpoint {
       public FriendsOfFriendsProcessorRequest getRequestData() throws IOException {
         FriendsOfFriendsProcessorRequest.Builder builder =
             FriendsOfFriendsProcessorRequest.newBuilder();
-        builder.setPerson(HBaseZeroCopyByteString.wrap(person));
-        builder.setRow(HBaseZeroCopyByteString.wrap(row));
+        builder.setPerson(ByteStringer.wrap(person));
+        builder.setRow(ByteStringer.wrap(row));
         builder.addAllResult(result);
         FriendsOfFriendsProcessorRequest f = builder.build();
         return f;
@@ -554,8 +554,8 @@ public class TestRowProcessorEndpoint {
       @Override
       public RowSwapProcessorRequest getRequestData() throws IOException {
         RowSwapProcessorRequest.Builder builder = RowSwapProcessorRequest.newBuilder();
-        builder.setRow1(HBaseZeroCopyByteString.wrap(row1));
-        builder.setRow2(HBaseZeroCopyByteString.wrap(row2));
+        builder.setRow1(ByteStringer.wrap(row1));
+        builder.setRow2(ByteStringer.wrap(row2));
         return builder.build();
       }
 
@@ -614,7 +614,7 @@ public class TestRowProcessorEndpoint {
       @Override
       public TimeoutProcessorRequest getRequestData() throws IOException {
         TimeoutProcessorRequest.Builder builder = TimeoutProcessorRequest.newBuilder();
-        builder.setRow(HBaseZeroCopyByteString.wrap(row));
+        builder.setRow(ByteStringer.wrap(row));
         return builder.build();
       }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/c01e7e50/hbase-server/src/test/java/org/apache/hadoop/hbase/protobuf/TestProtobufUtil.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/protobuf/TestProtobufUtil.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/protobuf/TestProtobufUtil.java
index 0aa011b..f4b71f7 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/protobuf/TestProtobufUtil.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/protobuf/TestProtobufUtil.java
@@ -22,7 +22,7 @@ import static org.junit.Assert.assertEquals;
 
 import java.io.IOException;
 
-import com.google.protobuf.HBaseZeroCopyByteString;
+import org.apache.hadoop.hbase.util.ByteStringer;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.SmallTests;
 import org.apache.hadoop.hbase.client.Append;
@@ -55,12 +55,12 @@ public class TestProtobufUtil {
     NameBytesPair.Builder builder = NameBytesPair.newBuilder();
     final String omg = "OMG!!!";
     builder.setName("java.io.IOException");
-    builder.setValue(HBaseZeroCopyByteString.wrap(Bytes.toBytes(omg)));
+    builder.setValue(ByteStringer.wrap(Bytes.toBytes(omg)));
     Throwable t = ProtobufUtil.toException(builder.build());
     assertEquals(omg, t.getMessage());
     builder.clear();
     builder.setName("org.apache.hadoop.ipc.RemoteException");
-    builder.setValue(HBaseZeroCopyByteString.wrap(Bytes.toBytes(omg)));
+    builder.setValue(ByteStringer.wrap(Bytes.toBytes(omg)));
     t = ProtobufUtil.toException(builder.build());
     assertEquals(omg, t.getMessage());
   }
@@ -200,10 +200,10 @@ public class TestProtobufUtil {
     valueBuilder.setFamily(ByteString.copyFromUtf8("f1"));
     QualifierValue.Builder qualifierBuilder = QualifierValue.newBuilder();
     qualifierBuilder.setQualifier(ByteString.copyFromUtf8("c1"));
-    qualifierBuilder.setValue(HBaseZeroCopyByteString.wrap(Bytes.toBytes(11L)));
+    qualifierBuilder.setValue(ByteStringer.wrap(Bytes.toBytes(11L)));
     valueBuilder.addQualifierValue(qualifierBuilder.build());
     qualifierBuilder.setQualifier(ByteString.copyFromUtf8("c2"));
-    qualifierBuilder.setValue(HBaseZeroCopyByteString.wrap(Bytes.toBytes(22L)));
+    qualifierBuilder.setValue(ByteStringer.wrap(Bytes.toBytes(22L)));
     valueBuilder.addQualifierValue(qualifierBuilder.build());
     mutateBuilder.addColumnValue(valueBuilder.build());
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/c01e7e50/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestPriorityRpc.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestPriorityRpc.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestPriorityRpc.java
index bdd7124..574b435 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestPriorityRpc.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestPriorityRpc.java
@@ -24,6 +24,7 @@ import static org.junit.Assert.assertTrue;
 
 import java.io.IOException;
 
+import org.apache.hadoop.hbase.util.ByteStringer;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.CoordinatedStateManagerFactory;
 import org.apache.hadoop.hbase.HBaseConfiguration;
@@ -44,7 +45,6 @@ import org.junit.experimental.categories.Category;
 import org.mockito.Mockito;
 
 import com.google.protobuf.ByteString;
-import com.google.protobuf.HBaseZeroCopyByteString;
 
 /**
  * Tests that verify certain RPCs get a higher QoS.
@@ -75,12 +75,12 @@ public class TestPriorityRpc {
     GetRequest.Builder getRequestBuilder = GetRequest.newBuilder();
     RegionSpecifier.Builder regionSpecifierBuilder = RegionSpecifier.newBuilder();
     regionSpecifierBuilder.setType(RegionSpecifierType.REGION_NAME);
-    ByteString name = HBaseZeroCopyByteString.wrap(HRegionInfo.FIRST_META_REGIONINFO.getRegionName());
+    ByteString name = ByteStringer.wrap(HRegionInfo.FIRST_META_REGIONINFO.getRegionName());
     regionSpecifierBuilder.setValue(name);
     RegionSpecifier regionSpecifier = regionSpecifierBuilder.build();
     getRequestBuilder.setRegion(regionSpecifier);
     Get.Builder getBuilder = Get.newBuilder();
-    getBuilder.setRow(HBaseZeroCopyByteString.wrap("somerow".getBytes()));
+    getBuilder.setRow(ByteStringer.wrap("somerow".getBytes()));
     getRequestBuilder.setGet(getBuilder.build());
     GetRequest getRequest = getRequestBuilder.build();
     RequestHeader header = headerBuilder.build();

http://git-wip-us.apache.org/repos/asf/hbase/blob/c01e7e50/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSink.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSink.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSink.java
index 2a08ef2..3a138e4 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSink.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSink.java
@@ -25,7 +25,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.atomic.AtomicBoolean;
 
-import com.google.protobuf.HBaseZeroCopyByteString;
+import org.apache.hadoop.hbase.util.ByteStringer;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
@@ -261,9 +261,9 @@ public class TestReplicationSink {
     uuidBuilder.setLeastSigBits(HConstants.DEFAULT_CLUSTER_ID.getLeastSignificantBits());
     uuidBuilder.setMostSigBits(HConstants.DEFAULT_CLUSTER_ID.getMostSignificantBits());
     keyBuilder.setClusterId(uuidBuilder.build());
-    keyBuilder.setTableName(HBaseZeroCopyByteString.wrap(table));
+    keyBuilder.setTableName(ByteStringer.wrap(table));
     keyBuilder.setWriteTime(now);
-    keyBuilder.setEncodedRegionName(HBaseZeroCopyByteString.wrap(HConstants.EMPTY_BYTE_ARRAY));
+    keyBuilder.setEncodedRegionName(ByteStringer.wrap(HConstants.EMPTY_BYTE_ARRAY));
     keyBuilder.setLogSequenceNumber(-1);
     builder.setKey(keyBuilder.build());
     cells.add(kv);


Mime
View raw message