hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nkey...@apache.org
Subject svn commit: r1543435 - in /hbase/branches/0.96: hbase-client/src/main/java/org/apache/hadoop/hbase/ hbase-client/src/main/java/org/apache/hadoop/hbase/client/ hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ hbase-client/src/test/java/org/a...
Date Tue, 19 Nov 2013 14:03:30 GMT
Author: nkeywal
Date: Tue Nov 19 14:03:30 2013
New Revision: 1543435

URL: http://svn.apache.org/r1543435
Log:
HBASE-9959 Remove some array copy - server side

Modified:
    hbase/branches/0.96/hbase-client/src/main/java/org/apache/hadoop/hbase/HColumnDescriptor.java
    hbase/branches/0.96/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Mutation.java
    hbase/branches/0.96/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Put.java
    hbase/branches/0.96/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java
    hbase/branches/0.96/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestOperation.java
    hbase/branches/0.96/hbase-common/src/main/java/org/apache/hadoop/hbase/KeyValue.java
    hbase/branches/0.96/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java
    hbase/branches/0.96/hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestBytes.java
    hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
    hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java

Modified: hbase/branches/0.96/hbase-client/src/main/java/org/apache/hadoop/hbase/HColumnDescriptor.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.96/hbase-client/src/main/java/org/apache/hadoop/hbase/HColumnDescriptor.java?rev=1543435&r1=1543434&r2=1543435&view=diff
==============================================================================
--- hbase/branches/0.96/hbase-client/src/main/java/org/apache/hadoop/hbase/HColumnDescriptor.java
(original)
+++ hbase/branches/0.96/hbase-client/src/main/java/org/apache/hadoop/hbase/HColumnDescriptor.java
Tue Nov 19 14:03:30 2013
@@ -93,6 +93,7 @@ public class HColumnDescriptor implement
   public static final String BLOOMFILTER = "BLOOMFILTER";
   public static final String FOREVER = "FOREVER";
   public static final String REPLICATION_SCOPE = "REPLICATION_SCOPE";
+  public static final byte[] REPLICATION_SCOPE_BYTES = Bytes.toBytes(REPLICATION_SCOPE);
   public static final String MIN_VERSIONS = "MIN_VERSIONS";
   public static final String KEEP_DELETED_CELLS = "KEEP_DELETED_CELLS";
 
@@ -783,9 +784,9 @@ public class HColumnDescriptor implement
     * @return the scope tag
     */
   public int getScope() {
-    String value = getValue(REPLICATION_SCOPE);
+    byte[] value = getValue(REPLICATION_SCOPE_BYTES);
     if (value != null) {
-      return Integer.valueOf(value).intValue();
+      return Integer.valueOf(Bytes.toString(value));
     }
     return DEFAULT_REPLICATION_SCOPE;
   }

Modified: hbase/branches/0.96/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Mutation.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.96/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Mutation.java?rev=1543435&r1=1543434&r2=1543435&view=diff
==============================================================================
--- hbase/branches/0.96/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Mutation.java
(original)
+++ hbase/branches/0.96/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Mutation.java
Tue Nov 19 14:03:30 2013
@@ -18,6 +18,7 @@
 
 package org.apache.hadoop.hbase.client;
 
+import java.nio.ByteBuffer;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -104,6 +105,17 @@ public abstract class Mutation extends O
     return new KeyValue(this.row, family, qualifier, ts, KeyValue.Type.Put, value);
   }
 
+  /*
+   * Create a KeyValue with this objects row key and the Put identifier.
+   *
+   * @return a KeyValue with this objects row key and the Put identifier.
+   */
+  KeyValue createPutKeyValue(byte[] family, ByteBuffer qualifier, long ts, ByteBuffer value)
{
+    return new KeyValue(this.row, 0, this.row == null ? 0 : this.row.length,
+        family, 0, family == null ? 0 : family.length,
+        qualifier, ts, KeyValue.Type.Put, value);
+  }
+
   /**
    * Compile the column family (i.e. schema) information
    * into a Map. Useful for parsing and aggregation by debugging,
@@ -418,4 +430,17 @@ public abstract class Mutation extends O
     }
     return row;
   }
+
+  static void checkRow(ByteBuffer row) {
+    if (row == null) {
+      throw new IllegalArgumentException("Row buffer is null");
+    }
+    if (row.remaining() == 0) {
+      throw new IllegalArgumentException("Row length is 0");
+    }
+    if (row.remaining() > HConstants.MAX_ROW_LENGTH) {
+      throw new IllegalArgumentException("Row length " + row.remaining() + " is > " +
+          HConstants.MAX_ROW_LENGTH);
+    }
+  }
 }

Modified: hbase/branches/0.96/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Put.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.96/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Put.java?rev=1543435&r1=1543434&r2=1543435&view=diff
==============================================================================
--- hbase/branches/0.96/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Put.java
(original)
+++ hbase/branches/0.96/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Put.java
Tue Nov 19 14:03:30 2013
@@ -20,6 +20,7 @@
 package org.apache.hadoop.hbase.client;
 
 import java.io.IOException;
+import java.nio.ByteBuffer;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
@@ -73,6 +74,27 @@ public class Put extends Mutation implem
   }
 
   /**
+   * @param row row key; we make a copy of what we are passed to keep local.
+   * @param ts  timestamp
+   */
+  public Put(ByteBuffer row, long ts) {
+    if (ts < 0) {
+      throw new IllegalArgumentException("Timestamp cannot be negative. ts=" + ts);
+    }
+    checkRow(row);
+    this.row = new byte[row.remaining()];
+    row.get(this.row);
+    this.ts = ts;
+  }
+
+  /**
+   * @param row row key; we make a copy of what we are passed to keep local.
+   */
+  public Put(ByteBuffer row) {
+    this(row, HConstants.LATEST_TIMESTAMP);
+  }
+
+  /**
    * We make a copy of the passed in row key to keep local.
    * @param rowArray
    * @param rowOffset
@@ -133,6 +155,26 @@ public class Put extends Mutation implem
   }
 
   /**
+   * Add the specified column and value, with the specified timestamp as
+   * its version to this Put operation.
+   * @param family family name
+   * @param qualifier column qualifier
+   * @param ts version timestamp
+   * @param value column value
+   * @return this
+   */
+  public Put add(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);
+    list.add(kv);
+    familyMap.put(kv.getFamily(), list);
+    return this;
+  }
+
+  /**
    * Add the specified KeyValue to this Put operation.  Operation assumes that
    * the passed KeyValue is immutable and its backing array will not be modified
    * for the duration of this Put.

Modified: hbase/branches/0.96/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.96/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java?rev=1543435&r1=1543434&r2=1543435&view=diff
==============================================================================
--- hbase/branches/0.96/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java
(original)
+++ hbase/branches/0.96/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java
Tue Nov 19 14:03:30 2013
@@ -27,6 +27,7 @@ import java.lang.reflect.InvocationTarge
 import java.lang.reflect.Method;
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
+import java.nio.ByteBuffer;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
@@ -478,7 +479,6 @@ public final class ProtobufUtil {
     // TODO: Server-side at least why do we convert back to the Client types?  Why not just
pb it?
     MutationType type = proto.getMutateType();
     assert type == MutationType.PUT: type.name();
-    byte [] row = proto.hasRow()? proto.getRow().toByteArray(): null;
     long timestamp = proto.hasTimestamp()? proto.getTimestamp(): HConstants.LATEST_TIMESTAMP;
     Put put = null;
     int cellCount = proto.hasAssociatedCellCount()? proto.getAssociatedCellCount(): 0;
@@ -500,17 +500,23 @@ public final class ProtobufUtil {
         put.add(KeyValueUtil.ensureKeyValue(cell));
       }
     } else {
-      put = new Put(row, timestamp);
+      if (proto.hasRow()) {
+        put = new Put(proto.getRow().asReadOnlyByteBuffer(), timestamp);
+      } else {
+        throw new IllegalArgumentException("row cannot be null");
+      }
       // The proto has the metadata and the data itself
       for (ColumnValue column: proto.getColumnValueList()) {
         byte[] family = column.getFamily().toByteArray();
         for (QualifierValue qv: column.getQualifierValueList()) {
-          byte[] qualifier = qv.getQualifier().toByteArray();
           if (!qv.hasValue()) {
             throw new DoNotRetryIOException(
-                "Missing required field: qualifer value");
+                "Missing required field: qualifier value");
           }
-          byte[] value = qv.getValue().toByteArray();
+          ByteBuffer qualifier =
+              qv.hasQualifier() ? qv.getQualifier().asReadOnlyByteBuffer() : null;
+          ByteBuffer value =
+              qv.hasValue() ? qv.getValue().asReadOnlyByteBuffer() : null;
           long ts = timestamp;
           if (qv.hasTimestamp()) {
             ts = qv.getTimestamp();

Modified: hbase/branches/0.96/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestOperation.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.96/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestOperation.java?rev=1543435&r1=1543434&r2=1543435&view=diff
==============================================================================
--- hbase/branches/0.96/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestOperation.java
(original)
+++ hbase/branches/0.96/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestOperation.java
Tue Nov 19 14:03:30 2013
@@ -21,10 +21,16 @@ package org.apache.hadoop.hbase.client;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 
+import org.apache.hadoop.hbase.Cell;
+import org.apache.hadoop.hbase.CellUtil;
+import org.apache.hadoop.hbase.HConstants;
+import org.apache.hadoop.hbase.KeyValue;
 import org.apache.hadoop.hbase.SmallTests;
+import org.junit.Assert;
 import org.junit.Test;
 
 import java.io.IOException;
+import java.nio.ByteBuffer;
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
@@ -368,5 +374,51 @@ public class TestOperation {
         Bytes.toStringBinary(QUALIFIER), kvMap.get("qualifier"));
   }
 
+  @Test
+  public void testPutCreationWithByteBuffer() {
+    Put p = new Put(ROW);
+    List<Cell> c = p.get(FAMILY, QUALIFIER);
+    Assert.assertEquals(0, c.size());
+    Assert.assertEquals(HConstants.LATEST_TIMESTAMP, p.getTimeStamp());
+
+    p.add(FAMILY, ByteBuffer.wrap(QUALIFIER), 1984L, ByteBuffer.wrap(VALUE));
+    c = p.get(FAMILY, QUALIFIER);
+    Assert.assertEquals(1, c.size());
+    Assert.assertEquals(1984L, c.get(0).getTimestamp());
+    Assert.assertArrayEquals(VALUE, CellUtil.cloneValue(c.get(0)));
+    Assert.assertEquals(HConstants.LATEST_TIMESTAMP, p.getTimeStamp());
+    Assert.assertEquals(0, KeyValue.COMPARATOR.compare(c.get(0), new KeyValue(c.get(0))));
+
+    p = new Put(ROW);
+    p.add(FAMILY, ByteBuffer.wrap(QUALIFIER), 2013L, null);
+    c = p.get(FAMILY, QUALIFIER);
+    Assert.assertEquals(1, c.size());
+    Assert.assertEquals(2013L, c.get(0).getTimestamp());
+    Assert.assertArrayEquals(new byte[]{}, CellUtil.cloneValue(c.get(0)));
+    Assert.assertEquals(HConstants.LATEST_TIMESTAMP, p.getTimeStamp());
+    Assert.assertEquals(0, KeyValue.COMPARATOR.compare(c.get(0), new KeyValue(c.get(0))));
+
+    p = new Put(ByteBuffer.wrap(ROW));
+    p.add(FAMILY, ByteBuffer.wrap(QUALIFIER), 2001L, null);
+    c = p.get(FAMILY, QUALIFIER);
+    Assert.assertEquals(1, c.size());
+    Assert.assertEquals(2001L, c.get(0).getTimestamp());
+    Assert.assertArrayEquals(new byte[]{}, CellUtil.cloneValue(c.get(0)));
+    Assert.assertArrayEquals(ROW, CellUtil.cloneRow(c.get(0)));
+    Assert.assertEquals(HConstants.LATEST_TIMESTAMP, p.getTimeStamp());
+    Assert.assertEquals(0, KeyValue.COMPARATOR.compare(c.get(0), new KeyValue(c.get(0))));
+
+    p = new Put(ByteBuffer.wrap(ROW), 1970L);
+    p.add(FAMILY, ByteBuffer.wrap(QUALIFIER), 2001L, null);
+    c = p.get(FAMILY, QUALIFIER);
+    Assert.assertEquals(1, c.size());
+    Assert.assertEquals(2001L, c.get(0).getTimestamp());
+    Assert.assertArrayEquals(new byte[]{}, CellUtil.cloneValue(c.get(0)));
+    Assert.assertArrayEquals(ROW, CellUtil.cloneRow(c.get(0)));
+    Assert.assertEquals(1970L, p.getTimeStamp());
+    Assert.assertEquals(0, KeyValue.COMPARATOR.compare(c.get(0), new KeyValue(c.get(0))));
+  }
+
+
 }
 

Modified: hbase/branches/0.96/hbase-common/src/main/java/org/apache/hadoop/hbase/KeyValue.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.96/hbase-common/src/main/java/org/apache/hadoop/hbase/KeyValue.java?rev=1543435&r1=1543434&r2=1543435&view=diff
==============================================================================
--- hbase/branches/0.96/hbase-common/src/main/java/org/apache/hadoop/hbase/KeyValue.java (original)
+++ hbase/branches/0.96/hbase-common/src/main/java/org/apache/hadoop/hbase/KeyValue.java Tue
Nov 19 14:03:30 2013
@@ -144,6 +144,7 @@ public class KeyValue implements Cell, H
             getKeyDataStructureSize(rlength, flength, qlength) + vlength;
   }
 
+
   /**
    * Computes the number of bytes that a <code>KeyValue</code> instance with
the provided
    * characteristics would take up in its underlying data structure for the key.
@@ -471,6 +472,17 @@ public class KeyValue implements Cell, H
     this.offset = 0;
   }
 
+
+  public KeyValue(byte[] row, int roffset, int rlength,
+                  byte[] family, int foffset, int flength,
+                  ByteBuffer qualifier, long ts, Type type, ByteBuffer value) {
+    this.bytes = createByteArray(row, roffset, rlength, family, foffset, flength,
+        qualifier, 0, qualifier == null ? 0 : qualifier.remaining(), ts, type,
+        value, 0, value == null ? 0 : value.remaining());
+    this.length = bytes.length;
+    this.offset = 0;
+  }
+
   public KeyValue(Cell c) {
     this(c.getRowArray(), c.getRowOffset(), (int)c.getRowLength(),
         c.getFamilyArray(), c.getFamilyOffset(), (int)c.getFamilyLength(), 
@@ -619,17 +631,13 @@ public class KeyValue implements Cell, H
    * @param rlength row length
    * @param family family name
    * @param flength family length
-   * @param qualifier column qualifier
    * @param qlength qualifier length
-   * @param value column value
    * @param vlength value length
    *
    * @throws IllegalArgumentException an illegal value was passed
    */
   private static void checkParameters(final byte [] row, final int rlength,
-      final byte [] family, int flength,
-      final byte [] qualifier, int qlength,
-      final byte [] value, int vlength)
+      final byte [] family, int flength, int qlength, int vlength)
           throws IllegalArgumentException {
 
     if (rlength > Short.MAX_VALUE) {
@@ -644,7 +652,6 @@ public class KeyValue implements Cell, H
       throw new IllegalArgumentException("Family > " + Byte.MAX_VALUE);
     }
     // Qualifier length
-    qlength = qualifier == null ? 0 : qlength;
     if (qlength > Integer.MAX_VALUE - rlength - flength) {
       throw new IllegalArgumentException("Qualifier > " + Integer.MAX_VALUE);
     }
@@ -655,7 +662,6 @@ public class KeyValue implements Cell, H
           Integer.MAX_VALUE);
     }
     // Value length
-    vlength = value == null? 0 : vlength;
     if (vlength > HConstants.MAXIMUM_VALUE_LENGTH) { // FindBugs INT_VACUOUS_COMPARISON
       throw new IllegalArgumentException("Value length " + vlength + " > " +
           HConstants.MAXIMUM_VALUE_LENGTH);
@@ -694,7 +700,7 @@ public class KeyValue implements Cell, H
       final long timestamp, final Type type,
       final byte [] value, final int voffset, int vlength) {
 
-    checkParameters(row, rlength, family, flength, qualifier, qlength, value, vlength);
+    checkParameters(row, rlength, family, flength, qlength, vlength);
 
     int keyLength = (int) getKeyDataStructureSize(rlength, flength, qlength);
     int keyValueLength = (int) getKeyValueDataStructureSize(rlength, flength, qlength, vlength);
@@ -734,23 +740,23 @@ public class KeyValue implements Cell, H
    * @param family family name
    * @param foffset family offset
    * @param flength family length
-   * @param qualifier column qualifier
+   * @param qualifier column qualifier, a byte[] or a byte Buffer
    * @param qoffset qualifier offset
    * @param qlength qualifier length
    * @param timestamp version timestamp
    * @param type key type
-   * @param value column value
+   * @param value column value, a byte[] or a byte Buffer
    * @param voffset value offset
    * @param vlength value length
    * @return The newly created byte array.
    */
   private static byte [] createByteArray(final byte [] row, final int roffset,
       final int rlength, final byte [] family, final int foffset, int flength,
-      final byte [] qualifier, final int qoffset, int qlength,
+      final Object qualifier, final int qoffset, int qlength,
       final long timestamp, final Type type,
-      final byte [] value, final int voffset, int vlength) {
+      final Object value, final int voffset, int vlength) {
 
-    checkParameters(row, rlength, family, flength, qualifier, qlength, value, vlength);
+    checkParameters(row, rlength, family, flength, qlength, vlength);
 
     // Allocate right-sized byte array.
     int keyLength = (int) getKeyDataStructureSize(rlength, flength, qlength);
@@ -766,13 +772,21 @@ public class KeyValue implements Cell, H
     if(flength != 0) {
       pos = Bytes.putBytes(bytes, pos, family, foffset, flength);
     }
-    if(qlength != 0) {
-      pos = Bytes.putBytes(bytes, pos, qualifier, qoffset, qlength);
+    if (qlength > 0) {
+      if (qualifier instanceof ByteBuffer) {
+        pos = Bytes.putByteBuffer(bytes, pos, (ByteBuffer) qualifier);
+      } else {
+        pos = Bytes.putBytes(bytes, pos, (byte[]) qualifier, qoffset, qlength);
+      }
     }
     pos = Bytes.putLong(bytes, pos, timestamp);
     pos = Bytes.putByte(bytes, pos, type.getCode());
-    if (value != null && value.length > 0) {
-      pos = Bytes.putBytes(bytes, pos, value, voffset, vlength);
+    if (vlength > 0) {
+      if (value instanceof ByteBuffer) {
+        pos = Bytes.putByteBuffer(bytes, pos, (ByteBuffer) value);
+      } else {
+        pos = Bytes.putBytes(bytes, pos, (byte[]) value, voffset, vlength);
+      }
     }
     return bytes;
   }
@@ -2490,7 +2504,6 @@ public class KeyValue implements Cell, H
     }
   }
 
-
   /**
    * Avoids redundant comparisons for better performance.
    * 

Modified: hbase/branches/0.96/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.96/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java?rev=1543435&r1=1543434&r2=1543435&view=diff
==============================================================================
--- hbase/branches/0.96/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java
(original)
+++ hbase/branches/0.96/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java
Tue Nov 19 14:03:30 2013
@@ -306,6 +306,19 @@ public class Bytes {
   }
 
   /**
+   * Add the whole content of the ByteBuffer to the bytes arrays. The ByteBuffer is modified.
+   * @param bytes the byte array
+   * @param offset position in the array
+   * @param buf ByteBuffer to write out
+   * @return incremented offset
+   */
+  public static int putByteBuffer(byte[] bytes, int offset, ByteBuffer buf) {
+    int len = buf.remaining();
+    buf.get(bytes, offset, len);
+    return offset + len;
+  }
+
+  /**
    * Returns a new byte array, copied from the given {@code buf},
    * from the index 0 (inclusive) to the limit (exclusive),
    * regardless of the current position.

Modified: hbase/branches/0.96/hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestBytes.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.96/hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestBytes.java?rev=1543435&r1=1543434&r2=1543435&view=diff
==============================================================================
--- hbase/branches/0.96/hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestBytes.java
(original)
+++ hbase/branches/0.96/hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestBytes.java
Tue Nov 19 14:03:30 2013
@@ -463,5 +463,15 @@ public class TestBytes extends TestCase 
       assertFalse(array[i] == 0);
     }
   }
+
+  public void testPutBuffer() {
+    byte[] b = new byte[100];
+    for (byte i = 0; i < 100; i++) {
+      Bytes.putByteBuffer(b, i, ByteBuffer.wrap(new byte[]{i}));
+    }
+    for (byte i = 0; i < 100; i++) {
+      Assert.assertEquals(i, b[i]);
+    }
+  }
 }
 

Modified: hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java?rev=1543435&r1=1543434&r2=1543435&view=diff
==============================================================================
--- hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
(original)
+++ hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
Tue Nov 19 14:03:30 2013
@@ -3234,11 +3234,12 @@ public class HRegionServer implements Cl
     CellScanner cellScanner = controller != null? controller.cellScanner(): null;
     if (controller != null) controller.setCellScanner(null);
     List<CellScannable> cellsToReturn = null;
-     MultiResponse.Builder responseBuilder = MultiResponse.newBuilder();
+    MultiResponse.Builder responseBuilder = MultiResponse.newBuilder();
+    RegionActionResult.Builder regionActionResultBuilder = RegionActionResult.newBuilder();
 
-     for (RegionAction regionAction : request.getRegionActionList()) {
+    for (RegionAction regionAction : request.getRegionActionList()) {
        this.requestCount.add(regionAction.getActionCount());
-       RegionActionResult.Builder regionActionResultBuilder = RegionActionResult.newBuilder();
+      regionActionResultBuilder.clear();
        HRegion region;
        try {
          region = getRegion(regionAction.getRegion());

Modified: hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java?rev=1543435&r1=1543434&r2=1543435&view=diff
==============================================================================
--- hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
(original)
+++ hbase/branches/0.96/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
Tue Nov 19 14:03:30 2013
@@ -1930,17 +1930,17 @@ public class TestHRegion {
       // Putting data in Region
       Put put = null;
       put = new Put(row1);
-      put.add(fam1, null, ts, null);
-      put.add(fam2, null, ts, null);
-      put.add(fam3, null, ts, null);
-      put.add(fam4, null, ts, null);
+      put.add(fam1, (byte[]) null, ts, null);
+      put.add(fam2, (byte[]) null, ts, null);
+      put.add(fam3, (byte[]) null, ts, null);
+      put.add(fam4, (byte[]) null, ts, null);
       region.put(put);
 
       put = new Put(row2);
-      put.add(fam1, null, ts, null);
-      put.add(fam2, null, ts, null);
-      put.add(fam3, null, ts, null);
-      put.add(fam4, null, ts, null);
+      put.add(fam1, (byte[]) null, ts, null);
+      put.add(fam2, (byte[]) null, ts, null);
+      put.add(fam3, (byte[]) null, ts, null);
+      put.add(fam4, (byte[]) null, ts, null);
       region.put(put);
 
       Scan scan = new Scan();



Mime
View raw message