hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hashut...@apache.org
Subject svn commit: r1406984 [9/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/PrincipalPrivilegeSet.java
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/PrincipalPrivilegeSet.java?rev=1406984&r1=1406983&r2=1406984&view=diff
==============================================================================
--- hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/PrincipalPrivilegeSet.java (original)
+++ hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/PrincipalPrivilegeSet.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;
@@ -28,6 +38,12 @@ public class PrincipalPrivilegeSet imple
   private static final org.apache.thrift.protocol.TField GROUP_PRIVILEGES_FIELD_DESC = new org.apache.thrift.protocol.TField("groupPrivileges", org.apache.thrift.protocol.TType.MAP, (short)2);
   private static final org.apache.thrift.protocol.TField ROLE_PRIVILEGES_FIELD_DESC = new org.apache.thrift.protocol.TField("rolePrivileges", org.apache.thrift.protocol.TType.MAP, (short)3);
 
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new PrincipalPrivilegeSetStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new PrincipalPrivilegeSetTupleSchemeFactory());
+  }
+
   private Map<String,List<PrivilegeGrantInfo>> userPrivileges; // required
   private Map<String,List<PrivilegeGrantInfo>> groupPrivileges; // required
   private Map<String,List<PrivilegeGrantInfo>> rolePrivileges; // required
@@ -97,7 +113,6 @@ public class PrincipalPrivilegeSet imple
   }
 
   // isset id assignments
-
   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);
@@ -479,180 +494,11 @@ public class PrincipalPrivilegeSet imple
   }
 
   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: // USER_PRIVILEGES
-          if (field.type == org.apache.thrift.protocol.TType.MAP) {
-            {
-              org.apache.thrift.protocol.TMap _map12 = iprot.readMapBegin();
-              this.userPrivileges = new HashMap<String,List<PrivilegeGrantInfo>>(2*_map12.size);
-              for (int _i13 = 0; _i13 < _map12.size; ++_i13)
-              {
-                String _key14; // required
-                List<PrivilegeGrantInfo> _val15; // required
-                _key14 = iprot.readString();
-                {
-                  org.apache.thrift.protocol.TList _list16 = iprot.readListBegin();
-                  _val15 = new ArrayList<PrivilegeGrantInfo>(_list16.size);
-                  for (int _i17 = 0; _i17 < _list16.size; ++_i17)
-                  {
-                    PrivilegeGrantInfo _elem18; // required
-                    _elem18 = new PrivilegeGrantInfo();
-                    _elem18.read(iprot);
-                    _val15.add(_elem18);
-                  }
-                  iprot.readListEnd();
-                }
-                this.userPrivileges.put(_key14, _val15);
-              }
-              iprot.readMapEnd();
-            }
-          } else { 
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-          }
-          break;
-        case 2: // GROUP_PRIVILEGES
-          if (field.type == org.apache.thrift.protocol.TType.MAP) {
-            {
-              org.apache.thrift.protocol.TMap _map19 = iprot.readMapBegin();
-              this.groupPrivileges = new HashMap<String,List<PrivilegeGrantInfo>>(2*_map19.size);
-              for (int _i20 = 0; _i20 < _map19.size; ++_i20)
-              {
-                String _key21; // required
-                List<PrivilegeGrantInfo> _val22; // required
-                _key21 = iprot.readString();
-                {
-                  org.apache.thrift.protocol.TList _list23 = iprot.readListBegin();
-                  _val22 = new ArrayList<PrivilegeGrantInfo>(_list23.size);
-                  for (int _i24 = 0; _i24 < _list23.size; ++_i24)
-                  {
-                    PrivilegeGrantInfo _elem25; // required
-                    _elem25 = new PrivilegeGrantInfo();
-                    _elem25.read(iprot);
-                    _val22.add(_elem25);
-                  }
-                  iprot.readListEnd();
-                }
-                this.groupPrivileges.put(_key21, _val22);
-              }
-              iprot.readMapEnd();
-            }
-          } else { 
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-          }
-          break;
-        case 3: // ROLE_PRIVILEGES
-          if (field.type == org.apache.thrift.protocol.TType.MAP) {
-            {
-              org.apache.thrift.protocol.TMap _map26 = iprot.readMapBegin();
-              this.rolePrivileges = new HashMap<String,List<PrivilegeGrantInfo>>(2*_map26.size);
-              for (int _i27 = 0; _i27 < _map26.size; ++_i27)
-              {
-                String _key28; // required
-                List<PrivilegeGrantInfo> _val29; // required
-                _key28 = iprot.readString();
-                {
-                  org.apache.thrift.protocol.TList _list30 = iprot.readListBegin();
-                  _val29 = new ArrayList<PrivilegeGrantInfo>(_list30.size);
-                  for (int _i31 = 0; _i31 < _list30.size; ++_i31)
-                  {
-                    PrivilegeGrantInfo _elem32; // required
-                    _elem32 = new PrivilegeGrantInfo();
-                    _elem32.read(iprot);
-                    _val29.add(_elem32);
-                  }
-                  iprot.readListEnd();
-                }
-                this.rolePrivileges.put(_key28, _val29);
-              }
-              iprot.readMapEnd();
-            }
-          } 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.userPrivileges != null) {
-      oprot.writeFieldBegin(USER_PRIVILEGES_FIELD_DESC);
-      {
-        oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.LIST, this.userPrivileges.size()));
-        for (Map.Entry<String, List<PrivilegeGrantInfo>> _iter33 : this.userPrivileges.entrySet())
-        {
-          oprot.writeString(_iter33.getKey());
-          {
-            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, _iter33.getValue().size()));
-            for (PrivilegeGrantInfo _iter34 : _iter33.getValue())
-            {
-              _iter34.write(oprot);
-            }
-            oprot.writeListEnd();
-          }
-        }
-        oprot.writeMapEnd();
-      }
-      oprot.writeFieldEnd();
-    }
-    if (this.groupPrivileges != null) {
-      oprot.writeFieldBegin(GROUP_PRIVILEGES_FIELD_DESC);
-      {
-        oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.LIST, this.groupPrivileges.size()));
-        for (Map.Entry<String, List<PrivilegeGrantInfo>> _iter35 : this.groupPrivileges.entrySet())
-        {
-          oprot.writeString(_iter35.getKey());
-          {
-            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, _iter35.getValue().size()));
-            for (PrivilegeGrantInfo _iter36 : _iter35.getValue())
-            {
-              _iter36.write(oprot);
-            }
-            oprot.writeListEnd();
-          }
-        }
-        oprot.writeMapEnd();
-      }
-      oprot.writeFieldEnd();
-    }
-    if (this.rolePrivileges != null) {
-      oprot.writeFieldBegin(ROLE_PRIVILEGES_FIELD_DESC);
-      {
-        oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.LIST, this.rolePrivileges.size()));
-        for (Map.Entry<String, List<PrivilegeGrantInfo>> _iter37 : this.rolePrivileges.entrySet())
-        {
-          oprot.writeString(_iter37.getKey());
-          {
-            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, _iter37.getValue().size()));
-            for (PrivilegeGrantInfo _iter38 : _iter37.getValue())
-            {
-              _iter38.write(oprot);
-            }
-            oprot.writeListEnd();
-          }
-        }
-        oprot.writeMapEnd();
-      }
-      oprot.writeFieldEnd();
-    }
-    oprot.writeFieldStop();
-    oprot.writeStructEnd();
+    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
   }
 
   @Override
@@ -689,6 +535,7 @@ public class PrincipalPrivilegeSet imple
 
   public void validate() throws org.apache.thrift.TException {
     // check for required fields
+    // check for sub-struct validity
   }
 
   private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
@@ -707,5 +554,349 @@ public class PrincipalPrivilegeSet imple
     }
   }
 
+  private static class PrincipalPrivilegeSetStandardSchemeFactory implements SchemeFactory {
+    public PrincipalPrivilegeSetStandardScheme getScheme() {
+      return new PrincipalPrivilegeSetStandardScheme();
+    }
+  }
+
+  private static class PrincipalPrivilegeSetStandardScheme extends StandardScheme<PrincipalPrivilegeSet> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, PrincipalPrivilegeSet 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: // USER_PRIVILEGES
+            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
+              {
+                org.apache.thrift.protocol.TMap _map24 = iprot.readMapBegin();
+                struct.userPrivileges = new HashMap<String,List<PrivilegeGrantInfo>>(2*_map24.size);
+                for (int _i25 = 0; _i25 < _map24.size; ++_i25)
+                {
+                  String _key26; // required
+                  List<PrivilegeGrantInfo> _val27; // required
+                  _key26 = iprot.readString();
+                  {
+                    org.apache.thrift.protocol.TList _list28 = iprot.readListBegin();
+                    _val27 = new ArrayList<PrivilegeGrantInfo>(_list28.size);
+                    for (int _i29 = 0; _i29 < _list28.size; ++_i29)
+                    {
+                      PrivilegeGrantInfo _elem30; // required
+                      _elem30 = new PrivilegeGrantInfo();
+                      _elem30.read(iprot);
+                      _val27.add(_elem30);
+                    }
+                    iprot.readListEnd();
+                  }
+                  struct.userPrivileges.put(_key26, _val27);
+                }
+                iprot.readMapEnd();
+              }
+              struct.setUserPrivilegesIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 2: // GROUP_PRIVILEGES
+            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
+              {
+                org.apache.thrift.protocol.TMap _map31 = iprot.readMapBegin();
+                struct.groupPrivileges = new HashMap<String,List<PrivilegeGrantInfo>>(2*_map31.size);
+                for (int _i32 = 0; _i32 < _map31.size; ++_i32)
+                {
+                  String _key33; // required
+                  List<PrivilegeGrantInfo> _val34; // required
+                  _key33 = iprot.readString();
+                  {
+                    org.apache.thrift.protocol.TList _list35 = iprot.readListBegin();
+                    _val34 = new ArrayList<PrivilegeGrantInfo>(_list35.size);
+                    for (int _i36 = 0; _i36 < _list35.size; ++_i36)
+                    {
+                      PrivilegeGrantInfo _elem37; // required
+                      _elem37 = new PrivilegeGrantInfo();
+                      _elem37.read(iprot);
+                      _val34.add(_elem37);
+                    }
+                    iprot.readListEnd();
+                  }
+                  struct.groupPrivileges.put(_key33, _val34);
+                }
+                iprot.readMapEnd();
+              }
+              struct.setGroupPrivilegesIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 3: // ROLE_PRIVILEGES
+            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
+              {
+                org.apache.thrift.protocol.TMap _map38 = iprot.readMapBegin();
+                struct.rolePrivileges = new HashMap<String,List<PrivilegeGrantInfo>>(2*_map38.size);
+                for (int _i39 = 0; _i39 < _map38.size; ++_i39)
+                {
+                  String _key40; // required
+                  List<PrivilegeGrantInfo> _val41; // required
+                  _key40 = iprot.readString();
+                  {
+                    org.apache.thrift.protocol.TList _list42 = iprot.readListBegin();
+                    _val41 = new ArrayList<PrivilegeGrantInfo>(_list42.size);
+                    for (int _i43 = 0; _i43 < _list42.size; ++_i43)
+                    {
+                      PrivilegeGrantInfo _elem44; // required
+                      _elem44 = new PrivilegeGrantInfo();
+                      _elem44.read(iprot);
+                      _val41.add(_elem44);
+                    }
+                    iprot.readListEnd();
+                  }
+                  struct.rolePrivileges.put(_key40, _val41);
+                }
+                iprot.readMapEnd();
+              }
+              struct.setRolePrivilegesIsSet(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, PrincipalPrivilegeSet struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.userPrivileges != null) {
+        oprot.writeFieldBegin(USER_PRIVILEGES_FIELD_DESC);
+        {
+          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.LIST, struct.userPrivileges.size()));
+          for (Map.Entry<String, List<PrivilegeGrantInfo>> _iter45 : struct.userPrivileges.entrySet())
+          {
+            oprot.writeString(_iter45.getKey());
+            {
+              oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, _iter45.getValue().size()));
+              for (PrivilegeGrantInfo _iter46 : _iter45.getValue())
+              {
+                _iter46.write(oprot);
+              }
+              oprot.writeListEnd();
+            }
+          }
+          oprot.writeMapEnd();
+        }
+        oprot.writeFieldEnd();
+      }
+      if (struct.groupPrivileges != null) {
+        oprot.writeFieldBegin(GROUP_PRIVILEGES_FIELD_DESC);
+        {
+          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.LIST, struct.groupPrivileges.size()));
+          for (Map.Entry<String, List<PrivilegeGrantInfo>> _iter47 : struct.groupPrivileges.entrySet())
+          {
+            oprot.writeString(_iter47.getKey());
+            {
+              oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, _iter47.getValue().size()));
+              for (PrivilegeGrantInfo _iter48 : _iter47.getValue())
+              {
+                _iter48.write(oprot);
+              }
+              oprot.writeListEnd();
+            }
+          }
+          oprot.writeMapEnd();
+        }
+        oprot.writeFieldEnd();
+      }
+      if (struct.rolePrivileges != null) {
+        oprot.writeFieldBegin(ROLE_PRIVILEGES_FIELD_DESC);
+        {
+          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.LIST, struct.rolePrivileges.size()));
+          for (Map.Entry<String, List<PrivilegeGrantInfo>> _iter49 : struct.rolePrivileges.entrySet())
+          {
+            oprot.writeString(_iter49.getKey());
+            {
+              oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, _iter49.getValue().size()));
+              for (PrivilegeGrantInfo _iter50 : _iter49.getValue())
+              {
+                _iter50.write(oprot);
+              }
+              oprot.writeListEnd();
+            }
+          }
+          oprot.writeMapEnd();
+        }
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class PrincipalPrivilegeSetTupleSchemeFactory implements SchemeFactory {
+    public PrincipalPrivilegeSetTupleScheme getScheme() {
+      return new PrincipalPrivilegeSetTupleScheme();
+    }
+  }
+
+  private static class PrincipalPrivilegeSetTupleScheme extends TupleScheme<PrincipalPrivilegeSet> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, PrincipalPrivilegeSet struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      BitSet optionals = new BitSet();
+      if (struct.isSetUserPrivileges()) {
+        optionals.set(0);
+      }
+      if (struct.isSetGroupPrivileges()) {
+        optionals.set(1);
+      }
+      if (struct.isSetRolePrivileges()) {
+        optionals.set(2);
+      }
+      oprot.writeBitSet(optionals, 3);
+      if (struct.isSetUserPrivileges()) {
+        {
+          oprot.writeI32(struct.userPrivileges.size());
+          for (Map.Entry<String, List<PrivilegeGrantInfo>> _iter51 : struct.userPrivileges.entrySet())
+          {
+            oprot.writeString(_iter51.getKey());
+            {
+              oprot.writeI32(_iter51.getValue().size());
+              for (PrivilegeGrantInfo _iter52 : _iter51.getValue())
+              {
+                _iter52.write(oprot);
+              }
+            }
+          }
+        }
+      }
+      if (struct.isSetGroupPrivileges()) {
+        {
+          oprot.writeI32(struct.groupPrivileges.size());
+          for (Map.Entry<String, List<PrivilegeGrantInfo>> _iter53 : struct.groupPrivileges.entrySet())
+          {
+            oprot.writeString(_iter53.getKey());
+            {
+              oprot.writeI32(_iter53.getValue().size());
+              for (PrivilegeGrantInfo _iter54 : _iter53.getValue())
+              {
+                _iter54.write(oprot);
+              }
+            }
+          }
+        }
+      }
+      if (struct.isSetRolePrivileges()) {
+        {
+          oprot.writeI32(struct.rolePrivileges.size());
+          for (Map.Entry<String, List<PrivilegeGrantInfo>> _iter55 : struct.rolePrivileges.entrySet())
+          {
+            oprot.writeString(_iter55.getKey());
+            {
+              oprot.writeI32(_iter55.getValue().size());
+              for (PrivilegeGrantInfo _iter56 : _iter55.getValue())
+              {
+                _iter56.write(oprot);
+              }
+            }
+          }
+        }
+      }
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, PrincipalPrivilegeSet struct) throws org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      BitSet incoming = iprot.readBitSet(3);
+      if (incoming.get(0)) {
+        {
+          org.apache.thrift.protocol.TMap _map57 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.LIST, iprot.readI32());
+          struct.userPrivileges = new HashMap<String,List<PrivilegeGrantInfo>>(2*_map57.size);
+          for (int _i58 = 0; _i58 < _map57.size; ++_i58)
+          {
+            String _key59; // required
+            List<PrivilegeGrantInfo> _val60; // required
+            _key59 = iprot.readString();
+            {
+              org.apache.thrift.protocol.TList _list61 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+              _val60 = new ArrayList<PrivilegeGrantInfo>(_list61.size);
+              for (int _i62 = 0; _i62 < _list61.size; ++_i62)
+              {
+                PrivilegeGrantInfo _elem63; // required
+                _elem63 = new PrivilegeGrantInfo();
+                _elem63.read(iprot);
+                _val60.add(_elem63);
+              }
+            }
+            struct.userPrivileges.put(_key59, _val60);
+          }
+        }
+        struct.setUserPrivilegesIsSet(true);
+      }
+      if (incoming.get(1)) {
+        {
+          org.apache.thrift.protocol.TMap _map64 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.LIST, iprot.readI32());
+          struct.groupPrivileges = new HashMap<String,List<PrivilegeGrantInfo>>(2*_map64.size);
+          for (int _i65 = 0; _i65 < _map64.size; ++_i65)
+          {
+            String _key66; // required
+            List<PrivilegeGrantInfo> _val67; // required
+            _key66 = iprot.readString();
+            {
+              org.apache.thrift.protocol.TList _list68 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+              _val67 = new ArrayList<PrivilegeGrantInfo>(_list68.size);
+              for (int _i69 = 0; _i69 < _list68.size; ++_i69)
+              {
+                PrivilegeGrantInfo _elem70; // required
+                _elem70 = new PrivilegeGrantInfo();
+                _elem70.read(iprot);
+                _val67.add(_elem70);
+              }
+            }
+            struct.groupPrivileges.put(_key66, _val67);
+          }
+        }
+        struct.setGroupPrivilegesIsSet(true);
+      }
+      if (incoming.get(2)) {
+        {
+          org.apache.thrift.protocol.TMap _map71 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.LIST, iprot.readI32());
+          struct.rolePrivileges = new HashMap<String,List<PrivilegeGrantInfo>>(2*_map71.size);
+          for (int _i72 = 0; _i72 < _map71.size; ++_i72)
+          {
+            String _key73; // required
+            List<PrivilegeGrantInfo> _val74; // required
+            _key73 = iprot.readString();
+            {
+              org.apache.thrift.protocol.TList _list75 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+              _val74 = new ArrayList<PrivilegeGrantInfo>(_list75.size);
+              for (int _i76 = 0; _i76 < _list75.size; ++_i76)
+              {
+                PrivilegeGrantInfo _elem77; // required
+                _elem77 = new PrivilegeGrantInfo();
+                _elem77.read(iprot);
+                _val74.add(_elem77);
+              }
+            }
+            struct.rolePrivileges.put(_key73, _val74);
+          }
+        }
+        struct.setRolePrivilegesIsSet(true);
+      }
+    }
+  }
+
 }
 

Modified: hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/PrincipalType.java
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/PrincipalType.java?rev=1406984&r1=1406983&r2=1406984&view=diff
==============================================================================
--- hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/PrincipalType.java (original)
+++ hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/PrincipalType.java Thu Nov  8 09:44:19 2012
@@ -1,7 +1,8 @@
 /**
- * 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;
 

Modified: hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/PrivilegeBag.java
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/PrivilegeBag.java?rev=1406984&r1=1406983&r2=1406984&view=diff
==============================================================================
--- hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/PrivilegeBag.java (original)
+++ hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/PrivilegeBag.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;
@@ -26,6 +36,12 @@ public class PrivilegeBag implements org
 
   private static final org.apache.thrift.protocol.TField PRIVILEGES_FIELD_DESC = new org.apache.thrift.protocol.TField("privileges", org.apache.thrift.protocol.TType.LIST, (short)1);
 
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new PrivilegeBagStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new PrivilegeBagTupleSchemeFactory());
+  }
+
   private List<HiveObjectPrivilege> privileges; // required
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
@@ -87,7 +103,6 @@ public class PrivilegeBag implements org
   }
 
   // isset id assignments
-
   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);
@@ -266,60 +281,11 @@ public class PrivilegeBag implements org
   }
 
   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: // PRIVILEGES
-          if (field.type == org.apache.thrift.protocol.TType.LIST) {
-            {
-              org.apache.thrift.protocol.TList _list8 = iprot.readListBegin();
-              this.privileges = new ArrayList<HiveObjectPrivilege>(_list8.size);
-              for (int _i9 = 0; _i9 < _list8.size; ++_i9)
-              {
-                HiveObjectPrivilege _elem10; // required
-                _elem10 = new HiveObjectPrivilege();
-                _elem10.read(iprot);
-                this.privileges.add(_elem10);
-              }
-              iprot.readListEnd();
-            }
-          } 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.privileges != null) {
-      oprot.writeFieldBegin(PRIVILEGES_FIELD_DESC);
-      {
-        oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.privileges.size()));
-        for (HiveObjectPrivilege _iter11 : this.privileges)
-        {
-          _iter11.write(oprot);
-        }
-        oprot.writeListEnd();
-      }
-      oprot.writeFieldEnd();
-    }
-    oprot.writeFieldStop();
-    oprot.writeStructEnd();
+    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
   }
 
   @Override
@@ -340,6 +306,7 @@ public class PrivilegeBag implements org
 
   public void validate() throws org.apache.thrift.TException {
     // check for required fields
+    // check for sub-struct validity
   }
 
   private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
@@ -358,5 +325,121 @@ public class PrivilegeBag implements org
     }
   }
 
+  private static class PrivilegeBagStandardSchemeFactory implements SchemeFactory {
+    public PrivilegeBagStandardScheme getScheme() {
+      return new PrivilegeBagStandardScheme();
+    }
+  }
+
+  private static class PrivilegeBagStandardScheme extends StandardScheme<PrivilegeBag> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, PrivilegeBag 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: // PRIVILEGES
+            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
+              {
+                org.apache.thrift.protocol.TList _list16 = iprot.readListBegin();
+                struct.privileges = new ArrayList<HiveObjectPrivilege>(_list16.size);
+                for (int _i17 = 0; _i17 < _list16.size; ++_i17)
+                {
+                  HiveObjectPrivilege _elem18; // required
+                  _elem18 = new HiveObjectPrivilege();
+                  _elem18.read(iprot);
+                  struct.privileges.add(_elem18);
+                }
+                iprot.readListEnd();
+              }
+              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, PrivilegeBag struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.privileges != null) {
+        oprot.writeFieldBegin(PRIVILEGES_FIELD_DESC);
+        {
+          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.privileges.size()));
+          for (HiveObjectPrivilege _iter19 : struct.privileges)
+          {
+            _iter19.write(oprot);
+          }
+          oprot.writeListEnd();
+        }
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class PrivilegeBagTupleSchemeFactory implements SchemeFactory {
+    public PrivilegeBagTupleScheme getScheme() {
+      return new PrivilegeBagTupleScheme();
+    }
+  }
+
+  private static class PrivilegeBagTupleScheme extends TupleScheme<PrivilegeBag> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, PrivilegeBag struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      BitSet optionals = new BitSet();
+      if (struct.isSetPrivileges()) {
+        optionals.set(0);
+      }
+      oprot.writeBitSet(optionals, 1);
+      if (struct.isSetPrivileges()) {
+        {
+          oprot.writeI32(struct.privileges.size());
+          for (HiveObjectPrivilege _iter20 : struct.privileges)
+          {
+            _iter20.write(oprot);
+          }
+        }
+      }
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, PrivilegeBag struct) throws org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      BitSet incoming = iprot.readBitSet(1);
+      if (incoming.get(0)) {
+        {
+          org.apache.thrift.protocol.TList _list21 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+          struct.privileges = new ArrayList<HiveObjectPrivilege>(_list21.size);
+          for (int _i22 = 0; _i22 < _list21.size; ++_i22)
+          {
+            HiveObjectPrivilege _elem23; // required
+            _elem23 = new HiveObjectPrivilege();
+            _elem23.read(iprot);
+            struct.privileges.add(_elem23);
+          }
+        }
+        struct.setPrivilegesIsSet(true);
+      }
+    }
+  }
+
 }
 

Modified: hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/PrivilegeGrantInfo.java
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/PrivilegeGrantInfo.java?rev=1406984&r1=1406983&r2=1406984&view=diff
==============================================================================
--- hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/PrivilegeGrantInfo.java (original)
+++ hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/PrivilegeGrantInfo.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;
@@ -30,6 +40,12 @@ public class PrivilegeGrantInfo implemen
   private static final org.apache.thrift.protocol.TField GRANTOR_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("grantorType", org.apache.thrift.protocol.TType.I32, (short)4);
   private static final org.apache.thrift.protocol.TField GRANT_OPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("grantOption", org.apache.thrift.protocol.TType.BOOL, (short)5);
 
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new PrivilegeGrantInfoStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new PrivilegeGrantInfoTupleSchemeFactory());
+  }
+
   private String privilege; // required
   private int createTime; // required
   private String grantor; // required
@@ -113,8 +129,7 @@ public class PrivilegeGrantInfo implemen
   // isset id assignments
   private static final int __CREATETIME_ISSET_ID = 0;
   private static final int __GRANTOPTION_ISSET_ID = 1;
-  private BitSet __isset_bit_vector = new BitSet(2);
-
+  private byte __isset_bitfield = 0;
   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);
@@ -156,8 +171,7 @@ public class PrivilegeGrantInfo implemen
    * Performs a deep copy on <i>other</i>.
    */
   public PrivilegeGrantInfo(PrivilegeGrantInfo other) {
-    __isset_bit_vector.clear();
-    __isset_bit_vector.or(other.__isset_bit_vector);
+    __isset_bitfield = other.__isset_bitfield;
     if (other.isSetPrivilege()) {
       this.privilege = other.privilege;
     }
@@ -219,16 +233,16 @@ public class PrivilegeGrantInfo implemen
   }
 
   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 String getGrantor() {
@@ -295,16 +309,16 @@ public class PrivilegeGrantInfo implemen
   }
 
   public void unsetGrantOption() {
-    __isset_bit_vector.clear(__GRANTOPTION_ISSET_ID);
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __GRANTOPTION_ISSET_ID);
   }
 
   /** Returns true if field grantOption is set (has been assigned a value) and false otherwise */
   public boolean isSetGrantOption() {
-    return __isset_bit_vector.get(__GRANTOPTION_ISSET_ID);
+    return EncodingUtils.testBit(__isset_bitfield, __GRANTOPTION_ISSET_ID);
   }
 
   public void setGrantOptionIsSet(boolean value) {
-    __isset_bit_vector.set(__GRANTOPTION_ISSET_ID, value);
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __GRANTOPTION_ISSET_ID, value);
   }
 
   public void setFieldValue(_Fields field, Object value) {
@@ -553,88 +567,11 @@ public class PrivilegeGrantInfo implemen
   }
 
   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: // PRIVILEGE
-          if (field.type == org.apache.thrift.protocol.TType.STRING) {
-            this.privilege = iprot.readString();
-          } else { 
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-          }
-          break;
-        case 2: // 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 3: // GRANTOR
-          if (field.type == org.apache.thrift.protocol.TType.STRING) {
-            this.grantor = iprot.readString();
-          } else { 
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-          }
-          break;
-        case 4: // GRANTOR_TYPE
-          if (field.type == org.apache.thrift.protocol.TType.I32) {
-            this.grantorType = PrincipalType.findByValue(iprot.readI32());
-          } else { 
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-          }
-          break;
-        case 5: // GRANT_OPTION
-          if (field.type == org.apache.thrift.protocol.TType.BOOL) {
-            this.grantOption = iprot.readBool();
-            setGrantOptionIsSet(true);
-          } 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.privilege != null) {
-      oprot.writeFieldBegin(PRIVILEGE_FIELD_DESC);
-      oprot.writeString(this.privilege);
-      oprot.writeFieldEnd();
-    }
-    oprot.writeFieldBegin(CREATE_TIME_FIELD_DESC);
-    oprot.writeI32(this.createTime);
-    oprot.writeFieldEnd();
-    if (this.grantor != null) {
-      oprot.writeFieldBegin(GRANTOR_FIELD_DESC);
-      oprot.writeString(this.grantor);
-      oprot.writeFieldEnd();
-    }
-    if (this.grantorType != null) {
-      oprot.writeFieldBegin(GRANTOR_TYPE_FIELD_DESC);
-      oprot.writeI32(this.grantorType.getValue());
-      oprot.writeFieldEnd();
-    }
-    oprot.writeFieldBegin(GRANT_OPTION_FIELD_DESC);
-    oprot.writeBool(this.grantOption);
-    oprot.writeFieldEnd();
-    oprot.writeFieldStop();
-    oprot.writeStructEnd();
+    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
   }
 
   @Override
@@ -679,6 +616,7 @@ public class PrivilegeGrantInfo implemen
 
   public void validate() throws org.apache.thrift.TException {
     // check for required fields
+    // check for sub-struct validity
   }
 
   private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
@@ -692,12 +630,182 @@ public class PrivilegeGrantInfo implemen
   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 PrivilegeGrantInfoStandardSchemeFactory implements SchemeFactory {
+    public PrivilegeGrantInfoStandardScheme getScheme() {
+      return new PrivilegeGrantInfoStandardScheme();
+    }
+  }
+
+  private static class PrivilegeGrantInfoStandardScheme extends StandardScheme<PrivilegeGrantInfo> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, PrivilegeGrantInfo 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: // PRIVILEGE
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.privilege = iprot.readString();
+              struct.setPrivilegeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 2: // 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 3: // GRANTOR
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.grantor = iprot.readString();
+              struct.setGrantorIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 4: // GRANTOR_TYPE
+            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+              struct.grantorType = PrincipalType.findByValue(iprot.readI32());
+              struct.setGrantorTypeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 5: // GRANT_OPTION
+            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+              struct.grantOption = iprot.readBool();
+              struct.setGrantOptionIsSet(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, PrivilegeGrantInfo struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.privilege != null) {
+        oprot.writeFieldBegin(PRIVILEGE_FIELD_DESC);
+        oprot.writeString(struct.privilege);
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldBegin(CREATE_TIME_FIELD_DESC);
+      oprot.writeI32(struct.createTime);
+      oprot.writeFieldEnd();
+      if (struct.grantor != null) {
+        oprot.writeFieldBegin(GRANTOR_FIELD_DESC);
+        oprot.writeString(struct.grantor);
+        oprot.writeFieldEnd();
+      }
+      if (struct.grantorType != null) {
+        oprot.writeFieldBegin(GRANTOR_TYPE_FIELD_DESC);
+        oprot.writeI32(struct.grantorType.getValue());
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldBegin(GRANT_OPTION_FIELD_DESC);
+      oprot.writeBool(struct.grantOption);
+      oprot.writeFieldEnd();
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class PrivilegeGrantInfoTupleSchemeFactory implements SchemeFactory {
+    public PrivilegeGrantInfoTupleScheme getScheme() {
+      return new PrivilegeGrantInfoTupleScheme();
+    }
+  }
+
+  private static class PrivilegeGrantInfoTupleScheme extends TupleScheme<PrivilegeGrantInfo> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, PrivilegeGrantInfo struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      BitSet optionals = new BitSet();
+      if (struct.isSetPrivilege()) {
+        optionals.set(0);
+      }
+      if (struct.isSetCreateTime()) {
+        optionals.set(1);
+      }
+      if (struct.isSetGrantor()) {
+        optionals.set(2);
+      }
+      if (struct.isSetGrantorType()) {
+        optionals.set(3);
+      }
+      if (struct.isSetGrantOption()) {
+        optionals.set(4);
+      }
+      oprot.writeBitSet(optionals, 5);
+      if (struct.isSetPrivilege()) {
+        oprot.writeString(struct.privilege);
+      }
+      if (struct.isSetCreateTime()) {
+        oprot.writeI32(struct.createTime);
+      }
+      if (struct.isSetGrantor()) {
+        oprot.writeString(struct.grantor);
+      }
+      if (struct.isSetGrantorType()) {
+        oprot.writeI32(struct.grantorType.getValue());
+      }
+      if (struct.isSetGrantOption()) {
+        oprot.writeBool(struct.grantOption);
+      }
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, PrivilegeGrantInfo struct) throws org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      BitSet incoming = iprot.readBitSet(5);
+      if (incoming.get(0)) {
+        struct.privilege = iprot.readString();
+        struct.setPrivilegeIsSet(true);
+      }
+      if (incoming.get(1)) {
+        struct.createTime = iprot.readI32();
+        struct.setCreateTimeIsSet(true);
+      }
+      if (incoming.get(2)) {
+        struct.grantor = iprot.readString();
+        struct.setGrantorIsSet(true);
+      }
+      if (incoming.get(3)) {
+        struct.grantorType = PrincipalType.findByValue(iprot.readI32());
+        struct.setGrantorTypeIsSet(true);
+      }
+      if (incoming.get(4)) {
+        struct.grantOption = iprot.readBool();
+        struct.setGrantOptionIsSet(true);
+      }
+    }
+  }
+
 }
 

Modified: hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Role.java
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Role.java?rev=1406984&r1=1406983&r2=1406984&view=diff
==============================================================================
--- hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Role.java (original)
+++ hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Role.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;
@@ -28,6 +38,12 @@ public class Role implements org.apache.
   private static final org.apache.thrift.protocol.TField CREATE_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("createTime", org.apache.thrift.protocol.TType.I32, (short)2);
   private static final org.apache.thrift.protocol.TField OWNER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("ownerName", org.apache.thrift.protocol.TType.STRING, (short)3);
 
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new RoleStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new RoleTupleSchemeFactory());
+  }
+
   private String roleName; // required
   private int createTime; // required
   private String ownerName; // required
@@ -98,8 +114,7 @@ public class Role implements org.apache.
 
   // isset id assignments
   private static final int __CREATETIME_ISSET_ID = 0;
-  private BitSet __isset_bit_vector = new BitSet(1);
-
+  private byte __isset_bitfield = 0;
   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);
@@ -132,8 +147,7 @@ public class Role implements org.apache.
    * Performs a deep copy on <i>other</i>.
    */
   public Role(Role other) {
-    __isset_bit_vector.clear();
-    __isset_bit_vector.or(other.__isset_bit_vector);
+    __isset_bitfield = other.__isset_bitfield;
     if (other.isSetRoleName()) {
       this.roleName = other.roleName;
     }
@@ -188,16 +202,16 @@ public class Role 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 String getOwnerName() {
@@ -395,65 +409,11 @@ public class Role 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: // ROLE_NAME
-          if (field.type == org.apache.thrift.protocol.TType.STRING) {
-            this.roleName = iprot.readString();
-          } else { 
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-          }
-          break;
-        case 2: // 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 3: // OWNER_NAME
-          if (field.type == org.apache.thrift.protocol.TType.STRING) {
-            this.ownerName = iprot.readString();
-          } 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.roleName != null) {
-      oprot.writeFieldBegin(ROLE_NAME_FIELD_DESC);
-      oprot.writeString(this.roleName);
-      oprot.writeFieldEnd();
-    }
-    oprot.writeFieldBegin(CREATE_TIME_FIELD_DESC);
-    oprot.writeI32(this.createTime);
-    oprot.writeFieldEnd();
-    if (this.ownerName != null) {
-      oprot.writeFieldBegin(OWNER_NAME_FIELD_DESC);
-      oprot.writeString(this.ownerName);
-      oprot.writeFieldEnd();
-    }
-    oprot.writeFieldStop();
-    oprot.writeStructEnd();
+    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
   }
 
   @Override
@@ -486,6 +446,7 @@ public class Role implements org.apache.
 
   public void validate() throws org.apache.thrift.TException {
     // check for required fields
+    // check for sub-struct validity
   }
 
   private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
@@ -499,12 +460,138 @@ public class Role 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 RoleStandardSchemeFactory implements SchemeFactory {
+    public RoleStandardScheme getScheme() {
+      return new RoleStandardScheme();
+    }
+  }
+
+  private static class RoleStandardScheme extends StandardScheme<Role> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, Role 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: // ROLE_NAME
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.roleName = iprot.readString();
+              struct.setRoleNameIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 2: // 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 3: // OWNER_NAME
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.ownerName = iprot.readString();
+              struct.setOwnerNameIsSet(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, Role struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.roleName != null) {
+        oprot.writeFieldBegin(ROLE_NAME_FIELD_DESC);
+        oprot.writeString(struct.roleName);
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldBegin(CREATE_TIME_FIELD_DESC);
+      oprot.writeI32(struct.createTime);
+      oprot.writeFieldEnd();
+      if (struct.ownerName != null) {
+        oprot.writeFieldBegin(OWNER_NAME_FIELD_DESC);
+        oprot.writeString(struct.ownerName);
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class RoleTupleSchemeFactory implements SchemeFactory {
+    public RoleTupleScheme getScheme() {
+      return new RoleTupleScheme();
+    }
+  }
+
+  private static class RoleTupleScheme extends TupleScheme<Role> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, Role struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      BitSet optionals = new BitSet();
+      if (struct.isSetRoleName()) {
+        optionals.set(0);
+      }
+      if (struct.isSetCreateTime()) {
+        optionals.set(1);
+      }
+      if (struct.isSetOwnerName()) {
+        optionals.set(2);
+      }
+      oprot.writeBitSet(optionals, 3);
+      if (struct.isSetRoleName()) {
+        oprot.writeString(struct.roleName);
+      }
+      if (struct.isSetCreateTime()) {
+        oprot.writeI32(struct.createTime);
+      }
+      if (struct.isSetOwnerName()) {
+        oprot.writeString(struct.ownerName);
+      }
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, Role struct) throws org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      BitSet incoming = iprot.readBitSet(3);
+      if (incoming.get(0)) {
+        struct.roleName = iprot.readString();
+        struct.setRoleNameIsSet(true);
+      }
+      if (incoming.get(1)) {
+        struct.createTime = iprot.readI32();
+        struct.setCreateTimeIsSet(true);
+      }
+      if (incoming.get(2)) {
+        struct.ownerName = iprot.readString();
+        struct.setOwnerNameIsSet(true);
+      }
+    }
+  }
+
 }
 

Modified: hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Schema.java
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Schema.java?rev=1406984&r1=1406983&r2=1406984&view=diff
==============================================================================
--- hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Schema.java (original)
+++ hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Schema.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;
@@ -27,6 +37,12 @@ public class Schema implements org.apach
   private static final org.apache.thrift.protocol.TField FIELD_SCHEMAS_FIELD_DESC = new org.apache.thrift.protocol.TField("fieldSchemas", org.apache.thrift.protocol.TType.LIST, (short)1);
   private static final org.apache.thrift.protocol.TField PROPERTIES_FIELD_DESC = new org.apache.thrift.protocol.TField("properties", org.apache.thrift.protocol.TType.MAP, (short)2);
 
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new SchemaStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new SchemaTupleSchemeFactory());
+  }
+
   private List<FieldSchema> fieldSchemas; // required
   private Map<String,String> properties; // required
 
@@ -92,7 +108,6 @@ public class Schema implements org.apach
   }
 
   // isset id assignments
-
   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);
@@ -364,92 +379,11 @@ public class Schema implements org.apach
   }
 
   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: // FIELD_SCHEMAS
-          if (field.type == org.apache.thrift.protocol.TType.LIST) {
-            {
-              org.apache.thrift.protocol.TList _list114 = iprot.readListBegin();
-              this.fieldSchemas = new ArrayList<FieldSchema>(_list114.size);
-              for (int _i115 = 0; _i115 < _list114.size; ++_i115)
-              {
-                FieldSchema _elem116; // required
-                _elem116 = new FieldSchema();
-                _elem116.read(iprot);
-                this.fieldSchemas.add(_elem116);
-              }
-              iprot.readListEnd();
-            }
-          } else { 
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-          }
-          break;
-        case 2: // PROPERTIES
-          if (field.type == org.apache.thrift.protocol.TType.MAP) {
-            {
-              org.apache.thrift.protocol.TMap _map117 = iprot.readMapBegin();
-              this.properties = new HashMap<String,String>(2*_map117.size);
-              for (int _i118 = 0; _i118 < _map117.size; ++_i118)
-              {
-                String _key119; // required
-                String _val120; // required
-                _key119 = iprot.readString();
-                _val120 = iprot.readString();
-                this.properties.put(_key119, _val120);
-              }
-              iprot.readMapEnd();
-            }
-          } 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.fieldSchemas != null) {
-      oprot.writeFieldBegin(FIELD_SCHEMAS_FIELD_DESC);
-      {
-        oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.fieldSchemas.size()));
-        for (FieldSchema _iter121 : this.fieldSchemas)
-        {
-          _iter121.write(oprot);
-        }
-        oprot.writeListEnd();
-      }
-      oprot.writeFieldEnd();
-    }
-    if (this.properties != null) {
-      oprot.writeFieldBegin(PROPERTIES_FIELD_DESC);
-      {
-        oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, this.properties.size()));
-        for (Map.Entry<String, String> _iter122 : this.properties.entrySet())
-        {
-          oprot.writeString(_iter122.getKey());
-          oprot.writeString(_iter122.getValue());
-        }
-        oprot.writeMapEnd();
-      }
-      oprot.writeFieldEnd();
-    }
-    oprot.writeFieldStop();
-    oprot.writeStructEnd();
+    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
   }
 
   @Override
@@ -478,6 +412,7 @@ public class Schema implements org.apach
 
   public void validate() throws org.apache.thrift.TException {
     // check for required fields
+    // check for sub-struct validity
   }
 
   private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
@@ -496,5 +431,182 @@ public class Schema implements org.apach
     }
   }
 
+  private static class SchemaStandardSchemeFactory implements SchemeFactory {
+    public SchemaStandardScheme getScheme() {
+      return new SchemaStandardScheme();
+    }
+  }
+
+  private static class SchemaStandardScheme extends StandardScheme<Schema> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, Schema 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: // FIELD_SCHEMAS
+            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
+              {
+                org.apache.thrift.protocol.TList _list228 = iprot.readListBegin();
+                struct.fieldSchemas = new ArrayList<FieldSchema>(_list228.size);
+                for (int _i229 = 0; _i229 < _list228.size; ++_i229)
+                {
+                  FieldSchema _elem230; // required
+                  _elem230 = new FieldSchema();
+                  _elem230.read(iprot);
+                  struct.fieldSchemas.add(_elem230);
+                }
+                iprot.readListEnd();
+              }
+              struct.setFieldSchemasIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 2: // PROPERTIES
+            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
+              {
+                org.apache.thrift.protocol.TMap _map231 = iprot.readMapBegin();
+                struct.properties = new HashMap<String,String>(2*_map231.size);
+                for (int _i232 = 0; _i232 < _map231.size; ++_i232)
+                {
+                  String _key233; // required
+                  String _val234; // required
+                  _key233 = iprot.readString();
+                  _val234 = iprot.readString();
+                  struct.properties.put(_key233, _val234);
+                }
+                iprot.readMapEnd();
+              }
+              struct.setPropertiesIsSet(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, Schema struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.fieldSchemas != null) {
+        oprot.writeFieldBegin(FIELD_SCHEMAS_FIELD_DESC);
+        {
+          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.fieldSchemas.size()));
+          for (FieldSchema _iter235 : struct.fieldSchemas)
+          {
+            _iter235.write(oprot);
+          }
+          oprot.writeListEnd();
+        }
+        oprot.writeFieldEnd();
+      }
+      if (struct.properties != null) {
+        oprot.writeFieldBegin(PROPERTIES_FIELD_DESC);
+        {
+          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.properties.size()));
+          for (Map.Entry<String, String> _iter236 : struct.properties.entrySet())
+          {
+            oprot.writeString(_iter236.getKey());
+            oprot.writeString(_iter236.getValue());
+          }
+          oprot.writeMapEnd();
+        }
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class SchemaTupleSchemeFactory implements SchemeFactory {
+    public SchemaTupleScheme getScheme() {
+      return new SchemaTupleScheme();
+    }
+  }
+
+  private static class SchemaTupleScheme extends TupleScheme<Schema> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, Schema struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      BitSet optionals = new BitSet();
+      if (struct.isSetFieldSchemas()) {
+        optionals.set(0);
+      }
+      if (struct.isSetProperties()) {
+        optionals.set(1);
+      }
+      oprot.writeBitSet(optionals, 2);
+      if (struct.isSetFieldSchemas()) {
+        {
+          oprot.writeI32(struct.fieldSchemas.size());
+          for (FieldSchema _iter237 : struct.fieldSchemas)
+          {
+            _iter237.write(oprot);
+          }
+        }
+      }
+      if (struct.isSetProperties()) {
+        {
+          oprot.writeI32(struct.properties.size());
+          for (Map.Entry<String, String> _iter238 : struct.properties.entrySet())
+          {
+            oprot.writeString(_iter238.getKey());
+            oprot.writeString(_iter238.getValue());
+          }
+        }
+      }
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, Schema struct) throws org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      BitSet incoming = iprot.readBitSet(2);
+      if (incoming.get(0)) {
+        {
+          org.apache.thrift.protocol.TList _list239 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+          struct.fieldSchemas = new ArrayList<FieldSchema>(_list239.size);
+          for (int _i240 = 0; _i240 < _list239.size; ++_i240)
+          {
+            FieldSchema _elem241; // required
+            _elem241 = new FieldSchema();
+            _elem241.read(iprot);
+            struct.fieldSchemas.add(_elem241);
+          }
+        }
+        struct.setFieldSchemasIsSet(true);
+      }
+      if (incoming.get(1)) {
+        {
+          org.apache.thrift.protocol.TMap _map242 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
+          struct.properties = new HashMap<String,String>(2*_map242.size);
+          for (int _i243 = 0; _i243 < _map242.size; ++_i243)
+          {
+            String _key244; // required
+            String _val245; // required
+            _key244 = iprot.readString();
+            _val245 = iprot.readString();
+            struct.properties.put(_key244, _val245);
+          }
+        }
+        struct.setPropertiesIsSet(true);
+      }
+    }
+  }
+
 }
 

Modified: hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/SerDeInfo.java
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/SerDeInfo.java?rev=1406984&r1=1406983&r2=1406984&view=diff
==============================================================================
--- hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/SerDeInfo.java (original)
+++ hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/SerDeInfo.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;
@@ -28,6 +38,12 @@ public class SerDeInfo implements org.ap
   private static final org.apache.thrift.protocol.TField SERIALIZATION_LIB_FIELD_DESC = new org.apache.thrift.protocol.TField("serializationLib", org.apache.thrift.protocol.TType.STRING, (short)2);
   private static final org.apache.thrift.protocol.TField PARAMETERS_FIELD_DESC = new org.apache.thrift.protocol.TField("parameters", org.apache.thrift.protocol.TType.MAP, (short)3);
 
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new SerDeInfoStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new SerDeInfoTupleSchemeFactory());
+  }
+
   private String name; // required
   private String serializationLib; // required
   private Map<String,String> parameters; // required
@@ -97,7 +113,6 @@ public class SerDeInfo implements org.ap
   }
 
   // isset id assignments
-
   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);
@@ -417,86 +432,11 @@ public class SerDeInfo implements org.ap
   }
 
   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: // NAME
-          if (field.type == org.apache.thrift.protocol.TType.STRING) {
-            this.name = iprot.readString();
-          } else { 
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-          }
-          break;
-        case 2: // SERIALIZATION_LIB
-          if (field.type == org.apache.thrift.protocol.TType.STRING) {
-            this.serializationLib = iprot.readString();
-          } else { 
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-          }
-          break;
-        case 3: // PARAMETERS
-          if (field.type == org.apache.thrift.protocol.TType.MAP) {
-            {
-              org.apache.thrift.protocol.TMap _map44 = iprot.readMapBegin();
-              this.parameters = new HashMap<String,String>(2*_map44.size);
-              for (int _i45 = 0; _i45 < _map44.size; ++_i45)
-              {
-                String _key46; // required
-                String _val47; // required
-                _key46 = iprot.readString();
-                _val47 = iprot.readString();
-                this.parameters.put(_key46, _val47);
-              }
-              iprot.readMapEnd();
-            }
-          } 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.name != null) {
-      oprot.writeFieldBegin(NAME_FIELD_DESC);
-      oprot.writeString(this.name);
-      oprot.writeFieldEnd();
-    }
-    if (this.serializationLib != null) {
-      oprot.writeFieldBegin(SERIALIZATION_LIB_FIELD_DESC);
-      oprot.writeString(this.serializationLib);
-      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> _iter48 : this.parameters.entrySet())
-        {
-          oprot.writeString(_iter48.getKey());
-          oprot.writeString(_iter48.getValue());
-        }
-        oprot.writeMapEnd();
-      }
-      oprot.writeFieldEnd();
-    }
-    oprot.writeFieldStop();
-    oprot.writeStructEnd();
+    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
   }
 
   @Override
@@ -533,6 +473,7 @@ public class SerDeInfo implements org.ap
 
   public void validate() throws org.apache.thrift.TException {
     // check for required fields
+    // check for sub-struct validity
   }
 
   private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
@@ -551,5 +492,171 @@ public class SerDeInfo implements org.ap
     }
   }
 
+  private static class SerDeInfoStandardSchemeFactory implements SchemeFactory {
+    public SerDeInfoStandardScheme getScheme() {
+      return new SerDeInfoStandardScheme();
+    }
+  }
+
+  private static class SerDeInfoStandardScheme extends StandardScheme<SerDeInfo> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, SerDeInfo 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: // NAME
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.name = iprot.readString();
+              struct.setNameIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 2: // SERIALIZATION_LIB
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.serializationLib = iprot.readString();
+              struct.setSerializationLibIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 3: // PARAMETERS
+            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
+              {
+                org.apache.thrift.protocol.TMap _map88 = iprot.readMapBegin();
+                struct.parameters = new HashMap<String,String>(2*_map88.size);
+                for (int _i89 = 0; _i89 < _map88.size; ++_i89)
+                {
+                  String _key90; // required
+                  String _val91; // required
+                  _key90 = iprot.readString();
+                  _val91 = iprot.readString();
+                  struct.parameters.put(_key90, _val91);
+                }
+                iprot.readMapEnd();
+              }
+              struct.setParametersIsSet(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, SerDeInfo struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.name != null) {
+        oprot.writeFieldBegin(NAME_FIELD_DESC);
+        oprot.writeString(struct.name);
+        oprot.writeFieldEnd();
+      }
+      if (struct.serializationLib != null) {
+        oprot.writeFieldBegin(SERIALIZATION_LIB_FIELD_DESC);
+        oprot.writeString(struct.serializationLib);
+        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> _iter92 : struct.parameters.entrySet())
+          {
+            oprot.writeString(_iter92.getKey());
+            oprot.writeString(_iter92.getValue());
+          }
+          oprot.writeMapEnd();
+        }
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class SerDeInfoTupleSchemeFactory implements SchemeFactory {
+    public SerDeInfoTupleScheme getScheme() {
+      return new SerDeInfoTupleScheme();
+    }
+  }
+
+  private static class SerDeInfoTupleScheme extends TupleScheme<SerDeInfo> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, SerDeInfo struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      BitSet optionals = new BitSet();
+      if (struct.isSetName()) {
+        optionals.set(0);
+      }
+      if (struct.isSetSerializationLib()) {
+        optionals.set(1);
+      }
+      if (struct.isSetParameters()) {
+        optionals.set(2);
+      }
+      oprot.writeBitSet(optionals, 3);
+      if (struct.isSetName()) {
+        oprot.writeString(struct.name);
+      }
+      if (struct.isSetSerializationLib()) {
+        oprot.writeString(struct.serializationLib);
+      }
+      if (struct.isSetParameters()) {
+        {
+          oprot.writeI32(struct.parameters.size());
+          for (Map.Entry<String, String> _iter93 : struct.parameters.entrySet())
+          {
+            oprot.writeString(_iter93.getKey());
+            oprot.writeString(_iter93.getValue());
+          }
+        }
+      }
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, SerDeInfo struct) throws org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      BitSet incoming = iprot.readBitSet(3);
+      if (incoming.get(0)) {
+        struct.name = iprot.readString();
+        struct.setNameIsSet(true);
+      }
+      if (incoming.get(1)) {
+        struct.serializationLib = iprot.readString();
+        struct.setSerializationLibIsSet(true);
+      }
+      if (incoming.get(2)) {
+        {
+          org.apache.thrift.protocol.TMap _map94 = 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*_map94.size);
+          for (int _i95 = 0; _i95 < _map94.size; ++_i95)
+          {
+            String _key96; // required
+            String _val97; // required
+            _key96 = iprot.readString();
+            _val97 = iprot.readString();
+            struct.parameters.put(_key96, _val97);
+          }
+        }
+        struct.setParametersIsSet(true);
+      }
+    }
+  }
+
 }
 



Mime
View raw message