Repository: hive Updated Branches: refs/heads/master f4a12a561 -> 32b7abac9
http://git-wip-us.apache.org/repos/asf/hive/blob/32b7abac/standalone-metastore/src/gen/thrift/gen-php/metastore/Types.php ---------------------------------------------------------------------- diff --git a/standalone-metastore/src/gen/thrift/gen-php/metastore/Types.php b/standalone-metastore/src/gen/thrift/gen-php/metastore/Types.php index 8cf9e33..f2d8826 100644 --- a/standalone-metastore/src/gen/thrift/gen-php/metastore/Types.php +++ b/standalone-metastore/src/gen/thrift/gen-php/metastore/Types.php @@ -20430,6 +20430,628 @@ class TableMeta { } +class WMResourcePlan { + static $_TSPEC; + + /** + * @var string + */ + public $name = null; + /** + * @var string + */ + public $status = null; + /** + * @var int + */ + public $queryParallelism = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'name', + 'type' => TType::STRING, + ), + 2 => array( + 'var' => 'status', + 'type' => TType::STRING, + ), + 3 => array( + 'var' => 'queryParallelism', + 'type' => TType::I32, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['name'])) { + $this->name = $vals['name']; + } + if (isset($vals['status'])) { + $this->status = $vals['status']; + } + if (isset($vals['queryParallelism'])) { + $this->queryParallelism = $vals['queryParallelism']; + } + } + } + + public function getName() { + return 'WMResourcePlan'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->status); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::I32) { + $xfer += $input->readI32($this->queryParallelism); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('WMResourcePlan'); + if ($this->name !== null) { + $xfer += $output->writeFieldBegin('name', TType::STRING, 1); + $xfer += $output->writeString($this->name); + $xfer += $output->writeFieldEnd(); + } + if ($this->status !== null) { + $xfer += $output->writeFieldBegin('status', TType::STRING, 2); + $xfer += $output->writeString($this->status); + $xfer += $output->writeFieldEnd(); + } + if ($this->queryParallelism !== null) { + $xfer += $output->writeFieldBegin('queryParallelism', TType::I32, 3); + $xfer += $output->writeI32($this->queryParallelism); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class WMPool { + static $_TSPEC; + + /** + * @var string + */ + public $resourcePlanName = null; + /** + * @var string + */ + public $poolName = null; + /** + * @var string + */ + public $parentPoolName = null; + /** + * @var double + */ + public $allocFraction = null; + /** + * @var int + */ + public $queryParallelism = null; + /** + * @var string + */ + public $schedulingPolicy = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'resourcePlanName', + 'type' => TType::STRING, + ), + 2 => array( + 'var' => 'poolName', + 'type' => TType::STRING, + ), + 3 => array( + 'var' => 'parentPoolName', + 'type' => TType::STRING, + ), + 4 => array( + 'var' => 'allocFraction', + 'type' => TType::DOUBLE, + ), + 5 => array( + 'var' => 'queryParallelism', + 'type' => TType::I32, + ), + 6 => array( + 'var' => 'schedulingPolicy', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['resourcePlanName'])) { + $this->resourcePlanName = $vals['resourcePlanName']; + } + if (isset($vals['poolName'])) { + $this->poolName = $vals['poolName']; + } + if (isset($vals['parentPoolName'])) { + $this->parentPoolName = $vals['parentPoolName']; + } + if (isset($vals['allocFraction'])) { + $this->allocFraction = $vals['allocFraction']; + } + if (isset($vals['queryParallelism'])) { + $this->queryParallelism = $vals['queryParallelism']; + } + if (isset($vals['schedulingPolicy'])) { + $this->schedulingPolicy = $vals['schedulingPolicy']; + } + } + } + + public function getName() { + return 'WMPool'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->resourcePlanName); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->poolName); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->parentPoolName); + } else { + $xfer += $input->skip($ftype); + } + break; + case 4: + if ($ftype == TType::DOUBLE) { + $xfer += $input->readDouble($this->allocFraction); + } else { + $xfer += $input->skip($ftype); + } + break; + case 5: + if ($ftype == TType::I32) { + $xfer += $input->readI32($this->queryParallelism); + } else { + $xfer += $input->skip($ftype); + } + break; + case 6: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->schedulingPolicy); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('WMPool'); + if ($this->resourcePlanName !== null) { + $xfer += $output->writeFieldBegin('resourcePlanName', TType::STRING, 1); + $xfer += $output->writeString($this->resourcePlanName); + $xfer += $output->writeFieldEnd(); + } + if ($this->poolName !== null) { + $xfer += $output->writeFieldBegin('poolName', TType::STRING, 2); + $xfer += $output->writeString($this->poolName); + $xfer += $output->writeFieldEnd(); + } + if ($this->parentPoolName !== null) { + $xfer += $output->writeFieldBegin('parentPoolName', TType::STRING, 3); + $xfer += $output->writeString($this->parentPoolName); + $xfer += $output->writeFieldEnd(); + } + if ($this->allocFraction !== null) { + $xfer += $output->writeFieldBegin('allocFraction', TType::DOUBLE, 4); + $xfer += $output->writeDouble($this->allocFraction); + $xfer += $output->writeFieldEnd(); + } + if ($this->queryParallelism !== null) { + $xfer += $output->writeFieldBegin('queryParallelism', TType::I32, 5); + $xfer += $output->writeI32($this->queryParallelism); + $xfer += $output->writeFieldEnd(); + } + if ($this->schedulingPolicy !== null) { + $xfer += $output->writeFieldBegin('schedulingPolicy', TType::STRING, 6); + $xfer += $output->writeString($this->schedulingPolicy); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class WMTrigger { + static $_TSPEC; + + /** + * @var string + */ + public $resourcePlanName = null; + /** + * @var string + */ + public $poolName = null; + /** + * @var string + */ + public $triggerExpression = null; + /** + * @var string + */ + public $actionExpression = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'resourcePlanName', + 'type' => TType::STRING, + ), + 2 => array( + 'var' => 'poolName', + 'type' => TType::STRING, + ), + 3 => array( + 'var' => 'triggerExpression', + 'type' => TType::STRING, + ), + 4 => array( + 'var' => 'actionExpression', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['resourcePlanName'])) { + $this->resourcePlanName = $vals['resourcePlanName']; + } + if (isset($vals['poolName'])) { + $this->poolName = $vals['poolName']; + } + if (isset($vals['triggerExpression'])) { + $this->triggerExpression = $vals['triggerExpression']; + } + if (isset($vals['actionExpression'])) { + $this->actionExpression = $vals['actionExpression']; + } + } + } + + public function getName() { + return 'WMTrigger'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->resourcePlanName); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->poolName); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->triggerExpression); + } else { + $xfer += $input->skip($ftype); + } + break; + case 4: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->actionExpression); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('WMTrigger'); + if ($this->resourcePlanName !== null) { + $xfer += $output->writeFieldBegin('resourcePlanName', TType::STRING, 1); + $xfer += $output->writeString($this->resourcePlanName); + $xfer += $output->writeFieldEnd(); + } + if ($this->poolName !== null) { + $xfer += $output->writeFieldBegin('poolName', TType::STRING, 2); + $xfer += $output->writeString($this->poolName); + $xfer += $output->writeFieldEnd(); + } + if ($this->triggerExpression !== null) { + $xfer += $output->writeFieldBegin('triggerExpression', TType::STRING, 3); + $xfer += $output->writeString($this->triggerExpression); + $xfer += $output->writeFieldEnd(); + } + if ($this->actionExpression !== null) { + $xfer += $output->writeFieldBegin('actionExpression', TType::STRING, 4); + $xfer += $output->writeString($this->actionExpression); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class WMMapping { + static $_TSPEC; + + /** + * @var string + */ + public $resourcePlanName = null; + /** + * @var string + */ + public $entityType = null; + /** + * @var string + */ + public $entityName = null; + /** + * @var string + */ + public $poolName = null; + /** + * @var int + */ + public $ordering = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'resourcePlanName', + 'type' => TType::STRING, + ), + 2 => array( + 'var' => 'entityType', + 'type' => TType::STRING, + ), + 3 => array( + 'var' => 'entityName', + 'type' => TType::STRING, + ), + 4 => array( + 'var' => 'poolName', + 'type' => TType::STRING, + ), + 5 => array( + 'var' => 'ordering', + 'type' => TType::I32, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['resourcePlanName'])) { + $this->resourcePlanName = $vals['resourcePlanName']; + } + if (isset($vals['entityType'])) { + $this->entityType = $vals['entityType']; + } + if (isset($vals['entityName'])) { + $this->entityName = $vals['entityName']; + } + if (isset($vals['poolName'])) { + $this->poolName = $vals['poolName']; + } + if (isset($vals['ordering'])) { + $this->ordering = $vals['ordering']; + } + } + } + + public function getName() { + return 'WMMapping'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->resourcePlanName); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->entityType); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->entityName); + } else { + $xfer += $input->skip($ftype); + } + break; + case 4: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->poolName); + } else { + $xfer += $input->skip($ftype); + } + break; + case 5: + if ($ftype == TType::I32) { + $xfer += $input->readI32($this->ordering); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('WMMapping'); + if ($this->resourcePlanName !== null) { + $xfer += $output->writeFieldBegin('resourcePlanName', TType::STRING, 1); + $xfer += $output->writeString($this->resourcePlanName); + $xfer += $output->writeFieldEnd(); + } + if ($this->entityType !== null) { + $xfer += $output->writeFieldBegin('entityType', TType::STRING, 2); + $xfer += $output->writeString($this->entityType); + $xfer += $output->writeFieldEnd(); + } + if ($this->entityName !== null) { + $xfer += $output->writeFieldBegin('entityName', TType::STRING, 3); + $xfer += $output->writeString($this->entityName); + $xfer += $output->writeFieldEnd(); + } + if ($this->poolName !== null) { + $xfer += $output->writeFieldBegin('poolName', TType::STRING, 4); + $xfer += $output->writeString($this->poolName); + $xfer += $output->writeFieldEnd(); + } + if ($this->ordering !== null) { + $xfer += $output->writeFieldBegin('ordering', TType::I32, 5); + $xfer += $output->writeI32($this->ordering); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + class MetaException extends TException { static $_TSPEC; http://git-wip-us.apache.org/repos/asf/hive/blob/32b7abac/standalone-metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py ---------------------------------------------------------------------- diff --git a/standalone-metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py b/standalone-metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py index c67a781..1ee7fe7 100644 --- a/standalone-metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py +++ b/standalone-metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py @@ -14402,6 +14402,464 @@ class TableMeta: def __ne__(self, other): return not (self == other) +class WMResourcePlan: + """ + Attributes: + - name + - status + - queryParallelism + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'name', None, None, ), # 1 + (2, TType.STRING, 'status', None, None, ), # 2 + (3, TType.I32, 'queryParallelism', None, None, ), # 3 + ) + + def __init__(self, name=None, status=None, queryParallelism=None,): + self.name = name + self.status = status + self.queryParallelism = queryParallelism + + 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.name = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.status = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.I32: + self.queryParallelism = iprot.readI32() + 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('WMResourcePlan') + if self.name is not None: + oprot.writeFieldBegin('name', TType.STRING, 1) + oprot.writeString(self.name) + oprot.writeFieldEnd() + if self.status is not None: + oprot.writeFieldBegin('status', TType.STRING, 2) + oprot.writeString(self.status) + oprot.writeFieldEnd() + if self.queryParallelism is not None: + oprot.writeFieldBegin('queryParallelism', TType.I32, 3) + oprot.writeI32(self.queryParallelism) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.name is None: + raise TProtocol.TProtocolException(message='Required field name is unset!') + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.name) + value = (value * 31) ^ hash(self.status) + value = (value * 31) ^ hash(self.queryParallelism) + return value + + 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 WMPool: + """ + Attributes: + - resourcePlanName + - poolName + - parentPoolName + - allocFraction + - queryParallelism + - schedulingPolicy + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'resourcePlanName', None, None, ), # 1 + (2, TType.STRING, 'poolName', None, None, ), # 2 + (3, TType.STRING, 'parentPoolName', None, None, ), # 3 + (4, TType.DOUBLE, 'allocFraction', None, None, ), # 4 + (5, TType.I32, 'queryParallelism', None, None, ), # 5 + (6, TType.STRING, 'schedulingPolicy', None, None, ), # 6 + ) + + def __init__(self, resourcePlanName=None, poolName=None, parentPoolName=None, allocFraction=None, queryParallelism=None, schedulingPolicy=None,): + self.resourcePlanName = resourcePlanName + self.poolName = poolName + self.parentPoolName = parentPoolName + self.allocFraction = allocFraction + self.queryParallelism = queryParallelism + self.schedulingPolicy = schedulingPolicy + + 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.resourcePlanName = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.poolName = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.parentPoolName = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.DOUBLE: + self.allocFraction = iprot.readDouble() + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.I32: + self.queryParallelism = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 6: + if ftype == TType.STRING: + self.schedulingPolicy = 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('WMPool') + if self.resourcePlanName is not None: + oprot.writeFieldBegin('resourcePlanName', TType.STRING, 1) + oprot.writeString(self.resourcePlanName) + oprot.writeFieldEnd() + if self.poolName is not None: + oprot.writeFieldBegin('poolName', TType.STRING, 2) + oprot.writeString(self.poolName) + oprot.writeFieldEnd() + if self.parentPoolName is not None: + oprot.writeFieldBegin('parentPoolName', TType.STRING, 3) + oprot.writeString(self.parentPoolName) + oprot.writeFieldEnd() + if self.allocFraction is not None: + oprot.writeFieldBegin('allocFraction', TType.DOUBLE, 4) + oprot.writeDouble(self.allocFraction) + oprot.writeFieldEnd() + if self.queryParallelism is not None: + oprot.writeFieldBegin('queryParallelism', TType.I32, 5) + oprot.writeI32(self.queryParallelism) + oprot.writeFieldEnd() + if self.schedulingPolicy is not None: + oprot.writeFieldBegin('schedulingPolicy', TType.STRING, 6) + oprot.writeString(self.schedulingPolicy) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.resourcePlanName is None: + raise TProtocol.TProtocolException(message='Required field resourcePlanName is unset!') + if self.poolName is None: + raise TProtocol.TProtocolException(message='Required field poolName is unset!') + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.resourcePlanName) + value = (value * 31) ^ hash(self.poolName) + value = (value * 31) ^ hash(self.parentPoolName) + value = (value * 31) ^ hash(self.allocFraction) + value = (value * 31) ^ hash(self.queryParallelism) + value = (value * 31) ^ hash(self.schedulingPolicy) + return value + + 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 WMTrigger: + """ + Attributes: + - resourcePlanName + - poolName + - triggerExpression + - actionExpression + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'resourcePlanName', None, None, ), # 1 + (2, TType.STRING, 'poolName', None, None, ), # 2 + (3, TType.STRING, 'triggerExpression', None, None, ), # 3 + (4, TType.STRING, 'actionExpression', None, None, ), # 4 + ) + + def __init__(self, resourcePlanName=None, poolName=None, triggerExpression=None, actionExpression=None,): + self.resourcePlanName = resourcePlanName + self.poolName = poolName + self.triggerExpression = triggerExpression + self.actionExpression = actionExpression + + 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.resourcePlanName = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.poolName = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.triggerExpression = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRING: + self.actionExpression = 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('WMTrigger') + if self.resourcePlanName is not None: + oprot.writeFieldBegin('resourcePlanName', TType.STRING, 1) + oprot.writeString(self.resourcePlanName) + oprot.writeFieldEnd() + if self.poolName is not None: + oprot.writeFieldBegin('poolName', TType.STRING, 2) + oprot.writeString(self.poolName) + oprot.writeFieldEnd() + if self.triggerExpression is not None: + oprot.writeFieldBegin('triggerExpression', TType.STRING, 3) + oprot.writeString(self.triggerExpression) + oprot.writeFieldEnd() + if self.actionExpression is not None: + oprot.writeFieldBegin('actionExpression', TType.STRING, 4) + oprot.writeString(self.actionExpression) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.resourcePlanName is None: + raise TProtocol.TProtocolException(message='Required field resourcePlanName is unset!') + if self.poolName is None: + raise TProtocol.TProtocolException(message='Required field poolName is unset!') + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.resourcePlanName) + value = (value * 31) ^ hash(self.poolName) + value = (value * 31) ^ hash(self.triggerExpression) + value = (value * 31) ^ hash(self.actionExpression) + return value + + 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 WMMapping: + """ + Attributes: + - resourcePlanName + - entityType + - entityName + - poolName + - ordering + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'resourcePlanName', None, None, ), # 1 + (2, TType.STRING, 'entityType', None, None, ), # 2 + (3, TType.STRING, 'entityName', None, None, ), # 3 + (4, TType.STRING, 'poolName', None, None, ), # 4 + (5, TType.I32, 'ordering', None, None, ), # 5 + ) + + def __init__(self, resourcePlanName=None, entityType=None, entityName=None, poolName=None, ordering=None,): + self.resourcePlanName = resourcePlanName + self.entityType = entityType + self.entityName = entityName + self.poolName = poolName + self.ordering = ordering + + 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.resourcePlanName = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.entityType = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.entityName = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRING: + self.poolName = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.I32: + self.ordering = iprot.readI32() + 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('WMMapping') + if self.resourcePlanName is not None: + oprot.writeFieldBegin('resourcePlanName', TType.STRING, 1) + oprot.writeString(self.resourcePlanName) + oprot.writeFieldEnd() + if self.entityType is not None: + oprot.writeFieldBegin('entityType', TType.STRING, 2) + oprot.writeString(self.entityType) + oprot.writeFieldEnd() + if self.entityName is not None: + oprot.writeFieldBegin('entityName', TType.STRING, 3) + oprot.writeString(self.entityName) + oprot.writeFieldEnd() + if self.poolName is not None: + oprot.writeFieldBegin('poolName', TType.STRING, 4) + oprot.writeString(self.poolName) + oprot.writeFieldEnd() + if self.ordering is not None: + oprot.writeFieldBegin('ordering', TType.I32, 5) + oprot.writeI32(self.ordering) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.resourcePlanName is None: + raise TProtocol.TProtocolException(message='Required field resourcePlanName is unset!') + if self.entityType is None: + raise TProtocol.TProtocolException(message='Required field entityType is unset!') + if self.entityName is None: + raise TProtocol.TProtocolException(message='Required field entityName is unset!') + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.resourcePlanName) + value = (value * 31) ^ hash(self.entityType) + value = (value * 31) ^ hash(self.entityName) + value = (value * 31) ^ hash(self.poolName) + value = (value * 31) ^ hash(self.ordering) + return value + + 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 MetaException(TException): """ Attributes: http://git-wip-us.apache.org/repos/asf/hive/blob/32b7abac/standalone-metastore/src/gen/thrift/gen-rb/hive_metastore_types.rb ---------------------------------------------------------------------- diff --git a/standalone-metastore/src/gen/thrift/gen-rb/hive_metastore_types.rb b/standalone-metastore/src/gen/thrift/gen-rb/hive_metastore_types.rb index ddb7e18..deef602 100644 --- a/standalone-metastore/src/gen/thrift/gen-rb/hive_metastore_types.rb +++ b/standalone-metastore/src/gen/thrift/gen-rb/hive_metastore_types.rb @@ -3244,6 +3244,106 @@ class TableMeta ::Thrift::Struct.generate_accessors self end +class WMResourcePlan + include ::Thrift::Struct, ::Thrift::Struct_Union + NAME = 1 + STATUS = 2 + QUERYPARALLELISM = 3 + + FIELDS = { + NAME => {:type => ::Thrift::Types::STRING, :name => 'name'}, + STATUS => {:type => ::Thrift::Types::STRING, :name => 'status', :optional => true}, + QUERYPARALLELISM => {:type => ::Thrift::Types::I32, :name => 'queryParallelism', :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field name is unset!') unless @name + end + + ::Thrift::Struct.generate_accessors self +end + +class WMPool + include ::Thrift::Struct, ::Thrift::Struct_Union + RESOURCEPLANNAME = 1 + POOLNAME = 2 + PARENTPOOLNAME = 3 + ALLOCFRACTION = 4 + QUERYPARALLELISM = 5 + SCHEDULINGPOLICY = 6 + + FIELDS = { + RESOURCEPLANNAME => {:type => ::Thrift::Types::STRING, :name => 'resourcePlanName'}, + POOLNAME => {:type => ::Thrift::Types::STRING, :name => 'poolName'}, + PARENTPOOLNAME => {:type => ::Thrift::Types::STRING, :name => 'parentPoolName', :optional => true}, + ALLOCFRACTION => {:type => ::Thrift::Types::DOUBLE, :name => 'allocFraction', :optional => true}, + QUERYPARALLELISM => {:type => ::Thrift::Types::I32, :name => 'queryParallelism', :optional => true}, + SCHEDULINGPOLICY => {:type => ::Thrift::Types::STRING, :name => 'schedulingPolicy', :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field resourcePlanName is unset!') unless @resourcePlanName + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field poolName is unset!') unless @poolName + end + + ::Thrift::Struct.generate_accessors self +end + +class WMTrigger + include ::Thrift::Struct, ::Thrift::Struct_Union + RESOURCEPLANNAME = 1 + POOLNAME = 2 + TRIGGEREXPRESSION = 3 + ACTIONEXPRESSION = 4 + + FIELDS = { + RESOURCEPLANNAME => {:type => ::Thrift::Types::STRING, :name => 'resourcePlanName'}, + POOLNAME => {:type => ::Thrift::Types::STRING, :name => 'poolName'}, + TRIGGEREXPRESSION => {:type => ::Thrift::Types::STRING, :name => 'triggerExpression', :optional => true}, + ACTIONEXPRESSION => {:type => ::Thrift::Types::STRING, :name => 'actionExpression', :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field resourcePlanName is unset!') unless @resourcePlanName + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field poolName is unset!') unless @poolName + end + + ::Thrift::Struct.generate_accessors self +end + +class WMMapping + include ::Thrift::Struct, ::Thrift::Struct_Union + RESOURCEPLANNAME = 1 + ENTITYTYPE = 2 + ENTITYNAME = 3 + POOLNAME = 4 + ORDERING = 5 + + FIELDS = { + RESOURCEPLANNAME => {:type => ::Thrift::Types::STRING, :name => 'resourcePlanName'}, + ENTITYTYPE => {:type => ::Thrift::Types::STRING, :name => 'entityType'}, + ENTITYNAME => {:type => ::Thrift::Types::STRING, :name => 'entityName'}, + POOLNAME => {:type => ::Thrift::Types::STRING, :name => 'poolName', :optional => true}, + ORDERING => {:type => ::Thrift::Types::I32, :name => 'ordering', :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field resourcePlanName is unset!') unless @resourcePlanName + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field entityType is unset!') unless @entityType + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field entityName is unset!') unless @entityName + end + + ::Thrift::Struct.generate_accessors self +end + class MetaException < ::Thrift::Exception include ::Thrift::Struct, ::Thrift::Struct_Union def initialize(message=nil) http://git-wip-us.apache.org/repos/asf/hive/blob/32b7abac/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MWMMapping.java ---------------------------------------------------------------------- diff --git a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MWMMapping.java b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MWMMapping.java new file mode 100644 index 0000000..ec0ac3f --- /dev/null +++ b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MWMMapping.java @@ -0,0 +1,82 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.metastore.model; + +public class MWMMapping { + private MWMResourcePlan resourcePlan; + private EntityType entityType; + private String entityName; + private MWMPool pool; + private Integer ordering; + + public enum EntityType { + USER, + GROUP + } + + public MWMMapping(MWMResourcePlan resourcePlan, EntityType entityType, String entityName, + MWMPool pool, Integer ordering) { + this.resourcePlan = resourcePlan; + this.entityType = entityType; + this.entityName = entityName; + this.pool = pool; + this.ordering = ordering; + } + + public MWMResourcePlan getResourcePlan() { + return resourcePlan; + } + + public void setResourcePlan(MWMResourcePlan resourcePlan) { + this.resourcePlan = resourcePlan; + } + + public EntityType getEntityType() { + return entityType; + } + + public void setEntityType(EntityType entityType) { + this.entityType = entityType; + } + + public String getEntityName() { + return entityName; + } + + public void setEntityName(String entityName) { + this.entityName = entityName; + } + + public MWMPool getPool() { + return pool; + } + + public void setPool(MWMPool pool) { + this.pool = pool; + } + + public Integer getOrdering() { + return ordering; + } + + public void setOrdering(Integer ordering) { + this.ordering = ordering; + } + +} http://git-wip-us.apache.org/repos/asf/hive/blob/32b7abac/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MWMPool.java ---------------------------------------------------------------------- diff --git a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MWMPool.java b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MWMPool.java new file mode 100644 index 0000000..c7cd983 --- /dev/null +++ b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MWMPool.java @@ -0,0 +1,89 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.metastore.model; + +import java.util.Set; + +public class MWMPool { + private MWMResourcePlan resourcePlan; + private String path; + private MWMPool parentPool; + private Double allocFraction; + private Integer queryParallelism; + private Set<MWMTrigger> triggers; + + public MWMPool() {} + + public MWMPool(MWMResourcePlan resourcePlan, String path, MWMPool parentPool, + Double allocFraction, Integer queryParallelism) { + this.resourcePlan = resourcePlan; + this.path = path; + this.parentPool = parentPool; + this.allocFraction = allocFraction; + this.queryParallelism = queryParallelism; + } + + public MWMResourcePlan getResourcePlan() { + return resourcePlan; + } + + public void setResourcePlan(MWMResourcePlan resourcePlan) { + this.resourcePlan = resourcePlan; + } + + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + public MWMPool getParentPool() { + return parentPool; + } + + public void setParentPool(MWMPool parentPool) { + this.parentPool = parentPool; + } + + public Double getAllocFraction() { + return allocFraction; + } + + public void setAllocFraction(Double allocFraction) { + this.allocFraction = allocFraction; + } + + public Integer getQueryParallelism() { + return queryParallelism; + } + + public void setQueryParallelism(Integer queryParallelism) { + this.queryParallelism = queryParallelism; + } + + public Set<MWMTrigger> getTriggers() { + return triggers; + } + + public void setTriggers(Set<MWMTrigger> triggers) { + this.triggers = triggers; + } +} http://git-wip-us.apache.org/repos/asf/hive/blob/32b7abac/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MWMResourcePlan.java ---------------------------------------------------------------------- diff --git a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MWMResourcePlan.java b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MWMResourcePlan.java new file mode 100644 index 0000000..3ff924f --- /dev/null +++ b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MWMResourcePlan.java @@ -0,0 +1,95 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.metastore.model; + +import java.util.List; + +/** + * Storage class for ResourcePlan. + */ +public class MWMResourcePlan { + private String name; + private Integer queryParallelism; + private Status status; + private List<MWMPool> pools; + private List<MWMTrigger> triggers; + private List<MWMMapping> mappings; + + public enum Status { + ACTIVE, + ENABLED, + DISABLED + } + + public MWMResourcePlan() {} + + public MWMResourcePlan(String name, Integer queryParallelism, Status status) { + this.name = name; + this.queryParallelism = queryParallelism; + this.status = status; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Integer getQueryParallelism() { + return queryParallelism; + } + + public void setQueryParallelism(Integer queryParallelism) { + this.queryParallelism = queryParallelism; + } + + public Status getStatus() { + return status; + } + + public void setStatus(Status status) { + this.status = status; + } + + public List<MWMPool> getPools() { + return pools; + } + + public void setPools(List<MWMPool> pools) { + this.pools = pools; + } + + public List<MWMTrigger> getTriggers() { + return triggers; + } + + public void setTriggers(List<MWMTrigger> triggers) { + this.triggers = triggers; + } + + public List<MWMMapping> getMappings() { + return mappings; + } + + public void setMappings(List<MWMMapping> mappings) { + this.mappings = mappings; + } +} http://git-wip-us.apache.org/repos/asf/hive/blob/32b7abac/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MWMTrigger.java ---------------------------------------------------------------------- diff --git a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MWMTrigger.java b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MWMTrigger.java new file mode 100644 index 0000000..081c1ae --- /dev/null +++ b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/model/MWMTrigger.java @@ -0,0 +1,78 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.metastore.model; + +import java.util.Set; + +public class MWMTrigger { + private MWMResourcePlan resourcePlan; + private String name; + private String triggerExpression; + private String actionExpression; + private Set<MWMPool> pools; + + public MWMTrigger(MWMResourcePlan resourcePlan, String name, + String triggerExpression, String actionExpression, Set<MWMPool> pools) { + this.resourcePlan = resourcePlan; + this.name = name; + this.triggerExpression = triggerExpression; + this.actionExpression = actionExpression; + this.pools = pools; + } + + public MWMResourcePlan getResourcePlan() { + return resourcePlan; + } + + public void setResourcePlan(MWMResourcePlan resourcePlan) { + this.resourcePlan = resourcePlan; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getTriggerExpression() { + return triggerExpression; + } + + public void setTriggerExpression(String triggerExpression) { + this.triggerExpression = triggerExpression; + } + + public String getActionExpression() { + return actionExpression; + } + + public void setActionExpression(String actionExpression) { + this.actionExpression = actionExpression; + } + + public Set<MWMPool> getPools() { + return pools; + } + + public void setPools(Set<MWMPool> pools) { + this.pools = pools; + } +} http://git-wip-us.apache.org/repos/asf/hive/blob/32b7abac/standalone-metastore/src/main/resources/package.jdo ---------------------------------------------------------------------- diff --git a/standalone-metastore/src/main/resources/package.jdo b/standalone-metastore/src/main/resources/package.jdo index 570fd44..bcc33ce 100644 --- a/standalone-metastore/src/main/resources/package.jdo +++ b/standalone-metastore/src/main/resources/package.jdo @@ -1082,6 +1082,117 @@ </field> </class> + <class name="MWMResourcePlan" identity-type="datastore" table="WM_RESOURCEPLAN" detachable="true"> + <datastore-identity> + <column name="RP_ID"/> + </datastore-identity> + <field name="name"> + <column name="NAME" length="128" jdbc-type="VARCHAR" allows-null="false"/> + </field> + <field name="queryParallelism"> + <column name="QUERY_PARALLELISM" jdbc-type="integer" allows-null="true"/> + </field> + <field name="status"> + <column name="STATUS" jdbc-type="string" allows-null="false"/> + </field> + <index name="UniqueResourcePlan" unique="true"> + <column name="NAME"/> + </index> + + <field name="pools" mapped-by="resourcePlan"> + <collection element-type="MWMPool"/> + </field> + <field name="triggers" mapped-by="resourcePlan"> + <collection element-type="MWMTrigger"/> + </field> + <field name="mappings" mapped-by="resourcePlan"> + <collection element-type="MWMMapping"/> + </field> + </class> + + <class name="MWMPool" identity-type="datastore" table="WM_POOL" detachable="true"> + <datastore-identity> + <column name="POOL_ID"/> + </datastore-identity> + <field name="resourcePlan"> + <column name="RP_ID" jdbc-type="integer" allows-null="false"/> + </field> + <field name="path"> + <column name="PATH" length="1024" jdbc-type="VARCHAR" allows-null="false"/> + </field> + <field name="parentPool"> + <column name="PARENT_POOL_ID" jdbc-type="integer" allows-null="true" target="POOL_ID"/> + </field> + <field name="allocFraction"> + <column name="ALLOC_FRACTION" jdbc-type="double" allows-null="true"/> + </field> + <field name="queryParallelism"> + <column name="QUERY_PARALLELISM" jdbc-type="integer" allows-null="true"/> + </field> + <field name="triggers" table="WM_POOL_TO_TRIGGER"> + <join> + <column name="POOL_ID" /> + </join> + <element> + <column name="TRIGGER_ID"/> + </element> + </field> + <index name="UniqueWMPool" unique="true"> + <column name="RP_ID"/> + <column name="PATH"/> + </index> + </class> + + <class name="MWMTrigger" identity-type="datastore" table="WM_TRIGGER" detachable="true"> + <datastore-identity> + <column name="TRIGGER_ID"/> + </datastore-identity> + <field name="resourcePlan"> + <column name="RP_ID" jdbc-type="integer" allows-null="false"/> + </field> + <field name="name"> + <column name="NAME" length="128" jdbc-type="VARCHAR" allows-null="false"/> + </field> + <field name="triggerExpression"> + <column name="TRIGGER_EXPRESSION" jdbc-type="string" allows-null="true"/> + </field> + <field name="actionExpression"> + <column name="ACTION_EXPRESSION" jdbc-type="string" allows-null="true"/> + </field> + <field name="pools" mapped-by="triggers"> + <collection element-type="MWMPool" /> + </field> + <index name="UniqueWMTrigger" unique="true"> + <column name="RP_ID"/> + <column name="NAME"/> + </index> + </class> + + <class name="MWMMapping" identity-type="datastore" table="WM_MAPPING" detachable="true"> + <datastore-identity> + <column name="MAPPING_ID"/> + </datastore-identity> + <field name="resourcePlan"> + <column name="RP_ID" jdbc-type="integer" allows-null="false"/> + </field> + <field name="entityType"> + <column name="ENTITY_TYPE" jdbc-type="string" length="10" /> + </field> + <field name="entityName"> + <column name="ENTITY_NAME" jdbc-type="string" length="128" /> + </field> + <field name="pool"> + <column name="POOL_ID" jdbc-type="integer" allows-null="true"/> + </field> + <field name="ordering"> + <column name="ORDERING" jdbc-type="integer" allows-null="true"/> + </field> + <index name="UniqueWMMapping" unique="true"> + <column name="RP_ID"/> + <column name="ENTITY_TYPE"/> + <column name="ENTITY_NAME"/> + </index> + </class> </package> </jdo> http://git-wip-us.apache.org/repos/asf/hive/blob/32b7abac/standalone-metastore/src/main/thrift/hive_metastore.thrift ---------------------------------------------------------------------- diff --git a/standalone-metastore/src/main/thrift/hive_metastore.thrift b/standalone-metastore/src/main/thrift/hive_metastore.thrift index 8908ff2..51dc4ea 100644 --- a/standalone-metastore/src/main/thrift/hive_metastore.thrift +++ b/standalone-metastore/src/main/thrift/hive_metastore.thrift @@ -1030,6 +1030,36 @@ struct TableMeta { 4: optional string comments; } +struct WMResourcePlan { + 1: required string name; + 2: optional string status; + 3: optional i32 queryParallelism; +} + +struct WMPool { + 1: required string resourcePlanName; + 2: required string poolName; + 3: optional string parentPoolName; + 4: optional double allocFraction; + 5: optional i32 queryParallelism; + 6: optional string schedulingPolicy; +} + +struct WMTrigger { + 1: required string resourcePlanName; + 2: required string poolName; + 3: optional string triggerExpression; + 4: optional string actionExpression; +} + +struct WMMapping { + 1: required string resourcePlanName; + 2: required string entityType; + 3: required string entityName; + 4: optional string poolName; + 5: optional i32 ordering; +} + exception MetaException { 1: string message }
