hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nkey...@apache.org
Subject svn commit: r1545592 - in /hbase/trunk: hbase-client/src/main/java/org/apache/hadoop/hbase/client/ hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ hbase-server/src/main/java/org/apache/hadoop/hbase/catalog/ hbase-server/src/main/java/org/a...
Date Tue, 26 Nov 2013 10:05:44 GMT
Author: nkeywal
Date: Tue Nov 26 10:05:44 2013
New Revision: 1545592

URL: http://svn.apache.org/r1545592
Log:
HBASE-10024 Add an interface to create put with immutable arrays

Modified:
    hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Put.java
    hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/catalog/MetaEditor.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/catalog/MetaMigrationConvertingToPB.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/TableNamespaceManager.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/FavoredNodeAssignmentHelper.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/migration/NamespaceUpgrade.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/SplitTransaction.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RowResource.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessControlLists.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityController.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitLogWorker.java
    hbase/trunk/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
    hbase/trunk/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftUtilities.java

Modified: hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Put.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Put.java?rev=1545592&r1=1545591&r2=1545592&view=diff
==============================================================================
--- hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Put.java (original)
+++ hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Put.java Tue Nov
26 10:05:44 2013
@@ -138,11 +138,29 @@ public class Put extends Mutation implem
     return add(family, qualifier, this.ts, value);
   }
 
+  /**
+   * See {@link #add(byte[], byte[], byte[])}. This version expects
+   * that the underlying arrays won't change. It's intended
+   * for usage internal HBase to and for advanced client applications.
+   */
+  public Put addImmutable(byte [] family, byte [] qualifier, byte [] value) {
+    return addImmutable(family, qualifier, this.ts, value);
+  }
+
   public Put add(byte[] family, byte [] qualifier, byte [] value, Tag[] tag) {
     return add(family, qualifier, this.ts, value, tag);
   }
 
   /**
+   * See {@link #add(byte[], byte[], byte[], Tag[] tag)}. This version expects
+   * that the underlying arrays won't change. It's intended
+   * for usage internal HBase to and for advanced client applications.
+   */
+  public Put addImmutable(byte[] family, byte [] qualifier, byte [] value, Tag[] tag) {
+    return addImmutable(family, qualifier, this.ts, value, tag);
+  }
+
+  /**
    * Add the specified column and value, with the specified timestamp as
    * its version to this Put operation.
    * @param family family name
@@ -158,6 +176,22 @@ public class Put extends Mutation implem
     List<Cell> list = getCellList(family);
     KeyValue kv = createPutKeyValue(family, qualifier, ts, value);
     list.add(kv);
+    familyMap.put(CellUtil.cloneFamily(kv), list);
+    return this;
+  }
+
+  /**
+   * See {@link #add(byte[], byte[], long, byte[])}. This version expects
+   * that the underlying arrays won't change. It's intended
+   * for usage internal HBase to and for advanced client applications.
+   */
+  public Put addImmutable(byte [] family, byte [] qualifier, long ts, byte [] value) {
+    if (ts < 0) {
+      throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + ts);
+    }
+    List<Cell> list = getCellList(family);
+    KeyValue kv = createPutKeyValue(family, qualifier, ts, value);
+    list.add(kv);
     familyMap.put(family, list);
     return this;
   }
@@ -170,7 +204,21 @@ public class Put extends Mutation implem
     List<Cell> list = getCellList(family);
     KeyValue kv = createPutKeyValue(family, qualifier, ts, value, tag);
     list.add(kv);
-    familyMap.put(kv.getFamily(), list);
+    familyMap.put(CellUtil.cloneFamily(kv), list);
+    return this;
+  }
+
+  /**
+   * See {@link #add(byte[], byte[], long, byte[], Tag[] tag)}. This version expects
+   * that the underlying arrays won't change. It's intended
+   * for usage internal HBase to and for advanced client applications.
+   */
+  @SuppressWarnings("unchecked")
+  public Put addImmutable(byte[] family, byte[] qualifier, long ts, byte[] value, Tag[] tag)
{
+    List<Cell> list = getCellList(family);
+    KeyValue kv = createPutKeyValue(family, qualifier, ts, value, tag);
+    list.add(kv);
+    familyMap.put(family, list);
     return this;
   }
 
@@ -191,10 +239,29 @@ public class Put extends Mutation implem
     List<Cell> list = getCellList(family);
     KeyValue kv = createPutKeyValue(family, qualifier, ts, value, tag);
     list.add(kv);
-    familyMap.put(kv.getFamily(), list);
+    familyMap.put(CellUtil.cloneFamily(kv), list);
     return this;
   }
 
+
+  /**
+   * See {@link #add(byte[], ByteBuffer, long, ByteBuffer, Tag[] tag)}. This version expects
+   * that the underlying arrays won't change. It's intended
+   * for usage internal HBase to and for advanced client applications.
+   */
+  public Put addImmutable(byte[] family, ByteBuffer qualifier, long ts, ByteBuffer value,
+                          Tag[] tag) {
+    if (ts < 0) {
+      throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + ts);
+    }
+    List<Cell> list = getCellList(family);
+    KeyValue kv = createPutKeyValue(family, qualifier, ts, value, tag);
+    list.add(kv);
+    familyMap.put(family, list);
+    return this;
+  }
+
+
   /**
    * Add the specified column and value, with the specified timestamp as
    * its version to this Put operation.
@@ -211,7 +278,23 @@ public class Put extends Mutation implem
     List<Cell> list = getCellList(family);
     KeyValue kv = createPutKeyValue(family, qualifier, ts, value, null);
     list.add(kv);
-    familyMap.put(kv.getFamily(), list);
+    familyMap.put(CellUtil.cloneFamily(kv), list);
+    return this;
+  }
+
+  /**
+   * See {@link #add(byte[], ByteBuffer, long, ByteBuffer)}. This version expects
+   * that the underlying arrays won't change. It's intended
+   * for usage internal HBase to and for advanced client applications.
+   */
+  public Put addImmutable(byte[] family, ByteBuffer qualifier, long ts, ByteBuffer value)
{
+    if (ts < 0) {
+      throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + ts);
+    }
+    List<Cell> list = getCellList(family);
+    KeyValue kv = createPutKeyValue(family, qualifier, ts, value, null);
+    list.add(kv);
+    familyMap.put(family, list);
     return this;
   }
 

Modified: hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java?rev=1545592&r1=1545591&r2=1545592&view=diff
==============================================================================
--- hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java
(original)
+++ hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java
Tue Nov 26 10:05:44 2013
@@ -503,7 +503,7 @@ public final class ProtobufUtil {
         if (put == null) {
           put = new Put(cell.getRowArray(), cell.getRowOffset(), cell.getRowLength(), timestamp);
         }
-        put.add(KeyValueUtil.ensureKeyValue(cell));
+        put.add(cell);
       }
     } else {
       if (proto.hasRow()) {
@@ -535,9 +535,9 @@ public final class ProtobufUtil {
             for(int i = 0; i< array.length; i++) {
               tagArray[i] = (Tag)array[i];
             }
-            put.add(family, qualifier, ts, value, tagArray);
+            put.addImmutable(family, qualifier, ts, value, tagArray);
           } else {
-            put.add(family, qualifier, ts, value);
+            put.addImmutable(family, qualifier, ts, value);
           }
         }
       }

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/catalog/MetaEditor.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/catalog/MetaEditor.java?rev=1545592&r1=1545591&r2=1545592&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/catalog/MetaEditor.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/catalog/MetaEditor.java
Tue Nov 26 10:05:44 2013
@@ -84,10 +84,12 @@ public class MetaEditor {
    */
   public static Put addDaughtersToPut(Put put, HRegionInfo splitA, HRegionInfo splitB) {
     if (splitA != null) {
-      put.add(HConstants.CATALOG_FAMILY, HConstants.SPLITA_QUALIFIER, splitA.toByteArray());
+      put.addImmutable(
+          HConstants.CATALOG_FAMILY, HConstants.SPLITA_QUALIFIER, splitA.toByteArray());
     }
     if (splitB != null) {
-      put.add(HConstants.CATALOG_FAMILY, HConstants.SPLITB_QUALIFIER, splitB.toByteArray());
+      put.addImmutable(
+          HConstants.CATALOG_FAMILY, HConstants.SPLITB_QUALIFIER, splitB.toByteArray());
     }
     return put;
   }
@@ -315,9 +317,9 @@ public class MetaEditor {
 
       // Put for parent
       Put putOfMerged = makePutFromRegionInfo(copyOfMerged);
-      putOfMerged.add(HConstants.CATALOG_FAMILY, HConstants.MERGEA_QUALIFIER,
+      putOfMerged.addImmutable(HConstants.CATALOG_FAMILY, HConstants.MERGEA_QUALIFIER,
           regionA.toByteArray());
-      putOfMerged.add(HConstants.CATALOG_FAMILY, HConstants.MERGEB_QUALIFIER,
+      putOfMerged.addImmutable(HConstants.CATALOG_FAMILY, HConstants.MERGEB_QUALIFIER,
           regionB.toByteArray());
 
       // Deletes for merging regions
@@ -561,17 +563,17 @@ public class MetaEditor {
 
   private static Put addRegionInfo(final Put p, final HRegionInfo hri)
   throws IOException {
-    p.add(HConstants.CATALOG_FAMILY, HConstants.REGIONINFO_QUALIFIER,
+    p.addImmutable(HConstants.CATALOG_FAMILY, HConstants.REGIONINFO_QUALIFIER,
         hri.toByteArray());
     return p;
   }
 
   private static Put addLocation(final Put p, final ServerName sn, long openSeqNum) {
-    p.add(HConstants.CATALOG_FAMILY, HConstants.SERVER_QUALIFIER,
+    p.addImmutable(HConstants.CATALOG_FAMILY, HConstants.SERVER_QUALIFIER,
       Bytes.toBytes(sn.getHostAndPort()));
-    p.add(HConstants.CATALOG_FAMILY, HConstants.STARTCODE_QUALIFIER,
+    p.addImmutable(HConstants.CATALOG_FAMILY, HConstants.STARTCODE_QUALIFIER,
       Bytes.toBytes(sn.getStartcode()));
-    p.add(HConstants.CATALOG_FAMILY, HConstants.SEQNUM_QUALIFIER,
+    p.addImmutable(HConstants.CATALOG_FAMILY, HConstants.SEQNUM_QUALIFIER,
         Bytes.toBytes(openSeqNum));
     return p;
   }

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/catalog/MetaMigrationConvertingToPB.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/catalog/MetaMigrationConvertingToPB.java?rev=1545592&r1=1545591&r2=1545592&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/catalog/MetaMigrationConvertingToPB.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/catalog/MetaMigrationConvertingToPB.java
Tue Nov 26 10:05:44 2013
@@ -91,7 +91,7 @@ public class MetaMigrationConvertingToPB
       //This will 'migrate' the HRI from 092.x and 0.94.x to 0.96+ by reading the
       //writable serialization
       HRegionInfo hri = parseFrom(hriSplitBytes);
-      p.add(HConstants.CATALOG_FAMILY, which, hri.toByteArray());
+      p.addImmutable(HConstants.CATALOG_FAMILY, which, hri.toByteArray());
     }
   }
 

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/TableNamespaceManager.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/TableNamespaceManager.java?rev=1545592&r1=1545591&r2=1545592&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/TableNamespaceManager.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/TableNamespaceManager.java
Tue Nov 26 10:05:44 2013
@@ -155,7 +155,7 @@ public class TableNamespaceManager {
 
   private void upsert(HTable table, NamespaceDescriptor ns) throws IOException {
     Put p = new Put(Bytes.toBytes(ns.getName()));
-    p.add(HTableDescriptor.NAMESPACE_FAMILY_INFO_BYTES,
+    p.addImmutable(HTableDescriptor.NAMESPACE_FAMILY_INFO_BYTES,
         HTableDescriptor.NAMESPACE_COL_DESC_BYTES,
         ProtobufUtil.toProtoNamespaceDescriptor(ns).toByteArray());
     table.put(p);

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/FavoredNodeAssignmentHelper.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/FavoredNodeAssignmentHelper.java?rev=1545592&r1=1545591&r2=1545592&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/FavoredNodeAssignmentHelper.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/FavoredNodeAssignmentHelper.java
Tue Nov 26 10:05:44 2013
@@ -143,7 +143,7 @@ public class FavoredNodeAssignmentHelper
     if (favoredNodeList != null) {
       put = MetaEditor.makePutFromRegionInfo(regionInfo);
       byte[] favoredNodes = getFavoredNodes(favoredNodeList);
-      put.add(HConstants.CATALOG_FAMILY, FAVOREDNODES_QUALIFIER,
+      put.addImmutable(HConstants.CATALOG_FAMILY, FAVOREDNODES_QUALIFIER,
           EnvironmentEdgeManager.currentTimeMillis(), favoredNodes);
       LOG.info("Create the region " + regionInfo.getRegionNameAsString() +
           " with favored nodes " + Bytes.toString(favoredNodes));

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/migration/NamespaceUpgrade.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/migration/NamespaceUpgrade.java?rev=1545592&r1=1545591&r2=1545592&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/migration/NamespaceUpgrade.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/migration/NamespaceUpgrade.java
Tue Nov 26 10:05:44 2013
@@ -462,7 +462,7 @@ public class NamespaceUpgrade implements
     // create a put for new _acl_ entry with rowkey as hbase:acl
     Put p = new Put(AccessControlLists.ACL_GLOBAL_NAME);
     for (Cell c : r.rawCells()) {
-      p.add(CellUtil.cloneFamily(c), CellUtil.cloneQualifier(c), CellUtil.cloneValue(c));
+      p.addImmutable(CellUtil.cloneFamily(c), CellUtil.cloneQualifier(c), CellUtil.cloneValue(c));
     }
     region.put(p);
     // delete the old entry

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/SplitTransaction.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/SplitTransaction.java?rev=1545592&r1=1545591&r2=1545592&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/SplitTransaction.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/SplitTransaction.java
Tue Nov 26 10:05:44 2013
@@ -605,11 +605,11 @@ public class SplitTransaction {
   }
 
   public Put addLocation(final Put p, final ServerName sn, long openSeqNum) {
-    p.add(HConstants.CATALOG_FAMILY, HConstants.SERVER_QUALIFIER,
+    p.addImmutable(HConstants.CATALOG_FAMILY, HConstants.SERVER_QUALIFIER,
       Bytes.toBytes(sn.getHostAndPort()));
-    p.add(HConstants.CATALOG_FAMILY, HConstants.STARTCODE_QUALIFIER,
+    p.addImmutable(HConstants.CATALOG_FAMILY, HConstants.STARTCODE_QUALIFIER,
       Bytes.toBytes(sn.getStartcode()));
-    p.add(HConstants.CATALOG_FAMILY, HConstants.SEQNUM_QUALIFIER,
+    p.addImmutable(HConstants.CATALOG_FAMILY, HConstants.SEQNUM_QUALIFIER,
         Bytes.toBytes(openSeqNum));
     return p;
   }

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RowResource.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RowResource.java?rev=1545592&r1=1545591&r2=1545592&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RowResource.java (original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/rest/RowResource.java Tue
Nov 26 10:05:44 2013
@@ -224,7 +224,7 @@ public class RowResource extends Resourc
               .type(MIMETYPE_TEXT).entity("Bad request" + CRLF)
               .build();
           }
-          put.add(parts[0], parts[1], cell.getTimestamp(), cell.getValue());
+          put.addImmutable(parts[0], parts[1], cell.getTimestamp(), cell.getValue());
         }
         puts.add(put);
         if (LOG.isDebugEnabled()) {
@@ -293,7 +293,7 @@ public class RowResource extends Resourc
           .type(MIMETYPE_TEXT).entity("Bad request" + CRLF)
           .build();
       }
-      put.add(parts[0], parts[1], timestamp, message);
+      put.addImmutable(parts[0], parts[1], timestamp, message);
       table = servlet.getTable(tableResource.getName());
       table.put(put);
       if (LOG.isDebugEnabled()) {
@@ -471,7 +471,7 @@ public class RowResource extends Resourc
           .type(MIMETYPE_TEXT).entity("Bad request" + CRLF)
           .build();
       }
-      put.add(valueToPutParts[0], valueToPutParts[1], valueToPutCell
+      put.addImmutable(valueToPutParts[0], valueToPutParts[1], valueToPutCell
         .getTimestamp(), valueToPutCell.getValue());
 
       table = servlet.getTable(this.tableResource.getName());

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessControlLists.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessControlLists.java?rev=1545592&r1=1545591&r2=1545592&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessControlLists.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessControlLists.java
Tue Nov 26 10:05:44 2013
@@ -157,7 +157,7 @@ public class AccessControlLists {
     for (int i = 0; i < actions.length; i++) {
       value[i] = actions[i].code();
     }
-    p.add(ACL_LIST_FAMILY, key, value);
+    p.addImmutable(ACL_LIST_FAMILY, key, value);
     if (LOG.isDebugEnabled()) {
       LOG.debug("Writing permission with rowKey "+
           Bytes.toString(rowKey)+" "+

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityController.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityController.java?rev=1545592&r1=1545591&r2=1545592&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityController.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityController.java
Tue Nov 26 10:05:44 2013
@@ -568,11 +568,12 @@ public class VisibilityController extend
       Map<String, List<Integer>> userAuths) throws IOException {
     if (!labels.containsKey(SYSTEM_LABEL)) {
       Put p = new Put(Bytes.toBytes(SYSTEM_LABEL_ORDINAL));
-      p.add(LABELS_TABLE_FAMILY, LABEL_QUALIFIER, Bytes.toBytes(SYSTEM_LABEL));
+      p.addImmutable(LABELS_TABLE_FAMILY, LABEL_QUALIFIER, Bytes.toBytes(SYSTEM_LABEL));
       // Set auth for "system" label for all super users.
       List<String> superUsers = getSystemAndSuperUsers();
       for (String superUser : superUsers) {
-        p.add(LABELS_TABLE_FAMILY, Bytes.toBytes(superUser), DUMMY_VALUE, LABELS_TABLE_TAGS);
+        p.addImmutable(
+            LABELS_TABLE_FAMILY, Bytes.toBytes(superUser), DUMMY_VALUE, LABELS_TABLE_TAGS);
       }
       region.put(p);
       labels.put(SYSTEM_LABEL, SYSTEM_LABEL_ORDINAL);
@@ -1037,7 +1038,8 @@ public class VisibilityController extend
             response.addResult(failureResultBuilder.build());
           } else {
             Put p = new Put(Bytes.toBytes(ordinalCounter));
-            p.add(LABELS_TABLE_FAMILY, LABEL_QUALIFIER, label, LABELS_TABLE_TAGS);
+            p.addImmutable(
+                LABELS_TABLE_FAMILY, LABEL_QUALIFIER, label, LABELS_TABLE_TAGS);
             puts.add(p);
             ordinalCounter++;
             response.addResult(successResult);
@@ -1127,7 +1129,8 @@ public class VisibilityController extend
           response.addResult(failureResultBuilder.build());
         } else {
           Put p = new Put(Bytes.toBytes(labelOrdinal));
-          p.add(LABELS_TABLE_FAMILY, user, DUMMY_VALUE, LABELS_TABLE_TAGS);
+          p.addImmutable(
+              LABELS_TABLE_FAMILY, user, DUMMY_VALUE, LABELS_TABLE_TAGS);
           puts.add(p);
           response.addResult(successResult);
         }

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitLogWorker.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitLogWorker.java?rev=1545592&r1=1545591&r2=1545592&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitLogWorker.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitLogWorker.java
Tue Nov 26 10:05:44 2013
@@ -32,7 +32,6 @@ import org.apache.hadoop.conf.Configurat
 import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.MediumTests;
-import org.apache.hadoop.hbase.Server;
 import org.apache.hadoop.hbase.ServerName;
 import org.apache.hadoop.hbase.SplitLogCounters;
 import org.apache.hadoop.hbase.SplitLogTask;
@@ -357,7 +356,7 @@ public class TestSplitLogWorker {
     SplitLogWorker slw = new SplitLogWorker(zkw, testConf, mockedRS, neverEndingTask);
     slw.start();
     try {
-      waitForCounter(SplitLogCounters.tot_wkr_task_acquired, 0, maxTasks, 3000);
+      waitForCounter(SplitLogCounters.tot_wkr_task_acquired, 0, maxTasks, 6000);
       for (int i = 0; i < maxTasks; i++) {
         byte[] bytes = ZKUtil.getData(zkw, ZKSplitLog.getEncodedNodeName(zkw, TATAS + i));
         SplitLogTask slt = SplitLogTask.parseFrom(bytes);
@@ -402,7 +401,7 @@ public class TestSplitLogWorker {
     slw.start();
     try {
       int acquiredTasks = 0;
-      waitForCounter(SplitLogCounters.tot_wkr_task_acquired, 0, 2, 3000);
+      waitForCounter(SplitLogCounters.tot_wkr_task_acquired, 0, 2, 6000);
       for (int i = 0; i < maxTasks; i++) {
         byte[] bytes = ZKUtil.getData(zkw, ZKSplitLog.getEncodedNodeName(zkw, TATAS + i));
         SplitLogTask slt = SplitLogTask.parseFrom(bytes);

Modified: hbase/trunk/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java?rev=1545592&r1=1545591&r2=1545592&view=diff
==============================================================================
--- hbase/trunk/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
(original)
+++ hbase/trunk/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java
Tue Nov 26 10:05:44 2013
@@ -1033,7 +1033,7 @@ public class ThriftServerRunner implemen
               LOG.warn("No column qualifier specified. Delete is the only mutation supported
"
                   + "over the whole column family.");
             } else {
-              put.add(famAndQf[0], famAndQf[1],
+              put.addImmutable(famAndQf[0], famAndQf[1],
                   m.value != null ? getBytes(m.value)
                       : HConstants.EMPTY_BYTE_ARRAY);
             }
@@ -1092,7 +1092,7 @@ public class ThriftServerRunner implemen
                   + "over the whole column family.");
             }
             if (famAndQf.length == 2) {
-              put.add(famAndQf[0], famAndQf[1],
+              put.addImmutable(famAndQf[0], famAndQf[1],
                   m.value != null ? getBytes(m.value)
                       : HConstants.EMPTY_BYTE_ARRAY);
             } else {

Modified: hbase/trunk/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftUtilities.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftUtilities.java?rev=1545592&r1=1545591&r2=1545592&view=diff
==============================================================================
--- hbase/trunk/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftUtilities.java
(original)
+++ hbase/trunk/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftUtilities.java
Tue Nov 26 10:05:44 2013
@@ -198,10 +198,12 @@ public class ThriftUtilities {
 
     for (TColumnValue columnValue : in.getColumnValues()) {
       if (columnValue.isSetTimestamp()) {
-        out.add(columnValue.getFamily(), columnValue.getQualifier(), columnValue.getTimestamp(),
+        out.addImmutable(
+            columnValue.getFamily(), columnValue.getQualifier(), columnValue.getTimestamp(),
             columnValue.getValue());
       } else {
-        out.add(columnValue.getFamily(), columnValue.getQualifier(), columnValue.getValue());
+        out.addImmutable(
+            columnValue.getFamily(), columnValue.getQualifier(), columnValue.getValue());
       }
     }
 



Mime
View raw message