hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From na...@apache.org
Subject svn commit: r1057999 [11/22] - in /hive/trunk: ./ common/src/java/org/apache/hadoop/hive/conf/ conf/ metastore/if/ metastore/src/gen/thrift/gen-cpp/ metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ metastore/src/gen/thrift/ge...
Date Wed, 12 Jan 2011 06:58:10 GMT
Modified: hive/trunk/metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py?rev=1057999&r1=1057998&r2=1057999&view=diff
==============================================================================
--- hive/trunk/metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py (original)
+++ hive/trunk/metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py Wed Jan 12 06:58:04 2011
@@ -16,6 +16,46 @@ except:
   fastbinary = None
 
 
+class HiveObjectType:
+  GLOBAL = 1
+  DATABASE = 2
+  TABLE = 3
+  PARTITION = 4
+  COLUMN = 5
+
+  _VALUES_TO_NAMES = {
+    1: "GLOBAL",
+    2: "DATABASE",
+    3: "TABLE",
+    4: "PARTITION",
+    5: "COLUMN",
+  }
+
+  _NAMES_TO_VALUES = {
+    "GLOBAL": 1,
+    "DATABASE": 2,
+    "TABLE": 3,
+    "PARTITION": 4,
+    "COLUMN": 5,
+  }
+
+class PrincipalType:
+  USER = 1
+  ROLE = 2
+  GROUP = 3
+
+  _VALUES_TO_NAMES = {
+    1: "USER",
+    2: "ROLE",
+    3: "GROUP",
+  }
+
+  _NAMES_TO_VALUES = {
+    "USER": 1,
+    "ROLE": 2,
+    "GROUP": 3,
+  }
+
 
 class Version:
   """
@@ -275,6 +315,616 @@ class Type:
   def __ne__(self, other):
     return not (self == other)
 
+class HiveObjectRef:
+  """
+  Attributes:
+   - objectType
+   - dbName
+   - objectName
+   - partValues
+   - columnName
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.I32, 'objectType', None, None, ), # 1
+    (2, TType.STRING, 'dbName', None, None, ), # 2
+    (3, TType.STRING, 'objectName', None, None, ), # 3
+    (4, TType.LIST, 'partValues', (TType.STRING,None), None, ), # 4
+    (5, TType.STRING, 'columnName', None, None, ), # 5
+  )
+
+  def __init__(self, objectType=None, dbName=None, objectName=None, partValues=None, columnName=None,):
+    self.objectType = objectType
+    self.dbName = dbName
+    self.objectName = objectName
+    self.partValues = partValues
+    self.columnName = columnName
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.I32:
+          self.objectType = iprot.readI32();
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRING:
+          self.dbName = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 3:
+        if ftype == TType.STRING:
+          self.objectName = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 4:
+        if ftype == TType.LIST:
+          self.partValues = []
+          (_etype10, _size7) = iprot.readListBegin()
+          for _i11 in xrange(_size7):
+            _elem12 = iprot.readString();
+            self.partValues.append(_elem12)
+          iprot.readListEnd()
+        else:
+          iprot.skip(ftype)
+      elif fid == 5:
+        if ftype == TType.STRING:
+          self.columnName = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('HiveObjectRef')
+    if self.objectType != None:
+      oprot.writeFieldBegin('objectType', TType.I32, 1)
+      oprot.writeI32(self.objectType)
+      oprot.writeFieldEnd()
+    if self.dbName != None:
+      oprot.writeFieldBegin('dbName', TType.STRING, 2)
+      oprot.writeString(self.dbName)
+      oprot.writeFieldEnd()
+    if self.objectName != None:
+      oprot.writeFieldBegin('objectName', TType.STRING, 3)
+      oprot.writeString(self.objectName)
+      oprot.writeFieldEnd()
+    if self.partValues != None:
+      oprot.writeFieldBegin('partValues', TType.LIST, 4)
+      oprot.writeListBegin(TType.STRING, len(self.partValues))
+      for iter13 in self.partValues:
+        oprot.writeString(iter13)
+      oprot.writeListEnd()
+      oprot.writeFieldEnd()
+    if self.columnName != None:
+      oprot.writeFieldBegin('columnName', TType.STRING, 5)
+      oprot.writeString(self.columnName)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+    def validate(self):
+      return
+
+
+  def __repr__(self):
+    L = ['%s=%r' % (key, value)
+      for key, value in self.__dict__.iteritems()]
+    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class PrivilegeGrantInfo:
+  """
+  Attributes:
+   - privilege
+   - createTime
+   - grantor
+   - grantorType
+   - grantOption
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRING, 'privilege', None, None, ), # 1
+    (2, TType.I32, 'createTime', None, None, ), # 2
+    (3, TType.STRING, 'grantor', None, None, ), # 3
+    (4, TType.I32, 'grantorType', None, None, ), # 4
+    (5, TType.BOOL, 'grantOption', None, None, ), # 5
+  )
+
+  def __init__(self, privilege=None, createTime=None, grantor=None, grantorType=None, grantOption=None,):
+    self.privilege = privilege
+    self.createTime = createTime
+    self.grantor = grantor
+    self.grantorType = grantorType
+    self.grantOption = grantOption
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRING:
+          self.privilege = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.I32:
+          self.createTime = iprot.readI32();
+        else:
+          iprot.skip(ftype)
+      elif fid == 3:
+        if ftype == TType.STRING:
+          self.grantor = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 4:
+        if ftype == TType.I32:
+          self.grantorType = iprot.readI32();
+        else:
+          iprot.skip(ftype)
+      elif fid == 5:
+        if ftype == TType.BOOL:
+          self.grantOption = iprot.readBool();
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('PrivilegeGrantInfo')
+    if self.privilege != None:
+      oprot.writeFieldBegin('privilege', TType.STRING, 1)
+      oprot.writeString(self.privilege)
+      oprot.writeFieldEnd()
+    if self.createTime != None:
+      oprot.writeFieldBegin('createTime', TType.I32, 2)
+      oprot.writeI32(self.createTime)
+      oprot.writeFieldEnd()
+    if self.grantor != None:
+      oprot.writeFieldBegin('grantor', TType.STRING, 3)
+      oprot.writeString(self.grantor)
+      oprot.writeFieldEnd()
+    if self.grantorType != None:
+      oprot.writeFieldBegin('grantorType', TType.I32, 4)
+      oprot.writeI32(self.grantorType)
+      oprot.writeFieldEnd()
+    if self.grantOption != None:
+      oprot.writeFieldBegin('grantOption', TType.BOOL, 5)
+      oprot.writeBool(self.grantOption)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+    def validate(self):
+      return
+
+
+  def __repr__(self):
+    L = ['%s=%r' % (key, value)
+      for key, value in self.__dict__.iteritems()]
+    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class HiveObjectPrivilege:
+  """
+  Attributes:
+   - hiveObject
+   - principalName
+   - principalType
+   - grantInfo
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRUCT, 'hiveObject', (HiveObjectRef, HiveObjectRef.thrift_spec), None, ), # 1
+    (2, TType.STRING, 'principalName', None, None, ), # 2
+    (3, TType.I32, 'principalType', None, None, ), # 3
+    (4, TType.STRUCT, 'grantInfo', (PrivilegeGrantInfo, PrivilegeGrantInfo.thrift_spec), None, ), # 4
+  )
+
+  def __init__(self, hiveObject=None, principalName=None, principalType=None, grantInfo=None,):
+    self.hiveObject = hiveObject
+    self.principalName = principalName
+    self.principalType = principalType
+    self.grantInfo = grantInfo
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRUCT:
+          self.hiveObject = HiveObjectRef()
+          self.hiveObject.read(iprot)
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRING:
+          self.principalName = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 3:
+        if ftype == TType.I32:
+          self.principalType = iprot.readI32();
+        else:
+          iprot.skip(ftype)
+      elif fid == 4:
+        if ftype == TType.STRUCT:
+          self.grantInfo = PrivilegeGrantInfo()
+          self.grantInfo.read(iprot)
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('HiveObjectPrivilege')
+    if self.hiveObject != None:
+      oprot.writeFieldBegin('hiveObject', TType.STRUCT, 1)
+      self.hiveObject.write(oprot)
+      oprot.writeFieldEnd()
+    if self.principalName != None:
+      oprot.writeFieldBegin('principalName', TType.STRING, 2)
+      oprot.writeString(self.principalName)
+      oprot.writeFieldEnd()
+    if self.principalType != None:
+      oprot.writeFieldBegin('principalType', TType.I32, 3)
+      oprot.writeI32(self.principalType)
+      oprot.writeFieldEnd()
+    if self.grantInfo != None:
+      oprot.writeFieldBegin('grantInfo', TType.STRUCT, 4)
+      self.grantInfo.write(oprot)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+    def validate(self):
+      return
+
+
+  def __repr__(self):
+    L = ['%s=%r' % (key, value)
+      for key, value in self.__dict__.iteritems()]
+    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class PrivilegeBag:
+  """
+  Attributes:
+   - privileges
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.LIST, 'privileges', (TType.STRUCT,(HiveObjectPrivilege, HiveObjectPrivilege.thrift_spec)), None, ), # 1
+  )
+
+  def __init__(self, privileges=None,):
+    self.privileges = privileges
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.LIST:
+          self.privileges = []
+          (_etype17, _size14) = iprot.readListBegin()
+          for _i18 in xrange(_size14):
+            _elem19 = HiveObjectPrivilege()
+            _elem19.read(iprot)
+            self.privileges.append(_elem19)
+          iprot.readListEnd()
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('PrivilegeBag')
+    if self.privileges != None:
+      oprot.writeFieldBegin('privileges', TType.LIST, 1)
+      oprot.writeListBegin(TType.STRUCT, len(self.privileges))
+      for iter20 in self.privileges:
+        iter20.write(oprot)
+      oprot.writeListEnd()
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+    def validate(self):
+      return
+
+
+  def __repr__(self):
+    L = ['%s=%r' % (key, value)
+      for key, value in self.__dict__.iteritems()]
+    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class PrincipalPrivilegeSet:
+  """
+  Attributes:
+   - userPrivileges
+   - groupPrivileges
+   - rolePrivileges
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.MAP, 'userPrivileges', (TType.STRING,None,TType.LIST,(TType.STRUCT,(PrivilegeGrantInfo, PrivilegeGrantInfo.thrift_spec))), None, ), # 1
+    (2, TType.MAP, 'groupPrivileges', (TType.STRING,None,TType.LIST,(TType.STRUCT,(PrivilegeGrantInfo, PrivilegeGrantInfo.thrift_spec))), None, ), # 2
+    (3, TType.MAP, 'rolePrivileges', (TType.STRING,None,TType.LIST,(TType.STRUCT,(PrivilegeGrantInfo, PrivilegeGrantInfo.thrift_spec))), None, ), # 3
+  )
+
+  def __init__(self, userPrivileges=None, groupPrivileges=None, rolePrivileges=None,):
+    self.userPrivileges = userPrivileges
+    self.groupPrivileges = groupPrivileges
+    self.rolePrivileges = rolePrivileges
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.MAP:
+          self.userPrivileges = {}
+          (_ktype22, _vtype23, _size21 ) = iprot.readMapBegin() 
+          for _i25 in xrange(_size21):
+            _key26 = iprot.readString();
+            _val27 = []
+            (_etype31, _size28) = iprot.readListBegin()
+            for _i32 in xrange(_size28):
+              _elem33 = PrivilegeGrantInfo()
+              _elem33.read(iprot)
+              _val27.append(_elem33)
+            iprot.readListEnd()
+            self.userPrivileges[_key26] = _val27
+          iprot.readMapEnd()
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.MAP:
+          self.groupPrivileges = {}
+          (_ktype35, _vtype36, _size34 ) = iprot.readMapBegin() 
+          for _i38 in xrange(_size34):
+            _key39 = iprot.readString();
+            _val40 = []
+            (_etype44, _size41) = iprot.readListBegin()
+            for _i45 in xrange(_size41):
+              _elem46 = PrivilegeGrantInfo()
+              _elem46.read(iprot)
+              _val40.append(_elem46)
+            iprot.readListEnd()
+            self.groupPrivileges[_key39] = _val40
+          iprot.readMapEnd()
+        else:
+          iprot.skip(ftype)
+      elif fid == 3:
+        if ftype == TType.MAP:
+          self.rolePrivileges = {}
+          (_ktype48, _vtype49, _size47 ) = iprot.readMapBegin() 
+          for _i51 in xrange(_size47):
+            _key52 = iprot.readString();
+            _val53 = []
+            (_etype57, _size54) = iprot.readListBegin()
+            for _i58 in xrange(_size54):
+              _elem59 = PrivilegeGrantInfo()
+              _elem59.read(iprot)
+              _val53.append(_elem59)
+            iprot.readListEnd()
+            self.rolePrivileges[_key52] = _val53
+          iprot.readMapEnd()
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('PrincipalPrivilegeSet')
+    if self.userPrivileges != None:
+      oprot.writeFieldBegin('userPrivileges', TType.MAP, 1)
+      oprot.writeMapBegin(TType.STRING, TType.LIST, len(self.userPrivileges))
+      for kiter60,viter61 in self.userPrivileges.items():
+        oprot.writeString(kiter60)
+        oprot.writeListBegin(TType.STRUCT, len(viter61))
+        for iter62 in viter61:
+          iter62.write(oprot)
+        oprot.writeListEnd()
+      oprot.writeMapEnd()
+      oprot.writeFieldEnd()
+    if self.groupPrivileges != None:
+      oprot.writeFieldBegin('groupPrivileges', TType.MAP, 2)
+      oprot.writeMapBegin(TType.STRING, TType.LIST, len(self.groupPrivileges))
+      for kiter63,viter64 in self.groupPrivileges.items():
+        oprot.writeString(kiter63)
+        oprot.writeListBegin(TType.STRUCT, len(viter64))
+        for iter65 in viter64:
+          iter65.write(oprot)
+        oprot.writeListEnd()
+      oprot.writeMapEnd()
+      oprot.writeFieldEnd()
+    if self.rolePrivileges != None:
+      oprot.writeFieldBegin('rolePrivileges', TType.MAP, 3)
+      oprot.writeMapBegin(TType.STRING, TType.LIST, len(self.rolePrivileges))
+      for kiter66,viter67 in self.rolePrivileges.items():
+        oprot.writeString(kiter66)
+        oprot.writeListBegin(TType.STRUCT, len(viter67))
+        for iter68 in viter67:
+          iter68.write(oprot)
+        oprot.writeListEnd()
+      oprot.writeMapEnd()
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+    def validate(self):
+      return
+
+
+  def __repr__(self):
+    L = ['%s=%r' % (key, value)
+      for key, value in self.__dict__.iteritems()]
+    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
+class Role:
+  """
+  Attributes:
+   - roleName
+   - createTime
+   - ownerName
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.STRING, 'roleName', None, None, ), # 1
+    (2, TType.I32, 'createTime', None, None, ), # 2
+    (3, TType.STRING, 'ownerName', None, None, ), # 3
+  )
+
+  def __init__(self, roleName=None, createTime=None, ownerName=None,):
+    self.roleName = roleName
+    self.createTime = createTime
+    self.ownerName = ownerName
+
+  def read(self, iprot):
+    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+      return
+    iprot.readStructBegin()
+    while True:
+      (fname, ftype, fid) = iprot.readFieldBegin()
+      if ftype == TType.STOP:
+        break
+      if fid == 1:
+        if ftype == TType.STRING:
+          self.roleName = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.I32:
+          self.createTime = iprot.readI32();
+        else:
+          iprot.skip(ftype)
+      elif fid == 3:
+        if ftype == TType.STRING:
+          self.ownerName = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      else:
+        iprot.skip(ftype)
+      iprot.readFieldEnd()
+    iprot.readStructEnd()
+
+  def write(self, oprot):
+    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+      return
+    oprot.writeStructBegin('Role')
+    if self.roleName != None:
+      oprot.writeFieldBegin('roleName', TType.STRING, 1)
+      oprot.writeString(self.roleName)
+      oprot.writeFieldEnd()
+    if self.createTime != None:
+      oprot.writeFieldBegin('createTime', TType.I32, 2)
+      oprot.writeI32(self.createTime)
+      oprot.writeFieldEnd()
+    if self.ownerName != None:
+      oprot.writeFieldBegin('ownerName', TType.STRING, 3)
+      oprot.writeString(self.ownerName)
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+    def validate(self):
+      return
+
+
+  def __repr__(self):
+    L = ['%s=%r' % (key, value)
+      for key, value in self.__dict__.iteritems()]
+    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+  def __eq__(self, other):
+    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+  def __ne__(self, other):
+    return not (self == other)
+
 class Database:
   """
   Attributes:
@@ -282,6 +932,7 @@ class Database:
    - description
    - locationUri
    - parameters
+   - privileges
   """
 
   thrift_spec = (
@@ -290,13 +941,15 @@ class Database:
     (2, TType.STRING, 'description', None, None, ), # 2
     (3, TType.STRING, 'locationUri', None, None, ), # 3
     (4, TType.MAP, 'parameters', (TType.STRING,None,TType.STRING,None), None, ), # 4
+    (5, TType.STRUCT, 'privileges', (PrincipalPrivilegeSet, PrincipalPrivilegeSet.thrift_spec), None, ), # 5
   )
 
-  def __init__(self, name=None, description=None, locationUri=None, parameters=None,):
+  def __init__(self, name=None, description=None, locationUri=None, parameters=None, privileges=None,):
     self.name = name
     self.description = description
     self.locationUri = locationUri
     self.parameters = parameters
+    self.privileges = privileges
 
   def read(self, iprot):
     if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
@@ -325,14 +978,20 @@ class Database:
       elif fid == 4:
         if ftype == TType.MAP:
           self.parameters = {}
-          (_ktype8, _vtype9, _size7 ) = iprot.readMapBegin() 
-          for _i11 in xrange(_size7):
-            _key12 = iprot.readString();
-            _val13 = iprot.readString();
-            self.parameters[_key12] = _val13
+          (_ktype70, _vtype71, _size69 ) = iprot.readMapBegin() 
+          for _i73 in xrange(_size69):
+            _key74 = iprot.readString();
+            _val75 = iprot.readString();
+            self.parameters[_key74] = _val75
           iprot.readMapEnd()
         else:
           iprot.skip(ftype)
+      elif fid == 5:
+        if ftype == TType.STRUCT:
+          self.privileges = PrincipalPrivilegeSet()
+          self.privileges.read(iprot)
+        else:
+          iprot.skip(ftype)
       else:
         iprot.skip(ftype)
       iprot.readFieldEnd()
@@ -358,11 +1017,15 @@ class Database:
     if self.parameters != None:
       oprot.writeFieldBegin('parameters', TType.MAP, 4)
       oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.parameters))
-      for kiter14,viter15 in self.parameters.items():
-        oprot.writeString(kiter14)
-        oprot.writeString(viter15)
+      for kiter76,viter77 in self.parameters.items():
+        oprot.writeString(kiter76)
+        oprot.writeString(viter77)
       oprot.writeMapEnd()
       oprot.writeFieldEnd()
+    if self.privileges != None:
+      oprot.writeFieldBegin('privileges', TType.STRUCT, 5)
+      self.privileges.write(oprot)
+      oprot.writeFieldEnd()
     oprot.writeFieldStop()
     oprot.writeStructEnd()
     def validate(self):
@@ -422,11 +1085,11 @@ class SerDeInfo:
       elif fid == 3:
         if ftype == TType.MAP:
           self.parameters = {}
-          (_ktype17, _vtype18, _size16 ) = iprot.readMapBegin() 
-          for _i20 in xrange(_size16):
-            _key21 = iprot.readString();
-            _val22 = iprot.readString();
-            self.parameters[_key21] = _val22
+          (_ktype79, _vtype80, _size78 ) = iprot.readMapBegin() 
+          for _i82 in xrange(_size78):
+            _key83 = iprot.readString();
+            _val84 = iprot.readString();
+            self.parameters[_key83] = _val84
           iprot.readMapEnd()
         else:
           iprot.skip(ftype)
@@ -451,9 +1114,9 @@ class SerDeInfo:
     if self.parameters != None:
       oprot.writeFieldBegin('parameters', TType.MAP, 3)
       oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.parameters))
-      for kiter23,viter24 in self.parameters.items():
-        oprot.writeString(kiter23)
-        oprot.writeString(viter24)
+      for kiter85,viter86 in self.parameters.items():
+        oprot.writeString(kiter85)
+        oprot.writeString(viter86)
       oprot.writeMapEnd()
       oprot.writeFieldEnd()
     oprot.writeFieldStop()
@@ -597,11 +1260,11 @@ class StorageDescriptor:
       if fid == 1:
         if ftype == TType.LIST:
           self.cols = []
-          (_etype28, _size25) = iprot.readListBegin()
-          for _i29 in xrange(_size25):
-            _elem30 = FieldSchema()
-            _elem30.read(iprot)
-            self.cols.append(_elem30)
+          (_etype90, _size87) = iprot.readListBegin()
+          for _i91 in xrange(_size87):
+            _elem92 = FieldSchema()
+            _elem92.read(iprot)
+            self.cols.append(_elem92)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
@@ -639,32 +1302,32 @@ class StorageDescriptor:
       elif fid == 8:
         if ftype == TType.LIST:
           self.bucketCols = []
-          (_etype34, _size31) = iprot.readListBegin()
-          for _i35 in xrange(_size31):
-            _elem36 = iprot.readString();
-            self.bucketCols.append(_elem36)
+          (_etype96, _size93) = iprot.readListBegin()
+          for _i97 in xrange(_size93):
+            _elem98 = iprot.readString();
+            self.bucketCols.append(_elem98)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
       elif fid == 9:
         if ftype == TType.LIST:
           self.sortCols = []
-          (_etype40, _size37) = iprot.readListBegin()
-          for _i41 in xrange(_size37):
-            _elem42 = Order()
-            _elem42.read(iprot)
-            self.sortCols.append(_elem42)
+          (_etype102, _size99) = iprot.readListBegin()
+          for _i103 in xrange(_size99):
+            _elem104 = Order()
+            _elem104.read(iprot)
+            self.sortCols.append(_elem104)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
       elif fid == 10:
         if ftype == TType.MAP:
           self.parameters = {}
-          (_ktype44, _vtype45, _size43 ) = iprot.readMapBegin() 
-          for _i47 in xrange(_size43):
-            _key48 = iprot.readString();
-            _val49 = iprot.readString();
-            self.parameters[_key48] = _val49
+          (_ktype106, _vtype107, _size105 ) = iprot.readMapBegin() 
+          for _i109 in xrange(_size105):
+            _key110 = iprot.readString();
+            _val111 = iprot.readString();
+            self.parameters[_key110] = _val111
           iprot.readMapEnd()
         else:
           iprot.skip(ftype)
@@ -681,8 +1344,8 @@ class StorageDescriptor:
     if self.cols != None:
       oprot.writeFieldBegin('cols', TType.LIST, 1)
       oprot.writeListBegin(TType.STRUCT, len(self.cols))
-      for iter50 in self.cols:
-        iter50.write(oprot)
+      for iter112 in self.cols:
+        iter112.write(oprot)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     if self.location != None:
@@ -712,23 +1375,23 @@ class StorageDescriptor:
     if self.bucketCols != None:
       oprot.writeFieldBegin('bucketCols', TType.LIST, 8)
       oprot.writeListBegin(TType.STRING, len(self.bucketCols))
-      for iter51 in self.bucketCols:
-        oprot.writeString(iter51)
+      for iter113 in self.bucketCols:
+        oprot.writeString(iter113)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     if self.sortCols != None:
       oprot.writeFieldBegin('sortCols', TType.LIST, 9)
       oprot.writeListBegin(TType.STRUCT, len(self.sortCols))
-      for iter52 in self.sortCols:
-        iter52.write(oprot)
+      for iter114 in self.sortCols:
+        iter114.write(oprot)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     if self.parameters != None:
       oprot.writeFieldBegin('parameters', TType.MAP, 10)
       oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.parameters))
-      for kiter53,viter54 in self.parameters.items():
-        oprot.writeString(kiter53)
-        oprot.writeString(viter54)
+      for kiter115,viter116 in self.parameters.items():
+        oprot.writeString(kiter115)
+        oprot.writeString(viter116)
       oprot.writeMapEnd()
       oprot.writeFieldEnd()
     oprot.writeFieldStop()
@@ -763,6 +1426,7 @@ class Table:
    - viewOriginalText
    - viewExpandedText
    - tableType
+   - privileges
   """
 
   thrift_spec = (
@@ -779,9 +1443,10 @@ class Table:
     (10, TType.STRING, 'viewOriginalText', None, None, ), # 10
     (11, TType.STRING, 'viewExpandedText', None, None, ), # 11
     (12, TType.STRING, 'tableType', None, None, ), # 12
+    (13, TType.STRUCT, 'privileges', (PrincipalPrivilegeSet, PrincipalPrivilegeSet.thrift_spec), None, ), # 13
   )
 
-  def __init__(self, tableName=None, dbName=None, owner=None, createTime=None, lastAccessTime=None, retention=None, sd=None, partitionKeys=None, parameters=None, viewOriginalText=None, viewExpandedText=None, tableType=None,):
+  def __init__(self, tableName=None, dbName=None, owner=None, createTime=None, lastAccessTime=None, retention=None, sd=None, partitionKeys=None, parameters=None, viewOriginalText=None, viewExpandedText=None, tableType=None, privileges=None,):
     self.tableName = tableName
     self.dbName = dbName
     self.owner = owner
@@ -794,6 +1459,7 @@ class Table:
     self.viewOriginalText = viewOriginalText
     self.viewExpandedText = viewExpandedText
     self.tableType = tableType
+    self.privileges = privileges
 
   def read(self, iprot):
     if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
@@ -843,22 +1509,22 @@ class Table:
       elif fid == 8:
         if ftype == TType.LIST:
           self.partitionKeys = []
-          (_etype58, _size55) = iprot.readListBegin()
-          for _i59 in xrange(_size55):
-            _elem60 = FieldSchema()
-            _elem60.read(iprot)
-            self.partitionKeys.append(_elem60)
+          (_etype120, _size117) = iprot.readListBegin()
+          for _i121 in xrange(_size117):
+            _elem122 = FieldSchema()
+            _elem122.read(iprot)
+            self.partitionKeys.append(_elem122)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
       elif fid == 9:
         if ftype == TType.MAP:
           self.parameters = {}
-          (_ktype62, _vtype63, _size61 ) = iprot.readMapBegin() 
-          for _i65 in xrange(_size61):
-            _key66 = iprot.readString();
-            _val67 = iprot.readString();
-            self.parameters[_key66] = _val67
+          (_ktype124, _vtype125, _size123 ) = iprot.readMapBegin() 
+          for _i127 in xrange(_size123):
+            _key128 = iprot.readString();
+            _val129 = iprot.readString();
+            self.parameters[_key128] = _val129
           iprot.readMapEnd()
         else:
           iprot.skip(ftype)
@@ -877,6 +1543,12 @@ class Table:
           self.tableType = iprot.readString();
         else:
           iprot.skip(ftype)
+      elif fid == 13:
+        if ftype == TType.STRUCT:
+          self.privileges = PrincipalPrivilegeSet()
+          self.privileges.read(iprot)
+        else:
+          iprot.skip(ftype)
       else:
         iprot.skip(ftype)
       iprot.readFieldEnd()
@@ -918,16 +1590,16 @@ class Table:
     if self.partitionKeys != None:
       oprot.writeFieldBegin('partitionKeys', TType.LIST, 8)
       oprot.writeListBegin(TType.STRUCT, len(self.partitionKeys))
-      for iter68 in self.partitionKeys:
-        iter68.write(oprot)
+      for iter130 in self.partitionKeys:
+        iter130.write(oprot)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     if self.parameters != None:
       oprot.writeFieldBegin('parameters', TType.MAP, 9)
       oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.parameters))
-      for kiter69,viter70 in self.parameters.items():
-        oprot.writeString(kiter69)
-        oprot.writeString(viter70)
+      for kiter131,viter132 in self.parameters.items():
+        oprot.writeString(kiter131)
+        oprot.writeString(viter132)
       oprot.writeMapEnd()
       oprot.writeFieldEnd()
     if self.viewOriginalText != None:
@@ -942,6 +1614,10 @@ class Table:
       oprot.writeFieldBegin('tableType', TType.STRING, 12)
       oprot.writeString(self.tableType)
       oprot.writeFieldEnd()
+    if self.privileges != None:
+      oprot.writeFieldBegin('privileges', TType.STRUCT, 13)
+      self.privileges.write(oprot)
+      oprot.writeFieldEnd()
     oprot.writeFieldStop()
     oprot.writeStructEnd()
     def validate(self):
@@ -969,6 +1645,7 @@ class Partition:
    - lastAccessTime
    - sd
    - parameters
+   - privileges
   """
 
   thrift_spec = (
@@ -980,9 +1657,10 @@ class Partition:
     (5, TType.I32, 'lastAccessTime', None, None, ), # 5
     (6, TType.STRUCT, 'sd', (StorageDescriptor, StorageDescriptor.thrift_spec), None, ), # 6
     (7, TType.MAP, 'parameters', (TType.STRING,None,TType.STRING,None), None, ), # 7
+    (8, TType.STRUCT, 'privileges', (PrincipalPrivilegeSet, PrincipalPrivilegeSet.thrift_spec), None, ), # 8
   )
 
-  def __init__(self, values=None, dbName=None, tableName=None, createTime=None, lastAccessTime=None, sd=None, parameters=None,):
+  def __init__(self, values=None, dbName=None, tableName=None, createTime=None, lastAccessTime=None, sd=None, parameters=None, privileges=None,):
     self.values = values
     self.dbName = dbName
     self.tableName = tableName
@@ -990,6 +1668,7 @@ class Partition:
     self.lastAccessTime = lastAccessTime
     self.sd = sd
     self.parameters = parameters
+    self.privileges = privileges
 
   def read(self, iprot):
     if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
@@ -1003,10 +1682,10 @@ class Partition:
       if fid == 1:
         if ftype == TType.LIST:
           self.values = []
-          (_etype74, _size71) = iprot.readListBegin()
-          for _i75 in xrange(_size71):
-            _elem76 = iprot.readString();
-            self.values.append(_elem76)
+          (_etype136, _size133) = iprot.readListBegin()
+          for _i137 in xrange(_size133):
+            _elem138 = iprot.readString();
+            self.values.append(_elem138)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
@@ -1039,14 +1718,20 @@ class Partition:
       elif fid == 7:
         if ftype == TType.MAP:
           self.parameters = {}
-          (_ktype78, _vtype79, _size77 ) = iprot.readMapBegin() 
-          for _i81 in xrange(_size77):
-            _key82 = iprot.readString();
-            _val83 = iprot.readString();
-            self.parameters[_key82] = _val83
+          (_ktype140, _vtype141, _size139 ) = iprot.readMapBegin() 
+          for _i143 in xrange(_size139):
+            _key144 = iprot.readString();
+            _val145 = iprot.readString();
+            self.parameters[_key144] = _val145
           iprot.readMapEnd()
         else:
           iprot.skip(ftype)
+      elif fid == 8:
+        if ftype == TType.STRUCT:
+          self.privileges = PrincipalPrivilegeSet()
+          self.privileges.read(iprot)
+        else:
+          iprot.skip(ftype)
       else:
         iprot.skip(ftype)
       iprot.readFieldEnd()
@@ -1060,8 +1745,8 @@ class Partition:
     if self.values != None:
       oprot.writeFieldBegin('values', TType.LIST, 1)
       oprot.writeListBegin(TType.STRING, len(self.values))
-      for iter84 in self.values:
-        oprot.writeString(iter84)
+      for iter146 in self.values:
+        oprot.writeString(iter146)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     if self.dbName != None:
@@ -1087,11 +1772,15 @@ class Partition:
     if self.parameters != None:
       oprot.writeFieldBegin('parameters', TType.MAP, 7)
       oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.parameters))
-      for kiter85,viter86 in self.parameters.items():
-        oprot.writeString(kiter85)
-        oprot.writeString(viter86)
+      for kiter147,viter148 in self.parameters.items():
+        oprot.writeString(kiter147)
+        oprot.writeString(viter148)
       oprot.writeMapEnd()
       oprot.writeFieldEnd()
+    if self.privileges != None:
+      oprot.writeFieldBegin('privileges', TType.STRUCT, 8)
+      self.privileges.write(oprot)
+      oprot.writeFieldEnd()
     oprot.writeFieldStop()
     oprot.writeStructEnd()
     def validate(self):
@@ -1203,11 +1892,11 @@ class Index:
       elif fid == 9:
         if ftype == TType.MAP:
           self.parameters = {}
-          (_ktype88, _vtype89, _size87 ) = iprot.readMapBegin() 
-          for _i91 in xrange(_size87):
-            _key92 = iprot.readString();
-            _val93 = iprot.readString();
-            self.parameters[_key92] = _val93
+          (_ktype150, _vtype151, _size149 ) = iprot.readMapBegin() 
+          for _i153 in xrange(_size149):
+            _key154 = iprot.readString();
+            _val155 = iprot.readString();
+            self.parameters[_key154] = _val155
           iprot.readMapEnd()
         else:
           iprot.skip(ftype)
@@ -1261,9 +1950,9 @@ class Index:
     if self.parameters != None:
       oprot.writeFieldBegin('parameters', TType.MAP, 9)
       oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.parameters))
-      for kiter94,viter95 in self.parameters.items():
-        oprot.writeString(kiter94)
-        oprot.writeString(viter95)
+      for kiter156,viter157 in self.parameters.items():
+        oprot.writeString(kiter156)
+        oprot.writeString(viter157)
       oprot.writeMapEnd()
       oprot.writeFieldEnd()
     if self.deferredRebuild != None:
@@ -1316,22 +2005,22 @@ class Schema:
       if fid == 1:
         if ftype == TType.LIST:
           self.fieldSchemas = []
-          (_etype99, _size96) = iprot.readListBegin()
-          for _i100 in xrange(_size96):
-            _elem101 = FieldSchema()
-            _elem101.read(iprot)
-            self.fieldSchemas.append(_elem101)
+          (_etype161, _size158) = iprot.readListBegin()
+          for _i162 in xrange(_size158):
+            _elem163 = FieldSchema()
+            _elem163.read(iprot)
+            self.fieldSchemas.append(_elem163)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
       elif fid == 2:
         if ftype == TType.MAP:
           self.properties = {}
-          (_ktype103, _vtype104, _size102 ) = iprot.readMapBegin() 
-          for _i106 in xrange(_size102):
-            _key107 = iprot.readString();
-            _val108 = iprot.readString();
-            self.properties[_key107] = _val108
+          (_ktype165, _vtype166, _size164 ) = iprot.readMapBegin() 
+          for _i168 in xrange(_size164):
+            _key169 = iprot.readString();
+            _val170 = iprot.readString();
+            self.properties[_key169] = _val170
           iprot.readMapEnd()
         else:
           iprot.skip(ftype)
@@ -1348,16 +2037,16 @@ class Schema:
     if self.fieldSchemas != None:
       oprot.writeFieldBegin('fieldSchemas', TType.LIST, 1)
       oprot.writeListBegin(TType.STRUCT, len(self.fieldSchemas))
-      for iter109 in self.fieldSchemas:
-        iter109.write(oprot)
+      for iter171 in self.fieldSchemas:
+        iter171.write(oprot)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     if self.properties != None:
       oprot.writeFieldBegin('properties', TType.MAP, 2)
       oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.properties))
-      for kiter110,viter111 in self.properties.items():
-        oprot.writeString(kiter110)
-        oprot.writeString(viter111)
+      for kiter172,viter173 in self.properties.items():
+        oprot.writeString(kiter172)
+        oprot.writeString(viter173)
       oprot.writeMapEnd()
       oprot.writeFieldEnd()
     oprot.writeFieldStop()

Modified: hive/trunk/metastore/src/gen/thrift/gen-rb/hive_metastore_types.rb
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/gen/thrift/gen-rb/hive_metastore_types.rb?rev=1057999&r1=1057998&r2=1057999&view=diff
==============================================================================
--- hive/trunk/metastore/src/gen/thrift/gen-rb/hive_metastore_types.rb (original)
+++ hive/trunk/metastore/src/gen/thrift/gen-rb/hive_metastore_types.rb Wed Jan 12 06:58:04 2011
@@ -7,6 +7,24 @@
 require 'fb303_types'
 
 
+module HiveObjectType
+  GLOBAL = 1
+  DATABASE = 2
+  TABLE = 3
+  PARTITION = 4
+  COLUMN = 5
+  VALUE_MAP = {1 => "GLOBAL", 2 => "DATABASE", 3 => "TABLE", 4 => "PARTITION", 5 => "COLUMN"}
+  VALID_VALUES = Set.new([GLOBAL, DATABASE, TABLE, PARTITION, COLUMN]).freeze
+end
+
+module PrincipalType
+  USER = 1
+  ROLE = 2
+  GROUP = 3
+  VALUE_MAP = {1 => "USER", 2 => "ROLE", 3 => "GROUP"}
+  VALID_VALUES = Set.new([USER, ROLE, GROUP]).freeze
+end
+
 class Version
   include ::Thrift::Struct, ::Thrift::Struct_Union
   VERSION = 1
@@ -67,18 +85,155 @@ class Type
   ::Thrift::Struct.generate_accessors self
 end
 
+class HiveObjectRef
+  include ::Thrift::Struct, ::Thrift::Struct_Union
+  OBJECTTYPE = 1
+  DBNAME = 2
+  OBJECTNAME = 3
+  PARTVALUES = 4
+  COLUMNNAME = 5
+
+  FIELDS = {
+    OBJECTTYPE => {:type => ::Thrift::Types::I32, :name => 'objectType', :enum_class => HiveObjectType},
+    DBNAME => {:type => ::Thrift::Types::STRING, :name => 'dbName'},
+    OBJECTNAME => {:type => ::Thrift::Types::STRING, :name => 'objectName'},
+    PARTVALUES => {:type => ::Thrift::Types::LIST, :name => 'partValues', :element => {:type => ::Thrift::Types::STRING}},
+    COLUMNNAME => {:type => ::Thrift::Types::STRING, :name => 'columnName'}
+  }
+
+  def struct_fields; FIELDS; end
+
+  def validate
+    unless @objectType.nil? || HiveObjectType::VALID_VALUES.include?(@objectType)
+      raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field objectType!')
+    end
+  end
+
+  ::Thrift::Struct.generate_accessors self
+end
+
+class PrivilegeGrantInfo
+  include ::Thrift::Struct, ::Thrift::Struct_Union
+  PRIVILEGE = 1
+  CREATETIME = 2
+  GRANTOR = 3
+  GRANTORTYPE = 4
+  GRANTOPTION = 5
+
+  FIELDS = {
+    PRIVILEGE => {:type => ::Thrift::Types::STRING, :name => 'privilege'},
+    CREATETIME => {:type => ::Thrift::Types::I32, :name => 'createTime'},
+    GRANTOR => {:type => ::Thrift::Types::STRING, :name => 'grantor'},
+    GRANTORTYPE => {:type => ::Thrift::Types::I32, :name => 'grantorType', :enum_class => PrincipalType},
+    GRANTOPTION => {:type => ::Thrift::Types::BOOL, :name => 'grantOption'}
+  }
+
+  def struct_fields; FIELDS; end
+
+  def validate
+    unless @grantorType.nil? || PrincipalType::VALID_VALUES.include?(@grantorType)
+      raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field grantorType!')
+    end
+  end
+
+  ::Thrift::Struct.generate_accessors self
+end
+
+class HiveObjectPrivilege
+  include ::Thrift::Struct, ::Thrift::Struct_Union
+  HIVEOBJECT = 1
+  PRINCIPALNAME = 2
+  PRINCIPALTYPE = 3
+  GRANTINFO = 4
+
+  FIELDS = {
+    HIVEOBJECT => {:type => ::Thrift::Types::STRUCT, :name => 'hiveObject', :class => HiveObjectRef},
+    PRINCIPALNAME => {:type => ::Thrift::Types::STRING, :name => 'principalName'},
+    PRINCIPALTYPE => {:type => ::Thrift::Types::I32, :name => 'principalType', :enum_class => PrincipalType},
+    GRANTINFO => {:type => ::Thrift::Types::STRUCT, :name => 'grantInfo', :class => PrivilegeGrantInfo}
+  }
+
+  def struct_fields; FIELDS; end
+
+  def validate
+    unless @principalType.nil? || PrincipalType::VALID_VALUES.include?(@principalType)
+      raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field principalType!')
+    end
+  end
+
+  ::Thrift::Struct.generate_accessors self
+end
+
+class PrivilegeBag
+  include ::Thrift::Struct, ::Thrift::Struct_Union
+  PRIVILEGES = 1
+
+  FIELDS = {
+    PRIVILEGES => {:type => ::Thrift::Types::LIST, :name => 'privileges', :element => {:type => ::Thrift::Types::STRUCT, :class => HiveObjectPrivilege}}
+  }
+
+  def struct_fields; FIELDS; end
+
+  def validate
+  end
+
+  ::Thrift::Struct.generate_accessors self
+end
+
+class PrincipalPrivilegeSet
+  include ::Thrift::Struct, ::Thrift::Struct_Union
+  USERPRIVILEGES = 1
+  GROUPPRIVILEGES = 2
+  ROLEPRIVILEGES = 3
+
+  FIELDS = {
+    USERPRIVILEGES => {:type => ::Thrift::Types::MAP, :name => 'userPrivileges', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::LIST, :element => {:type => ::Thrift::Types::STRUCT, :class => PrivilegeGrantInfo}}},
+    GROUPPRIVILEGES => {:type => ::Thrift::Types::MAP, :name => 'groupPrivileges', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::LIST, :element => {:type => ::Thrift::Types::STRUCT, :class => PrivilegeGrantInfo}}},
+    ROLEPRIVILEGES => {:type => ::Thrift::Types::MAP, :name => 'rolePrivileges', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::LIST, :element => {:type => ::Thrift::Types::STRUCT, :class => PrivilegeGrantInfo}}}
+  }
+
+  def struct_fields; FIELDS; end
+
+  def validate
+  end
+
+  ::Thrift::Struct.generate_accessors self
+end
+
+class Role
+  include ::Thrift::Struct, ::Thrift::Struct_Union
+  ROLENAME = 1
+  CREATETIME = 2
+  OWNERNAME = 3
+
+  FIELDS = {
+    ROLENAME => {:type => ::Thrift::Types::STRING, :name => 'roleName'},
+    CREATETIME => {:type => ::Thrift::Types::I32, :name => 'createTime'},
+    OWNERNAME => {:type => ::Thrift::Types::STRING, :name => 'ownerName'}
+  }
+
+  def struct_fields; FIELDS; end
+
+  def validate
+  end
+
+  ::Thrift::Struct.generate_accessors self
+end
+
 class Database
   include ::Thrift::Struct, ::Thrift::Struct_Union
   NAME = 1
   DESCRIPTION = 2
   LOCATIONURI = 3
   PARAMETERS = 4
+  PRIVILEGES = 5
 
   FIELDS = {
     NAME => {:type => ::Thrift::Types::STRING, :name => 'name'},
     DESCRIPTION => {:type => ::Thrift::Types::STRING, :name => 'description'},
     LOCATIONURI => {:type => ::Thrift::Types::STRING, :name => 'locationUri'},
-    PARAMETERS => {:type => ::Thrift::Types::MAP, :name => 'parameters', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}}
+    PARAMETERS => {:type => ::Thrift::Types::MAP, :name => 'parameters', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}},
+    PRIVILEGES => {:type => ::Thrift::Types::STRUCT, :name => 'privileges', :class => PrincipalPrivilegeSet, :optional => true}
   }
 
   def struct_fields; FIELDS; end
@@ -175,6 +330,7 @@ class Table
   VIEWORIGINALTEXT = 10
   VIEWEXPANDEDTEXT = 11
   TABLETYPE = 12
+  PRIVILEGES = 13
 
   FIELDS = {
     TABLENAME => {:type => ::Thrift::Types::STRING, :name => 'tableName'},
@@ -188,7 +344,8 @@ class Table
     PARAMETERS => {:type => ::Thrift::Types::MAP, :name => 'parameters', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}},
     VIEWORIGINALTEXT => {:type => ::Thrift::Types::STRING, :name => 'viewOriginalText'},
     VIEWEXPANDEDTEXT => {:type => ::Thrift::Types::STRING, :name => 'viewExpandedText'},
-    TABLETYPE => {:type => ::Thrift::Types::STRING, :name => 'tableType'}
+    TABLETYPE => {:type => ::Thrift::Types::STRING, :name => 'tableType'},
+    PRIVILEGES => {:type => ::Thrift::Types::STRUCT, :name => 'privileges', :class => PrincipalPrivilegeSet, :optional => true}
   }
 
   def struct_fields; FIELDS; end
@@ -208,6 +365,7 @@ class Partition
   LASTACCESSTIME = 5
   SD = 6
   PARAMETERS = 7
+  PRIVILEGES = 8
 
   FIELDS = {
     VALUES => {:type => ::Thrift::Types::LIST, :name => 'values', :element => {:type => ::Thrift::Types::STRING}},
@@ -216,7 +374,8 @@ class Partition
     CREATETIME => {:type => ::Thrift::Types::I32, :name => 'createTime'},
     LASTACCESSTIME => {:type => ::Thrift::Types::I32, :name => 'lastAccessTime'},
     SD => {:type => ::Thrift::Types::STRUCT, :name => 'sd', :class => StorageDescriptor},
-    PARAMETERS => {:type => ::Thrift::Types::MAP, :name => 'parameters', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}}
+    PARAMETERS => {:type => ::Thrift::Types::MAP, :name => 'parameters', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}},
+    PRIVILEGES => {:type => ::Thrift::Types::STRUCT, :name => 'privileges', :class => PrincipalPrivilegeSet, :optional => true}
   }
 
   def struct_fields; FIELDS; end



Mime
View raw message