You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by te...@apache.org on 2011/06/28 06:49:09 UTC

svn commit: r1140435 - in /hbase/trunk: CHANGES.txt src/main/java/org/apache/hadoop/hbase/client/Action.java src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java

Author: tedyu
Date: Tue Jun 28 04:49:09 2011
New Revision: 1140435

URL: http://svn.apache.org/viewvc?rev=1140435&view=rev
Log:
HBASE-3534 Action should not store or serialize regionName (Ted Yu)


Modified:
    hbase/trunk/CHANGES.txt
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/Action.java
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java

Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1140435&r1=1140434&r2=1140435&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Tue Jun 28 04:49:09 2011
@@ -137,6 +137,7 @@ Release 0.91.0 - Unreleased
                all tests
    HBASE-4024 Major compaction may not be triggered, even though region
               server log says it is triggered (Ted Yu)
+   HBASE-3534 Action should not store or serialize regionName (Ted Yu)
 
   IMPROVEMENTS
    HBASE-3290  Max Compaction Size (Nicolas Spiegelberg via Stack)  

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/Action.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/Action.java?rev=1140435&r1=1140434&r2=1140435&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/Action.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/Action.java Tue Jun 28 04:49:09 2011
@@ -34,7 +34,6 @@ import org.apache.hadoop.io.Writable;
  */
 public class Action<R> implements Writable, Comparable {
 
-  private byte[] regionName;
   private Row action;
   private int originalIndex;
   private R result;
@@ -43,19 +42,27 @@ public class Action<R> implements Writab
     super();
   }
 
+  /*
+   * This constructor is replaced by {@link #Action(Row, int)}
+   */
+  @Deprecated
   public Action(byte[] regionName, Row action, int originalIndex) {
+    this(action, originalIndex);
+  }
+
+  public Action(Row action, int originalIndex) {
     super();
-    this.regionName = regionName;
     this.action = action;
-    this.originalIndex = originalIndex;
+    this.originalIndex = originalIndex;    
   }
-
+  
+  @Deprecated
   public byte[] getRegionName() {
-    return regionName;
+    return null;
   }
 
+  @Deprecated
   public void setRegionName(byte[] regionName) {
-    this.regionName = regionName;
   }
 
   public R getResult() {
@@ -84,7 +91,6 @@ public class Action<R> implements Writab
   // ///////////////////////////////////////////////////////////////////////////
 
   public void write(final DataOutput out) throws IOException {
-    Bytes.writeByteArray(out, regionName);
     HbaseObjectWritable.writeObject(out, action, Row.class, null);
     out.writeInt(originalIndex);
     HbaseObjectWritable.writeObject(out, result,
@@ -92,7 +98,6 @@ public class Action<R> implements Writab
   }
 
   public void readFields(final DataInput in) throws IOException {
-    this.regionName = Bytes.readByteArray(in);
     this.action = (Row) HbaseObjectWritable.readObject(in, null);
     this.originalIndex = in.readInt();
     this.result = (R) HbaseObjectWritable.readObject(in, null);

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java?rev=1140435&r1=1140434&r2=1140435&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java Tue Jun 28 04:49:09 2011
@@ -1404,7 +1404,7 @@ public class HConnectionManager {
               actionsByServer.put(loc, actions);
             }
 
-            Action<R> action = new Action<R>(regionName, row, i);
+            Action<R> action = new Action<R>(row, i);
             lastServers[i] = loc;
             actions.add(regionName, action);
           }