hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mbau...@apache.org
Subject svn commit: r1328562 [7/9] - in /hbase/branches/0.89-fb: ./ src/main/java/org/apache/hadoop/hbase/ src/main/java/org/apache/hadoop/hbase/filter/ src/main/java/org/apache/hadoop/hbase/regionserver/ src/main/java/org/apache/hadoop/hbase/thrift/ src/main/...
Date Sat, 21 Apr 2012 01:37:16 GMT
Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/thrift/generated/TRegionInfo.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/thrift/generated/TRegionInfo.java?rev=1328562&r1=1328561&r2=1328562&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/thrift/generated/TRegionInfo.java (original)
+++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/thrift/generated/TRegionInfo.java Sat Apr 21 01:37:15 2012
@@ -1,11 +1,17 @@
 /**
- * Autogenerated by Thrift
+ * Autogenerated by Thrift Compiler (0.8.0)
  *
  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
  */
 package org.apache.hadoop.hbase.thrift.generated;
 
-import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
 import java.util.List;
 import java.util.ArrayList;
 import java.util.Map;
@@ -16,38 +22,41 @@ import java.util.HashSet;
 import java.util.EnumSet;
 import java.util.Collections;
 import java.util.BitSet;
+import java.nio.ByteBuffer;
 import java.util.Arrays;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import org.apache.thrift.*;
-import org.apache.thrift.meta_data.*;
-import org.apache.thrift.protocol.*;
-
 /**
  * A TRegionInfo contains information about an HTable region.
  */
-public class TRegionInfo implements TBase<TRegionInfo._Fields>, java.io.Serializable, Cloneable, Comparable<TRegionInfo> {
-  private static final TStruct STRUCT_DESC = new TStruct("TRegionInfo");
+public class TRegionInfo implements org.apache.thrift.TBase<TRegionInfo, TRegionInfo._Fields>, java.io.Serializable, Cloneable {
+  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRegionInfo");
+
+  private static final org.apache.thrift.protocol.TField START_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("startKey", org.apache.thrift.protocol.TType.STRING, (short)1);
+  private static final org.apache.thrift.protocol.TField END_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("endKey", org.apache.thrift.protocol.TType.STRING, (short)2);
+  private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I64, (short)3);
+  private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)4);
+  private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.BYTE, (short)5);
+  private static final org.apache.thrift.protocol.TField SERVER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("serverName", org.apache.thrift.protocol.TType.STRING, (short)6);
+  private static final org.apache.thrift.protocol.TField PORT_FIELD_DESC = new org.apache.thrift.protocol.TField("port", org.apache.thrift.protocol.TType.I32, (short)7);
+
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new TRegionInfoStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new TRegionInfoTupleSchemeFactory());
+  }
 
-  private static final TField START_KEY_FIELD_DESC = new TField("startKey", TType.STRING, (short)1);
-  private static final TField END_KEY_FIELD_DESC = new TField("endKey", TType.STRING, (short)2);
-  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;
+  public ByteBuffer startKey; // required
+  public ByteBuffer endKey; // required
+  public long id; // required
+  public ByteBuffer name; // required
+  public byte version; // required
+  public ByteBuffer serverName; // required
+  public int port; // required
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-  public enum _Fields implements TFieldIdEnum {
+  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
     START_KEY((short)1, "startKey"),
     END_KEY((short)2, "endKey"),
     ID((short)3, "id"),
@@ -56,12 +65,10 @@ public class TRegionInfo implements TBas
     SERVER_NAME((short)6, "serverName"),
     PORT((short)7, "port");
 
-    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
     static {
       for (_Fields field : EnumSet.allOf(_Fields.class)) {
-        byId.put((int)field._thriftId, field);
         byName.put(field.getFieldName(), field);
       }
     }
@@ -70,7 +77,24 @@ public class TRegionInfo implements TBas
      * Find the _Fields constant that matches fieldId, or null if its not found.
      */
     public static _Fields findByThriftId(int fieldId) {
-      return byId.get(fieldId);
+      switch(fieldId) {
+        case 1: // START_KEY
+          return START_KEY;
+        case 2: // END_KEY
+          return END_KEY;
+        case 3: // ID
+          return ID;
+        case 4: // NAME
+          return NAME;
+        case 5: // VERSION
+          return VERSION;
+        case 6: // SERVER_NAME
+          return SERVER_NAME;
+        case 7: // PORT
+          return PORT;
+        default:
+          return null;
+      }
     }
 
     /**
@@ -112,38 +136,37 @@ public class TRegionInfo implements TBas
   private static final int __VERSION_ISSET_ID = 1;
   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,
-        new FieldValueMetaData(TType.STRING)));
-    put(_Fields.END_KEY, new FieldMetaData("endKey", TFieldRequirementType.DEFAULT,
-        new FieldValueMetaData(TType.STRING)));
-    put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT,
-        new FieldValueMetaData(TType.I64)));
-    put(_Fields.NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT,
-        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)));
-  }});
-
+  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
   static {
-    FieldMetaData.addStructMetaDataMap(TRegionInfo.class, metaDataMap);
+    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+    tmpMap.put(_Fields.START_KEY, new org.apache.thrift.meta_data.FieldMetaData("startKey", org.apache.thrift.TFieldRequirementType.DEFAULT,
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , "Text")));
+    tmpMap.put(_Fields.END_KEY, new org.apache.thrift.meta_data.FieldMetaData("endKey", org.apache.thrift.TFieldRequirementType.DEFAULT,
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , "Text")));
+    tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT,
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
+    tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT,
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , "Text")));
+    tmpMap.put(_Fields.VERSION, new org.apache.thrift.meta_data.FieldMetaData("version", org.apache.thrift.TFieldRequirementType.DEFAULT,
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BYTE)));
+    tmpMap.put(_Fields.SERVER_NAME, new org.apache.thrift.meta_data.FieldMetaData("serverName", org.apache.thrift.TFieldRequirementType.DEFAULT,
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , "Text")));
+    tmpMap.put(_Fields.PORT, new org.apache.thrift.meta_data.FieldMetaData("port", org.apache.thrift.TFieldRequirementType.DEFAULT,
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
+    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRegionInfo.class, metaDataMap);
   }
 
   public TRegionInfo() {
   }
 
   public TRegionInfo(
-    byte[] startKey,
-    byte[] endKey,
+    ByteBuffer startKey,
+    ByteBuffer endKey,
     long id,
-    byte[] name,
+    ByteBuffer name,
     byte version,
-    byte[] serverName,
+    ByteBuffer serverName,
     int port)
   {
     this();
@@ -186,16 +209,35 @@ public class TRegionInfo implements TBas
     return new TRegionInfo(this);
   }
 
-  @Deprecated
-  public TRegionInfo clone() {
-    return new TRegionInfo(this);
+  @Override
+  public void clear() {
+    this.startKey = null;
+    this.endKey = null;
+    setIdIsSet(false);
+    this.id = 0;
+    this.name = null;
+    setVersionIsSet(false);
+    this.version = 0;
+    this.serverName = null;
+    setPortIsSet(false);
+    this.port = 0;
   }
 
   public byte[] getStartKey() {
-    return this.startKey;
+    setStartKey(org.apache.thrift.TBaseHelper.rightSize(startKey));
+    return startKey == null ? null : startKey.array();
+  }
+
+  public ByteBuffer bufferForStartKey() {
+    return startKey;
   }
 
   public TRegionInfo setStartKey(byte[] startKey) {
+    setStartKey(startKey == null ? (ByteBuffer)null : ByteBuffer.wrap(startKey));
+    return this;
+  }
+
+  public TRegionInfo setStartKey(ByteBuffer startKey) {
     this.startKey = startKey;
     return this;
   }
@@ -204,7 +246,7 @@ public class TRegionInfo implements TBas
     this.startKey = null;
   }
 
-  /** Returns true if field startKey is set (has been asigned a value) and false otherwise */
+  /** Returns true if field startKey is set (has been assigned a value) and false otherwise */
   public boolean isSetStartKey() {
     return this.startKey != null;
   }
@@ -216,10 +258,20 @@ public class TRegionInfo implements TBas
   }
 
   public byte[] getEndKey() {
-    return this.endKey;
+    setEndKey(org.apache.thrift.TBaseHelper.rightSize(endKey));
+    return endKey == null ? null : endKey.array();
+  }
+
+  public ByteBuffer bufferForEndKey() {
+    return endKey;
   }
 
   public TRegionInfo setEndKey(byte[] endKey) {
+    setEndKey(endKey == null ? (ByteBuffer)null : ByteBuffer.wrap(endKey));
+    return this;
+  }
+
+  public TRegionInfo setEndKey(ByteBuffer endKey) {
     this.endKey = endKey;
     return this;
   }
@@ -228,7 +280,7 @@ public class TRegionInfo implements TBas
     this.endKey = null;
   }
 
-  /** Returns true if field endKey is set (has been asigned a value) and false otherwise */
+  /** Returns true if field endKey is set (has been assigned a value) and false otherwise */
   public boolean isSetEndKey() {
     return this.endKey != null;
   }
@@ -253,7 +305,7 @@ public class TRegionInfo implements TBas
     __isset_bit_vector.clear(__ID_ISSET_ID);
   }
 
-  /** Returns true if field id is set (has been asigned a value) and false otherwise */
+  /** Returns true if field id is set (has been assigned a value) and false otherwise */
   public boolean isSetId() {
     return __isset_bit_vector.get(__ID_ISSET_ID);
   }
@@ -263,10 +315,20 @@ public class TRegionInfo implements TBas
   }
 
   public byte[] getName() {
-    return this.name;
+    setName(org.apache.thrift.TBaseHelper.rightSize(name));
+    return name == null ? null : name.array();
+  }
+
+  public ByteBuffer bufferForName() {
+    return name;
   }
 
   public TRegionInfo setName(byte[] name) {
+    setName(name == null ? (ByteBuffer)null : ByteBuffer.wrap(name));
+    return this;
+  }
+
+  public TRegionInfo setName(ByteBuffer name) {
     this.name = name;
     return this;
   }
@@ -275,7 +337,7 @@ public class TRegionInfo implements TBas
     this.name = null;
   }
 
-  /** Returns true if field name is set (has been asigned a value) and false otherwise */
+  /** Returns true if field name is set (has been assigned a value) and false otherwise */
   public boolean isSetName() {
     return this.name != null;
   }
@@ -300,7 +362,7 @@ public class TRegionInfo implements TBas
     __isset_bit_vector.clear(__VERSION_ISSET_ID);
   }
 
-  /** Returns true if field version is set (has been asigned a value) and false otherwise */
+  /** Returns true if field version is set (has been assigned a value) and false otherwise */
   public boolean isSetVersion() {
     return __isset_bit_vector.get(__VERSION_ISSET_ID);
   }
@@ -310,10 +372,20 @@ public class TRegionInfo implements TBas
   }
 
   public byte[] getServerName() {
-    return this.serverName;
+    setServerName(org.apache.thrift.TBaseHelper.rightSize(serverName));
+    return serverName == null ? null : serverName.array();
+  }
+
+  public ByteBuffer bufferForServerName() {
+    return serverName;
   }
 
   public TRegionInfo setServerName(byte[] serverName) {
+    setServerName(serverName == null ? (ByteBuffer)null : ByteBuffer.wrap(serverName));
+    return this;
+  }
+
+  public TRegionInfo setServerName(ByteBuffer serverName) {
     this.serverName = serverName;
     return this;
   }
@@ -322,7 +394,7 @@ public class TRegionInfo implements TBas
     this.serverName = null;
   }
 
-  /** Returns true if field serverName is set (has been asigned a value) and false otherwise */
+  /** Returns true if field serverName is set (has been assigned a value) and false otherwise */
   public boolean isSetServerName() {
     return this.serverName != null;
   }
@@ -347,7 +419,7 @@ public class TRegionInfo implements TBas
     __isset_bit_vector.clear(__PORT_ISSET_ID);
   }
 
-  /** Returns true if field port is set (has been asigned a value) and false otherwise */
+  /** Returns true if field port is set (has been assigned a value) and false otherwise */
   public boolean isSetPort() {
     return __isset_bit_vector.get(__PORT_ISSET_ID);
   }
@@ -362,7 +434,7 @@ public class TRegionInfo implements TBas
       if (value == null) {
         unsetStartKey();
       } else {
-        setStartKey((byte[])value);
+        setStartKey((ByteBuffer)value);
       }
       break;
 
@@ -370,7 +442,7 @@ public class TRegionInfo implements TBas
       if (value == null) {
         unsetEndKey();
       } else {
-        setEndKey((byte[])value);
+        setEndKey((ByteBuffer)value);
       }
       break;
 
@@ -386,7 +458,7 @@ public class TRegionInfo implements TBas
       if (value == null) {
         unsetName();
       } else {
-        setName((byte[])value);
+        setName((ByteBuffer)value);
       }
       break;
 
@@ -402,7 +474,7 @@ public class TRegionInfo implements TBas
       if (value == null) {
         unsetServerName();
       } else {
-        setServerName((byte[])value);
+        setServerName((ByteBuffer)value);
       }
       break;
 
@@ -417,10 +489,6 @@ public class TRegionInfo implements TBas
     }
   }
 
-  public void setFieldValue(int fieldID, Object value) {
-    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
-  }
-
   public Object getFieldValue(_Fields field) {
     switch (field) {
     case START_KEY:
@@ -430,30 +498,30 @@ public class TRegionInfo implements TBas
       return getEndKey();
 
     case ID:
-      return new Long(getId());
+      return Long.valueOf(getId());
 
     case NAME:
       return getName();
 
     case VERSION:
-      return new Byte(getVersion());
+      return Byte.valueOf(getVersion());
 
     case SERVER_NAME:
       return getServerName();
 
     case PORT:
-      return new Integer(getPort());
+      return Integer.valueOf(getPort());
 
     }
     throw new IllegalStateException();
   }
 
-  public Object getFieldValue(int fieldId) {
-    return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
-  }
-
-  /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
+  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
   public boolean isSet(_Fields field) {
+    if (field == null) {
+      throw new IllegalArgumentException();
+    }
+
     switch (field) {
     case START_KEY:
       return isSetStartKey();
@@ -473,10 +541,6 @@ public class TRegionInfo implements TBas
     throw new IllegalStateException();
   }
 
-  public boolean isSet(int fieldID) {
-    return isSet(_Fields.findByThriftIdOrThrow(fieldID));
-  }
-
   @Override
   public boolean equals(Object that) {
     if (that == null)
@@ -495,7 +559,7 @@ public class TRegionInfo implements TBas
     if (this_present_startKey || that_present_startKey) {
       if (!(this_present_startKey && that_present_startKey))
         return false;
-      if (!java.util.Arrays.equals(this.startKey, that.startKey))
+      if (!this.startKey.equals(that.startKey))
         return false;
     }
 
@@ -504,7 +568,7 @@ public class TRegionInfo implements TBas
     if (this_present_endKey || that_present_endKey) {
       if (!(this_present_endKey && that_present_endKey))
         return false;
-      if (!java.util.Arrays.equals(this.endKey, that.endKey))
+      if (!this.endKey.equals(that.endKey))
         return false;
     }
 
@@ -522,7 +586,7 @@ public class TRegionInfo implements TBas
     if (this_present_name || that_present_name) {
       if (!(this_present_name && that_present_name))
         return false;
-      if (!java.util.Arrays.equals(this.name, that.name))
+      if (!this.name.equals(that.name))
         return false;
     }
 
@@ -540,7 +604,7 @@ public class TRegionInfo implements TBas
     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))
+      if (!this.serverName.equals(that.serverName))
         return false;
     }
 
@@ -558,44 +622,7 @@ public class TRegionInfo implements TBas
 
   @Override
   public int hashCode() {
-    HashCodeBuilder builder = new HashCodeBuilder();
-
-    boolean present_startKey = true && (isSetStartKey());
-    builder.append(present_startKey);
-    if (present_startKey)
-      builder.append(startKey);
-
-    boolean present_endKey = true && (isSetEndKey());
-    builder.append(present_endKey);
-    if (present_endKey)
-      builder.append(endKey);
-
-    boolean present_id = true;
-    builder.append(present_id);
-    if (present_id)
-      builder.append(id);
-
-    boolean present_name = true && (isSetName());
-    builder.append(present_name);
-    if (present_name)
-      builder.append(name);
-
-    boolean present_version = true;
-    builder.append(present_version);
-    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();
+    return 0;
   }
 
   public int compareTo(TRegionInfo other) {
@@ -606,176 +633,89 @@ public class TRegionInfo implements TBas
     int lastComparison = 0;
     TRegionInfo typedOther = (TRegionInfo)other;
 
-    lastComparison = Boolean.valueOf(isSetStartKey()).compareTo(isSetStartKey());
+    lastComparison = Boolean.valueOf(isSetStartKey()).compareTo(typedOther.isSetStartKey());
     if (lastComparison != 0) {
       return lastComparison;
     }
-    lastComparison = TBaseHelper.compareTo(startKey, typedOther.startKey);
-    if (lastComparison != 0) {
-      return lastComparison;
+    if (isSetStartKey()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startKey, typedOther.startKey);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
     }
-    lastComparison = Boolean.valueOf(isSetEndKey()).compareTo(isSetEndKey());
+    lastComparison = Boolean.valueOf(isSetEndKey()).compareTo(typedOther.isSetEndKey());
     if (lastComparison != 0) {
       return lastComparison;
     }
-    lastComparison = TBaseHelper.compareTo(endKey, typedOther.endKey);
-    if (lastComparison != 0) {
-      return lastComparison;
+    if (isSetEndKey()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endKey, typedOther.endKey);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
     }
-    lastComparison = Boolean.valueOf(isSetId()).compareTo(isSetId());
+    lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
     if (lastComparison != 0) {
       return lastComparison;
     }
-    lastComparison = TBaseHelper.compareTo(id, typedOther.id);
-    if (lastComparison != 0) {
-      return lastComparison;
+    if (isSetId()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
     }
-    lastComparison = Boolean.valueOf(isSetName()).compareTo(isSetName());
+    lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName());
     if (lastComparison != 0) {
       return lastComparison;
     }
-    lastComparison = TBaseHelper.compareTo(name, typedOther.name);
-    if (lastComparison != 0) {
-      return lastComparison;
+    if (isSetName()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
     }
-    lastComparison = Boolean.valueOf(isSetVersion()).compareTo(isSetVersion());
+    lastComparison = Boolean.valueOf(isSetVersion()).compareTo(typedOther.isSetVersion());
     if (lastComparison != 0) {
       return lastComparison;
     }
-    lastComparison = TBaseHelper.compareTo(version, typedOther.version);
-    if (lastComparison != 0) {
-      return lastComparison;
+    if (isSetVersion()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.version, typedOther.version);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
     }
-    lastComparison = Boolean.valueOf(isSetServerName()).compareTo(isSetServerName());
+    lastComparison = Boolean.valueOf(isSetServerName()).compareTo(typedOther.isSetServerName());
     if (lastComparison != 0) {
       return lastComparison;
     }
-    lastComparison = TBaseHelper.compareTo(serverName, typedOther.serverName);
-    if (lastComparison != 0) {
-      return lastComparison;
+    if (isSetServerName()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serverName, typedOther.serverName);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
     }
-    lastComparison = Boolean.valueOf(isSetPort()).compareTo(isSetPort());
+    lastComparison = Boolean.valueOf(isSetPort()).compareTo(typedOther.isSetPort());
     if (lastComparison != 0) {
       return lastComparison;
     }
-    lastComparison = TBaseHelper.compareTo(port, typedOther.port);
-    if (lastComparison != 0) {
-      return lastComparison;
+    if (isSetPort()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.port, typedOther.port);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
     }
     return 0;
   }
 
-  public void read(TProtocol iprot) throws TException {
-    TField field;
-    iprot.readStructBegin();
-    while (true)
-    {
-      field = iprot.readFieldBegin();
-      if (field.type == TType.STOP) {
-        break;
-      }
-      _Fields fieldId = _Fields.findByThriftId(field.id);
-      if (fieldId == null) {
-        TProtocolUtil.skip(iprot, field.type);
-      } else {
-        switch (fieldId) {
-          case START_KEY:
-            if (field.type == TType.STRING) {
-              this.startKey = iprot.readBinary();
-            } else {
-              TProtocolUtil.skip(iprot, field.type);
-            }
-            break;
-          case END_KEY:
-            if (field.type == TType.STRING) {
-              this.endKey = iprot.readBinary();
-            } else {
-              TProtocolUtil.skip(iprot, field.type);
-            }
-            break;
-          case ID:
-            if (field.type == TType.I64) {
-              this.id = iprot.readI64();
-              setIdIsSet(true);
-            } else {
-              TProtocolUtil.skip(iprot, field.type);
-            }
-            break;
-          case NAME:
-            if (field.type == TType.STRING) {
-              this.name = iprot.readBinary();
-            } else {
-              TProtocolUtil.skip(iprot, field.type);
-            }
-            break;
-          case VERSION:
-            if (field.type == TType.BYTE) {
-              this.version = iprot.readByte();
-              setVersionIsSet(true);
-            } else {
-              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();
-      }
-    }
-    iprot.readStructEnd();
-
-    // check for required fields of primitive type, which can't be checked in the validate method
-    validate();
+  public _Fields fieldForId(int fieldId) {
+    return _Fields.findByThriftId(fieldId);
   }
 
-  public void write(TProtocol oprot) throws TException {
-    validate();
+  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+  }
 
-    oprot.writeStructBegin(STRUCT_DESC);
-    if (this.startKey != null) {
-      oprot.writeFieldBegin(START_KEY_FIELD_DESC);
-      oprot.writeBinary(this.startKey);
-      oprot.writeFieldEnd();
-    }
-    if (this.endKey != null) {
-      oprot.writeFieldBegin(END_KEY_FIELD_DESC);
-      oprot.writeBinary(this.endKey);
-      oprot.writeFieldEnd();
-    }
-    oprot.writeFieldBegin(ID_FIELD_DESC);
-    oprot.writeI64(this.id);
-    oprot.writeFieldEnd();
-    if (this.name != null) {
-      oprot.writeFieldBegin(NAME_FIELD_DESC);
-      oprot.writeBinary(this.name);
-      oprot.writeFieldEnd();
-    }
-    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();
+  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
   }
 
   @Override
@@ -830,9 +770,243 @@ public class TRegionInfo implements TBas
     return sb.toString();
   }
 
-  public void validate() throws TException {
+  public void validate() throws org.apache.thrift.TException {
     // check for required fields
   }
 
+  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+    try {
+      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+    try {
+      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
+      __isset_bit_vector = new BitSet(1);
+      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private static class TRegionInfoStandardSchemeFactory implements SchemeFactory {
+    public TRegionInfoStandardScheme getScheme() {
+      return new TRegionInfoStandardScheme();
+    }
+  }
+
+  private static class TRegionInfoStandardScheme extends StandardScheme<TRegionInfo> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, TRegionInfo struct) throws org.apache.thrift.TException {
+      org.apache.thrift.protocol.TField schemeField;
+      iprot.readStructBegin();
+      while (true)
+      {
+        schemeField = iprot.readFieldBegin();
+        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+          break;
+        }
+        switch (schemeField.id) {
+          case 1: // START_KEY
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.startKey = iprot.readBinary();
+              struct.setStartKeyIsSet(true);
+            } else {
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 2: // END_KEY
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.endKey = iprot.readBinary();
+              struct.setEndKeyIsSet(true);
+            } else {
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 3: // ID
+            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+              struct.id = iprot.readI64();
+              struct.setIdIsSet(true);
+            } else {
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 4: // NAME
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.name = iprot.readBinary();
+              struct.setNameIsSet(true);
+            } else {
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 5: // VERSION
+            if (schemeField.type == org.apache.thrift.protocol.TType.BYTE) {
+              struct.version = iprot.readByte();
+              struct.setVersionIsSet(true);
+            } else {
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 6: // SERVER_NAME
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.serverName = iprot.readBinary();
+              struct.setServerNameIsSet(true);
+            } else {
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 7: // PORT
+            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+              struct.port = iprot.readI32();
+              struct.setPortIsSet(true);
+            } else {
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          default:
+            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+        }
+        iprot.readFieldEnd();
+      }
+      iprot.readStructEnd();
+
+      // check for required fields of primitive type, which can't be checked in the validate method
+      struct.validate();
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot, TRegionInfo struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.startKey != null) {
+        oprot.writeFieldBegin(START_KEY_FIELD_DESC);
+        oprot.writeBinary(struct.startKey);
+        oprot.writeFieldEnd();
+      }
+      if (struct.endKey != null) {
+        oprot.writeFieldBegin(END_KEY_FIELD_DESC);
+        oprot.writeBinary(struct.endKey);
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldBegin(ID_FIELD_DESC);
+      oprot.writeI64(struct.id);
+      oprot.writeFieldEnd();
+      if (struct.name != null) {
+        oprot.writeFieldBegin(NAME_FIELD_DESC);
+        oprot.writeBinary(struct.name);
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldBegin(VERSION_FIELD_DESC);
+      oprot.writeByte(struct.version);
+      oprot.writeFieldEnd();
+      if (struct.serverName != null) {
+        oprot.writeFieldBegin(SERVER_NAME_FIELD_DESC);
+        oprot.writeBinary(struct.serverName);
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldBegin(PORT_FIELD_DESC);
+      oprot.writeI32(struct.port);
+      oprot.writeFieldEnd();
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class TRegionInfoTupleSchemeFactory implements SchemeFactory {
+    public TRegionInfoTupleScheme getScheme() {
+      return new TRegionInfoTupleScheme();
+    }
+  }
+
+  private static class TRegionInfoTupleScheme extends TupleScheme<TRegionInfo> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, TRegionInfo struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      BitSet optionals = new BitSet();
+      if (struct.isSetStartKey()) {
+        optionals.set(0);
+      }
+      if (struct.isSetEndKey()) {
+        optionals.set(1);
+      }
+      if (struct.isSetId()) {
+        optionals.set(2);
+      }
+      if (struct.isSetName()) {
+        optionals.set(3);
+      }
+      if (struct.isSetVersion()) {
+        optionals.set(4);
+      }
+      if (struct.isSetServerName()) {
+        optionals.set(5);
+      }
+      if (struct.isSetPort()) {
+        optionals.set(6);
+      }
+      oprot.writeBitSet(optionals, 7);
+      if (struct.isSetStartKey()) {
+        oprot.writeBinary(struct.startKey);
+      }
+      if (struct.isSetEndKey()) {
+        oprot.writeBinary(struct.endKey);
+      }
+      if (struct.isSetId()) {
+        oprot.writeI64(struct.id);
+      }
+      if (struct.isSetName()) {
+        oprot.writeBinary(struct.name);
+      }
+      if (struct.isSetVersion()) {
+        oprot.writeByte(struct.version);
+      }
+      if (struct.isSetServerName()) {
+        oprot.writeBinary(struct.serverName);
+      }
+      if (struct.isSetPort()) {
+        oprot.writeI32(struct.port);
+      }
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, TRegionInfo struct) throws org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      BitSet incoming = iprot.readBitSet(7);
+      if (incoming.get(0)) {
+        struct.startKey = iprot.readBinary();
+        struct.setStartKeyIsSet(true);
+      }
+      if (incoming.get(1)) {
+        struct.endKey = iprot.readBinary();
+        struct.setEndKeyIsSet(true);
+      }
+      if (incoming.get(2)) {
+        struct.id = iprot.readI64();
+        struct.setIdIsSet(true);
+      }
+      if (incoming.get(3)) {
+        struct.name = iprot.readBinary();
+        struct.setNameIsSet(true);
+      }
+      if (incoming.get(4)) {
+        struct.version = iprot.readByte();
+        struct.setVersionIsSet(true);
+      }
+      if (incoming.get(5)) {
+        struct.serverName = iprot.readBinary();
+        struct.setServerNameIsSet(true);
+      }
+      if (incoming.get(6)) {
+        struct.port = iprot.readI32();
+        struct.setPortIsSet(true);
+      }
+    }
+  }
+
 }
 

Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/thrift/generated/TRowResult.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/thrift/generated/TRowResult.java?rev=1328562&r1=1328561&r2=1328562&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/thrift/generated/TRowResult.java (original)
+++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/thrift/generated/TRowResult.java Sat Apr 21 01:37:15 2012
@@ -1,11 +1,17 @@
 /**
- * Autogenerated by Thrift
+ * Autogenerated by Thrift Compiler (0.8.0)
  *
  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
  */
 package org.apache.hadoop.hbase.thrift.generated;
 
-import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
 import java.util.List;
 import java.util.ArrayList;
 import java.util.Map;
@@ -16,37 +22,38 @@ import java.util.HashSet;
 import java.util.EnumSet;
 import java.util.Collections;
 import java.util.BitSet;
+import java.nio.ByteBuffer;
 import java.util.Arrays;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import org.apache.thrift.*;
-import org.apache.thrift.meta_data.*;
-import org.apache.thrift.protocol.*;
-
 /**
  * Holds row name and then a map of columns to cells.
  */
-public class TRowResult implements TBase<TRowResult._Fields>, java.io.Serializable, Cloneable {
-  private static final TStruct STRUCT_DESC = new TStruct("TRowResult");
+public class TRowResult implements org.apache.thrift.TBase<TRowResult, TRowResult._Fields>, java.io.Serializable, Cloneable {
+  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRowResult");
 
-  private static final TField ROW_FIELD_DESC = new TField("row", TType.STRING, (short)1);
-  private static final TField COLUMNS_FIELD_DESC = new TField("columns", TType.MAP, (short)2);
+  private static final org.apache.thrift.protocol.TField ROW_FIELD_DESC = new org.apache.thrift.protocol.TField("row", org.apache.thrift.protocol.TType.STRING, (short)1);
+  private static final org.apache.thrift.protocol.TField COLUMNS_FIELD_DESC = new org.apache.thrift.protocol.TField("columns", org.apache.thrift.protocol.TType.MAP, (short)2);
 
-  public byte[] row;
-  public Map<byte[],TCell> columns;
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new TRowResultStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new TRowResultTupleSchemeFactory());
+  }
+
+  public ByteBuffer row; // required
+  public Map<ByteBuffer,TCell> columns; // required
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-  public enum _Fields implements TFieldIdEnum {
+  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
     ROW((short)1, "row"),
     COLUMNS((short)2, "columns");
 
-    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
     static {
       for (_Fields field : EnumSet.allOf(_Fields.class)) {
-        byId.put((int)field._thriftId, field);
         byName.put(field.getFieldName(), field);
       }
     }
@@ -55,7 +62,14 @@ public class TRowResult implements TBase
      * Find the _Fields constant that matches fieldId, or null if its not found.
      */
     public static _Fields findByThriftId(int fieldId) {
-      return byId.get(fieldId);
+      switch(fieldId) {
+        case 1: // ROW
+          return ROW;
+        case 2: // COLUMNS
+          return COLUMNS;
+        default:
+          return null;
+      }
     }
 
     /**
@@ -93,26 +107,25 @@ public class TRowResult implements TBase
   }
 
   // isset id assignments
-
-  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
-    put(_Fields.ROW, new FieldMetaData("row", TFieldRequirementType.DEFAULT,
-        new FieldValueMetaData(TType.STRING)));
-    put(_Fields.COLUMNS, new FieldMetaData("columns", TFieldRequirementType.DEFAULT,
-        new MapMetaData(TType.MAP,
-            new FieldValueMetaData(TType.STRING),
-            new StructMetaData(TType.STRUCT, TCell.class))));
-  }});
-
+  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
   static {
-    FieldMetaData.addStructMetaDataMap(TRowResult.class, metaDataMap);
+    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+    tmpMap.put(_Fields.ROW, new org.apache.thrift.meta_data.FieldMetaData("row", org.apache.thrift.TFieldRequirementType.DEFAULT,
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , "Text")));
+    tmpMap.put(_Fields.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", org.apache.thrift.TFieldRequirementType.DEFAULT,
+        new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
+            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING            , "Text"),
+            new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TCell.class))));
+    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRowResult.class, metaDataMap);
   }
 
   public TRowResult() {
   }
 
   public TRowResult(
-    byte[] row,
-    Map<byte[],TCell> columns)
+    ByteBuffer row,
+    Map<ByteBuffer,TCell> columns)
   {
     this();
     this.row = row;
@@ -127,13 +140,13 @@ public class TRowResult implements TBase
       this.row = other.row;
     }
     if (other.isSetColumns()) {
-      Map<byte[],TCell> __this__columns = new HashMap<byte[],TCell>();
-      for (Map.Entry<byte[], TCell> other_element : other.columns.entrySet()) {
+      Map<ByteBuffer,TCell> __this__columns = new HashMap<ByteBuffer,TCell>();
+      for (Map.Entry<ByteBuffer, TCell> other_element : other.columns.entrySet()) {
 
-        byte[] other_element_key = other_element.getKey();
+        ByteBuffer other_element_key = other_element.getKey();
         TCell other_element_value = other_element.getValue();
 
-        byte[] __this__columns_copy_key = other_element_key;
+        ByteBuffer __this__columns_copy_key = other_element_key;
 
         TCell __this__columns_copy_value = new TCell(other_element_value);
 
@@ -147,16 +160,27 @@ public class TRowResult implements TBase
     return new TRowResult(this);
   }
 
-  @Deprecated
-  public TRowResult clone() {
-    return new TRowResult(this);
+  @Override
+  public void clear() {
+    this.row = null;
+    this.columns = null;
   }
 
   public byte[] getRow() {
-    return this.row;
+    setRow(org.apache.thrift.TBaseHelper.rightSize(row));
+    return row == null ? null : row.array();
+  }
+
+  public ByteBuffer bufferForRow() {
+    return row;
   }
 
   public TRowResult setRow(byte[] row) {
+    setRow(row == null ? (ByteBuffer)null : ByteBuffer.wrap(row));
+    return this;
+  }
+
+  public TRowResult setRow(ByteBuffer row) {
     this.row = row;
     return this;
   }
@@ -165,7 +189,7 @@ public class TRowResult implements TBase
     this.row = null;
   }
 
-  /** Returns true if field row is set (has been asigned a value) and false otherwise */
+  /** Returns true if field row is set (has been assigned a value) and false otherwise */
   public boolean isSetRow() {
     return this.row != null;
   }
@@ -180,18 +204,18 @@ public class TRowResult implements TBase
     return (this.columns == null) ? 0 : this.columns.size();
   }
 
-  public void putToColumns(byte[] key, TCell val) {
+  public void putToColumns(ByteBuffer key, TCell val) {
     if (this.columns == null) {
-      this.columns = new HashMap<byte[],TCell>();
+      this.columns = new HashMap<ByteBuffer,TCell>();
     }
     this.columns.put(key, val);
   }
 
-  public Map<byte[],TCell> getColumns() {
+  public Map<ByteBuffer,TCell> getColumns() {
     return this.columns;
   }
 
-  public TRowResult setColumns(Map<byte[],TCell> columns) {
+  public TRowResult setColumns(Map<ByteBuffer,TCell> columns) {
     this.columns = columns;
     return this;
   }
@@ -200,7 +224,7 @@ public class TRowResult implements TBase
     this.columns = null;
   }
 
-  /** Returns true if field columns is set (has been asigned a value) and false otherwise */
+  /** Returns true if field columns is set (has been assigned a value) and false otherwise */
   public boolean isSetColumns() {
     return this.columns != null;
   }
@@ -217,7 +241,7 @@ public class TRowResult implements TBase
       if (value == null) {
         unsetRow();
       } else {
-        setRow((byte[])value);
+        setRow((ByteBuffer)value);
       }
       break;
 
@@ -225,17 +249,13 @@ public class TRowResult implements TBase
       if (value == null) {
         unsetColumns();
       } else {
-        setColumns((Map<byte[],TCell>)value);
+        setColumns((Map<ByteBuffer,TCell>)value);
       }
       break;
 
     }
   }
 
-  public void setFieldValue(int fieldID, Object value) {
-    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
-  }
-
   public Object getFieldValue(_Fields field) {
     switch (field) {
     case ROW:
@@ -248,12 +268,12 @@ public class TRowResult implements TBase
     throw new IllegalStateException();
   }
 
-  public Object getFieldValue(int fieldId) {
-    return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
-  }
-
-  /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
+  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
   public boolean isSet(_Fields field) {
+    if (field == null) {
+      throw new IllegalArgumentException();
+    }
+
     switch (field) {
     case ROW:
       return isSetRow();
@@ -263,10 +283,6 @@ public class TRowResult implements TBase
     throw new IllegalStateException();
   }
 
-  public boolean isSet(int fieldID) {
-    return isSet(_Fields.findByThriftIdOrThrow(fieldID));
-  }
-
   @Override
   public boolean equals(Object that) {
     if (that == null)
@@ -285,7 +301,7 @@ public class TRowResult implements TBase
     if (this_present_row || that_present_row) {
       if (!(this_present_row && that_present_row))
         return false;
-      if (!java.util.Arrays.equals(this.row, that.row))
+      if (!this.row.equals(that.row))
         return false;
     }
 
@@ -303,96 +319,50 @@ public class TRowResult implements TBase
 
   @Override
   public int hashCode() {
-    HashCodeBuilder builder = new HashCodeBuilder();
+    return 0;
+  }
 
-    boolean present_row = true && (isSetRow());
-    builder.append(present_row);
-    if (present_row)
-      builder.append(row);
-
-    boolean present_columns = true && (isSetColumns());
-    builder.append(present_columns);
-    if (present_columns)
-      builder.append(columns);
-
-    return builder.toHashCode();
-  }
-
-  public void read(TProtocol iprot) throws TException {
-    TField field;
-    iprot.readStructBegin();
-    while (true)
-    {
-      field = iprot.readFieldBegin();
-      if (field.type == TType.STOP) {
-        break;
-      }
-      _Fields fieldId = _Fields.findByThriftId(field.id);
-      if (fieldId == null) {
-        TProtocolUtil.skip(iprot, field.type);
-      } else {
-        switch (fieldId) {
-          case ROW:
-            if (field.type == TType.STRING) {
-              this.row = iprot.readBinary();
-            } else {
-              TProtocolUtil.skip(iprot, field.type);
-            }
-            break;
-          case COLUMNS:
-            if (field.type == TType.MAP) {
-              {
-                TMap _map4 = iprot.readMapBegin();
-                this.columns = new HashMap<byte[],TCell>(2*_map4.size);
-                for (int _i5 = 0; _i5 < _map4.size; ++_i5)
-                {
-                  byte[] _key6;
-                  TCell _val7;
-                  _key6 = iprot.readBinary();
-                  _val7 = new TCell();
-                  _val7.read(iprot);
-                  this.columns.put(_key6, _val7);
-                }
-                iprot.readMapEnd();
-              }
-            } else {
-              TProtocolUtil.skip(iprot, field.type);
-            }
-            break;
-        }
-        iprot.readFieldEnd();
-      }
+  public int compareTo(TRowResult other) {
+    if (!getClass().equals(other.getClass())) {
+      return getClass().getName().compareTo(other.getClass().getName());
     }
-    iprot.readStructEnd();
-
-    // check for required fields of primitive type, which can't be checked in the validate method
-    validate();
-  }
 
-  public void write(TProtocol oprot) throws TException {
-    validate();
+    int lastComparison = 0;
+    TRowResult typedOther = (TRowResult)other;
 
-    oprot.writeStructBegin(STRUCT_DESC);
-    if (this.row != null) {
-      oprot.writeFieldBegin(ROW_FIELD_DESC);
-      oprot.writeBinary(this.row);
-      oprot.writeFieldEnd();
+    lastComparison = Boolean.valueOf(isSetRow()).compareTo(typedOther.isSetRow());
+    if (lastComparison != 0) {
+      return lastComparison;
     }
-    if (this.columns != null) {
-      oprot.writeFieldBegin(COLUMNS_FIELD_DESC);
-      {
-        oprot.writeMapBegin(new TMap(TType.STRING, TType.STRUCT, this.columns.size()));
-        for (Map.Entry<byte[], TCell> _iter8 : this.columns.entrySet())
-        {
-          oprot.writeBinary(_iter8.getKey());
-          _iter8.getValue().write(oprot);
-        }
-        oprot.writeMapEnd();
+    if (isSetRow()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row, typedOther.row);
+      if (lastComparison != 0) {
+        return lastComparison;
       }
-      oprot.writeFieldEnd();
     }
-    oprot.writeFieldStop();
-    oprot.writeStructEnd();
+    lastComparison = Boolean.valueOf(isSetColumns()).compareTo(typedOther.isSetColumns());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetColumns()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columns, typedOther.columns);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    return 0;
+  }
+
+  public _Fields fieldForId(int fieldId) {
+    return _Fields.findByThriftId(fieldId);
+  }
+
+  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+  }
+
+  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
   }
 
   @Override
@@ -419,9 +389,172 @@ public class TRowResult implements TBase
     return sb.toString();
   }
 
-  public void validate() throws TException {
+  public void validate() throws org.apache.thrift.TException {
     // check for required fields
   }
 
+  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+    try {
+      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+    try {
+      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private static class TRowResultStandardSchemeFactory implements SchemeFactory {
+    public TRowResultStandardScheme getScheme() {
+      return new TRowResultStandardScheme();
+    }
+  }
+
+  private static class TRowResultStandardScheme extends StandardScheme<TRowResult> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, TRowResult struct) throws org.apache.thrift.TException {
+      org.apache.thrift.protocol.TField schemeField;
+      iprot.readStructBegin();
+      while (true)
+      {
+        schemeField = iprot.readFieldBegin();
+        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+          break;
+        }
+        switch (schemeField.id) {
+          case 1: // ROW
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.row = iprot.readBinary();
+              struct.setRowIsSet(true);
+            } else {
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 2: // COLUMNS
+            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
+              {
+                org.apache.thrift.protocol.TMap _map8 = iprot.readMapBegin();
+                struct.columns = new HashMap<ByteBuffer,TCell>(2*_map8.size);
+                for (int _i9 = 0; _i9 < _map8.size; ++_i9)
+                {
+                  ByteBuffer _key10; // required
+                  TCell _val11; // optional
+                  _key10 = iprot.readBinary();
+                  _val11 = new TCell();
+                  _val11.read(iprot);
+                  struct.columns.put(_key10, _val11);
+                }
+                iprot.readMapEnd();
+              }
+              struct.setColumnsIsSet(true);
+            } else {
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          default:
+            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+        }
+        iprot.readFieldEnd();
+      }
+      iprot.readStructEnd();
+
+      // check for required fields of primitive type, which can't be checked in the validate method
+      struct.validate();
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot, TRowResult struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.row != null) {
+        oprot.writeFieldBegin(ROW_FIELD_DESC);
+        oprot.writeBinary(struct.row);
+        oprot.writeFieldEnd();
+      }
+      if (struct.columns != null) {
+        oprot.writeFieldBegin(COLUMNS_FIELD_DESC);
+        {
+          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, struct.columns.size()));
+          for (Map.Entry<ByteBuffer, TCell> _iter12 : struct.columns.entrySet())
+          {
+            oprot.writeBinary(_iter12.getKey());
+            _iter12.getValue().write(oprot);
+          }
+          oprot.writeMapEnd();
+        }
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class TRowResultTupleSchemeFactory implements SchemeFactory {
+    public TRowResultTupleScheme getScheme() {
+      return new TRowResultTupleScheme();
+    }
+  }
+
+  private static class TRowResultTupleScheme extends TupleScheme<TRowResult> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, TRowResult struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      BitSet optionals = new BitSet();
+      if (struct.isSetRow()) {
+        optionals.set(0);
+      }
+      if (struct.isSetColumns()) {
+        optionals.set(1);
+      }
+      oprot.writeBitSet(optionals, 2);
+      if (struct.isSetRow()) {
+        oprot.writeBinary(struct.row);
+      }
+      if (struct.isSetColumns()) {
+        {
+          oprot.writeI32(struct.columns.size());
+          for (Map.Entry<ByteBuffer, TCell> _iter13 : struct.columns.entrySet())
+          {
+            oprot.writeBinary(_iter13.getKey());
+            _iter13.getValue().write(oprot);
+          }
+        }
+      }
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, TRowResult struct) throws org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      BitSet incoming = iprot.readBitSet(2);
+      if (incoming.get(0)) {
+        struct.row = iprot.readBinary();
+        struct.setRowIsSet(true);
+      }
+      if (incoming.get(1)) {
+        {
+          org.apache.thrift.protocol.TMap _map14 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+          struct.columns = new HashMap<ByteBuffer,TCell>(2*_map14.size);
+          for (int _i15 = 0; _i15 < _map14.size; ++_i15)
+          {
+            ByteBuffer _key16; // required
+            TCell _val17; // optional
+            _key16 = iprot.readBinary();
+            _val17 = new TCell();
+            _val17.read(iprot);
+            struct.columns.put(_key16, _val17);
+          }
+        }
+        struct.setColumnsIsSet(true);
+      }
+    }
+  }
+
 }
 



Mime
View raw message