HBASE-3534 Action should not store or serialize regionName (Ted Yu)

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1140435 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Zhihong Yu 2011-06-28 04:49:09 +00:00
parent 9822b89693
commit 00a3a5c8f7
3 changed files with 15 additions and 9 deletions

View File

@ -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)

View File

@ -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 Writable, Comparable {
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 Writable, Comparable {
// ///////////////////////////////////////////////////////////////////////////
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 Writable, Comparable {
}
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);

View File

@ -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);
}