hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hashut...@apache.org
Subject svn commit: r1406984 [11/29] - in /hive/trunk: contrib/src/java/org/apache/hadoop/hive/contrib/genericudf/example/ contrib/src/java/org/apache/hadoop/hive/contrib/serde2/ contrib/src/java/org/apache/hadoop/hive/contrib/util/typedbytes/ contrib/src/test...
Date Thu, 08 Nov 2012 09:44:29 GMT
Modified: hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Table.java
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Table.java?rev=1406984&r1=1406983&r2=1406984&view=diff
==============================================================================
--- hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Table.java
(original)
+++ hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Table.java
Thu Nov  8 09:44:19 2012
@@ -1,11 +1,21 @@
 /**
- * Autogenerated by Thrift Compiler (0.7.0)
+ * Autogenerated by Thrift Compiler (0.9.0)
  *
  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
  */
 package org.apache.hadoop.hive.metastore.api;
 
 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 org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
 import java.util.List;
 import java.util.ArrayList;
 import java.util.Map;
@@ -38,6 +48,12 @@ public class Table implements org.apache
   private static final org.apache.thrift.protocol.TField TABLE_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("tableType",
org.apache.thrift.protocol.TType.STRING, (short)12);
   private static final org.apache.thrift.protocol.TField PRIVILEGES_FIELD_DESC = new org.apache.thrift.protocol.TField("privileges",
org.apache.thrift.protocol.TType.STRUCT, (short)13);
 
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes =
new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new TableStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new TableTupleSchemeFactory());
+  }
+
   private String tableName; // required
   private String dbName; // required
   private String owner; // required
@@ -50,7 +66,7 @@ public class Table implements org.apache
   private String viewOriginalText; // required
   private String viewExpandedText; // required
   private String tableType; // required
-  private PrincipalPrivilegeSet privileges; // required
+  private PrincipalPrivilegeSet privileges; // optional
 
   /** The set of fields this struct contains, along with convenience methods for finding
and manipulating them. */
   public enum _Fields implements org.apache.thrift.TFieldIdEnum {
@@ -150,8 +166,8 @@ public class Table implements org.apache
   private static final int __CREATETIME_ISSET_ID = 0;
   private static final int __LASTACCESSTIME_ISSET_ID = 1;
   private static final int __RETENTION_ISSET_ID = 2;
-  private BitSet __isset_bit_vector = new BitSet(3);
-
+  private byte __isset_bitfield = 0;
+  private _Fields optionals[] = {_Fields.PRIVILEGES};
   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
   static {
     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields,
org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
@@ -227,8 +243,7 @@ public class Table implements org.apache
    * Performs a deep copy on <i>other</i>.
    */
   public Table(Table other) {
-    __isset_bit_vector.clear();
-    __isset_bit_vector.or(other.__isset_bit_vector);
+    __isset_bitfield = other.__isset_bitfield;
     if (other.isSetTableName()) {
       this.tableName = other.tableName;
     }
@@ -383,16 +398,16 @@ public class Table implements org.apache
   }
 
   public void unsetCreateTime() {
-    __isset_bit_vector.clear(__CREATETIME_ISSET_ID);
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CREATETIME_ISSET_ID);
   }
 
   /** Returns true if field createTime is set (has been assigned a value) and false otherwise
*/
   public boolean isSetCreateTime() {
-    return __isset_bit_vector.get(__CREATETIME_ISSET_ID);
+    return EncodingUtils.testBit(__isset_bitfield, __CREATETIME_ISSET_ID);
   }
 
   public void setCreateTimeIsSet(boolean value) {
-    __isset_bit_vector.set(__CREATETIME_ISSET_ID, value);
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CREATETIME_ISSET_ID, value);
   }
 
   public int getLastAccessTime() {
@@ -405,16 +420,16 @@ public class Table implements org.apache
   }
 
   public void unsetLastAccessTime() {
-    __isset_bit_vector.clear(__LASTACCESSTIME_ISSET_ID);
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LASTACCESSTIME_ISSET_ID);
   }
 
   /** Returns true if field lastAccessTime is set (has been assigned a value) and false otherwise
*/
   public boolean isSetLastAccessTime() {
-    return __isset_bit_vector.get(__LASTACCESSTIME_ISSET_ID);
+    return EncodingUtils.testBit(__isset_bitfield, __LASTACCESSTIME_ISSET_ID);
   }
 
   public void setLastAccessTimeIsSet(boolean value) {
-    __isset_bit_vector.set(__LASTACCESSTIME_ISSET_ID, value);
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LASTACCESSTIME_ISSET_ID,
value);
   }
 
   public int getRetention() {
@@ -427,16 +442,16 @@ public class Table implements org.apache
   }
 
   public void unsetRetention() {
-    __isset_bit_vector.clear(__RETENTION_ISSET_ID);
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RETENTION_ISSET_ID);
   }
 
   /** Returns true if field retention is set (has been assigned a value) and false otherwise
*/
   public boolean isSetRetention() {
-    return __isset_bit_vector.get(__RETENTION_ISSET_ID);
+    return EncodingUtils.testBit(__isset_bitfield, __RETENTION_ISSET_ID);
   }
 
   public void setRetentionIsSet(boolean value) {
-    __isset_bit_vector.set(__RETENTION_ISSET_ID, value);
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RETENTION_ISSET_ID, value);
   }
 
   public StorageDescriptor getSd() {
@@ -1168,225 +1183,11 @@ public class Table implements org.apache
   }
 
   public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException
{
-    org.apache.thrift.protocol.TField field;
-    iprot.readStructBegin();
-    while (true)
-    {
-      field = iprot.readFieldBegin();
-      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
-        break;
-      }
-      switch (field.id) {
-        case 1: // TABLE_NAME
-          if (field.type == org.apache.thrift.protocol.TType.STRING) {
-            this.tableName = iprot.readString();
-          } else { 
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-          }
-          break;
-        case 2: // DB_NAME
-          if (field.type == org.apache.thrift.protocol.TType.STRING) {
-            this.dbName = iprot.readString();
-          } else { 
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-          }
-          break;
-        case 3: // OWNER
-          if (field.type == org.apache.thrift.protocol.TType.STRING) {
-            this.owner = iprot.readString();
-          } else { 
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-          }
-          break;
-        case 4: // CREATE_TIME
-          if (field.type == org.apache.thrift.protocol.TType.I32) {
-            this.createTime = iprot.readI32();
-            setCreateTimeIsSet(true);
-          } else { 
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-          }
-          break;
-        case 5: // LAST_ACCESS_TIME
-          if (field.type == org.apache.thrift.protocol.TType.I32) {
-            this.lastAccessTime = iprot.readI32();
-            setLastAccessTimeIsSet(true);
-          } else { 
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-          }
-          break;
-        case 6: // RETENTION
-          if (field.type == org.apache.thrift.protocol.TType.I32) {
-            this.retention = iprot.readI32();
-            setRetentionIsSet(true);
-          } else { 
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-          }
-          break;
-        case 7: // SD
-          if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
-            this.sd = new StorageDescriptor();
-            this.sd.read(iprot);
-          } else { 
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-          }
-          break;
-        case 8: // PARTITION_KEYS
-          if (field.type == org.apache.thrift.protocol.TType.LIST) {
-            {
-              org.apache.thrift.protocol.TList _list87 = iprot.readListBegin();
-              this.partitionKeys = new ArrayList<FieldSchema>(_list87.size);
-              for (int _i88 = 0; _i88 < _list87.size; ++_i88)
-              {
-                FieldSchema _elem89; // required
-                _elem89 = new FieldSchema();
-                _elem89.read(iprot);
-                this.partitionKeys.add(_elem89);
-              }
-              iprot.readListEnd();
-            }
-          } else { 
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-          }
-          break;
-        case 9: // PARAMETERS
-          if (field.type == org.apache.thrift.protocol.TType.MAP) {
-            {
-              org.apache.thrift.protocol.TMap _map90 = iprot.readMapBegin();
-              this.parameters = new HashMap<String,String>(2*_map90.size);
-              for (int _i91 = 0; _i91 < _map90.size; ++_i91)
-              {
-                String _key92; // required
-                String _val93; // required
-                _key92 = iprot.readString();
-                _val93 = iprot.readString();
-                this.parameters.put(_key92, _val93);
-              }
-              iprot.readMapEnd();
-            }
-          } else { 
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-          }
-          break;
-        case 10: // VIEW_ORIGINAL_TEXT
-          if (field.type == org.apache.thrift.protocol.TType.STRING) {
-            this.viewOriginalText = iprot.readString();
-          } else { 
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-          }
-          break;
-        case 11: // VIEW_EXPANDED_TEXT
-          if (field.type == org.apache.thrift.protocol.TType.STRING) {
-            this.viewExpandedText = iprot.readString();
-          } else { 
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-          }
-          break;
-        case 12: // TABLE_TYPE
-          if (field.type == org.apache.thrift.protocol.TType.STRING) {
-            this.tableType = iprot.readString();
-          } else { 
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-          }
-          break;
-        case 13: // PRIVILEGES
-          if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
-            this.privileges = new PrincipalPrivilegeSet();
-            this.privileges.read(iprot);
-          } else { 
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-          }
-          break;
-        default:
-          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-      }
-      iprot.readFieldEnd();
-    }
-    iprot.readStructEnd();
-    validate();
+    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
   }
 
   public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException
{
-    validate();
-
-    oprot.writeStructBegin(STRUCT_DESC);
-    if (this.tableName != null) {
-      oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC);
-      oprot.writeString(this.tableName);
-      oprot.writeFieldEnd();
-    }
-    if (this.dbName != null) {
-      oprot.writeFieldBegin(DB_NAME_FIELD_DESC);
-      oprot.writeString(this.dbName);
-      oprot.writeFieldEnd();
-    }
-    if (this.owner != null) {
-      oprot.writeFieldBegin(OWNER_FIELD_DESC);
-      oprot.writeString(this.owner);
-      oprot.writeFieldEnd();
-    }
-    oprot.writeFieldBegin(CREATE_TIME_FIELD_DESC);
-    oprot.writeI32(this.createTime);
-    oprot.writeFieldEnd();
-    oprot.writeFieldBegin(LAST_ACCESS_TIME_FIELD_DESC);
-    oprot.writeI32(this.lastAccessTime);
-    oprot.writeFieldEnd();
-    oprot.writeFieldBegin(RETENTION_FIELD_DESC);
-    oprot.writeI32(this.retention);
-    oprot.writeFieldEnd();
-    if (this.sd != null) {
-      oprot.writeFieldBegin(SD_FIELD_DESC);
-      this.sd.write(oprot);
-      oprot.writeFieldEnd();
-    }
-    if (this.partitionKeys != null) {
-      oprot.writeFieldBegin(PARTITION_KEYS_FIELD_DESC);
-      {
-        oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT,
this.partitionKeys.size()));
-        for (FieldSchema _iter94 : this.partitionKeys)
-        {
-          _iter94.write(oprot);
-        }
-        oprot.writeListEnd();
-      }
-      oprot.writeFieldEnd();
-    }
-    if (this.parameters != null) {
-      oprot.writeFieldBegin(PARAMETERS_FIELD_DESC);
-      {
-        oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING,
org.apache.thrift.protocol.TType.STRING, this.parameters.size()));
-        for (Map.Entry<String, String> _iter95 : this.parameters.entrySet())
-        {
-          oprot.writeString(_iter95.getKey());
-          oprot.writeString(_iter95.getValue());
-        }
-        oprot.writeMapEnd();
-      }
-      oprot.writeFieldEnd();
-    }
-    if (this.viewOriginalText != null) {
-      oprot.writeFieldBegin(VIEW_ORIGINAL_TEXT_FIELD_DESC);
-      oprot.writeString(this.viewOriginalText);
-      oprot.writeFieldEnd();
-    }
-    if (this.viewExpandedText != null) {
-      oprot.writeFieldBegin(VIEW_EXPANDED_TEXT_FIELD_DESC);
-      oprot.writeString(this.viewExpandedText);
-      oprot.writeFieldEnd();
-    }
-    if (this.tableType != null) {
-      oprot.writeFieldBegin(TABLE_TYPE_FIELD_DESC);
-      oprot.writeString(this.tableType);
-      oprot.writeFieldEnd();
-    }
-    if (this.privileges != null) {
-      if (isSetPrivileges()) {
-        oprot.writeFieldBegin(PRIVILEGES_FIELD_DESC);
-        this.privileges.write(oprot);
-        oprot.writeFieldEnd();
-      }
-    }
-    oprot.writeFieldStop();
-    oprot.writeStructEnd();
+    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
   }
 
   @Override
@@ -1493,6 +1294,13 @@ public class Table implements org.apache
 
   public void validate() throws org.apache.thrift.TException {
     // check for required fields
+    // check for sub-struct validity
+    if (sd != null) {
+      sd.validate();
+    }
+    if (privileges != null) {
+      privileges.validate();
+    }
   }
 
   private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
@@ -1506,12 +1314,442 @@ public class Table implements org.apache
   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);
+      __isset_bitfield = 0;
       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 TableStandardSchemeFactory implements SchemeFactory {
+    public TableStandardScheme getScheme() {
+      return new TableStandardScheme();
+    }
+  }
+
+  private static class TableStandardScheme extends StandardScheme<Table> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, Table 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: // TABLE_NAME
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.tableName = iprot.readString();
+              struct.setTableNameIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 2: // DB_NAME
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.dbName = iprot.readString();
+              struct.setDbNameIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 3: // OWNER
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.owner = iprot.readString();
+              struct.setOwnerIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 4: // CREATE_TIME
+            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+              struct.createTime = iprot.readI32();
+              struct.setCreateTimeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 5: // LAST_ACCESS_TIME
+            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+              struct.lastAccessTime = iprot.readI32();
+              struct.setLastAccessTimeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 6: // RETENTION
+            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+              struct.retention = iprot.readI32();
+              struct.setRetentionIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 7: // SD
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+              struct.sd = new StorageDescriptor();
+              struct.sd.read(iprot);
+              struct.setSdIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 8: // PARTITION_KEYS
+            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
+              {
+                org.apache.thrift.protocol.TList _list174 = iprot.readListBegin();
+                struct.partitionKeys = new ArrayList<FieldSchema>(_list174.size);
+                for (int _i175 = 0; _i175 < _list174.size; ++_i175)
+                {
+                  FieldSchema _elem176; // required
+                  _elem176 = new FieldSchema();
+                  _elem176.read(iprot);
+                  struct.partitionKeys.add(_elem176);
+                }
+                iprot.readListEnd();
+              }
+              struct.setPartitionKeysIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 9: // PARAMETERS
+            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
+              {
+                org.apache.thrift.protocol.TMap _map177 = iprot.readMapBegin();
+                struct.parameters = new HashMap<String,String>(2*_map177.size);
+                for (int _i178 = 0; _i178 < _map177.size; ++_i178)
+                {
+                  String _key179; // required
+                  String _val180; // required
+                  _key179 = iprot.readString();
+                  _val180 = iprot.readString();
+                  struct.parameters.put(_key179, _val180);
+                }
+                iprot.readMapEnd();
+              }
+              struct.setParametersIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 10: // VIEW_ORIGINAL_TEXT
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.viewOriginalText = iprot.readString();
+              struct.setViewOriginalTextIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 11: // VIEW_EXPANDED_TEXT
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.viewExpandedText = iprot.readString();
+              struct.setViewExpandedTextIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 12: // TABLE_TYPE
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.tableType = iprot.readString();
+              struct.setTableTypeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 13: // PRIVILEGES
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+              struct.privileges = new PrincipalPrivilegeSet();
+              struct.privileges.read(iprot);
+              struct.setPrivilegesIsSet(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();
+      struct.validate();
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot, Table struct) throws org.apache.thrift.TException
{
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.tableName != null) {
+        oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC);
+        oprot.writeString(struct.tableName);
+        oprot.writeFieldEnd();
+      }
+      if (struct.dbName != null) {
+        oprot.writeFieldBegin(DB_NAME_FIELD_DESC);
+        oprot.writeString(struct.dbName);
+        oprot.writeFieldEnd();
+      }
+      if (struct.owner != null) {
+        oprot.writeFieldBegin(OWNER_FIELD_DESC);
+        oprot.writeString(struct.owner);
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldBegin(CREATE_TIME_FIELD_DESC);
+      oprot.writeI32(struct.createTime);
+      oprot.writeFieldEnd();
+      oprot.writeFieldBegin(LAST_ACCESS_TIME_FIELD_DESC);
+      oprot.writeI32(struct.lastAccessTime);
+      oprot.writeFieldEnd();
+      oprot.writeFieldBegin(RETENTION_FIELD_DESC);
+      oprot.writeI32(struct.retention);
+      oprot.writeFieldEnd();
+      if (struct.sd != null) {
+        oprot.writeFieldBegin(SD_FIELD_DESC);
+        struct.sd.write(oprot);
+        oprot.writeFieldEnd();
+      }
+      if (struct.partitionKeys != null) {
+        oprot.writeFieldBegin(PARTITION_KEYS_FIELD_DESC);
+        {
+          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT,
struct.partitionKeys.size()));
+          for (FieldSchema _iter181 : struct.partitionKeys)
+          {
+            _iter181.write(oprot);
+          }
+          oprot.writeListEnd();
+        }
+        oprot.writeFieldEnd();
+      }
+      if (struct.parameters != null) {
+        oprot.writeFieldBegin(PARAMETERS_FIELD_DESC);
+        {
+          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING,
org.apache.thrift.protocol.TType.STRING, struct.parameters.size()));
+          for (Map.Entry<String, String> _iter182 : struct.parameters.entrySet())
+          {
+            oprot.writeString(_iter182.getKey());
+            oprot.writeString(_iter182.getValue());
+          }
+          oprot.writeMapEnd();
+        }
+        oprot.writeFieldEnd();
+      }
+      if (struct.viewOriginalText != null) {
+        oprot.writeFieldBegin(VIEW_ORIGINAL_TEXT_FIELD_DESC);
+        oprot.writeString(struct.viewOriginalText);
+        oprot.writeFieldEnd();
+      }
+      if (struct.viewExpandedText != null) {
+        oprot.writeFieldBegin(VIEW_EXPANDED_TEXT_FIELD_DESC);
+        oprot.writeString(struct.viewExpandedText);
+        oprot.writeFieldEnd();
+      }
+      if (struct.tableType != null) {
+        oprot.writeFieldBegin(TABLE_TYPE_FIELD_DESC);
+        oprot.writeString(struct.tableType);
+        oprot.writeFieldEnd();
+      }
+      if (struct.privileges != null) {
+        if (struct.isSetPrivileges()) {
+          oprot.writeFieldBegin(PRIVILEGES_FIELD_DESC);
+          struct.privileges.write(oprot);
+          oprot.writeFieldEnd();
+        }
+      }
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class TableTupleSchemeFactory implements SchemeFactory {
+    public TableTupleScheme getScheme() {
+      return new TableTupleScheme();
+    }
+  }
+
+  private static class TableTupleScheme extends TupleScheme<Table> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, Table struct) throws org.apache.thrift.TException
{
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      BitSet optionals = new BitSet();
+      if (struct.isSetTableName()) {
+        optionals.set(0);
+      }
+      if (struct.isSetDbName()) {
+        optionals.set(1);
+      }
+      if (struct.isSetOwner()) {
+        optionals.set(2);
+      }
+      if (struct.isSetCreateTime()) {
+        optionals.set(3);
+      }
+      if (struct.isSetLastAccessTime()) {
+        optionals.set(4);
+      }
+      if (struct.isSetRetention()) {
+        optionals.set(5);
+      }
+      if (struct.isSetSd()) {
+        optionals.set(6);
+      }
+      if (struct.isSetPartitionKeys()) {
+        optionals.set(7);
+      }
+      if (struct.isSetParameters()) {
+        optionals.set(8);
+      }
+      if (struct.isSetViewOriginalText()) {
+        optionals.set(9);
+      }
+      if (struct.isSetViewExpandedText()) {
+        optionals.set(10);
+      }
+      if (struct.isSetTableType()) {
+        optionals.set(11);
+      }
+      if (struct.isSetPrivileges()) {
+        optionals.set(12);
+      }
+      oprot.writeBitSet(optionals, 13);
+      if (struct.isSetTableName()) {
+        oprot.writeString(struct.tableName);
+      }
+      if (struct.isSetDbName()) {
+        oprot.writeString(struct.dbName);
+      }
+      if (struct.isSetOwner()) {
+        oprot.writeString(struct.owner);
+      }
+      if (struct.isSetCreateTime()) {
+        oprot.writeI32(struct.createTime);
+      }
+      if (struct.isSetLastAccessTime()) {
+        oprot.writeI32(struct.lastAccessTime);
+      }
+      if (struct.isSetRetention()) {
+        oprot.writeI32(struct.retention);
+      }
+      if (struct.isSetSd()) {
+        struct.sd.write(oprot);
+      }
+      if (struct.isSetPartitionKeys()) {
+        {
+          oprot.writeI32(struct.partitionKeys.size());
+          for (FieldSchema _iter183 : struct.partitionKeys)
+          {
+            _iter183.write(oprot);
+          }
+        }
+      }
+      if (struct.isSetParameters()) {
+        {
+          oprot.writeI32(struct.parameters.size());
+          for (Map.Entry<String, String> _iter184 : struct.parameters.entrySet())
+          {
+            oprot.writeString(_iter184.getKey());
+            oprot.writeString(_iter184.getValue());
+          }
+        }
+      }
+      if (struct.isSetViewOriginalText()) {
+        oprot.writeString(struct.viewOriginalText);
+      }
+      if (struct.isSetViewExpandedText()) {
+        oprot.writeString(struct.viewExpandedText);
+      }
+      if (struct.isSetTableType()) {
+        oprot.writeString(struct.tableType);
+      }
+      if (struct.isSetPrivileges()) {
+        struct.privileges.write(oprot);
+      }
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, Table struct) throws org.apache.thrift.TException
{
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      BitSet incoming = iprot.readBitSet(13);
+      if (incoming.get(0)) {
+        struct.tableName = iprot.readString();
+        struct.setTableNameIsSet(true);
+      }
+      if (incoming.get(1)) {
+        struct.dbName = iprot.readString();
+        struct.setDbNameIsSet(true);
+      }
+      if (incoming.get(2)) {
+        struct.owner = iprot.readString();
+        struct.setOwnerIsSet(true);
+      }
+      if (incoming.get(3)) {
+        struct.createTime = iprot.readI32();
+        struct.setCreateTimeIsSet(true);
+      }
+      if (incoming.get(4)) {
+        struct.lastAccessTime = iprot.readI32();
+        struct.setLastAccessTimeIsSet(true);
+      }
+      if (incoming.get(5)) {
+        struct.retention = iprot.readI32();
+        struct.setRetentionIsSet(true);
+      }
+      if (incoming.get(6)) {
+        struct.sd = new StorageDescriptor();
+        struct.sd.read(iprot);
+        struct.setSdIsSet(true);
+      }
+      if (incoming.get(7)) {
+        {
+          org.apache.thrift.protocol.TList _list185 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT,
iprot.readI32());
+          struct.partitionKeys = new ArrayList<FieldSchema>(_list185.size);
+          for (int _i186 = 0; _i186 < _list185.size; ++_i186)
+          {
+            FieldSchema _elem187; // required
+            _elem187 = new FieldSchema();
+            _elem187.read(iprot);
+            struct.partitionKeys.add(_elem187);
+          }
+        }
+        struct.setPartitionKeysIsSet(true);
+      }
+      if (incoming.get(8)) {
+        {
+          org.apache.thrift.protocol.TMap _map188 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING,
org.apache.thrift.protocol.TType.STRING, iprot.readI32());
+          struct.parameters = new HashMap<String,String>(2*_map188.size);
+          for (int _i189 = 0; _i189 < _map188.size; ++_i189)
+          {
+            String _key190; // required
+            String _val191; // required
+            _key190 = iprot.readString();
+            _val191 = iprot.readString();
+            struct.parameters.put(_key190, _val191);
+          }
+        }
+        struct.setParametersIsSet(true);
+      }
+      if (incoming.get(9)) {
+        struct.viewOriginalText = iprot.readString();
+        struct.setViewOriginalTextIsSet(true);
+      }
+      if (incoming.get(10)) {
+        struct.viewExpandedText = iprot.readString();
+        struct.setViewExpandedTextIsSet(true);
+      }
+      if (incoming.get(11)) {
+        struct.tableType = iprot.readString();
+        struct.setTableTypeIsSet(true);
+      }
+      if (incoming.get(12)) {
+        struct.privileges = new PrincipalPrivilegeSet();
+        struct.privileges.read(iprot);
+        struct.setPrivilegesIsSet(true);
+      }
+    }
+  }
+
 }
 



Mime
View raw message