Return-Path: X-Original-To: apmail-hbase-commits-archive@www.apache.org Delivered-To: apmail-hbase-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 32E3A998D for ; Tue, 11 Oct 2011 17:44:36 +0000 (UTC) Received: (qmail 19559 invoked by uid 500); 11 Oct 2011 17:44:36 -0000 Delivered-To: apmail-hbase-commits-archive@hbase.apache.org Received: (qmail 19534 invoked by uid 500); 11 Oct 2011 17:44:36 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 19527 invoked by uid 99); 11 Oct 2011 17:44:36 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Oct 2011 17:44:36 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Oct 2011 17:44:32 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id BC8962388C6A for ; Tue, 11 Oct 2011 17:44:10 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1181955 [3/3] - in /hbase/branches/0.89/src/main: java/org/apache/hadoop/hbase/regionserver/ java/org/apache/hadoop/hbase/thrift/ java/org/apache/hadoop/hbase/thrift/generated/ resources/org/apache/hadoop/hbase/thrift/ Date: Tue, 11 Oct 2011 17:44:10 -0000 To: commits@hbase.apache.org From: nspiegelberg@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111011174410.BC8962388C6A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/thrift/generated/TRegionInfo.java URL: http://svn.apache.org/viewvc/hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/thrift/generated/TRegionInfo.java?rev=1181955&r1=1181954&r2=1181955&view=diff ============================================================================== --- hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/thrift/generated/TRegionInfo.java (original) +++ hbase/branches/0.89/src/main/java/org/apache/hadoop/hbase/thrift/generated/TRegionInfo.java Tue Oct 11 17:44:09 2011 @@ -35,12 +35,16 @@ public class TRegionInfo implements TBas private static final TField ID_FIELD_DESC = new TField("id", TType.I64, (short)3); private static final TField NAME_FIELD_DESC = new TField("name", TType.STRING, (short)4); private static final TField VERSION_FIELD_DESC = new TField("version", TType.BYTE, (short)5); + private static final TField SERVER_NAME_FIELD_DESC = new TField("serverName", TType.STRING, (short)6); + private static final TField PORT_FIELD_DESC = new TField("port", TType.I32, (short)7); public byte[] startKey; public byte[] endKey; public long id; public byte[] name; public byte version; + public byte[] serverName; + public int port; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements TFieldIdEnum { @@ -48,7 +52,9 @@ public class TRegionInfo implements TBas END_KEY((short)2, "endKey"), ID((short)3, "id"), NAME((short)4, "name"), - VERSION((short)5, "version"); + VERSION((short)5, "version"), + SERVER_NAME((short)6, "serverName"), + PORT((short)7, "port"); private static final Map byId = new HashMap(); private static final Map byName = new HashMap(); @@ -104,7 +110,8 @@ public class TRegionInfo implements TBas // isset id assignments private static final int __ID_ISSET_ID = 0; private static final int __VERSION_ISSET_ID = 1; - private BitSet __isset_bit_vector = new BitSet(2); + private static final int __PORT_ISSET_ID = 2; + private BitSet __isset_bit_vector = new BitSet(3); public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ put(_Fields.START_KEY, new FieldMetaData("startKey", TFieldRequirementType.DEFAULT, @@ -117,6 +124,10 @@ public class TRegionInfo implements TBas new FieldValueMetaData(TType.STRING))); put(_Fields.VERSION, new FieldMetaData("version", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.BYTE))); + put(_Fields.SERVER_NAME, new FieldMetaData("serverName", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + put(_Fields.PORT, new FieldMetaData("port", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.I32))); }}); static { @@ -131,7 +142,9 @@ public class TRegionInfo implements TBas byte[] endKey, long id, byte[] name, - byte version) + byte version, + byte[] serverName, + int port) { this(); this.startKey = startKey; @@ -141,6 +154,9 @@ public class TRegionInfo implements TBas this.name = name; this.version = version; setVersionIsSet(true); + this.serverName = serverName; + this.port = port; + setPortIsSet(true); } /** @@ -160,6 +176,10 @@ public class TRegionInfo implements TBas this.name = other.name; } this.version = other.version; + if (other.isSetServerName()) { + this.serverName = other.serverName; + } + this.port = other.port; } public TRegionInfo deepCopy() { @@ -289,6 +309,53 @@ public class TRegionInfo implements TBas __isset_bit_vector.set(__VERSION_ISSET_ID, value); } + public byte[] getServerName() { + return this.serverName; + } + + public TRegionInfo setServerName(byte[] serverName) { + this.serverName = serverName; + return this; + } + + public void unsetServerName() { + this.serverName = null; + } + + /** Returns true if field serverName is set (has been asigned a value) and false otherwise */ + public boolean isSetServerName() { + return this.serverName != null; + } + + public void setServerNameIsSet(boolean value) { + if (!value) { + this.serverName = null; + } + } + + public int getPort() { + return this.port; + } + + public TRegionInfo setPort(int port) { + this.port = port; + setPortIsSet(true); + return this; + } + + public void unsetPort() { + __isset_bit_vector.clear(__PORT_ISSET_ID); + } + + /** Returns true if field port is set (has been asigned a value) and false otherwise */ + public boolean isSetPort() { + return __isset_bit_vector.get(__PORT_ISSET_ID); + } + + public void setPortIsSet(boolean value) { + __isset_bit_vector.set(__PORT_ISSET_ID, value); + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case START_KEY: @@ -331,6 +398,22 @@ public class TRegionInfo implements TBas } break; + case SERVER_NAME: + if (value == null) { + unsetServerName(); + } else { + setServerName((byte[])value); + } + break; + + case PORT: + if (value == null) { + unsetPort(); + } else { + setPort((Integer)value); + } + break; + } } @@ -355,6 +438,12 @@ public class TRegionInfo implements TBas case VERSION: return new Byte(getVersion()); + case SERVER_NAME: + return getServerName(); + + case PORT: + return new Integer(getPort()); + } throw new IllegalStateException(); } @@ -376,6 +465,10 @@ public class TRegionInfo implements TBas return isSetName(); case VERSION: return isSetVersion(); + case SERVER_NAME: + return isSetServerName(); + case PORT: + return isSetPort(); } throw new IllegalStateException(); } @@ -442,6 +535,24 @@ public class TRegionInfo implements TBas return false; } + boolean this_present_serverName = true && this.isSetServerName(); + boolean that_present_serverName = true && that.isSetServerName(); + if (this_present_serverName || that_present_serverName) { + if (!(this_present_serverName && that_present_serverName)) + return false; + if (!java.util.Arrays.equals(this.serverName, that.serverName)) + return false; + } + + boolean this_present_port = true; + boolean that_present_port = true; + if (this_present_port || that_present_port) { + if (!(this_present_port && that_present_port)) + return false; + if (this.port != that.port) + return false; + } + return true; } @@ -474,6 +585,16 @@ public class TRegionInfo implements TBas if (present_version) builder.append(version); + boolean present_serverName = true && (isSetServerName()); + builder.append(present_serverName); + if (present_serverName) + builder.append(serverName); + + boolean present_port = true; + builder.append(present_port); + if (present_port) + builder.append(port); + return builder.toHashCode(); } @@ -525,6 +646,22 @@ public class TRegionInfo implements TBas if (lastComparison != 0) { return lastComparison; } + lastComparison = Boolean.valueOf(isSetServerName()).compareTo(isSetServerName()); + if (lastComparison != 0) { + return lastComparison; + } + lastComparison = TBaseHelper.compareTo(serverName, typedOther.serverName); + if (lastComparison != 0) { + return lastComparison; + } + lastComparison = Boolean.valueOf(isSetPort()).compareTo(isSetPort()); + if (lastComparison != 0) { + return lastComparison; + } + lastComparison = TBaseHelper.compareTo(port, typedOther.port); + if (lastComparison != 0) { + return lastComparison; + } return 0; } @@ -579,6 +716,21 @@ public class TRegionInfo implements TBas TProtocolUtil.skip(iprot, field.type); } break; + case SERVER_NAME: + if (field.type == TType.STRING) { + this.serverName = iprot.readBinary(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case PORT: + if (field.type == TType.I32) { + this.port = iprot.readI32(); + setPortIsSet(true); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; } iprot.readFieldEnd(); } @@ -614,6 +766,14 @@ public class TRegionInfo implements TBas oprot.writeFieldBegin(VERSION_FIELD_DESC); oprot.writeByte(this.version); oprot.writeFieldEnd(); + if (this.serverName != null) { + oprot.writeFieldBegin(SERVER_NAME_FIELD_DESC); + oprot.writeBinary(this.serverName); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(PORT_FIELD_DESC); + oprot.writeI32(this.port); + oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -654,6 +814,18 @@ public class TRegionInfo implements TBas sb.append("version:"); sb.append(this.version); first = false; + if (!first) sb.append(", "); + sb.append("serverName:"); + if (this.serverName == null) { + sb.append("null"); + } else { + sb.append(this.serverName); + } + first = false; + if (!first) sb.append(", "); + sb.append("port:"); + sb.append(this.port); + first = false; sb.append(")"); return sb.toString(); } Modified: hbase/branches/0.89/src/main/resources/org/apache/hadoop/hbase/thrift/Hbase.thrift URL: http://svn.apache.org/viewvc/hbase/branches/0.89/src/main/resources/org/apache/hadoop/hbase/thrift/Hbase.thrift?rev=1181955&r1=1181954&r2=1181955&view=diff ============================================================================== --- hbase/branches/0.89/src/main/resources/org/apache/hadoop/hbase/thrift/Hbase.thrift (original) +++ hbase/branches/0.89/src/main/resources/org/apache/hadoop/hbase/thrift/Hbase.thrift Tue Oct 11 17:44:09 2011 @@ -86,7 +86,9 @@ struct TRegionInfo { 2:Text endKey, 3:i64 id, 4:Text name, - 5:byte version + 5:byte version, + 6:Text serverName, + 7:i32 port } /** @@ -98,7 +100,6 @@ struct Mutation { 3:Text value } - /** * A BatchMutation object is used to apply a number of Mutations to a single row. */ @@ -107,7 +108,6 @@ struct BatchMutation { 2:list mutations } - /** * Holds row name and then a map of columns to cells. */ @@ -377,6 +377,54 @@ service Hbase { ) throws (1:IOError io) /** + * Get the columns with the specified prefix for the specified table and + * row at the latest timestamp. Returns an empty list if the row does not + * exist. + * + * @return TRowResult containing the row and map of columns to TCells + */ + list getRowWithColumnPrefix( + /** name of table */ + 1:Text tableName, + + /** row key */ + 2:Text row, + + /** + * column prefix, null for all columns + * family name can be specified as : + * If only provided then all families are + * searched + */ + 3:Text prefix + ) throws (1:IOError io) + + /** + * Get the columns with the specified prefix for the specified table and + * row at the specified timestamp. Returns an empty list if the row does not + * exist. + * + * @return TRowResult containing the row and map of columns to TCells + */ + list getRowWithColumnPrefixTs( + /** name of table */ + 1:Text tableName, + + /** row key */ + 2:Text row, + + /** + * column prefix, null for all columns + * family name can be specified as : + * If only provided then all families are + * searched + */ + 3:Text prefix + + 4:i64 timestamp + ) throws (1:IOError io) + + /** * Get multiple rows with the same columns or timestamps for all. * This returns latest entries, all columns and cfs. * @@ -918,4 +966,16 @@ service Hbase { /** id of a scanner returned by scannerOpen */ 1:ScannerID id ) throws (1:IOError io, 2:IllegalArgument ia) + + /** + * Get the regininfo for the specified row. It scans + * the metatable to find region's start and end keys. + * + * @return value for specified row/column + */ + TRegionInfo getRegionInfo( + /** row key */ + 1:Text row, + + ) throws (1:IOError io) }