http://git-wip-us.apache.org/repos/asf/hive/blob/56c3a957/standalone-metastore/src/gen/thrift/gen-php/metastore/ThriftHiveMetastore.php ---------------------------------------------------------------------- diff --git a/standalone-metastore/src/gen/thrift/gen-php/metastore/ThriftHiveMetastore.php b/standalone-metastore/src/gen/thrift/gen-php/metastore/ThriftHiveMetastore.php index 9c94942..1c1d58e 100644 --- a/standalone-metastore/src/gen/thrift/gen-php/metastore/ThriftHiveMetastore.php +++ b/standalone-metastore/src/gen/thrift/gen-php/metastore/ThriftHiveMetastore.php @@ -1528,6 +1528,17 @@ interface ThriftHiveMetastoreIf extends \FacebookServiceIf { * @return bool */ public function heartbeat_lock_materialization_rebuild($dbName, $tableName, $txnId); + /** + * @param \metastore\RuntimeStat $stat + * @throws \metastore\MetaException + */ + public function add_runtime_stats(\metastore\RuntimeStat $stat); + /** + * @param \metastore\GetRuntimeStatsRequest $rqst + * @return \metastore\RuntimeStat[] + * @throws \metastore\MetaException + */ + public function get_runtime_stats(\metastore\GetRuntimeStatsRequest $rqst); } class ThriftHiveMetastoreClient extends \FacebookServiceClient implements \metastore\ThriftHiveMetastoreIf { @@ -13007,6 +13018,111 @@ class ThriftHiveMetastoreClient extends \FacebookServiceClient implements \metas throw new \Exception("heartbeat_lock_materialization_rebuild failed: unknown result"); } + public function add_runtime_stats(\metastore\RuntimeStat $stat) + { + $this->send_add_runtime_stats($stat); + $this->recv_add_runtime_stats(); + } + + public function send_add_runtime_stats(\metastore\RuntimeStat $stat) + { + $args = new \metastore\ThriftHiveMetastore_add_runtime_stats_args(); + $args->stat = $stat; + $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'add_runtime_stats', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('add_runtime_stats', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_add_runtime_stats() + { + $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\metastore\ThriftHiveMetastore_add_runtime_stats_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new \metastore\ThriftHiveMetastore_add_runtime_stats_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->o1 !== null) { + throw $result->o1; + } + return; + } + + public function get_runtime_stats(\metastore\GetRuntimeStatsRequest $rqst) + { + $this->send_get_runtime_stats($rqst); + return $this->recv_get_runtime_stats(); + } + + public function send_get_runtime_stats(\metastore\GetRuntimeStatsRequest $rqst) + { + $args = new \metastore\ThriftHiveMetastore_get_runtime_stats_args(); + $args->rqst = $rqst; + $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); + if ($bin_accel) + { + thrift_protocol_write_binary($this->output_, 'get_runtime_stats', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite()); + } + else + { + $this->output_->writeMessageBegin('get_runtime_stats', TMessageType::CALL, $this->seqid_); + $args->write($this->output_); + $this->output_->writeMessageEnd(); + $this->output_->getTransport()->flush(); + } + } + + public function recv_get_runtime_stats() + { + $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary'); + if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\metastore\ThriftHiveMetastore_get_runtime_stats_result', $this->input_->isStrictRead()); + else + { + $rseqid = 0; + $fname = null; + $mtype = 0; + + $this->input_->readMessageBegin($fname, $mtype, $rseqid); + if ($mtype == TMessageType::EXCEPTION) { + $x = new TApplicationException(); + $x->read($this->input_); + $this->input_->readMessageEnd(); + throw $x; + } + $result = new \metastore\ThriftHiveMetastore_get_runtime_stats_result(); + $result->read($this->input_); + $this->input_->readMessageEnd(); + } + if ($result->success !== null) { + return $result->success; + } + if ($result->o1 !== null) { + throw $result->o1; + } + throw new \Exception("get_runtime_stats failed: unknown result"); + } + } // HELPER FUNCTIONS AND STRUCTURES @@ -58498,4 +58614,369 @@ class ThriftHiveMetastore_heartbeat_lock_materialization_rebuild_result { } +class ThriftHiveMetastore_add_runtime_stats_args { + static $_TSPEC; + + /** + * @var \metastore\RuntimeStat + */ + public $stat = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'stat', + 'type' => TType::STRUCT, + 'class' => '\metastore\RuntimeStat', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['stat'])) { + $this->stat = $vals['stat']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_add_runtime_stats_args'; + } + + 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::STRUCT) { + $this->stat = new \metastore\RuntimeStat(); + $xfer += $this->stat->read($input); + } 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('ThriftHiveMetastore_add_runtime_stats_args'); + if ($this->stat !== null) { + if (!is_object($this->stat)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('stat', TType::STRUCT, 1); + $xfer += $this->stat->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class ThriftHiveMetastore_add_runtime_stats_result { + static $_TSPEC; + + /** + * @var \metastore\MetaException + */ + public $o1 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => '\metastore\MetaException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_add_runtime_stats_result'; + } + + 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::STRUCT) { + $this->o1 = new \metastore\MetaException(); + $xfer += $this->o1->read($input); + } 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('ThriftHiveMetastore_add_runtime_stats_result'); + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class ThriftHiveMetastore_get_runtime_stats_args { + static $_TSPEC; + + /** + * @var \metastore\GetRuntimeStatsRequest + */ + public $rqst = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'rqst', + 'type' => TType::STRUCT, + 'class' => '\metastore\GetRuntimeStatsRequest', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['rqst'])) { + $this->rqst = $vals['rqst']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_runtime_stats_args'; + } + + 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::STRUCT) { + $this->rqst = new \metastore\GetRuntimeStatsRequest(); + $xfer += $this->rqst->read($input); + } 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('ThriftHiveMetastore_get_runtime_stats_args'); + if ($this->rqst !== null) { + if (!is_object($this->rqst)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('rqst', TType::STRUCT, 1); + $xfer += $this->rqst->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class ThriftHiveMetastore_get_runtime_stats_result { + static $_TSPEC; + + /** + * @var \metastore\RuntimeStat[] + */ + public $success = null; + /** + * @var \metastore\MetaException + */ + public $o1 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 0 => array( + 'var' => 'success', + 'type' => TType::LST, + 'etype' => TType::STRUCT, + 'elem' => array( + 'type' => TType::STRUCT, + 'class' => '\metastore\RuntimeStat', + ), + ), + 1 => array( + 'var' => 'o1', + 'type' => TType::STRUCT, + 'class' => '\metastore\MetaException', + ), + ); + } + if (is_array($vals)) { + if (isset($vals['success'])) { + $this->success = $vals['success']; + } + if (isset($vals['o1'])) { + $this->o1 = $vals['o1']; + } + } + } + + public function getName() { + return 'ThriftHiveMetastore_get_runtime_stats_result'; + } + + 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 0: + if ($ftype == TType::LST) { + $this->success = array(); + $_size1324 = 0; + $_etype1327 = 0; + $xfer += $input->readListBegin($_etype1327, $_size1324); + for ($_i1328 = 0; $_i1328 < $_size1324; ++$_i1328) + { + $elem1329 = null; + $elem1329 = new \metastore\RuntimeStat(); + $xfer += $elem1329->read($input); + $this->success []= $elem1329; + } + $xfer += $input->readListEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + case 1: + if ($ftype == TType::STRUCT) { + $this->o1 = new \metastore\MetaException(); + $xfer += $this->o1->read($input); + } 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('ThriftHiveMetastore_get_runtime_stats_result'); + if ($this->success !== null) { + if (!is_array($this->success)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('success', TType::LST, 0); + { + $output->writeListBegin(TType::STRUCT, count($this->success)); + { + foreach ($this->success as $iter1330) + { + $xfer += $iter1330->write($output); + } + } + $output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); + } + if ($this->o1 !== null) { + $xfer += $output->writeFieldBegin('o1', TType::STRUCT, 1); + $xfer += $this->o1->write($output); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} +
http://git-wip-us.apache.org/repos/asf/hive/blob/56c3a957/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 1625788..c9ebfaf 100644 --- a/standalone-metastore/src/gen/thrift/gen-php/metastore/Types.php +++ b/standalone-metastore/src/gen/thrift/gen-php/metastore/Types.php @@ -29722,6 +29722,177 @@ class GetSerdeRequest { } +class RuntimeStat { + static $_TSPEC; + + /** + * @var int + */ + public $createTime = null; + /** + * @var int + */ + public $weight = null; + /** + * @var string + */ + public $payload = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'createTime', + 'type' => TType::I32, + ), + 2 => array( + 'var' => 'weight', + 'type' => TType::I32, + ), + 3 => array( + 'var' => 'payload', + 'type' => TType::STRING, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['createTime'])) { + $this->createTime = $vals['createTime']; + } + if (isset($vals['weight'])) { + $this->weight = $vals['weight']; + } + if (isset($vals['payload'])) { + $this->payload = $vals['payload']; + } + } + } + + public function getName() { + return 'RuntimeStat'; + } + + 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::I32) { + $xfer += $input->readI32($this->createTime); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::I32) { + $xfer += $input->readI32($this->weight); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->payload); + } 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('RuntimeStat'); + if ($this->createTime !== null) { + $xfer += $output->writeFieldBegin('createTime', TType::I32, 1); + $xfer += $output->writeI32($this->createTime); + $xfer += $output->writeFieldEnd(); + } + if ($this->weight !== null) { + $xfer += $output->writeFieldBegin('weight', TType::I32, 2); + $xfer += $output->writeI32($this->weight); + $xfer += $output->writeFieldEnd(); + } + if ($this->payload !== null) { + $xfer += $output->writeFieldBegin('payload', TType::STRING, 3); + $xfer += $output->writeString($this->payload); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class GetRuntimeStatsRequest { + static $_TSPEC; + + + public function __construct() { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + ); + } + } + + public function getName() { + return 'GetRuntimeStatsRequest'; + } + + 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) + { + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('GetRuntimeStatsRequest'); + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + class MetaException extends TException { static $_TSPEC; http://git-wip-us.apache.org/repos/asf/hive/blob/56c3a957/standalone-metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore-remote ---------------------------------------------------------------------- diff --git a/standalone-metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore-remote b/standalone-metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore-remote index 079c7fc..a231e9c 100755 --- a/standalone-metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore-remote +++ b/standalone-metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore-remote @@ -226,6 +226,8 @@ if len(sys.argv) <= 1 or sys.argv[1] == '--help': print(' SerDeInfo get_serde(GetSerdeRequest rqst)') print(' LockResponse get_lock_materialization_rebuild(string dbName, string tableName, i64 txnId)') print(' bool heartbeat_lock_materialization_rebuild(string dbName, string tableName, i64 txnId)') + print(' void add_runtime_stats(RuntimeStat stat)') + print(' get_runtime_stats(GetRuntimeStatsRequest rqst)') print(' string getName()') print(' string getVersion()') print(' fb_status getStatus()') @@ -1507,6 +1509,18 @@ elif cmd == 'heartbeat_lock_materialization_rebuild': sys.exit(1) pp.pprint(client.heartbeat_lock_materialization_rebuild(args[0],args[1],eval(args[2]),)) +elif cmd == 'add_runtime_stats': + if len(args) != 1: + print('add_runtime_stats requires 1 args') + sys.exit(1) + pp.pprint(client.add_runtime_stats(eval(args[0]),)) + +elif cmd == 'get_runtime_stats': + if len(args) != 1: + print('get_runtime_stats requires 1 args') + sys.exit(1) + pp.pprint(client.get_runtime_stats(eval(args[0]),)) + elif cmd == 'getName': if len(args) != 0: print('getName requires 0 args') http://git-wip-us.apache.org/repos/asf/hive/blob/56c3a957/standalone-metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py ---------------------------------------------------------------------- diff --git a/standalone-metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py b/standalone-metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py index d241414..d94951b 100644 --- a/standalone-metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py +++ b/standalone-metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py @@ -1566,6 +1566,20 @@ class Iface(fb303.FacebookService.Iface): """ pass + def add_runtime_stats(self, stat): + """ + Parameters: + - stat + """ + pass + + def get_runtime_stats(self, rqst): + """ + Parameters: + - rqst + """ + pass + class Client(fb303.FacebookService.Client, Iface): """ @@ -8799,6 +8813,70 @@ class Client(fb303.FacebookService.Client, Iface): return result.success raise TApplicationException(TApplicationException.MISSING_RESULT, "heartbeat_lock_materialization_rebuild failed: unknown result") + def add_runtime_stats(self, stat): + """ + Parameters: + - stat + """ + self.send_add_runtime_stats(stat) + self.recv_add_runtime_stats() + + def send_add_runtime_stats(self, stat): + self._oprot.writeMessageBegin('add_runtime_stats', TMessageType.CALL, self._seqid) + args = add_runtime_stats_args() + args.stat = stat + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_add_runtime_stats(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = add_runtime_stats_result() + result.read(iprot) + iprot.readMessageEnd() + if result.o1 is not None: + raise result.o1 + return + + def get_runtime_stats(self, rqst): + """ + Parameters: + - rqst + """ + self.send_get_runtime_stats(rqst) + return self.recv_get_runtime_stats() + + def send_get_runtime_stats(self, rqst): + self._oprot.writeMessageBegin('get_runtime_stats', TMessageType.CALL, self._seqid) + args = get_runtime_stats_args() + args.rqst = rqst + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_get_runtime_stats(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = get_runtime_stats_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.o1 is not None: + raise result.o1 + raise TApplicationException(TApplicationException.MISSING_RESULT, "get_runtime_stats failed: unknown result") + class Processor(fb303.FacebookService.Processor, Iface, TProcessor): def __init__(self, handler): @@ -9005,6 +9083,8 @@ class Processor(fb303.FacebookService.Processor, Iface, TProcessor): self._processMap["get_serde"] = Processor.process_get_serde self._processMap["get_lock_materialization_rebuild"] = Processor.process_get_lock_materialization_rebuild self._processMap["heartbeat_lock_materialization_rebuild"] = Processor.process_heartbeat_lock_materialization_rebuild + self._processMap["add_runtime_stats"] = Processor.process_add_runtime_stats + self._processMap["get_runtime_stats"] = Processor.process_get_runtime_stats def process(self, iprot, oprot): (name, type, seqid) = iprot.readMessageBegin() @@ -14017,6 +14097,50 @@ class Processor(fb303.FacebookService.Processor, Iface, TProcessor): oprot.writeMessageEnd() oprot.trans.flush() + def process_add_runtime_stats(self, seqid, iprot, oprot): + args = add_runtime_stats_args() + args.read(iprot) + iprot.readMessageEnd() + result = add_runtime_stats_result() + try: + self._handler.add_runtime_stats(args.stat) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise + except MetaException as o1: + msg_type = TMessageType.REPLY + result.o1 = o1 + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("add_runtime_stats", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_get_runtime_stats(self, seqid, iprot, oprot): + args = get_runtime_stats_args() + args.read(iprot) + iprot.readMessageEnd() + result = get_runtime_stats_result() + try: + result.success = self._handler.get_runtime_stats(args.rqst) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise + except MetaException as o1: + msg_type = TMessageType.REPLY + result.o1 = o1 + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("get_runtime_stats", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + # HELPER FUNCTIONS AND STRUCTURES @@ -47720,3 +47844,288 @@ class heartbeat_lock_materialization_rebuild_result: def __ne__(self, other): return not (self == other) + +class add_runtime_stats_args: + """ + Attributes: + - stat + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'stat', (RuntimeStat, RuntimeStat.thrift_spec), None, ), # 1 + ) + + def __init__(self, stat=None,): + self.stat = stat + + 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.stat = RuntimeStat() + self.stat.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('add_runtime_stats_args') + if self.stat is not None: + oprot.writeFieldBegin('stat', TType.STRUCT, 1) + self.stat.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.stat) + 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 add_runtime_stats_result: + """ + Attributes: + - o1 + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'o1', (MetaException, MetaException.thrift_spec), None, ), # 1 + ) + + def __init__(self, o1=None,): + self.o1 = o1 + + 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.o1 = MetaException() + self.o1.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('add_runtime_stats_result') + if self.o1 is not None: + oprot.writeFieldBegin('o1', TType.STRUCT, 1) + self.o1.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.o1) + 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 get_runtime_stats_args: + """ + Attributes: + - rqst + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'rqst', (GetRuntimeStatsRequest, GetRuntimeStatsRequest.thrift_spec), None, ), # 1 + ) + + def __init__(self, rqst=None,): + self.rqst = rqst + + 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.rqst = GetRuntimeStatsRequest() + self.rqst.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('get_runtime_stats_args') + if self.rqst is not None: + oprot.writeFieldBegin('rqst', TType.STRUCT, 1) + self.rqst.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.rqst) + 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 get_runtime_stats_result: + """ + Attributes: + - success + - o1 + """ + + thrift_spec = ( + (0, TType.LIST, 'success', (TType.STRUCT,(RuntimeStat, RuntimeStat.thrift_spec)), None, ), # 0 + (1, TType.STRUCT, 'o1', (MetaException, MetaException.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, o1=None,): + self.success = success + self.o1 = o1 + + 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 == 0: + if ftype == TType.LIST: + self.success = [] + (_etype1323, _size1320) = iprot.readListBegin() + for _i1324 in xrange(_size1320): + _elem1325 = RuntimeStat() + _elem1325.read(iprot) + self.success.append(_elem1325) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.o1 = MetaException() + self.o1.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('get_runtime_stats_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.STRUCT, len(self.success)) + for iter1326 in self.success: + iter1326.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.o1 is not None: + oprot.writeFieldBegin('o1', TType.STRUCT, 1) + self.o1.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.success) + value = (value * 31) ^ hash(self.o1) + 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) http://git-wip-us.apache.org/repos/asf/hive/blob/56c3a957/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 1d09cb8..b1e577a 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 @@ -21236,6 +21236,147 @@ class GetSerdeRequest: def __ne__(self, other): return not (self == other) +class RuntimeStat: + """ + Attributes: + - createTime + - weight + - payload + """ + + thrift_spec = ( + None, # 0 + (1, TType.I32, 'createTime', None, None, ), # 1 + (2, TType.I32, 'weight', None, None, ), # 2 + (3, TType.STRING, 'payload', None, None, ), # 3 + ) + + def __init__(self, createTime=None, weight=None, payload=None,): + self.createTime = createTime + self.weight = weight + self.payload = payload + + 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.createTime = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.I32: + self.weight = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.payload = 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('RuntimeStat') + if self.createTime is not None: + oprot.writeFieldBegin('createTime', TType.I32, 1) + oprot.writeI32(self.createTime) + oprot.writeFieldEnd() + if self.weight is not None: + oprot.writeFieldBegin('weight', TType.I32, 2) + oprot.writeI32(self.weight) + oprot.writeFieldEnd() + if self.payload is not None: + oprot.writeFieldBegin('payload', TType.STRING, 3) + oprot.writeString(self.payload) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.weight is None: + raise TProtocol.TProtocolException(message='Required field weight is unset!') + if self.payload is None: + raise TProtocol.TProtocolException(message='Required field payload is unset!') + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.createTime) + value = (value * 31) ^ hash(self.weight) + value = (value * 31) ^ hash(self.payload) + 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 GetRuntimeStatsRequest: + + thrift_spec = ( + ) + + 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 + 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('GetRuntimeStatsRequest') + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + 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/56c3a957/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 47e8d0f..2687ce5 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 @@ -4825,6 +4825,43 @@ class GetSerdeRequest ::Thrift::Struct.generate_accessors self end +class RuntimeStat + include ::Thrift::Struct, ::Thrift::Struct_Union + CREATETIME = 1 + WEIGHT = 2 + PAYLOAD = 3 + + FIELDS = { + CREATETIME => {:type => ::Thrift::Types::I32, :name => 'createTime', :optional => true}, + WEIGHT => {:type => ::Thrift::Types::I32, :name => 'weight'}, + PAYLOAD => {:type => ::Thrift::Types::STRING, :name => 'payload', :binary => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field weight is unset!') unless @weight + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field payload is unset!') unless @payload + end + + ::Thrift::Struct.generate_accessors self +end + +class GetRuntimeStatsRequest + include ::Thrift::Struct, ::Thrift::Struct_Union + + FIELDS = { + + } + + def struct_fields; FIELDS; end + + def validate + 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/56c3a957/standalone-metastore/src/gen/thrift/gen-rb/thrift_hive_metastore.rb ---------------------------------------------------------------------- diff --git a/standalone-metastore/src/gen/thrift/gen-rb/thrift_hive_metastore.rb b/standalone-metastore/src/gen/thrift/gen-rb/thrift_hive_metastore.rb index 58ebd29..4de8bd3 100644 --- a/standalone-metastore/src/gen/thrift/gen-rb/thrift_hive_metastore.rb +++ b/standalone-metastore/src/gen/thrift/gen-rb/thrift_hive_metastore.rb @@ -3378,6 +3378,37 @@ module ThriftHiveMetastore raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'heartbeat_lock_materialization_rebuild failed: unknown result') end + def add_runtime_stats(stat) + send_add_runtime_stats(stat) + recv_add_runtime_stats() + end + + def send_add_runtime_stats(stat) + send_message('add_runtime_stats', Add_runtime_stats_args, :stat => stat) + end + + def recv_add_runtime_stats() + result = receive_message(Add_runtime_stats_result) + raise result.o1 unless result.o1.nil? + return + end + + def get_runtime_stats(rqst) + send_get_runtime_stats(rqst) + return recv_get_runtime_stats() + end + + def send_get_runtime_stats(rqst) + send_message('get_runtime_stats', Get_runtime_stats_args, :rqst => rqst) + end + + def recv_get_runtime_stats() + result = receive_message(Get_runtime_stats_result) + return result.success unless result.success.nil? + raise result.o1 unless result.o1.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'get_runtime_stats failed: unknown result') + end + end class Processor < ::FacebookService::Processor @@ -5919,6 +5950,28 @@ module ThriftHiveMetastore write_result(result, oprot, 'heartbeat_lock_materialization_rebuild', seqid) end + def process_add_runtime_stats(seqid, iprot, oprot) + args = read_args(iprot, Add_runtime_stats_args) + result = Add_runtime_stats_result.new() + begin + @handler.add_runtime_stats(args.stat) + rescue ::MetaException => o1 + result.o1 = o1 + end + write_result(result, oprot, 'add_runtime_stats', seqid) + end + + def process_get_runtime_stats(seqid, iprot, oprot) + args = read_args(iprot, Get_runtime_stats_args) + result = Get_runtime_stats_result.new() + begin + result.success = @handler.get_runtime_stats(args.rqst) + rescue ::MetaException => o1 + result.o1 = o1 + end + write_result(result, oprot, 'get_runtime_stats', seqid) + end + end # HELPER FUNCTIONS AND STRUCTURES @@ -13417,5 +13470,71 @@ module ThriftHiveMetastore ::Thrift::Struct.generate_accessors self end + class Add_runtime_stats_args + include ::Thrift::Struct, ::Thrift::Struct_Union + STAT = 1 + + FIELDS = { + STAT => {:type => ::Thrift::Types::STRUCT, :name => 'stat', :class => ::RuntimeStat} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Add_runtime_stats_result + include ::Thrift::Struct, ::Thrift::Struct_Union + O1 = 1 + + FIELDS = { + O1 => {:type => ::Thrift::Types::STRUCT, :name => 'o1', :class => ::MetaException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Get_runtime_stats_args + include ::Thrift::Struct, ::Thrift::Struct_Union + RQST = 1 + + FIELDS = { + RQST => {:type => ::Thrift::Types::STRUCT, :name => 'rqst', :class => ::GetRuntimeStatsRequest} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class Get_runtime_stats_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + O1 = 1 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::STRUCT, :class => ::RuntimeStat}}, + O1 => {:type => ::Thrift::Types::STRUCT, :name => 'o1', :class => ::MetaException} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + end http://git-wip-us.apache.org/repos/asf/hive/blob/56c3a957/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java ---------------------------------------------------------------------- diff --git a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java index f3c2d8b..397a081 100644 --- a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java +++ b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java @@ -50,7 +50,6 @@ import java.util.Map.Entry; import java.util.Objects; import java.util.Properties; import java.util.Set; -import java.util.concurrent.Callable; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; @@ -1237,7 +1236,9 @@ public class HiveMetaStore extends ThriftHiveMetastore { startFunction("create_database", ": " + db.toString()); boolean success = false; Exception ex = null; - if (!db.isSetCatalogName()) db.setCatalogName(getDefaultCatalog(conf)); + if (!db.isSetCatalogName()) { + db.setCatalogName(getDefaultCatalog(conf)); + } try { try { if (null != get_database_core(db.getCatalogName(), db.getName())) { @@ -1742,7 +1743,9 @@ public class HiveMetaStore extends ThriftHiveMetastore { Path tblPath = null; boolean success = false, madeDir = false; try { - if (!tbl.isSetCatName()) tbl.setCatName(getDefaultCatalog(conf)); + if (!tbl.isSetCatName()) { + tbl.setCatName(getDefaultCatalog(conf)); + } firePreEvent(new PreCreateTableEvent(tbl, this)); ms.openTransaction(); @@ -3335,10 +3338,14 @@ public class HiveMetaStore extends ThriftHiveMetastore { return result; } try { - if (!request.isSetCatName()) request.setCatName(getDefaultCatalog(conf)); + if (!request.isSetCatName()) { + request.setCatName(getDefaultCatalog(conf)); + } // Make sure all of the partitions have the catalog set as well request.getParts().forEach(p -> { - if (!p.isSetCatName()) p.setCatName(getDefaultCatalog(conf)); + if (!p.isSetCatName()) { + p.setCatName(getDefaultCatalog(conf)); + } }); List<Partition> parts = add_partitions_core(getMS(), request.getCatName(), request.getDbName(), request.getTblName(), request.getParts(), request.isIfNotExists()); @@ -3370,7 +3377,9 @@ public class HiveMetaStore extends ThriftHiveMetastore { // Old API assumed all partitions belong to the same table; keep the same assumption if (!parts.get(0).isSetCatName()) { String defaultCat = getDefaultCatalog(conf); - for (Partition p : parts) p.setCatName(defaultCat); + for (Partition p : parts) { + p.setCatName(defaultCat); + } } ret = add_partitions_core(getMS(), parts.get(0).getCatName(), parts.get(0).getDbName(), parts.get(0).getTableName(), parts, false).size(); @@ -3676,7 +3685,9 @@ public class HiveMetaStore extends ThriftHiveMetastore { boolean success = false; Table tbl = null; Map<String, String> transactionalListenerResponses = Collections.emptyMap(); - if (!part.isSetCatName()) part.setCatName(getDefaultCatalog(conf)); + if (!part.isSetCatName()) { + part.setCatName(getDefaultCatalog(conf)); + } try { ms.openTransaction(); tbl = ms.getTable(part.getCatName(), part.getDbName(), part.getTableName()); @@ -4678,7 +4689,9 @@ public class HiveMetaStore extends ThriftHiveMetastore { } // Make sure the new partition has the catalog value set - if (!new_part.isSetCatName()) new_part.setCatName(catName); + if (!new_part.isSetCatName()) { + new_part.setCatName(catName); + } Partition oldPart = null; Exception ex = null; @@ -4748,7 +4761,9 @@ public class HiveMetaStore extends ThriftHiveMetastore { try { for (Partition tmpPart : new_parts) { // Make sure the catalog name is set in the new partition - if (!tmpPart.isSetCatName()) tmpPart.setCatName(getDefaultCatalog(conf)); + if (!tmpPart.isSetCatName()) { + tmpPart.setCatName(getDefaultCatalog(conf)); + } firePreEvent(new PreAlterPartitionEvent(parsedDbName[DB_NAME], tbl_name, null, tmpPart, this)); } oldParts = alterHandler.alterPartitions(getMS(), wh, parsedDbName[CAT_NAME], @@ -4850,7 +4865,9 @@ public class HiveMetaStore extends ThriftHiveMetastore { } } // Set the catalog name if it hasn't been set in the new table - if (!newTable.isSetCatName()) newTable.setCatName(catName); + if (!newTable.isSetCatName()) { + newTable.setCatName(catName); + } boolean success = false; Exception ex = null; @@ -7874,6 +7891,7 @@ public class HiveMetaStore extends ThriftHiveMetastore { } } + @Override public WMAlterPoolResponse alter_wm_pool(WMAlterPoolRequest request) throws AlreadyExistsException, NoSuchObjectException, InvalidObjectException, MetaException, TException { @@ -7899,6 +7917,7 @@ public class HiveMetaStore extends ThriftHiveMetastore { } } + @Override public WMDropPoolResponse drop_wm_pool(WMDropPoolRequest request) throws NoSuchObjectException, InvalidOperationException, MetaException, TException { try { @@ -7910,6 +7929,7 @@ public class HiveMetaStore extends ThriftHiveMetastore { } } + @Override public WMCreateOrUpdateMappingResponse create_or_update_wm_mapping( WMCreateOrUpdateMappingRequest request) throws AlreadyExistsException, NoSuchObjectException, InvalidObjectException, MetaException, TException { @@ -7922,6 +7942,7 @@ public class HiveMetaStore extends ThriftHiveMetastore { } } + @Override public WMDropMappingResponse drop_wm_mapping(WMDropMappingRequest request) throws NoSuchObjectException, InvalidOperationException, MetaException, TException { try { @@ -7933,6 +7954,7 @@ public class HiveMetaStore extends ThriftHiveMetastore { } } + @Override public WMCreateOrDropTriggerToPoolMappingResponse create_or_drop_wm_trigger_to_pool_mapping( WMCreateOrDropTriggerToPoolMappingRequest request) throws AlreadyExistsException, NoSuchObjectException, InvalidObjectException, MetaException, TException { @@ -7951,6 +7973,7 @@ public class HiveMetaStore extends ThriftHiveMetastore { } } + @Override public void create_ischema(ISchema schema) throws TException { startFunction("create_ischema", ": " + schema.getName()); boolean success = false; @@ -7970,7 +7993,9 @@ public class HiveMetaStore extends ThriftHiveMetastore { } success = ms.commitTransaction(); } finally { - if (!success) ms.rollbackTransaction(); + if (!success) { + ms.rollbackTransaction(); + } if (!listeners.isEmpty()) { MetaStoreListenerNotifier.notifyEvent(listeners, EventType.CREATE_ISCHEMA, new CreateISchemaEvent(success, this, schema), null, @@ -8009,7 +8034,9 @@ public class HiveMetaStore extends ThriftHiveMetastore { } success = ms.commitTransaction(); } finally { - if (!success) ms.rollbackTransaction(); + if (!success) { + ms.rollbackTransaction(); + } if (!listeners.isEmpty()) { MetaStoreListenerNotifier.notifyEvent(listeners, EventType.ALTER_ISCHEMA, new AlterISchemaEvent(success, this, oldSchema, rqst.getNewSchema()), null, @@ -8074,7 +8101,9 @@ public class HiveMetaStore extends ThriftHiveMetastore { } success = ms.commitTransaction(); } finally { - if (!success) ms.rollbackTransaction(); + if (!success) { + ms.rollbackTransaction(); + } if (!listeners.isEmpty()) { MetaStoreListenerNotifier.notifyEvent(listeners, EventType.DROP_ISCHEMA, new DropISchemaEvent(success, this, schema), null, @@ -8114,7 +8143,9 @@ public class HiveMetaStore extends ThriftHiveMetastore { } success = ms.commitTransaction(); } finally { - if (!success) ms.rollbackTransaction(); + if (!success) { + ms.rollbackTransaction(); + } if (!listeners.isEmpty()) { MetaStoreListenerNotifier.notifyEvent(listeners, EventType.ADD_SCHEMA_VERSION, new AddSchemaVersionEvent(success, this, schemaVersion), null, @@ -8216,7 +8247,9 @@ public class HiveMetaStore extends ThriftHiveMetastore { } success = ms.commitTransaction(); } finally { - if (!success) ms.rollbackTransaction(); + if (!success) { + ms.rollbackTransaction(); + } if (!listeners.isEmpty()) { MetaStoreListenerNotifier.notifyEvent(listeners, EventType.DROP_SCHEMA_VERSION, new DropSchemaVersionEvent(success, this, schemaVersion), null, @@ -8285,7 +8318,9 @@ public class HiveMetaStore extends ThriftHiveMetastore { } success = ms.commitTransaction(); } finally { - if (!success) ms.rollbackTransaction(); + if (!success) { + ms.rollbackTransaction(); + } if (!listeners.isEmpty()) { MetaStoreListenerNotifier.notifyEvent(listeners, EventType.ALTER_SCHEMA_VERSION, new AlterSchemaVersionEvent(success, this, oldSchemaVersion, newSchemaVersion), null, @@ -8327,7 +8362,9 @@ public class HiveMetaStore extends ThriftHiveMetastore { } success = ms.commitTransaction(); } finally { - if (!success) ms.rollbackTransaction(); + if (!success) { + ms.rollbackTransaction(); + } if (!listeners.isEmpty()) { MetaStoreListenerNotifier.notifyEvent(listeners, EventType.ALTER_SCHEMA_VERSION, new AlterSchemaVersionEvent(success, this, oldSchemaVersion, newSchemaVersion), null, @@ -8358,7 +8395,9 @@ public class HiveMetaStore extends ThriftHiveMetastore { ex = e; throw e; } finally { - if (!success) ms.rollbackTransaction(); + if (!success) { + ms.rollbackTransaction(); + } endFunction("create_serde", success, ex); } } @@ -8394,6 +8433,44 @@ public class HiveMetaStore extends ThriftHiveMetastore { throws TException { return MaterializationsRebuildLockHandler.get().refreshLockResource(dbName, tableName, txnId); } + + @Override + public void add_runtime_stats(RuntimeStat stat) throws TException { + startFunction("store_runtime_stats"); + Exception ex = null; + boolean success = false; + RawStore ms = getMS(); + try { + ms.openTransaction(); + ms.addRuntimeStat(stat); + success = ms.commitTransaction(); + } catch (Exception e) { + LOG.error("Caught exception", e); + ex = e; + throw e; + } finally { + if (!success) { + ms.rollbackTransaction(); + } + endFunction("store_runtime_stats", success, ex); + } + } + + @Override + public List<RuntimeStat> get_runtime_stats(GetRuntimeStatsRequest rqst) throws TException { + startFunction("get_runtime_stats"); + Exception ex = null; + try { + List<RuntimeStat> res = getMS().getRuntimeStats(); + return res; + } catch (MetaException e) { + LOG.error("Caught exception", e); + ex = e; + throw e; + } finally { + endFunction("get_runtime_stats", ex == null, ex); + } + } } private static IHMSHandler newRetryingHMSHandler(IHMSHandler baseHandler, Configuration conf) http://git-wip-us.apache.org/repos/asf/hive/blob/56c3a957/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java ---------------------------------------------------------------------- diff --git a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java index feae991..1c8d223 100644 --- a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java +++ b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java @@ -649,7 +649,9 @@ public class HiveMetaStoreClient implements IMetaStoreClient, AutoCloseable { public Partition add_partition(Partition new_part, EnvironmentContext envContext) throws TException { - if (new_part != null && !new_part.isSetCatName()) new_part.setCatName(getDefaultCatalog(conf)); + if (new_part != null && !new_part.isSetCatName()) { + new_part.setCatName(getDefaultCatalog(conf)); + } Partition p = client.add_partition_with_environment_context(new_part, envContext); return deepCopy(p); } @@ -697,7 +699,9 @@ public class HiveMetaStoreClient implements IMetaStoreClient, AutoCloseable { if (partitionSpec == null) { throw new MetaException("PartitionSpec cannot be null."); } - if (partitionSpec.getCatName() == null) partitionSpec.setCatName(getDefaultCatalog(conf)); + if (partitionSpec.getCatName() == null) { + partitionSpec.setCatName(getDefaultCatalog(conf)); + } return client.add_partitions_pspec(partitionSpec.toPartitionSpec()); } @@ -800,7 +804,9 @@ public class HiveMetaStoreClient implements IMetaStoreClient, AutoCloseable { @Override public void createDatabase(Database db) throws AlreadyExistsException, InvalidObjectException, MetaException, TException { - if (!db.isSetCatalogName()) db.setCatalogName(getDefaultCatalog(conf)); + if (!db.isSetCatalogName()) { + db.setCatalogName(getDefaultCatalog(conf)); + } client.create_database(db); } @@ -819,7 +825,9 @@ public class HiveMetaStoreClient implements IMetaStoreClient, AutoCloseable { public void createTable(Table tbl, EnvironmentContext envContext) throws AlreadyExistsException, InvalidObjectException, MetaException, NoSuchObjectException, TException { - if (!tbl.isSetCatName()) tbl.setCatName(getDefaultCatalog(conf)); + if (!tbl.isSetCatName()) { + tbl.setCatName(getDefaultCatalog(conf)); + } HiveMetaHook hook = getHook(tbl); if (hook != null) { hook.preCreateTable(tbl); @@ -844,6 +852,7 @@ public class HiveMetaStoreClient implements IMetaStoreClient, AutoCloseable { } } + @Override public void createTableWithConstraints(Table tbl, List<SQLPrimaryKey> primaryKeys, List<SQLForeignKey> foreignKeys, List<SQLUniqueConstraint> uniqueConstraints, @@ -856,12 +865,24 @@ public class HiveMetaStoreClient implements IMetaStoreClient, AutoCloseable { if (!tbl.isSetCatName()) { String defaultCat = getDefaultCatalog(conf); tbl.setCatName(defaultCat); - if (primaryKeys != null) primaryKeys.forEach(pk -> pk.setCatName(defaultCat)); - if (foreignKeys != null) foreignKeys.forEach(fk -> fk.setCatName(defaultCat)); - if (uniqueConstraints != null) uniqueConstraints.forEach(uc -> uc.setCatName(defaultCat)); - if (notNullConstraints != null) notNullConstraints.forEach(nn -> nn.setCatName(defaultCat)); - if (defaultConstraints != null) defaultConstraints.forEach(def -> def.setCatName(defaultCat)); - if (checkConstraints != null) checkConstraints.forEach(cc -> cc.setCatName(defaultCat)); + if (primaryKeys != null) { + primaryKeys.forEach(pk -> pk.setCatName(defaultCat)); + } + if (foreignKeys != null) { + foreignKeys.forEach(fk -> fk.setCatName(defaultCat)); + } + if (uniqueConstraints != null) { + uniqueConstraints.forEach(uc -> uc.setCatName(defaultCat)); + } + if (notNullConstraints != null) { + notNullConstraints.forEach(nn -> nn.setCatName(defaultCat)); + } + if (defaultConstraints != null) { + defaultConstraints.forEach(def -> def.setCatName(defaultCat)); + } + if (checkConstraints != null) { + checkConstraints.forEach(cc -> cc.setCatName(defaultCat)); + } } HiveMetaHook hook = getHook(tbl); if (hook != null) { @@ -995,6 +1016,7 @@ public class HiveMetaStoreClient implements IMetaStoreClient, AutoCloseable { dropDatabase(getDefaultCatalog(conf), name, deleteData, ignoreUnknownDb, cascade); } + @Override public void dropDatabase(String catalogName, String dbName, boolean deleteData, boolean ignoreUnknownDb, boolean cascade) throws NoSuchObjectException, InvalidOperationException, MetaException, TException { @@ -1521,7 +1543,9 @@ public class HiveMetaStoreClient implements IMetaStoreClient, AutoCloseable { @Override public PartitionValuesResponse listPartitionValues(PartitionValuesRequest request) throws MetaException, TException, NoSuchObjectException { - if (!request.isSetCatName()) request.setCatName(getDefaultCatalog(conf)); + if (!request.isSetCatName()) { + request.setCatName(getDefaultCatalog(conf)); + } return client.get_partition_values(request); } @@ -1826,55 +1850,71 @@ public class HiveMetaStoreClient implements IMetaStoreClient, AutoCloseable { @Override public List<SQLPrimaryKey> getPrimaryKeys(PrimaryKeysRequest req) throws TException { - if (!req.isSetCatName()) req.setCatName(getDefaultCatalog(conf)); + if (!req.isSetCatName()) { + req.setCatName(getDefaultCatalog(conf)); + } return client.get_primary_keys(req).getPrimaryKeys(); } @Override public List<SQLForeignKey> getForeignKeys(ForeignKeysRequest req) throws MetaException, NoSuchObjectException, TException { - if (!req.isSetCatName()) req.setCatName(getDefaultCatalog(conf)); + if (!req.isSetCatName()) { + req.setCatName(getDefaultCatalog(conf)); + } return client.get_foreign_keys(req).getForeignKeys(); } @Override public List<SQLUniqueConstraint> getUniqueConstraints(UniqueConstraintsRequest req) throws MetaException, NoSuchObjectException, TException { - if (!req.isSetCatName()) req.setCatName(getDefaultCatalog(conf)); + if (!req.isSetCatName()) { + req.setCatName(getDefaultCatalog(conf)); + } return client.get_unique_constraints(req).getUniqueConstraints(); } @Override public List<SQLNotNullConstraint> getNotNullConstraints(NotNullConstraintsRequest req) throws MetaException, NoSuchObjectException, TException { - if (!req.isSetCatName()) req.setCatName(getDefaultCatalog(conf)); + if (!req.isSetCatName()) { + req.setCatName(getDefaultCatalog(conf)); + } return client.get_not_null_constraints(req).getNotNullConstraints(); } @Override public List<SQLDefaultConstraint> getDefaultConstraints(DefaultConstraintsRequest req) throws MetaException, NoSuchObjectException, TException { - if (!req.isSetCatName()) req.setCatName(getDefaultCatalog(conf)); + if (!req.isSetCatName()) { + req.setCatName(getDefaultCatalog(conf)); + } return client.get_default_constraints(req).getDefaultConstraints(); } @Override public List<SQLCheckConstraint> getCheckConstraints(CheckConstraintsRequest req) throws MetaException, NoSuchObjectException, TException { - if (!req.isSetCatName()) req.setCatName(getDefaultCatalog(conf)); + if (!req.isSetCatName()) { + req.setCatName(getDefaultCatalog(conf)); + } return client.get_check_constraints(req).getCheckConstraints(); } /** {@inheritDoc} */ @Override public boolean updateTableColumnStatistics(ColumnStatistics statsObj) throws TException { - if (!statsObj.getStatsDesc().isSetCatName()) statsObj.getStatsDesc().setCatName(getDefaultCatalog(conf)); + if (!statsObj.getStatsDesc().isSetCatName()) { + statsObj.getStatsDesc().setCatName(getDefaultCatalog(conf)); + } return client.update_table_column_statistics(statsObj); } @Override public boolean updatePartitionColumnStatistics(ColumnStatistics statsObj) throws TException { - if (!statsObj.getStatsDesc().isSetCatName()) statsObj.getStatsDesc().setCatName(getDefaultCatalog(conf)); + if (!statsObj.getStatsDesc().isSetCatName()) { + statsObj.getStatsDesc().setCatName(getDefaultCatalog(conf)); + } return client.update_partition_column_statistics(statsObj); } @@ -1882,7 +1922,9 @@ public class HiveMetaStoreClient implements IMetaStoreClient, AutoCloseable { public boolean setPartitionColumnStatistics(SetPartitionsStatsRequest request) throws TException { String defaultCat = getDefaultCatalog(conf); for (ColumnStatistics stats : request.getColStats()) { - if (!stats.getStatsDesc().isSetCatName()) stats.getStatsDesc().setCatName(defaultCat); + if (!stats.getStatsDesc().isSetCatName()) { + stats.getStatsDesc().setCatName(defaultCat); + } } return client.set_aggr_stats_for(request); } @@ -2196,7 +2238,9 @@ public class HiveMetaStoreClient implements IMetaStoreClient, AutoCloseable { throws MetaException, TException { String defaultCat = getDefaultCatalog(conf); for (HiveObjectPrivilege priv : privileges.getPrivileges()) { - if (!priv.getHiveObject().isSetCatName()) priv.getHiveObject().setCatName(defaultCat); + if (!priv.getHiveObject().isSetCatName()) { + priv.getHiveObject().setCatName(defaultCat); + } } GrantRevokePrivilegeRequest req = new GrantRevokePrivilegeRequest(); req.setRequestType(GrantRevokeType.GRANT); @@ -2229,7 +2273,9 @@ public class HiveMetaStoreClient implements IMetaStoreClient, AutoCloseable { TException { String defaultCat = getDefaultCatalog(conf); for (HiveObjectPrivilege priv : privileges.getPrivileges()) { - if (!priv.getHiveObject().isSetCatName()) priv.getHiveObject().setCatName(defaultCat); + if (!priv.getHiveObject().isSetCatName()) { + priv.getHiveObject().setCatName(defaultCat); + } } GrantRevokePrivilegeRequest req = new GrantRevokePrivilegeRequest(); req.setRequestType(GrantRevokeType.REVOKE); @@ -2246,7 +2292,9 @@ public class HiveMetaStoreClient implements IMetaStoreClient, AutoCloseable { public PrincipalPrivilegeSet get_privilege_set(HiveObjectRef hiveObject, String userName, List<String> groupNames) throws MetaException, TException { - if (!hiveObject.isSetCatName()) hiveObject.setCatName(getDefaultCatalog(conf)); + if (!hiveObject.isSetCatName()) { + hiveObject.setCatName(getDefaultCatalog(conf)); + } return client.get_privilege_set(hiveObject, userName, groupNames); } @@ -2254,7 +2302,9 @@ public class HiveMetaStoreClient implements IMetaStoreClient, AutoCloseable { public List<HiveObjectPrivilege> list_privileges(String principalName, PrincipalType principalType, HiveObjectRef hiveObject) throws MetaException, TException { - if (!hiveObject.isSetCatName()) hiveObject.setCatName(getDefaultCatalog(conf)); + if (!hiveObject.isSetCatName()) { + hiveObject.setCatName(getDefaultCatalog(conf)); + } return client.list_privileges(principalName, principalType, hiveObject); } @@ -2627,14 +2677,18 @@ public class HiveMetaStoreClient implements IMetaStoreClient, AutoCloseable { @Override public NotificationEventsCountResponse getNotificationEventsCount(NotificationEventsCountRequest rqst) throws TException { - if (!rqst.isSetCatName()) rqst.setCatName(getDefaultCatalog(conf)); + if (!rqst.isSetCatName()) { + rqst.setCatName(getDefaultCatalog(conf)); + } return client.get_notification_events_count(rqst); } @InterfaceAudience.LimitedPrivate({"Apache Hive, HCatalog"}) @Override public FireEventResponse fireListenerEvent(FireEventRequest rqst) throws TException { - if (!rqst.isSetCatName()) rqst.setCatName(getDefaultCatalog(conf)); + if (!rqst.isSetCatName()) { + rqst.setCatName(getDefaultCatalog(conf)); + } return client.fire_listener_event(rqst); } @@ -2707,7 +2761,9 @@ public class HiveMetaStoreClient implements IMetaStoreClient, AutoCloseable { if (func == null) { throw new MetaException("Function cannot be null."); } - if (!func.isSetCatName()) func.setCatName(getDefaultCatalog(conf)); + if (!func.isSetCatName()) { + func.setCatName(getDefaultCatalog(conf)); + } client.create_function(func); } @@ -3087,8 +3143,11 @@ public class HiveMetaStoreClient implements IMetaStoreClient, AutoCloseable { client.create_or_drop_wm_trigger_to_pool_mapping(request); } + @Override public void createISchema(ISchema schema) throws TException { - if (!schema.isSetCatName()) schema.setCatName(getDefaultCatalog(conf)); + if (!schema.isSetCatName()) { + schema.setCatName(getDefaultCatalog(conf)); + } client.create_ischema(schema); } @@ -3109,10 +3168,13 @@ public class HiveMetaStoreClient implements IMetaStoreClient, AutoCloseable { @Override public void addSchemaVersion(SchemaVersion schemaVersion) throws TException { - if (!schemaVersion.getSchema().isSetCatName()) schemaVersion.getSchema().setCatName(getDefaultCatalog(conf)); + if (!schemaVersion.getSchema().isSetCatName()) { + schemaVersion.getSchema().setCatName(getDefaultCatalog(conf)); + } client.add_schema_version(schemaVersion); } + @Override public SchemaVersion getSchemaVersion(String catName, String dbName, String schemaName, int version) throws TException { return client.get_schema_version(new SchemaVersionDescriptor(new ISchemaName(catName, dbName, schemaName), version)); } @@ -3162,9 +3224,13 @@ public class HiveMetaStoreClient implements IMetaStoreClient, AutoCloseable { } private short shrinkMaxtoShort(int max) { - if (max < 0) return -1; - else if (max <= Short.MAX_VALUE) return (short)max; - else return Short.MAX_VALUE; + if (max < 0) { + return -1; + } else if (max <= Short.MAX_VALUE) { + return (short)max; + } else { + return Short.MAX_VALUE; + } } @Override @@ -3176,4 +3242,14 @@ public class HiveMetaStoreClient implements IMetaStoreClient, AutoCloseable { public boolean heartbeatLockMaterializationRebuild(String dbName, String tableName, long txnId) throws TException { return client.heartbeat_lock_materialization_rebuild(dbName, tableName, txnId); } + + @Override + public void addRuntimeStat(RuntimeStat stat) throws TException { + client.add_runtime_stats(stat); + } + + @Override + public List<RuntimeStat> getRuntimeStats() throws TException { + return client.get_runtime_stats(new GetRuntimeStatsRequest()); + } } http://git-wip-us.apache.org/repos/asf/hive/blob/56c3a957/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java ---------------------------------------------------------------------- diff --git a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java index 27f8775..aee416d 100644 --- a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java +++ b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java @@ -94,6 +94,7 @@ import org.apache.hadoop.hive.metastore.api.PrincipalPrivilegeSet; import org.apache.hadoop.hive.metastore.api.PrincipalType; import org.apache.hadoop.hive.metastore.api.PrivilegeBag; import org.apache.hadoop.hive.metastore.api.Role; +import org.apache.hadoop.hive.metastore.api.RuntimeStat; import org.apache.hadoop.hive.metastore.api.SQLCheckConstraint; import org.apache.hadoop.hive.metastore.api.SQLDefaultConstraint; import org.apache.hadoop.hive.metastore.api.SQLForeignKey; @@ -1891,6 +1892,7 @@ public interface IMetaStoreClient { * @throws TException Thrift transport error. * @deprecated Use {@link #dropPartitions(String, String, String, List, boolean, boolean, boolean)} */ + @Deprecated List<Partition> dropPartitions(String dbName, String tblName, List<ObjectPair<Integer, byte[]>> partExprs, boolean deleteData, boolean ifExists, boolean needResults) throws NoSuchObjectException, MetaException, TException; @@ -3641,4 +3643,11 @@ public interface IMetaStoreClient { * @return true if the lock could be renewed, false otherwise */ boolean heartbeatLockMaterializationRebuild(String dbName, String tableName, long txnId) throws TException; + + /** Adds a RuntimeStat for metastore persistence. */ + void addRuntimeStat(RuntimeStat stat) throws TException; + + /** Reads runtime statistics. */ + List<RuntimeStat> getRuntimeStats() throws TException; + }