Index: src/java/org/apache/hadoop/hbase/HColumnDescriptor.java =================================================================== --- src/java/org/apache/hadoop/hbase/HColumnDescriptor.java (revision 689166) +++ src/java/org/apache/hadoop/hbase/HColumnDescriptor.java (working copy) @@ -142,6 +142,7 @@ * The other attributes are defaulted. * * @param columnName - column family name + * @deprecated Use String or byte [] overload instead */ public HColumnDescriptor(final Text columnName) { this(columnName.getBytes()); Index: src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java =================================================================== --- src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java (revision 689166) +++ src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java (working copy) @@ -738,14 +738,19 @@ /* Add to the outbound message buffer */ private void reportClose(HRegionInfo region) { - reportClose(region, null); + reportClose(region, (byte[])null); } /* Add to the outbound message buffer */ + @Deprecated private void reportClose(final HRegionInfo region, final Text message) { outboundMsgs.add(new HMsg(HMsg.Type.MSG_REPORT_CLOSE, region, message)); } + /* Add to the outbound message buffer */ + private void reportClose(final HRegionInfo region, final byte[] message) { + outboundMsgs.add(new HMsg(HMsg.Type.MSG_REPORT_CLOSE, region, message)); + } /** * Add to the outbound message buffer Index: src/java/org/apache/hadoop/hbase/master/RegionManager.java =================================================================== --- src/java/org/apache/hadoop/hbase/master/RegionManager.java (revision 689166) +++ src/java/org/apache/hadoop/hbase/master/RegionManager.java (working copy) @@ -74,7 +74,7 @@ Collections.synchronizedSortedMap(new TreeMap(Bytes.BYTES_COMPARATOR)); - private static final Text OVERLOADED = new Text("Overloaded"); + private static final byte[] OVERLOADED = Bytes.toBytes("Overloaded"); /** * The 'unassignedRegions' table maps from a HRegionInfo to a timestamp that Index: src/java/org/apache/hadoop/hbase/io/BatchUpdate.java =================================================================== --- src/java/org/apache/hadoop/hbase/io/BatchUpdate.java (revision 689166) +++ src/java/org/apache/hadoop/hbase/io/BatchUpdate.java (working copy) @@ -60,6 +60,7 @@ * now. * * @param row + * @deprecated Use String or byte [] overload instead */ public BatchUpdate(final Text row) { this(row, HConstants.LATEST_TIMESTAMP); @@ -98,6 +99,7 @@ * Initialize a BatchUpdate operation on a row with a specific timestamp. * * @param row + * @deprecated Use String or byte [] overload instead */ public BatchUpdate(final Text row, long timestamp){ this(row.getBytes(), timestamp); @@ -138,6 +140,7 @@ * * @param column column whose value is being set * @param val new value for column. Cannot be null (can be empty). + * @deprecated Use String or byte [] overload instead */ public synchronized void put(final Text column, final byte val[]) { put(column.getBytes(), val); @@ -172,6 +175,7 @@ * Deletes the cell whose row/column/commit-timestamp match those of the * delete. * @param column name of column whose value is to be deleted + * @deprecated Use String or byte [] overload instead */ public void delete(final Text column) { delete(column.getBytes()); Index: src/java/org/apache/hadoop/hbase/util/migration/v5/HColumnDescriptor.java =================================================================== --- src/java/org/apache/hadoop/hbase/util/migration/v5/HColumnDescriptor.java (revision 689166) +++ src/java/org/apache/hadoop/hbase/util/migration/v5/HColumnDescriptor.java (working copy) @@ -144,6 +144,7 @@ * The other attributes are defaulted. * * @param columnName - column family name + * @deprecated Use String or byte [] overload instead */ public HColumnDescriptor(final Text columnName) { this(columnName.getBytes()); @@ -341,9 +342,7 @@ public void readFields(DataInput in) throws IOException { int versionNumber = in.readByte(); if (versionNumber <= 2) { - Text t = new Text(); - t.readFields(in); - this.name = t.getBytes(); + this.name = Bytes.readByteArray(in); if (HStoreKey.getFamilyDelimiterIndex(this.name) > 0) { this.name = stripColon(this.name); } Index: src/java/org/apache/hadoop/hbase/util/Bytes.java =================================================================== --- src/java/org/apache/hadoop/hbase/util/Bytes.java (revision 689166) +++ src/java/org/apache/hadoop/hbase/util/Bytes.java (working copy) @@ -243,6 +243,7 @@ /** * @param t * @return Array of byte arrays made from passed array of Text + * @deprecated Use String overload instead */ public static byte [][] toByteArrays(final Text [] t) { byte [][] result = new byte[t.length][]; Index: src/java/org/apache/hadoop/hbase/client/Scanner.java =================================================================== --- src/java/org/apache/hadoop/hbase/client/Scanner.java (revision 689166) +++ src/java/org/apache/hadoop/hbase/client/Scanner.java (working copy) @@ -30,7 +30,7 @@ public interface Scanner extends Closeable, Iterable { /** * Grab the next row's worth of values. The scanner will return a RowResult - * that contains both the row's key and a map of Text column names to Cell + * that contains both the row's key and a map of byte[] column names to Cell * value objects. The data returned will only contain the most recent data * value for each row that is not newer than the target time passed when the * scanner was created. Index: src/java/org/apache/hadoop/hbase/client/HBaseAdmin.java =================================================================== --- src/java/org/apache/hadoop/hbase/client/HBaseAdmin.java (revision 689166) +++ src/java/org/apache/hadoop/hbase/client/HBaseAdmin.java (working copy) @@ -85,6 +85,7 @@ * @param tableName Table to check. * @return True if table exists already. * @throws MasterNotRunningException + * @deprecated Use String or byte [] overload instead */ public boolean tableExists(final Text tableName) throws MasterNotRunningException { @@ -200,6 +201,7 @@ * * @param tableName name of table to delete * @throws IOException + * @deprecated Use String or byte [] overload instead */ public void deleteTable(final Text tableName) throws IOException { deleteTable(tableName.getBytes()); @@ -297,6 +299,7 @@ * * @param tableName name of the table * @throws IOException + * @deprecated Use String or byte [] overload instead */ public void enableTable(final Text tableName) throws IOException { enableTable(tableName.getBytes()); @@ -359,6 +362,7 @@ * * @param tableName name of table * @throws IOException + * @deprecated Use String or byte [] overload instead */ public void disableTable(final Text tableName) throws IOException { disableTable(tableName.getBytes()); @@ -420,6 +424,7 @@ * @param tableName name of table to check * @return true if table is on-line * @throws IOException + * @deprecated Use String or byte [] overload instead */ public boolean isTableEnabled(Text tableName) throws IOException { return isTableEnabled(tableName.getBytes()); @@ -447,6 +452,7 @@ * @param tableName name of the table to add column to * @param column column descriptor of column to be added * @throws IOException + * @deprecated Use String or byte [] overload instead */ public void addColumn(final Text tableName, HColumnDescriptor column) throws IOException { @@ -491,6 +497,7 @@ * @param tableName name of table * @param columnName name of column to be deleted * @throws IOException + * @deprecated Use String or byte [] overload instead */ public void deleteColumn(final Text tableName, final Text columnName) throws IOException { @@ -536,6 +543,7 @@ * @param columnName name of column to be modified * @param descriptor new column descriptor to use * @throws IOException + * @deprecated Use String or byte [] overload instead */ public void modifyColumn(final Text tableName, final Text columnName, HColumnDescriptor descriptor) Index: src/java/org/apache/hadoop/hbase/HMsg.java =================================================================== --- src/java/org/apache/hadoop/hbase/HMsg.java (revision 689166) +++ src/java/org/apache/hadoop/hbase/HMsg.java (working copy) @@ -24,6 +24,7 @@ import java.io.DataOutput; import java.io.IOException; +import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Writable; @@ -97,7 +98,7 @@ private Type type = null; private HRegionInfo info = null; - private Text message = null; + private byte[] message = null; // Some useful statics. Use these rather than create a new HMsg each time. public static final HMsg REPORT_EXITING = new HMsg(Type.MSG_REPORT_EXITING); @@ -121,7 +122,7 @@ * @param type Message type */ public HMsg(final HMsg.Type type) { - this(type, new HRegionInfo(), null); + this(type, new HRegionInfo(), (byte[])null); } /** @@ -130,10 +131,22 @@ * @param hri Region to which message type applies */ public HMsg(final HMsg.Type type, final HRegionInfo hri) { - this(type, hri, null); + this(type, hri, (byte[])null); } - + /** + * + * @param type Message type + * @param hri Region to which message type applies. Cannot be + * null. If no info associated, used other Constructor. + * @param msg Optional message (Stringified exception, etc.) + * @deprecated Use byte [] overload instead + */ + public HMsg(final HMsg.Type type, final HRegionInfo hri, final Text msg) { + this(type, hri, (msg == null)? null : msg.getBytes()); + } + + /** * Construct a message with the specified message and HRegionInfo * * @param type Message type @@ -141,7 +154,7 @@ * null. If no info associated, used other Constructor. * @param msg Optional message (Stringified exception, etc.) */ - public HMsg(final HMsg.Type type, final HRegionInfo hri, final Text msg) { + public HMsg(final HMsg.Type type, final HRegionInfo hri, final byte[] msg) { if (type == null) { throw new NullPointerException("Message type cannot be null"); } @@ -172,7 +185,7 @@ return this.type.equals(other); } - public Text getMessage() { + public byte[] getMessage() { return this.message; } @@ -188,7 +201,7 @@ sb.append(": "); sb.append(this.info.getRegionNameAsString()); } - if (this.message != null && this.message.getLength() > 0) { + if (this.message != null && this.message.length > 0) { sb.append(": " + this.message); } return sb.toString(); @@ -221,11 +234,11 @@ public void write(DataOutput out) throws IOException { out.writeInt(this.type.ordinal()); this.info.write(out); - if (this.message == null || this.message.getLength() == 0) { + if (this.message == null || this.message.length == 0) { out.writeBoolean(false); } else { out.writeBoolean(true); - this.message.write(out); + Bytes.writeByteArray(out, this.message); } } @@ -238,10 +251,7 @@ this.info.readFields(in); boolean hasMessage = in.readBoolean(); if (hasMessage) { - if (this.message == null) { - this.message = new Text(); - } - this.message.readFields(in); + this.message = Bytes.readByteArray(in); } } -} \ No newline at end of file +}