You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by na...@apache.org on 2014/08/13 07:53:39 UTC
svn commit: r1617662 [1/3] - in /hive/trunk:
common/src/java/org/apache/hadoop/hive/conf/
itests/hive-unit/src/test/java/org/apache/hadoop/hive/metastore/
metastore/if/ metastore/src/gen/thrift/gen-cpp/
metastore/src/gen/thrift/gen-javabean/org/apache/...
Author: navis
Date: Wed Aug 13 05:53:38 2014
New Revision: 1617662
URL: http://svn.apache.org/r1617662
Log:
HIVE-7532 : allow disabling direct sql per query with external metastore (Navis reviewed by Sergey Shelukhin)
Added:
hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/events/ConfigChangeEvent.java
hive/trunk/ql/src/test/queries/clientpositive/set_metaconf.q
hive/trunk/ql/src/test/results/clientpositive/set_metaconf.q.out
Modified:
hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
hive/trunk/common/src/java/org/apache/hadoop/hive/conf/SystemVariables.java
hive/trunk/itests/hive-unit/src/test/java/org/apache/hadoop/hive/metastore/TestMetaStoreEventListener.java
hive/trunk/metastore/if/hive_metastore.thrift
hive/trunk/metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp
hive/trunk/metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.h
hive/trunk/metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore_server.skeleton.cpp
hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ThriftHiveMetastore.java
hive/trunk/metastore/src/gen/thrift/gen-php/metastore/ThriftHiveMetastore.php
hive/trunk/metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore-remote
hive/trunk/metastore/src/gen/thrift/gen-py/hive_metastore/ThriftHiveMetastore.py
hive/trunk/metastore/src/gen/thrift/gen-rb/thrift_hive_metastore.rb
hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/IHMSHandler.java
hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java
hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreEventListener.java
hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/RetryingHMSHandler.java
hive/trunk/metastore/src/test/org/apache/hadoop/hive/metastore/DummyListener.java
hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java
hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/processors/SetProcessor.java
hive/trunk/service/src/java/org/apache/hive/service/cli/session/HiveSessionBase.java
hive/trunk/service/src/java/org/apache/hive/service/cli/session/HiveSessionImpl.java
hive/trunk/service/src/java/org/apache/hive/service/cli/session/SessionManager.java
Modified: hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
URL: http://svn.apache.org/viewvc/hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java?rev=1617662&r1=1617661&r2=1617662&view=diff
==============================================================================
--- hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java (original)
+++ hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java Wed Aug 13 05:53:38 2014
@@ -68,6 +68,7 @@ public class HiveConf extends Configurat
private static final Map<String, ConfVars> vars = new HashMap<String, ConfVars>();
+ private static final Map<String, ConfVars> metaConfs = new HashMap<String, ConfVars>();
private final List<String> restrictList = new ArrayList<String>();
private boolean isWhiteListRestrictionEnabled = false;
@@ -153,6 +154,19 @@ public class HiveConf extends Configurat
HiveConf.ConfVars.HIVE_TXN_MAX_OPEN_BATCH,
};
+ /**
+ * User configurable Metastore vars
+ */
+ public static final HiveConf.ConfVars[] metaConfVars = {
+ HiveConf.ConfVars.METASTORE_TRY_DIRECT_SQL,
+ HiveConf.ConfVars.METASTORE_TRY_DIRECT_SQL_DDL
+ };
+
+ static {
+ for (ConfVars confVar : metaConfVars) {
+ metaConfs.put(confVar.varname, confVar);
+ }
+ }
/**
* dbVars are the parameters can be set per database. If these
@@ -2032,6 +2046,10 @@ public class HiveConf extends Configurat
return vars.get(name);
}
+ public static ConfVars getMetaConf(String name) {
+ return metaConfs.get(name);
+ }
+
public String getVar(ConfVars var) {
return getVar(this, var);
}
Modified: hive/trunk/common/src/java/org/apache/hadoop/hive/conf/SystemVariables.java
URL: http://svn.apache.org/viewvc/hive/trunk/common/src/java/org/apache/hadoop/hive/conf/SystemVariables.java?rev=1617662&r1=1617661&r2=1617662&view=diff
==============================================================================
--- hive/trunk/common/src/java/org/apache/hadoop/hive/conf/SystemVariables.java (original)
+++ hive/trunk/common/src/java/org/apache/hadoop/hive/conf/SystemVariables.java Wed Aug 13 05:53:38 2014
@@ -33,6 +33,7 @@ public class SystemVariables {
public static final String SYSTEM_PREFIX = "system:";
public static final String HIVECONF_PREFIX = "hiveconf:";
public static final String HIVEVAR_PREFIX = "hivevar:";
+ public static final String METACONF_PREFIX = "metaconf:";
public static final String SET_COLUMN_NAME = "set";
protected String getSubstitute(Configuration conf, String var) {
Modified: hive/trunk/itests/hive-unit/src/test/java/org/apache/hadoop/hive/metastore/TestMetaStoreEventListener.java
URL: http://svn.apache.org/viewvc/hive/trunk/itests/hive-unit/src/test/java/org/apache/hadoop/hive/metastore/TestMetaStoreEventListener.java?rev=1617662&r1=1617661&r2=1617662&view=diff
==============================================================================
--- hive/trunk/itests/hive-unit/src/test/java/org/apache/hadoop/hive/metastore/TestMetaStoreEventListener.java (original)
+++ hive/trunk/itests/hive-unit/src/test/java/org/apache/hadoop/hive/metastore/TestMetaStoreEventListener.java Wed Aug 13 05:53:38 2014
@@ -35,6 +35,7 @@ import org.apache.hadoop.hive.metastore.
import org.apache.hadoop.hive.metastore.events.AddPartitionEvent;
import org.apache.hadoop.hive.metastore.events.AlterPartitionEvent;
import org.apache.hadoop.hive.metastore.events.AlterTableEvent;
+import org.apache.hadoop.hive.metastore.events.ConfigChangeEvent;
import org.apache.hadoop.hive.metastore.events.CreateDatabaseEvent;
import org.apache.hadoop.hive.metastore.events.CreateTableEvent;
import org.apache.hadoop.hive.metastore.events.DropDatabaseEvent;
@@ -53,6 +54,7 @@ import org.apache.hadoop.hive.metastore.
import org.apache.hadoop.hive.metastore.events.PreEventContext;
import org.apache.hadoop.hive.metastore.events.PreLoadPartitionDoneEvent;
import org.apache.hadoop.hive.ql.Driver;
+import org.apache.hadoop.hive.ql.processors.SetProcessor;
import org.apache.hadoop.hive.ql.session.SessionState;
import org.apache.hadoop.hive.shims.ShimLoader;
@@ -375,8 +377,13 @@ public class TestMetaStoreEventListener
validateDropDb(db, dropDB.getDatabase());
PreDropDatabaseEvent preDropDB = (PreDropDatabaseEvent)preNotifyList.get(listSize-1);
- assert dropDB.getStatus();
validateDropDb(db, preDropDB.getDatabase());
+
+ SetProcessor.setVariable("metaconf:hive.metastore.try.direct.sql", "false");
+ ConfigChangeEvent event = (ConfigChangeEvent) notifyList.get(notifyList.size() - 1);
+ assertEquals("hive.metastore.try.direct.sql", event.getKey());
+ assertEquals("true", event.getOldValue());
+ assertEquals("false", event.getNewValue());
}
}
Modified: hive/trunk/metastore/if/hive_metastore.thrift
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/if/hive_metastore.thrift?rev=1617662&r1=1617661&r2=1617662&view=diff
==============================================================================
--- hive/trunk/metastore/if/hive_metastore.thrift (original)
+++ hive/trunk/metastore/if/hive_metastore.thrift Wed Aug 13 05:53:38 2014
@@ -682,6 +682,9 @@ exception NoSuchLockException {
*/
service ThriftHiveMetastore extends fb303.FacebookService
{
+ string getMetaConf(1:string key) throws(1:MetaException o1)
+ void setMetaConf(1:string key, 2:string value) throws(1:MetaException o1)
+
void create_database(1:Database database) throws(1:AlreadyExistsException o1, 2:InvalidObjectException o2, 3:MetaException o3)
Database get_database(1:string name) throws(1:NoSuchObjectException o1, 2:MetaException o2)
void drop_database(1:string name, 2:bool deleteData, 3:bool cascade) throws(1:NoSuchObjectException o1, 2:InvalidOperationException o2, 3:MetaException o3)
Modified: hive/trunk/metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp?rev=1617662&r1=1617661&r2=1617662&view=diff
==============================================================================
--- hive/trunk/metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp (original)
+++ hive/trunk/metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp Wed Aug 13 05:53:38 2014
@@ -8,6 +8,366 @@
namespace Apache { namespace Hadoop { namespace Hive {
+uint32_t ThriftHiveMetastore_getMetaConf_args::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->key);
+ this->__isset.key = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t ThriftHiveMetastore_getMetaConf_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("ThriftHiveMetastore_getMetaConf_args");
+
+ xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeString(this->key);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t ThriftHiveMetastore_getMetaConf_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("ThriftHiveMetastore_getMetaConf_pargs");
+
+ xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeString((*(this->key)));
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t ThriftHiveMetastore_getMetaConf_result::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->success);
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->o1.read(iprot);
+ this->__isset.o1 = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t ThriftHiveMetastore_getMetaConf_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+ uint32_t xfer = 0;
+
+ xfer += oprot->writeStructBegin("ThriftHiveMetastore_getMetaConf_result");
+
+ if (this->__isset.success) {
+ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRING, 0);
+ xfer += oprot->writeString(this->success);
+ xfer += oprot->writeFieldEnd();
+ } else if (this->__isset.o1) {
+ xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->o1.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t ThriftHiveMetastore_getMetaConf_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString((*(this->success)));
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->o1.read(iprot);
+ this->__isset.o1 = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t ThriftHiveMetastore_setMetaConf_args::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->key);
+ this->__isset.key = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->value);
+ this->__isset.value = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t ThriftHiveMetastore_setMetaConf_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("ThriftHiveMetastore_setMetaConf_args");
+
+ xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeString(this->key);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldBegin("value", ::apache::thrift::protocol::T_STRING, 2);
+ xfer += oprot->writeString(this->value);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t ThriftHiveMetastore_setMetaConf_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("ThriftHiveMetastore_setMetaConf_pargs");
+
+ xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1);
+ xfer += oprot->writeString((*(this->key)));
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldBegin("value", ::apache::thrift::protocol::T_STRING, 2);
+ xfer += oprot->writeString((*(this->value)));
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t ThriftHiveMetastore_setMetaConf_result::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->o1.read(iprot);
+ this->__isset.o1 = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t ThriftHiveMetastore_setMetaConf_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+ uint32_t xfer = 0;
+
+ xfer += oprot->writeStructBegin("ThriftHiveMetastore_setMetaConf_result");
+
+ if (this->__isset.o1) {
+ xfer += oprot->writeFieldBegin("o1", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->o1.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+uint32_t ThriftHiveMetastore_setMetaConf_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->o1.read(iprot);
+ this->__isset.o1 = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
uint32_t ThriftHiveMetastore_create_database_args::read(::apache::thrift::protocol::TProtocol* iprot) {
uint32_t xfer = 0;
@@ -25464,6 +25824,124 @@ uint32_t ThriftHiveMetastore_show_compac
return xfer;
}
+void ThriftHiveMetastoreClient::getMetaConf(std::string& _return, const std::string& key)
+{
+ send_getMetaConf(key);
+ recv_getMetaConf(_return);
+}
+
+void ThriftHiveMetastoreClient::send_getMetaConf(const std::string& key)
+{
+ int32_t cseqid = 0;
+ oprot_->writeMessageBegin("getMetaConf", ::apache::thrift::protocol::T_CALL, cseqid);
+
+ ThriftHiveMetastore_getMetaConf_pargs args;
+ args.key = &key;
+ args.write(oprot_);
+
+ oprot_->writeMessageEnd();
+ oprot_->getTransport()->writeEnd();
+ oprot_->getTransport()->flush();
+}
+
+void ThriftHiveMetastoreClient::recv_getMetaConf(std::string& _return)
+{
+
+ int32_t rseqid = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TMessageType mtype;
+
+ iprot_->readMessageBegin(fname, mtype, rseqid);
+ if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+ ::apache::thrift::TApplicationException x;
+ x.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ throw x;
+ }
+ if (mtype != ::apache::thrift::protocol::T_REPLY) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ if (fname.compare("getMetaConf") != 0) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ ThriftHiveMetastore_getMetaConf_presult result;
+ result.success = &_return;
+ result.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+
+ if (result.__isset.success) {
+ // _return pointer has now been filled
+ return;
+ }
+ if (result.__isset.o1) {
+ throw result.o1;
+ }
+ throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getMetaConf failed: unknown result");
+}
+
+void ThriftHiveMetastoreClient::setMetaConf(const std::string& key, const std::string& value)
+{
+ send_setMetaConf(key, value);
+ recv_setMetaConf();
+}
+
+void ThriftHiveMetastoreClient::send_setMetaConf(const std::string& key, const std::string& value)
+{
+ int32_t cseqid = 0;
+ oprot_->writeMessageBegin("setMetaConf", ::apache::thrift::protocol::T_CALL, cseqid);
+
+ ThriftHiveMetastore_setMetaConf_pargs args;
+ args.key = &key;
+ args.value = &value;
+ args.write(oprot_);
+
+ oprot_->writeMessageEnd();
+ oprot_->getTransport()->writeEnd();
+ oprot_->getTransport()->flush();
+}
+
+void ThriftHiveMetastoreClient::recv_setMetaConf()
+{
+
+ int32_t rseqid = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TMessageType mtype;
+
+ iprot_->readMessageBegin(fname, mtype, rseqid);
+ if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+ ::apache::thrift::TApplicationException x;
+ x.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ throw x;
+ }
+ if (mtype != ::apache::thrift::protocol::T_REPLY) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ if (fname.compare("setMetaConf") != 0) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ ThriftHiveMetastore_setMetaConf_presult result;
+ result.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+
+ if (result.__isset.o1) {
+ throw result.o1;
+ }
+ return;
+}
+
void ThriftHiveMetastoreClient::create_database(const Database& database)
{
send_create_database(database);
@@ -32535,6 +33013,119 @@ bool ThriftHiveMetastoreProcessor::dispa
return true;
}
+void ThriftHiveMetastoreProcessor::process_getMetaConf(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+ void* ctx = NULL;
+ if (this->eventHandler_.get() != NULL) {
+ ctx = this->eventHandler_->getContext("ThriftHiveMetastore.getMetaConf", callContext);
+ }
+ ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.getMetaConf");
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.getMetaConf");
+ }
+
+ ThriftHiveMetastore_getMetaConf_args args;
+ args.read(iprot);
+ iprot->readMessageEnd();
+ uint32_t bytes = iprot->getTransport()->readEnd();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.getMetaConf", bytes);
+ }
+
+ ThriftHiveMetastore_getMetaConf_result result;
+ try {
+ iface_->getMetaConf(result.success, args.key);
+ result.__isset.success = true;
+ } catch (MetaException &o1) {
+ result.o1 = o1;
+ result.__isset.o1 = true;
+ } catch (const std::exception& e) {
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.getMetaConf");
+ }
+
+ ::apache::thrift::TApplicationException x(e.what());
+ oprot->writeMessageBegin("getMetaConf", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+ x.write(oprot);
+ oprot->writeMessageEnd();
+ oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+ return;
+ }
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.getMetaConf");
+ }
+
+ oprot->writeMessageBegin("getMetaConf", ::apache::thrift::protocol::T_REPLY, seqid);
+ result.write(oprot);
+ oprot->writeMessageEnd();
+ bytes = oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.getMetaConf", bytes);
+ }
+}
+
+void ThriftHiveMetastoreProcessor::process_setMetaConf(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+ void* ctx = NULL;
+ if (this->eventHandler_.get() != NULL) {
+ ctx = this->eventHandler_->getContext("ThriftHiveMetastore.setMetaConf", callContext);
+ }
+ ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ThriftHiveMetastore.setMetaConf");
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preRead(ctx, "ThriftHiveMetastore.setMetaConf");
+ }
+
+ ThriftHiveMetastore_setMetaConf_args args;
+ args.read(iprot);
+ iprot->readMessageEnd();
+ uint32_t bytes = iprot->getTransport()->readEnd();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postRead(ctx, "ThriftHiveMetastore.setMetaConf", bytes);
+ }
+
+ ThriftHiveMetastore_setMetaConf_result result;
+ try {
+ iface_->setMetaConf(args.key, args.value);
+ } catch (MetaException &o1) {
+ result.o1 = o1;
+ result.__isset.o1 = true;
+ } catch (const std::exception& e) {
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->handlerError(ctx, "ThriftHiveMetastore.setMetaConf");
+ }
+
+ ::apache::thrift::TApplicationException x(e.what());
+ oprot->writeMessageBegin("setMetaConf", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+ x.write(oprot);
+ oprot->writeMessageEnd();
+ oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+ return;
+ }
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preWrite(ctx, "ThriftHiveMetastore.setMetaConf");
+ }
+
+ oprot->writeMessageBegin("setMetaConf", ::apache::thrift::protocol::T_REPLY, seqid);
+ result.write(oprot);
+ oprot->writeMessageEnd();
+ bytes = oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postWrite(ctx, "ThriftHiveMetastore.setMetaConf", bytes);
+ }
+}
+
void ThriftHiveMetastoreProcessor::process_create_database(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
{
void* ctx = NULL;
Modified: hive/trunk/metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.h
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.h?rev=1617662&r1=1617661&r2=1617662&view=diff
==============================================================================
--- hive/trunk/metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.h (original)
+++ hive/trunk/metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.h Wed Aug 13 05:53:38 2014
@@ -16,6 +16,8 @@ namespace Apache { namespace Hadoop { na
class ThriftHiveMetastoreIf : virtual public ::facebook::fb303::FacebookServiceIf {
public:
virtual ~ThriftHiveMetastoreIf() {}
+ virtual void getMetaConf(std::string& _return, const std::string& key) = 0;
+ virtual void setMetaConf(const std::string& key, const std::string& value) = 0;
virtual void create_database(const Database& database) = 0;
virtual void get_database(Database& _return, const std::string& name) = 0;
virtual void drop_database(const std::string& name, const bool deleteData, const bool cascade) = 0;
@@ -155,6 +157,12 @@ class ThriftHiveMetastoreIfSingletonFact
class ThriftHiveMetastoreNull : virtual public ThriftHiveMetastoreIf , virtual public ::facebook::fb303::FacebookServiceNull {
public:
virtual ~ThriftHiveMetastoreNull() {}
+ void getMetaConf(std::string& /* _return */, const std::string& /* key */) {
+ return;
+ }
+ void setMetaConf(const std::string& /* key */, const std::string& /* value */) {
+ return;
+ }
void create_database(const Database& /* database */) {
return;
}
@@ -508,6 +516,241 @@ class ThriftHiveMetastoreNull : virtual
}
};
+typedef struct _ThriftHiveMetastore_getMetaConf_args__isset {
+ _ThriftHiveMetastore_getMetaConf_args__isset() : key(false) {}
+ bool key;
+} _ThriftHiveMetastore_getMetaConf_args__isset;
+
+class ThriftHiveMetastore_getMetaConf_args {
+ public:
+
+ ThriftHiveMetastore_getMetaConf_args() : key() {
+ }
+
+ virtual ~ThriftHiveMetastore_getMetaConf_args() throw() {}
+
+ std::string key;
+
+ _ThriftHiveMetastore_getMetaConf_args__isset __isset;
+
+ void __set_key(const std::string& val) {
+ key = val;
+ }
+
+ bool operator == (const ThriftHiveMetastore_getMetaConf_args & rhs) const
+ {
+ if (!(key == rhs.key))
+ return false;
+ return true;
+ }
+ bool operator != (const ThriftHiveMetastore_getMetaConf_args &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const ThriftHiveMetastore_getMetaConf_args & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class ThriftHiveMetastore_getMetaConf_pargs {
+ public:
+
+
+ virtual ~ThriftHiveMetastore_getMetaConf_pargs() throw() {}
+
+ const std::string* key;
+
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _ThriftHiveMetastore_getMetaConf_result__isset {
+ _ThriftHiveMetastore_getMetaConf_result__isset() : success(false), o1(false) {}
+ bool success;
+ bool o1;
+} _ThriftHiveMetastore_getMetaConf_result__isset;
+
+class ThriftHiveMetastore_getMetaConf_result {
+ public:
+
+ ThriftHiveMetastore_getMetaConf_result() : success() {
+ }
+
+ virtual ~ThriftHiveMetastore_getMetaConf_result() throw() {}
+
+ std::string success;
+ MetaException o1;
+
+ _ThriftHiveMetastore_getMetaConf_result__isset __isset;
+
+ void __set_success(const std::string& val) {
+ success = val;
+ }
+
+ void __set_o1(const MetaException& val) {
+ o1 = val;
+ }
+
+ bool operator == (const ThriftHiveMetastore_getMetaConf_result & rhs) const
+ {
+ if (!(success == rhs.success))
+ return false;
+ if (!(o1 == rhs.o1))
+ return false;
+ return true;
+ }
+ bool operator != (const ThriftHiveMetastore_getMetaConf_result &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const ThriftHiveMetastore_getMetaConf_result & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _ThriftHiveMetastore_getMetaConf_presult__isset {
+ _ThriftHiveMetastore_getMetaConf_presult__isset() : success(false), o1(false) {}
+ bool success;
+ bool o1;
+} _ThriftHiveMetastore_getMetaConf_presult__isset;
+
+class ThriftHiveMetastore_getMetaConf_presult {
+ public:
+
+
+ virtual ~ThriftHiveMetastore_getMetaConf_presult() throw() {}
+
+ std::string* success;
+ MetaException o1;
+
+ _ThriftHiveMetastore_getMetaConf_presult__isset __isset;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+
+};
+
+typedef struct _ThriftHiveMetastore_setMetaConf_args__isset {
+ _ThriftHiveMetastore_setMetaConf_args__isset() : key(false), value(false) {}
+ bool key;
+ bool value;
+} _ThriftHiveMetastore_setMetaConf_args__isset;
+
+class ThriftHiveMetastore_setMetaConf_args {
+ public:
+
+ ThriftHiveMetastore_setMetaConf_args() : key(), value() {
+ }
+
+ virtual ~ThriftHiveMetastore_setMetaConf_args() throw() {}
+
+ std::string key;
+ std::string value;
+
+ _ThriftHiveMetastore_setMetaConf_args__isset __isset;
+
+ void __set_key(const std::string& val) {
+ key = val;
+ }
+
+ void __set_value(const std::string& val) {
+ value = val;
+ }
+
+ bool operator == (const ThriftHiveMetastore_setMetaConf_args & rhs) const
+ {
+ if (!(key == rhs.key))
+ return false;
+ if (!(value == rhs.value))
+ return false;
+ return true;
+ }
+ bool operator != (const ThriftHiveMetastore_setMetaConf_args &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const ThriftHiveMetastore_setMetaConf_args & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class ThriftHiveMetastore_setMetaConf_pargs {
+ public:
+
+
+ virtual ~ThriftHiveMetastore_setMetaConf_pargs() throw() {}
+
+ const std::string* key;
+ const std::string* value;
+
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _ThriftHiveMetastore_setMetaConf_result__isset {
+ _ThriftHiveMetastore_setMetaConf_result__isset() : o1(false) {}
+ bool o1;
+} _ThriftHiveMetastore_setMetaConf_result__isset;
+
+class ThriftHiveMetastore_setMetaConf_result {
+ public:
+
+ ThriftHiveMetastore_setMetaConf_result() {
+ }
+
+ virtual ~ThriftHiveMetastore_setMetaConf_result() throw() {}
+
+ MetaException o1;
+
+ _ThriftHiveMetastore_setMetaConf_result__isset __isset;
+
+ void __set_o1(const MetaException& val) {
+ o1 = val;
+ }
+
+ bool operator == (const ThriftHiveMetastore_setMetaConf_result & rhs) const
+ {
+ if (!(o1 == rhs.o1))
+ return false;
+ return true;
+ }
+ bool operator != (const ThriftHiveMetastore_setMetaConf_result &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const ThriftHiveMetastore_setMetaConf_result & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _ThriftHiveMetastore_setMetaConf_presult__isset {
+ _ThriftHiveMetastore_setMetaConf_presult__isset() : o1(false) {}
+ bool o1;
+} _ThriftHiveMetastore_setMetaConf_presult__isset;
+
+class ThriftHiveMetastore_setMetaConf_presult {
+ public:
+
+
+ virtual ~ThriftHiveMetastore_setMetaConf_presult() throw() {}
+
+ MetaException o1;
+
+ _ThriftHiveMetastore_setMetaConf_presult__isset __isset;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+
+};
+
typedef struct _ThriftHiveMetastore_create_database_args__isset {
_ThriftHiveMetastore_create_database_args__isset() : database(false) {}
bool database;
@@ -15582,6 +15825,12 @@ class ThriftHiveMetastoreClient : virtua
boost::shared_ptr< ::apache::thrift::protocol::TProtocol> getOutputProtocol() {
return poprot_;
}
+ void getMetaConf(std::string& _return, const std::string& key);
+ void send_getMetaConf(const std::string& key);
+ void recv_getMetaConf(std::string& _return);
+ void setMetaConf(const std::string& key, const std::string& value);
+ void send_setMetaConf(const std::string& key, const std::string& value);
+ void recv_setMetaConf();
void create_database(const Database& database);
void send_create_database(const Database& database);
void recv_create_database();
@@ -15922,6 +16171,8 @@ class ThriftHiveMetastoreProcessor : pub
typedef void (ThriftHiveMetastoreProcessor::*ProcessFunction)(int32_t, ::apache::thrift::protocol::TProtocol*, ::apache::thrift::protocol::TProtocol*, void*);
typedef std::map<std::string, ProcessFunction> ProcessMap;
ProcessMap processMap_;
+ void process_getMetaConf(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
+ void process_setMetaConf(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
void process_create_database(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
void process_get_database(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
void process_drop_database(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
@@ -16036,6 +16287,8 @@ class ThriftHiveMetastoreProcessor : pub
ThriftHiveMetastoreProcessor(boost::shared_ptr<ThriftHiveMetastoreIf> iface) :
::facebook::fb303::FacebookServiceProcessor(iface),
iface_(iface) {
+ processMap_["getMetaConf"] = &ThriftHiveMetastoreProcessor::process_getMetaConf;
+ processMap_["setMetaConf"] = &ThriftHiveMetastoreProcessor::process_setMetaConf;
processMap_["create_database"] = &ThriftHiveMetastoreProcessor::process_create_database;
processMap_["get_database"] = &ThriftHiveMetastoreProcessor::process_get_database;
processMap_["drop_database"] = &ThriftHiveMetastoreProcessor::process_drop_database;
@@ -16179,6 +16432,25 @@ class ThriftHiveMetastoreMultiface : vir
ifaces_.push_back(iface);
}
public:
+ void getMetaConf(std::string& _return, const std::string& key) {
+ size_t sz = ifaces_.size();
+ size_t i = 0;
+ for (; i < (sz - 1); ++i) {
+ ifaces_[i]->getMetaConf(_return, key);
+ }
+ ifaces_[i]->getMetaConf(_return, key);
+ return;
+ }
+
+ void setMetaConf(const std::string& key, const std::string& value) {
+ size_t sz = ifaces_.size();
+ size_t i = 0;
+ for (; i < (sz - 1); ++i) {
+ ifaces_[i]->setMetaConf(key, value);
+ }
+ ifaces_[i]->setMetaConf(key, value);
+ }
+
void create_database(const Database& database) {
size_t sz = ifaces_.size();
size_t i = 0;
Modified: hive/trunk/metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore_server.skeleton.cpp
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore_server.skeleton.cpp?rev=1617662&r1=1617661&r2=1617662&view=diff
==============================================================================
--- hive/trunk/metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore_server.skeleton.cpp (original)
+++ hive/trunk/metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore_server.skeleton.cpp Wed Aug 13 05:53:38 2014
@@ -22,6 +22,16 @@ class ThriftHiveMetastoreHandler : virtu
// Your initialization goes here
}
+ void getMetaConf(std::string& _return, const std::string& key) {
+ // Your implementation goes here
+ printf("getMetaConf\n");
+ }
+
+ void setMetaConf(const std::string& key, const std::string& value) {
+ // Your implementation goes here
+ printf("setMetaConf\n");
+ }
+
void create_database(const Database& database) {
// Your implementation goes here
printf("create_database\n");