You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by zs...@apache.org on 2009/08/19 23:03:05 UTC
svn commit: r805973 [18/19] - in /hadoop/hive/trunk: ./ data/files/
eclipse-templates/
metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/
metastore/src/gen-py/hive_metastore/ ql/ ql/if/ ql/src/gen-javabean/
ql/src/gen-javabean/org/ ql/src...
Modified: hadoop/hive/trunk/service/lib/py/fb303/FacebookService.py
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/service/lib/py/fb303/FacebookService.py?rev=805973&r1=805972&r2=805973&view=diff
==============================================================================
--- hadoop/hive/trunk/service/lib/py/fb303/FacebookService.py (original)
+++ hadoop/hive/trunk/service/lib/py/fb303/FacebookService.py Wed Aug 19 21:02:57 2009
@@ -16,47 +16,107 @@
class Iface:
+ """
+ Standard base service
+ """
def getName(self, ):
+ """
+ Returns a descriptive name of the service
+ """
pass
def getVersion(self, ):
+ """
+ Returns the version of the service
+ """
pass
def getStatus(self, ):
+ """
+ Gets the status of this service
+ """
pass
def getStatusDetails(self, ):
+ """
+ User friendly description of status, such as why the service is in
+ the dead or warning state, or what is being started or stopped.
+ """
pass
def getCounters(self, ):
+ """
+ Gets the counters for this service
+ """
pass
def getCounter(self, key):
+ """
+ Gets the value of a single counter
+
+ Parameters:
+ - key
+ """
pass
def setOption(self, key, value):
+ """
+ Sets an option
+
+ Parameters:
+ - key
+ - value
+ """
pass
def getOption(self, key):
+ """
+ Gets an option
+
+ Parameters:
+ - key
+ """
pass
def getOptions(self, ):
+ """
+ Gets all options
+ """
pass
- def aliveSince(self, ):
+ def getCpuProfile(self, profileDurationInSec):
+ """
+ Returns a CPU profile over the given time interval (client and server
+ must agree on the profile format).
+
+ Parameters:
+ - profileDurationInSec
+ """
pass
- def getLimitedReflection(self, ):
+ def aliveSince(self, ):
+ """
+ Returns the unix time that the server has been running since
+ """
pass
def reinitialize(self, ):
+ """
+ Tell the server to reload its configuration, reopen log files, etc
+ """
pass
def shutdown(self, ):
+ """
+ Suggest a shutdown to the server
+ """
pass
class Client(Iface):
+ """
+ Standard base service
+ """
def __init__(self, iprot, oprot=None):
self._iprot = self._oprot = iprot
if oprot != None:
@@ -64,6 +124,9 @@
self._seqid = 0
def getName(self, ):
+ """
+ Returns a descriptive name of the service
+ """
self.send_getName()
return self.recv_getName()
@@ -89,6 +152,9 @@
raise TApplicationException(TApplicationException.MISSING_RESULT, "getName failed: unknown result");
def getVersion(self, ):
+ """
+ Returns the version of the service
+ """
self.send_getVersion()
return self.recv_getVersion()
@@ -114,6 +180,9 @@
raise TApplicationException(TApplicationException.MISSING_RESULT, "getVersion failed: unknown result");
def getStatus(self, ):
+ """
+ Gets the status of this service
+ """
self.send_getStatus()
return self.recv_getStatus()
@@ -139,6 +208,10 @@
raise TApplicationException(TApplicationException.MISSING_RESULT, "getStatus failed: unknown result");
def getStatusDetails(self, ):
+ """
+ User friendly description of status, such as why the service is in
+ the dead or warning state, or what is being started or stopped.
+ """
self.send_getStatusDetails()
return self.recv_getStatusDetails()
@@ -164,6 +237,9 @@
raise TApplicationException(TApplicationException.MISSING_RESULT, "getStatusDetails failed: unknown result");
def getCounters(self, ):
+ """
+ Gets the counters for this service
+ """
self.send_getCounters()
return self.recv_getCounters()
@@ -189,6 +265,12 @@
raise TApplicationException(TApplicationException.MISSING_RESULT, "getCounters failed: unknown result");
def getCounter(self, key):
+ """
+ Gets the value of a single counter
+
+ Parameters:
+ - key
+ """
self.send_getCounter(key)
return self.recv_getCounter()
@@ -215,6 +297,13 @@
raise TApplicationException(TApplicationException.MISSING_RESULT, "getCounter failed: unknown result");
def setOption(self, key, value):
+ """
+ Sets an option
+
+ Parameters:
+ - key
+ - value
+ """
self.send_setOption(key, value)
self.recv_setOption()
@@ -240,6 +329,12 @@
return
def getOption(self, key):
+ """
+ Gets an option
+
+ Parameters:
+ - key
+ """
self.send_getOption(key)
return self.recv_getOption()
@@ -266,6 +361,9 @@
raise TApplicationException(TApplicationException.MISSING_RESULT, "getOption failed: unknown result");
def getOptions(self, ):
+ """
+ Gets all options
+ """
self.send_getOptions()
return self.recv_getOptions()
@@ -290,57 +388,71 @@
return result.success
raise TApplicationException(TApplicationException.MISSING_RESULT, "getOptions failed: unknown result");
- def aliveSince(self, ):
- self.send_aliveSince()
- return self.recv_aliveSince()
-
- def send_aliveSince(self, ):
- self._oprot.writeMessageBegin('aliveSince', TMessageType.CALL, self._seqid)
- args = aliveSince_args()
+ def getCpuProfile(self, profileDurationInSec):
+ """
+ Returns a CPU profile over the given time interval (client and server
+ must agree on the profile format).
+
+ Parameters:
+ - profileDurationInSec
+ """
+ self.send_getCpuProfile(profileDurationInSec)
+ return self.recv_getCpuProfile()
+
+ def send_getCpuProfile(self, profileDurationInSec):
+ self._oprot.writeMessageBegin('getCpuProfile', TMessageType.CALL, self._seqid)
+ args = getCpuProfile_args()
+ args.profileDurationInSec = profileDurationInSec
args.write(self._oprot)
self._oprot.writeMessageEnd()
self._oprot.trans.flush()
- def recv_aliveSince(self, ):
+ def recv_getCpuProfile(self, ):
(fname, mtype, rseqid) = self._iprot.readMessageBegin()
if mtype == TMessageType.EXCEPTION:
x = TApplicationException()
x.read(self._iprot)
self._iprot.readMessageEnd()
raise x
- result = aliveSince_result()
+ result = getCpuProfile_result()
result.read(self._iprot)
self._iprot.readMessageEnd()
if result.success != None:
return result.success
- raise TApplicationException(TApplicationException.MISSING_RESULT, "aliveSince failed: unknown result");
+ raise TApplicationException(TApplicationException.MISSING_RESULT, "getCpuProfile failed: unknown result");
+
+ def aliveSince(self, ):
+ """
+ Returns the unix time that the server has been running since
+ """
+ self.send_aliveSince()
+ return self.recv_aliveSince()
- def getLimitedReflection(self, ):
- self.send_getLimitedReflection()
- return self.recv_getLimitedReflection()
-
- def send_getLimitedReflection(self, ):
- self._oprot.writeMessageBegin('getLimitedReflection', TMessageType.CALL, self._seqid)
- args = getLimitedReflection_args()
+ def send_aliveSince(self, ):
+ self._oprot.writeMessageBegin('aliveSince', TMessageType.CALL, self._seqid)
+ args = aliveSince_args()
args.write(self._oprot)
self._oprot.writeMessageEnd()
self._oprot.trans.flush()
- def recv_getLimitedReflection(self, ):
+ def recv_aliveSince(self, ):
(fname, mtype, rseqid) = self._iprot.readMessageBegin()
if mtype == TMessageType.EXCEPTION:
x = TApplicationException()
x.read(self._iprot)
self._iprot.readMessageEnd()
raise x
- result = getLimitedReflection_result()
+ result = aliveSince_result()
result.read(self._iprot)
self._iprot.readMessageEnd()
if result.success != None:
return result.success
- raise TApplicationException(TApplicationException.MISSING_RESULT, "getLimitedReflection failed: unknown result");
+ raise TApplicationException(TApplicationException.MISSING_RESULT, "aliveSince failed: unknown result");
def reinitialize(self, ):
+ """
+ Tell the server to reload its configuration, reopen log files, etc
+ """
self.send_reinitialize()
def send_reinitialize(self, ):
@@ -350,6 +462,9 @@
self._oprot.writeMessageEnd()
self._oprot.trans.flush()
def shutdown(self, ):
+ """
+ Suggest a shutdown to the server
+ """
self.send_shutdown()
def send_shutdown(self, ):
@@ -372,8 +487,8 @@
self._processMap["setOption"] = Processor.process_setOption
self._processMap["getOption"] = Processor.process_getOption
self._processMap["getOptions"] = Processor.process_getOptions
+ self._processMap["getCpuProfile"] = Processor.process_getCpuProfile
self._processMap["aliveSince"] = Processor.process_aliveSince
- self._processMap["getLimitedReflection"] = Processor.process_getLimitedReflection
self._processMap["reinitialize"] = Processor.process_reinitialize
self._processMap["shutdown"] = Processor.process_shutdown
@@ -491,24 +606,24 @@
oprot.writeMessageEnd()
oprot.trans.flush()
- def process_aliveSince(self, seqid, iprot, oprot):
- args = aliveSince_args()
+ def process_getCpuProfile(self, seqid, iprot, oprot):
+ args = getCpuProfile_args()
args.read(iprot)
iprot.readMessageEnd()
- result = aliveSince_result()
- result.success = self._handler.aliveSince()
- oprot.writeMessageBegin("aliveSince", TMessageType.REPLY, seqid)
+ result = getCpuProfile_result()
+ result.success = self._handler.getCpuProfile(args.profileDurationInSec)
+ oprot.writeMessageBegin("getCpuProfile", TMessageType.REPLY, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
- def process_getLimitedReflection(self, seqid, iprot, oprot):
- args = getLimitedReflection_args()
+ def process_aliveSince(self, seqid, iprot, oprot):
+ args = aliveSince_args()
args.read(iprot)
iprot.readMessageEnd()
- result = getLimitedReflection_result()
- result.success = self._handler.getLimitedReflection()
- oprot.writeMessageBegin("getLimitedReflection", TMessageType.REPLY, seqid)
+ result = aliveSince_result()
+ result.success = self._handler.aliveSince()
+ oprot.writeMessageBegin("aliveSince", TMessageType.REPLY, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
@@ -535,9 +650,6 @@
thrift_spec = (
)
- def __init__(self, d=None):
- pass
-
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))
@@ -560,11 +672,10 @@
oprot.writeFieldStop()
oprot.writeStructEnd()
- def __str__(self):
- return str(self.__dict__)
-
- def __repr__(self):
- return repr(self.__dict__)
+ 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__
@@ -573,16 +684,17 @@
return not (self == other)
class getName_result:
+ """
+ Attributes:
+ - success
+ """
thrift_spec = (
(0, TType.STRING, 'success', None, None, ), # 0
)
- def __init__(self, d=None):
- self.success = None
- if isinstance(d, dict):
- if 'success' in d:
- self.success = d['success']
+ def __init__(self, success=None,):
+ self.success = success
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:
@@ -615,11 +727,10 @@
oprot.writeFieldStop()
oprot.writeStructEnd()
- def __str__(self):
- return str(self.__dict__)
-
- def __repr__(self):
- return repr(self.__dict__)
+ 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__
@@ -632,9 +743,6 @@
thrift_spec = (
)
- def __init__(self, d=None):
- pass
-
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))
@@ -657,11 +765,10 @@
oprot.writeFieldStop()
oprot.writeStructEnd()
- def __str__(self):
- return str(self.__dict__)
-
- def __repr__(self):
- return repr(self.__dict__)
+ 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__
@@ -670,16 +777,17 @@
return not (self == other)
class getVersion_result:
+ """
+ Attributes:
+ - success
+ """
thrift_spec = (
(0, TType.STRING, 'success', None, None, ), # 0
)
- def __init__(self, d=None):
- self.success = None
- if isinstance(d, dict):
- if 'success' in d:
- self.success = d['success']
+ def __init__(self, success=None,):
+ self.success = success
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:
@@ -712,11 +820,10 @@
oprot.writeFieldStop()
oprot.writeStructEnd()
- def __str__(self):
- return str(self.__dict__)
-
- def __repr__(self):
- return repr(self.__dict__)
+ 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__
@@ -729,9 +836,6 @@
thrift_spec = (
)
- def __init__(self, d=None):
- pass
-
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))
@@ -754,11 +858,10 @@
oprot.writeFieldStop()
oprot.writeStructEnd()
- def __str__(self):
- return str(self.__dict__)
-
- def __repr__(self):
- return repr(self.__dict__)
+ 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__
@@ -767,16 +870,17 @@
return not (self == other)
class getStatus_result:
+ """
+ Attributes:
+ - success
+ """
thrift_spec = (
(0, TType.I32, 'success', None, None, ), # 0
)
- def __init__(self, d=None):
- self.success = None
- if isinstance(d, dict):
- if 'success' in d:
- self.success = d['success']
+ def __init__(self, success=None,):
+ self.success = success
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:
@@ -809,11 +913,10 @@
oprot.writeFieldStop()
oprot.writeStructEnd()
- def __str__(self):
- return str(self.__dict__)
-
- def __repr__(self):
- return repr(self.__dict__)
+ 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__
@@ -826,9 +929,6 @@
thrift_spec = (
)
- def __init__(self, d=None):
- pass
-
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))
@@ -851,11 +951,10 @@
oprot.writeFieldStop()
oprot.writeStructEnd()
- def __str__(self):
- return str(self.__dict__)
-
- def __repr__(self):
- return repr(self.__dict__)
+ 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__
@@ -864,16 +963,17 @@
return not (self == other)
class getStatusDetails_result:
+ """
+ Attributes:
+ - success
+ """
thrift_spec = (
(0, TType.STRING, 'success', None, None, ), # 0
)
- def __init__(self, d=None):
- self.success = None
- if isinstance(d, dict):
- if 'success' in d:
- self.success = d['success']
+ def __init__(self, success=None,):
+ self.success = success
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:
@@ -906,11 +1006,10 @@
oprot.writeFieldStop()
oprot.writeStructEnd()
- def __str__(self):
- return str(self.__dict__)
-
- def __repr__(self):
- return repr(self.__dict__)
+ 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__
@@ -923,9 +1022,6 @@
thrift_spec = (
)
- def __init__(self, d=None):
- pass
-
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))
@@ -948,11 +1044,10 @@
oprot.writeFieldStop()
oprot.writeStructEnd()
- def __str__(self):
- return str(self.__dict__)
-
- def __repr__(self):
- return repr(self.__dict__)
+ 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__
@@ -961,16 +1056,17 @@
return not (self == other)
class getCounters_result:
+ """
+ Attributes:
+ - success
+ """
thrift_spec = (
(0, TType.MAP, 'success', (TType.STRING,None,TType.I64,None), None, ), # 0
)
- def __init__(self, d=None):
- self.success = None
- if isinstance(d, dict):
- if 'success' in d:
- self.success = d['success']
+ def __init__(self, success=None,):
+ self.success = success
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:
@@ -1013,11 +1109,10 @@
oprot.writeFieldStop()
oprot.writeStructEnd()
- def __str__(self):
- return str(self.__dict__)
-
- def __repr__(self):
- return repr(self.__dict__)
+ 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__
@@ -1026,17 +1121,18 @@
return not (self == other)
class getCounter_args:
+ """
+ Attributes:
+ - key
+ """
thrift_spec = (
None, # 0
(1, TType.STRING, 'key', None, None, ), # 1
)
- def __init__(self, d=None):
- self.key = None
- if isinstance(d, dict):
- if 'key' in d:
- self.key = d['key']
+ def __init__(self, key=None,):
+ self.key = key
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:
@@ -1069,11 +1165,10 @@
oprot.writeFieldStop()
oprot.writeStructEnd()
- def __str__(self):
- return str(self.__dict__)
-
- def __repr__(self):
- return repr(self.__dict__)
+ 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__
@@ -1082,16 +1177,17 @@
return not (self == other)
class getCounter_result:
+ """
+ Attributes:
+ - success
+ """
thrift_spec = (
(0, TType.I64, 'success', None, None, ), # 0
)
- def __init__(self, d=None):
- self.success = None
- if isinstance(d, dict):
- if 'success' in d:
- self.success = d['success']
+ def __init__(self, success=None,):
+ self.success = success
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:
@@ -1124,11 +1220,10 @@
oprot.writeFieldStop()
oprot.writeStructEnd()
- def __str__(self):
- return str(self.__dict__)
-
- def __repr__(self):
- return repr(self.__dict__)
+ 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__
@@ -1137,6 +1232,11 @@
return not (self == other)
class setOption_args:
+ """
+ Attributes:
+ - key
+ - value
+ """
thrift_spec = (
None, # 0
@@ -1144,14 +1244,9 @@
(2, TType.STRING, 'value', None, None, ), # 2
)
- def __init__(self, d=None):
- self.key = None
- self.value = None
- if isinstance(d, dict):
- if 'key' in d:
- self.key = d['key']
- if 'value' in d:
- self.value = d['value']
+ def __init__(self, key=None, value=None,):
+ self.key = key
+ self.value = value
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:
@@ -1193,11 +1288,10 @@
oprot.writeFieldStop()
oprot.writeStructEnd()
- def __str__(self):
- return str(self.__dict__)
-
- def __repr__(self):
- return repr(self.__dict__)
+ 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__
@@ -1210,9 +1304,6 @@
thrift_spec = (
)
- def __init__(self, d=None):
- pass
-
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))
@@ -1235,11 +1326,10 @@
oprot.writeFieldStop()
oprot.writeStructEnd()
- def __str__(self):
- return str(self.__dict__)
-
- def __repr__(self):
- return repr(self.__dict__)
+ 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__
@@ -1248,17 +1338,18 @@
return not (self == other)
class getOption_args:
+ """
+ Attributes:
+ - key
+ """
thrift_spec = (
None, # 0
(1, TType.STRING, 'key', None, None, ), # 1
)
- def __init__(self, d=None):
- self.key = None
- if isinstance(d, dict):
- if 'key' in d:
- self.key = d['key']
+ def __init__(self, key=None,):
+ self.key = key
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:
@@ -1291,11 +1382,10 @@
oprot.writeFieldStop()
oprot.writeStructEnd()
- def __str__(self):
- return str(self.__dict__)
-
- def __repr__(self):
- return repr(self.__dict__)
+ 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__
@@ -1304,16 +1394,17 @@
return not (self == other)
class getOption_result:
+ """
+ Attributes:
+ - success
+ """
thrift_spec = (
(0, TType.STRING, 'success', None, None, ), # 0
)
- def __init__(self, d=None):
- self.success = None
- if isinstance(d, dict):
- if 'success' in d:
- self.success = d['success']
+ def __init__(self, success=None,):
+ self.success = success
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:
@@ -1346,11 +1437,10 @@
oprot.writeFieldStop()
oprot.writeStructEnd()
- def __str__(self):
- return str(self.__dict__)
-
- def __repr__(self):
- return repr(self.__dict__)
+ 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__
@@ -1363,9 +1453,6 @@
thrift_spec = (
)
- def __init__(self, d=None):
- pass
-
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))
@@ -1388,11 +1475,10 @@
oprot.writeFieldStop()
oprot.writeStructEnd()
- def __str__(self):
- return str(self.__dict__)
-
- def __repr__(self):
- return repr(self.__dict__)
+ 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__
@@ -1401,16 +1487,17 @@
return not (self == other)
class getOptions_result:
+ """
+ Attributes:
+ - success
+ """
thrift_spec = (
(0, TType.MAP, 'success', (TType.STRING,None,TType.STRING,None), None, ), # 0
)
- def __init__(self, d=None):
- self.success = None
- if isinstance(d, dict):
- if 'success' in d:
- self.success = d['success']
+ def __init__(self, success=None,):
+ self.success = success
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:
@@ -1453,11 +1540,10 @@
oprot.writeFieldStop()
oprot.writeStructEnd()
- def __str__(self):
- return str(self.__dict__)
-
- def __repr__(self):
- return repr(self.__dict__)
+ 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__
@@ -1465,13 +1551,19 @@
def __ne__(self, other):
return not (self == other)
-class aliveSince_args:
+class getCpuProfile_args:
+ """
+ Attributes:
+ - profileDurationInSec
+ """
thrift_spec = (
+ None, # 0
+ (1, TType.I32, 'profileDurationInSec', None, None, ), # 1
)
- def __init__(self, d=None):
- pass
+ def __init__(self, profileDurationInSec=None,):
+ self.profileDurationInSec = profileDurationInSec
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:
@@ -1482,6 +1574,11 @@
(fname, ftype, fid) = iprot.readFieldBegin()
if ftype == TType.STOP:
break
+ if fid == 1:
+ if ftype == TType.I32:
+ self.profileDurationInSec = iprot.readI32();
+ else:
+ iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
@@ -1491,15 +1588,18 @@
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('aliveSince_args')
+ oprot.writeStructBegin('getCpuProfile_args')
+ if self.profileDurationInSec != None:
+ oprot.writeFieldBegin('profileDurationInSec', TType.I32, 1)
+ oprot.writeI32(self.profileDurationInSec)
+ oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
- def __str__(self):
- return str(self.__dict__)
-
- def __repr__(self):
- return repr(self.__dict__)
+ 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__
@@ -1507,17 +1607,18 @@
def __ne__(self, other):
return not (self == other)
-class aliveSince_result:
+class getCpuProfile_result:
+ """
+ Attributes:
+ - success
+ """
thrift_spec = (
- (0, TType.I64, 'success', None, None, ), # 0
+ (0, TType.STRING, 'success', None, None, ), # 0
)
- def __init__(self, d=None):
- self.success = None
- if isinstance(d, dict):
- if 'success' in d:
- self.success = d['success']
+ def __init__(self, success=None,):
+ self.success = success
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:
@@ -1529,8 +1630,8 @@
if ftype == TType.STOP:
break
if fid == 0:
- if ftype == TType.I64:
- self.success = iprot.readI64();
+ if ftype == TType.STRING:
+ self.success = iprot.readString();
else:
iprot.skip(ftype)
else:
@@ -1542,19 +1643,18 @@
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('aliveSince_result')
+ oprot.writeStructBegin('getCpuProfile_result')
if self.success != None:
- oprot.writeFieldBegin('success', TType.I64, 0)
- oprot.writeI64(self.success)
+ oprot.writeFieldBegin('success', TType.STRING, 0)
+ oprot.writeString(self.success)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
- def __str__(self):
- return str(self.__dict__)
-
- def __repr__(self):
- return repr(self.__dict__)
+ 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__
@@ -1562,14 +1662,11 @@
def __ne__(self, other):
return not (self == other)
-class getLimitedReflection_args:
+class aliveSince_args:
thrift_spec = (
)
- def __init__(self, d=None):
- pass
-
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))
@@ -1588,15 +1685,14 @@
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('getLimitedReflection_args')
+ oprot.writeStructBegin('aliveSince_args')
oprot.writeFieldStop()
oprot.writeStructEnd()
- def __str__(self):
- return str(self.__dict__)
-
- def __repr__(self):
- return repr(self.__dict__)
+ 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__
@@ -1604,17 +1700,18 @@
def __ne__(self, other):
return not (self == other)
-class getLimitedReflection_result:
+class aliveSince_result:
+ """
+ Attributes:
+ - success
+ """
thrift_spec = (
- (0, TType.STRUCT, 'success', (thrift.reflection.limited.ttypes.Service, thrift.reflection.limited.ttypes.Service.thrift_spec), None, ), # 0
+ (0, TType.I64, 'success', None, None, ), # 0
)
- def __init__(self, d=None):
- self.success = None
- if isinstance(d, dict):
- if 'success' in d:
- self.success = d['success']
+ def __init__(self, success=None,):
+ self.success = success
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:
@@ -1626,9 +1723,8 @@
if ftype == TType.STOP:
break
if fid == 0:
- if ftype == TType.STRUCT:
- self.success = thrift.reflection.limited.ttypes.Service()
- self.success.read(iprot)
+ if ftype == TType.I64:
+ self.success = iprot.readI64();
else:
iprot.skip(ftype)
else:
@@ -1640,19 +1736,18 @@
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('getLimitedReflection_result')
+ oprot.writeStructBegin('aliveSince_result')
if self.success != None:
- oprot.writeFieldBegin('success', TType.STRUCT, 0)
- self.success.write(oprot)
+ oprot.writeFieldBegin('success', TType.I64, 0)
+ oprot.writeI64(self.success)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
- def __str__(self):
- return str(self.__dict__)
-
- def __repr__(self):
- return repr(self.__dict__)
+ 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__
@@ -1665,9 +1760,6 @@
thrift_spec = (
)
- def __init__(self, d=None):
- pass
-
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))
@@ -1690,53 +1782,10 @@
oprot.writeFieldStop()
oprot.writeStructEnd()
- def __str__(self):
- return str(self.__dict__)
-
- def __repr__(self):
- return repr(self.__dict__)
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-class reinitialize_result:
-
- thrift_spec = (
- )
-
- def __init__(self, d=None):
- pass
-
- 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('reinitialize_result')
- oprot.writeFieldStop()
- oprot.writeStructEnd()
-
- def __str__(self):
- return str(self.__dict__)
-
- def __repr__(self):
- return repr(self.__dict__)
+ 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__
@@ -1749,9 +1798,6 @@
thrift_spec = (
)
- def __init__(self, d=None):
- pass
-
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))
@@ -1774,53 +1820,10 @@
oprot.writeFieldStop()
oprot.writeStructEnd()
- def __str__(self):
- return str(self.__dict__)
-
- def __repr__(self):
- return repr(self.__dict__)
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-class shutdown_result:
-
- thrift_spec = (
- )
-
- def __init__(self, d=None):
- pass
-
- 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('shutdown_result')
- oprot.writeFieldStop()
- oprot.writeStructEnd()
-
- def __str__(self):
- return str(self.__dict__)
-
- def __repr__(self):
- return repr(self.__dict__)
+ 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__
Modified: hadoop/hive/trunk/service/lib/py/fb303/ttypes.py
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/service/lib/py/fb303/ttypes.py?rev=805973&r1=805972&r2=805973&view=diff
==============================================================================
--- hadoop/hive/trunk/service/lib/py/fb303/ttypes.py (original)
+++ hadoop/hive/trunk/service/lib/py/fb303/ttypes.py Wed Aug 19 21:02:57 2009
@@ -5,8 +5,6 @@
#
from thrift.Thrift import *
-import thrift.reflection.limited.ttypes
-
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
@@ -17,6 +15,9 @@
class fb_status:
+ """
+ Common status reporting mechanism across all services
+ """
DEAD = 0
STARTING = 1
ALIVE = 2
Modified: hadoop/hive/trunk/service/lib/py/fb303_scripts/__init__.py
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/service/lib/py/fb303_scripts/__init__.py?rev=805973&r1=805972&r2=805973&view=diff
==============================================================================
--- hadoop/hive/trunk/service/lib/py/fb303_scripts/__init__.py (original)
+++ hadoop/hive/trunk/service/lib/py/fb303_scripts/__init__.py Wed Aug 19 21:02:57 2009
@@ -1 +1,20 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
__all__ = ['fb303_simple_mgmt']
Modified: hadoop/hive/trunk/service/lib/py/fb303_scripts/fb303_simple_mgmt.py
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/service/lib/py/fb303_scripts/fb303_simple_mgmt.py?rev=805973&r1=805972&r2=805973&view=diff
==============================================================================
--- hadoop/hive/trunk/service/lib/py/fb303_scripts/fb303_simple_mgmt.py (original)
+++ hadoop/hive/trunk/service/lib/py/fb303_scripts/fb303_simple_mgmt.py Wed Aug 19 21:02:57 2009
@@ -1,10 +1,23 @@
#!/usr/bin/env python
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
#
-# Copyright (c) 2006- Facebook
-# Distributed under the Thrift Software License
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
#
-# See accompanying file LICENSE or visit the Thrift site at:
-# http://developers.facebook.com/thrift/
import sys, os
from optparse import OptionParser
Modified: hadoop/hive/trunk/service/lib/py/thrift/TSCons.py
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/service/lib/py/thrift/TSCons.py?rev=805973&r1=805972&r2=805973&view=diff
==============================================================================
--- hadoop/hive/trunk/service/lib/py/thrift/TSCons.py (original)
+++ hadoop/hive/trunk/service/lib/py/thrift/TSCons.py Wed Aug 19 21:02:57 2009
@@ -1,8 +1,21 @@
-# Copyright (c) 2006- Facebook
-# Distributed under the Thrift Software License
#
-# See accompanying file LICENSE or visit the Thrift site at:
-# http://developers.facebook.com/thrift/
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
from os import path
from SCons.Builder import Builder
Modified: hadoop/hive/trunk/service/lib/py/thrift/Thrift.py
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/service/lib/py/thrift/Thrift.py?rev=805973&r1=805972&r2=805973&view=diff
==============================================================================
--- hadoop/hive/trunk/service/lib/py/thrift/Thrift.py (original)
+++ hadoop/hive/trunk/service/lib/py/thrift/Thrift.py Wed Aug 19 21:02:57 2009
@@ -1,8 +1,21 @@
-# Copyright (c) 2006- Facebook
-# Distributed under the Thrift Software License
#
-# See accompanying file LICENSE or visit the Thrift site at:
-# http://developers.facebook.com/thrift/
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
class TType:
STOP = 0
@@ -27,6 +40,7 @@
CALL = 1
REPLY = 2
EXCEPTION = 3
+ ONEWAY = 4
class TProcessor:
Modified: hadoop/hive/trunk/service/lib/py/thrift/__init__.py
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/service/lib/py/thrift/__init__.py?rev=805973&r1=805972&r2=805973&view=diff
==============================================================================
--- hadoop/hive/trunk/service/lib/py/thrift/__init__.py (original)
+++ hadoop/hive/trunk/service/lib/py/thrift/__init__.py Wed Aug 19 21:02:57 2009
@@ -1,7 +1,20 @@
-# Copyright (c) 2006- Facebook
-# Distributed under the Thrift Software License
#
-# See accompanying file LICENSE or visit the Thrift site at:
-# http://developers.facebook.com/thrift/
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
__all__ = ['Thrift', 'TSCons']
Modified: hadoop/hive/trunk/service/lib/py/thrift/protocol/TBinaryProtocol.py
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/service/lib/py/thrift/protocol/TBinaryProtocol.py?rev=805973&r1=805972&r2=805973&view=diff
==============================================================================
--- hadoop/hive/trunk/service/lib/py/thrift/protocol/TBinaryProtocol.py (original)
+++ hadoop/hive/trunk/service/lib/py/thrift/protocol/TBinaryProtocol.py Wed Aug 19 21:02:57 2009
@@ -1,8 +1,21 @@
-# Copyright (c) 2006- Facebook
-# Distributed under the Thrift Software License
#
-# See accompanying file LICENSE or visit the Thrift site at:
-# http://developers.facebook.com/thrift/
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
from TProtocol import *
from struct import pack, unpack
Modified: hadoop/hive/trunk/service/lib/py/thrift/protocol/TProtocol.py
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/service/lib/py/thrift/protocol/TProtocol.py?rev=805973&r1=805972&r2=805973&view=diff
==============================================================================
--- hadoop/hive/trunk/service/lib/py/thrift/protocol/TProtocol.py (original)
+++ hadoop/hive/trunk/service/lib/py/thrift/protocol/TProtocol.py Wed Aug 19 21:02:57 2009
@@ -1,8 +1,21 @@
-# Copyright (c) 2006- Facebook
-# Distributed under the Thrift Software License
#
-# See accompanying file LICENSE or visit the Thrift site at:
-# http://developers.facebook.com/thrift/
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
from thrift.Thrift import *
Modified: hadoop/hive/trunk/service/lib/py/thrift/protocol/__init__.py
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/service/lib/py/thrift/protocol/__init__.py?rev=805973&r1=805972&r2=805973&view=diff
==============================================================================
--- hadoop/hive/trunk/service/lib/py/thrift/protocol/__init__.py (original)
+++ hadoop/hive/trunk/service/lib/py/thrift/protocol/__init__.py Wed Aug 19 21:02:57 2009
@@ -1,7 +1,20 @@
-# Copyright (c) 2006- Facebook
-# Distributed under the Thrift Software License
#
-# See accompanying file LICENSE or visit the Thrift site at:
-# http://developers.facebook.com/thrift/
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
__all__ = ['TProtocol', 'TBinaryProtocol', 'fastbinary']
Modified: hadoop/hive/trunk/service/lib/py/thrift/server/THttpServer.py
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/service/lib/py/thrift/server/THttpServer.py?rev=805973&r1=805972&r2=805973&view=diff
==============================================================================
--- hadoop/hive/trunk/service/lib/py/thrift/server/THttpServer.py (original)
+++ hadoop/hive/trunk/service/lib/py/thrift/server/THttpServer.py Wed Aug 19 21:02:57 2009
@@ -1,8 +1,21 @@
-# Copyright (c) 2006- Facebook
-# Distributed under the Thrift Software License
#
-# See accompanying file LICENSE or visit the Thrift site at:
-# http://developers.facebook.com/thrift/
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
import BaseHTTPServer
Modified: hadoop/hive/trunk/service/lib/py/thrift/server/TNonblockingServer.py
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/service/lib/py/thrift/server/TNonblockingServer.py?rev=805973&r1=805972&r2=805973&view=diff
==============================================================================
--- hadoop/hive/trunk/service/lib/py/thrift/server/TNonblockingServer.py (original)
+++ hadoop/hive/trunk/service/lib/py/thrift/server/TNonblockingServer.py Wed Aug 19 21:02:57 2009
@@ -1,3 +1,21 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
"""Implementation of non-blocking server.
The main idea of the server is reciving and sending requests
@@ -148,7 +166,7 @@
This function is the only function witch can be called asynchronous.
The ready can switch Connection to three states:
- WAIT_LEN if request was async.
+ WAIT_LEN if request was oneway.
SEND_ANSWER if request was processed in normal way.
CLOSED if request throws unexpected exception.
@@ -162,7 +180,7 @@
self.len = ''
self.message = struct.pack('!i', len(message)) + message
if len(message) == 0:
- # it was async request, do not write answer
+ # it was a oneway request, do not write answer
self.status = WAIT_LEN
else:
self.status = SEND_ANSWER
Modified: hadoop/hive/trunk/service/lib/py/thrift/server/TServer.py
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/service/lib/py/thrift/server/TServer.py?rev=805973&r1=805972&r2=805973&view=diff
==============================================================================
--- hadoop/hive/trunk/service/lib/py/thrift/server/TServer.py (original)
+++ hadoop/hive/trunk/service/lib/py/thrift/server/TServer.py Wed Aug 19 21:02:57 2009
@@ -1,8 +1,21 @@
-# Copyright (c) 2006- Facebook
-# Distributed under the Thrift Software License
#
-# See accompanying file LICENSE or visit the Thrift site at:
-# http://developers.facebook.com/thrift/
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
import logging
import sys
Modified: hadoop/hive/trunk/service/lib/py/thrift/server/__init__.py
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/service/lib/py/thrift/server/__init__.py?rev=805973&r1=805972&r2=805973&view=diff
==============================================================================
--- hadoop/hive/trunk/service/lib/py/thrift/server/__init__.py (original)
+++ hadoop/hive/trunk/service/lib/py/thrift/server/__init__.py Wed Aug 19 21:02:57 2009
@@ -1,7 +1,20 @@
-# Copyright (c) 2006- Facebook
-# Distributed under the Thrift Software License
#
-# See accompanying file LICENSE or visit the Thrift site at:
-# http://developers.facebook.com/thrift/
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
__all__ = ['TServer', 'TNonblockingServer']
Modified: hadoop/hive/trunk/service/lib/py/thrift/transport/THttpClient.py
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/service/lib/py/thrift/transport/THttpClient.py?rev=805973&r1=805972&r2=805973&view=diff
==============================================================================
--- hadoop/hive/trunk/service/lib/py/thrift/transport/THttpClient.py (original)
+++ hadoop/hive/trunk/service/lib/py/thrift/transport/THttpClient.py Wed Aug 19 21:02:57 2009
@@ -1,27 +1,66 @@
-# Copyright (c) 2006- Facebook
-# Distributed under the Thrift Software License
#
-# See accompanying file LICENSE or visit the Thrift site at:
-# http://developers.facebook.com/thrift/
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
from TTransport import *
from cStringIO import StringIO
+import urlparse
import httplib
+import warnings
class THttpClient(TTransportBase):
"""Http implementation of TTransport base."""
- def __init__(self, host, port, uri):
- self.host = host
- self.port = port
- self.uri = uri
+ def __init__(self, uri_or_host, port=None, path=None):
+ """THttpClient supports two different types constructor parameters.
+
+ THttpClient(host, port, path) - deprecated
+ THttpClient(uri)
+
+ Only the second supports https."""
+
+ if port is not None:
+ warnings.warn("Please use the THttpClient('http://host:port/path') syntax", DeprecationWarning, stacklevel=2)
+ self.host = uri_or_host
+ self.port = port
+ assert path
+ self.path = path
+ self.scheme = 'http'
+ else:
+ parsed = urlparse.urlparse(uri_or_host)
+ self.scheme = parsed.scheme
+ assert self.scheme in ('http', 'https')
+ if self.scheme == 'http':
+ self.port = parsed.port or httplib.HTTP_PORT
+ elif self.scheme == 'https':
+ self.port = parsed.port or httplib.HTTPS_PORT
+ self.host = parsed.hostname
+ self.path = parsed.path
self.__wbuf = StringIO()
self.__http = None
def open(self):
- self.__http = httplib.HTTP(self.host, self.port)
+ if self.scheme == 'http':
+ self.__http = httplib.HTTP(self.host, self.port)
+ else:
+ self.__http = httplib.HTTPS(self.host, self.port)
def close(self):
self.__http.close()
@@ -37,12 +76,16 @@
self.__wbuf.write(buf)
def flush(self):
+ if self.isOpen():
+ self.close()
+ self.open();
+
# Pull data out of buffer
data = self.__wbuf.getvalue()
self.__wbuf = StringIO()
# HTTP request
- self.__http.putrequest('POST', self.uri)
+ self.__http.putrequest('POST', self.path)
# Write headers
self.__http.putheader('Host', self.host)
Modified: hadoop/hive/trunk/service/lib/py/thrift/transport/TSocket.py
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/service/lib/py/thrift/transport/TSocket.py?rev=805973&r1=805972&r2=805973&view=diff
==============================================================================
--- hadoop/hive/trunk/service/lib/py/thrift/transport/TSocket.py (original)
+++ hadoop/hive/trunk/service/lib/py/thrift/transport/TSocket.py Wed Aug 19 21:02:57 2009
@@ -1,8 +1,21 @@
-# Copyright (c) 2006- Facebook
-# Distributed under the Thrift Software License
#
-# See accompanying file LICENSE or visit the Thrift site at:
-# http://developers.facebook.com/thrift/
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
from TTransport import *
import os
@@ -82,6 +95,8 @@
return buff
def write(self, buff):
+ if not self.handle:
+ raise TTransportException(TTransportException.NOT_OPEN, 'Transport not open')
sent = 0
have = len(buff)
while sent < have:
@@ -94,7 +109,7 @@
def flush(self):
pass
-class TServerSocket(TServerTransportBase, TSocketBase):
+class TServerSocket(TSocketBase, TServerTransportBase):
"""Socket implementation of TServerTransport base."""
def __init__(self, port=9090, unix_socket=None):
Modified: hadoop/hive/trunk/service/lib/py/thrift/transport/TTransport.py
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/service/lib/py/thrift/transport/TTransport.py?rev=805973&r1=805972&r2=805973&view=diff
==============================================================================
--- hadoop/hive/trunk/service/lib/py/thrift/transport/TTransport.py (original)
+++ hadoop/hive/trunk/service/lib/py/thrift/transport/TTransport.py Wed Aug 19 21:02:57 2009
@@ -1,8 +1,21 @@
-# Copyright (c) 2006- Facebook
-# Distributed under the Thrift Software License
#
-# See accompanying file LICENSE or visit the Thrift site at:
-# http://developers.facebook.com/thrift/
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
from cStringIO import StringIO
from struct import pack,unpack
Modified: hadoop/hive/trunk/service/lib/py/thrift/transport/TTwisted.py
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/service/lib/py/thrift/transport/TTwisted.py?rev=805973&r1=805972&r2=805973&view=diff
==============================================================================
--- hadoop/hive/trunk/service/lib/py/thrift/transport/TTwisted.py (original)
+++ hadoop/hive/trunk/service/lib/py/thrift/transport/TTwisted.py Wed Aug 19 21:02:57 2009
@@ -1,9 +1,29 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
from zope.interface import implements, Interface, Attribute
from twisted.internet.protocol import Protocol, ServerFactory, ClientFactory, \
connectionDone
from twisted.internet import defer
from twisted.protocols import basic
from twisted.python import log
+
+
from thrift.transport import TTransport
from cStringIO import StringIO
@@ -37,6 +57,8 @@
class ThriftClientProtocol(basic.Int32StringReceiver):
+ MAX_LENGTH = 2 ** 31 - 1
+
def __init__(self, client_class, iprot_factory, oprot_factory=None):
self._client_class = client_class
self._iprot_factory = iprot_factory
@@ -79,6 +101,8 @@
class ThriftServerProtocol(basic.Int32StringReceiver):
+ MAX_LENGTH = 2 ** 31 - 1
+
def dispatch(self, msg):
self.sendString(msg)
Modified: hadoop/hive/trunk/service/lib/py/thrift/transport/__init__.py
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/service/lib/py/thrift/transport/__init__.py?rev=805973&r1=805972&r2=805973&view=diff
==============================================================================
--- hadoop/hive/trunk/service/lib/py/thrift/transport/__init__.py (original)
+++ hadoop/hive/trunk/service/lib/py/thrift/transport/__init__.py Wed Aug 19 21:02:57 2009
@@ -1,7 +1,20 @@
-# Copyright (c) 2006- Facebook
-# Distributed under the Thrift Software License
#
-# See accompanying file LICENSE or visit the Thrift site at:
-# http://developers.facebook.com/thrift/
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
__all__ = ['TTransport', 'TSocket', 'THttpClient']
Modified: hadoop/hive/trunk/service/src/gen-javabean/org/apache/hadoop/hive/service/ThriftHive.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/service/src/gen-javabean/org/apache/hadoop/hive/service/ThriftHive.java?rev=805973&r1=805972&r2=805973&view=diff
==============================================================================
--- hadoop/hive/trunk/service/src/gen-javabean/org/apache/hadoop/hive/service/ThriftHive.java (original)
+++ hadoop/hive/trunk/service/src/gen-javabean/org/apache/hadoop/hive/service/ThriftHive.java Wed Aug 19 21:02:57 2009
@@ -36,6 +36,8 @@
public HiveClusterStatus getClusterStatus() throws HiveServerException, TException;
+ public org.apache.hadoop.hive.ql.plan.api.QueryPlan getQueryPlan() throws HiveServerException, TException;
+
}
public static class Client extends org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore.Client implements Iface {
@@ -293,6 +295,41 @@
throw new TApplicationException(TApplicationException.MISSING_RESULT, "getClusterStatus failed: unknown result");
}
+ public org.apache.hadoop.hive.ql.plan.api.QueryPlan getQueryPlan() throws HiveServerException, TException
+ {
+ send_getQueryPlan();
+ return recv_getQueryPlan();
+ }
+
+ public void send_getQueryPlan() throws TException
+ {
+ oprot_.writeMessageBegin(new TMessage("getQueryPlan", TMessageType.CALL, seqid_));
+ getQueryPlan_args args = new getQueryPlan_args();
+ args.write(oprot_);
+ oprot_.writeMessageEnd();
+ oprot_.getTransport().flush();
+ }
+
+ public org.apache.hadoop.hive.ql.plan.api.QueryPlan recv_getQueryPlan() throws HiveServerException, TException
+ {
+ TMessage msg = iprot_.readMessageBegin();
+ if (msg.type == TMessageType.EXCEPTION) {
+ TApplicationException x = TApplicationException.read(iprot_);
+ iprot_.readMessageEnd();
+ throw x;
+ }
+ getQueryPlan_result result = new getQueryPlan_result();
+ result.read(iprot_);
+ iprot_.readMessageEnd();
+ if (result.isSetSuccess()) {
+ return result.success;
+ }
+ if (result.ex != null) {
+ throw result.ex;
+ }
+ throw new TApplicationException(TApplicationException.MISSING_RESULT, "getQueryPlan failed: unknown result");
+ }
+
}
public static class Processor extends org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore.Processor implements TProcessor {
private static final Logger LOGGER = Logger.getLogger(Processor.class.getName());
@@ -307,6 +344,7 @@
processMap_.put("getSchema", new getSchema());
processMap_.put("getThriftSchema", new getThriftSchema());
processMap_.put("getClusterStatus", new getClusterStatus());
+ processMap_.put("getQueryPlan", new getQueryPlan());
}
private Iface iface_;
@@ -525,6 +563,34 @@
}
+ private class getQueryPlan implements ProcessFunction {
+ public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
+ {
+ getQueryPlan_args args = new getQueryPlan_args();
+ args.read(iprot);
+ iprot.readMessageEnd();
+ getQueryPlan_result result = new getQueryPlan_result();
+ try {
+ result.success = iface_.getQueryPlan();
+ } catch (HiveServerException ex) {
+ result.ex = ex;
+ } catch (Throwable th) {
+ LOGGER.error("Internal error processing getQueryPlan", th);
+ TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getQueryPlan");
+ oprot.writeMessageBegin(new TMessage("getQueryPlan", TMessageType.EXCEPTION, seqid));
+ x.write(oprot);
+ oprot.writeMessageEnd();
+ oprot.getTransport().flush();
+ return;
+ }
+ oprot.writeMessageBegin(new TMessage("getQueryPlan", TMessageType.REPLY, seqid));
+ result.write(oprot);
+ oprot.writeMessageEnd();
+ oprot.getTransport().flush();
+ }
+
+ }
+
}
public static class execute_args implements TBase, java.io.Serializable, Cloneable {
@@ -3291,4 +3357,377 @@
}
+ public static class getQueryPlan_args implements TBase, java.io.Serializable, Cloneable {
+ private static final TStruct STRUCT_DESC = new TStruct("getQueryPlan_args");
+
+ public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{
+ }});
+
+ static {
+ FieldMetaData.addStructMetaDataMap(getQueryPlan_args.class, metaDataMap);
+ }
+
+ public getQueryPlan_args() {
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public getQueryPlan_args(getQueryPlan_args other) {
+ }
+
+ @Override
+ public getQueryPlan_args clone() {
+ return new getQueryPlan_args(this);
+ }
+
+ public void setFieldValue(int fieldID, Object value) {
+ switch (fieldID) {
+ default:
+ throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
+ }
+ }
+
+ public Object getFieldValue(int fieldID) {
+ switch (fieldID) {
+ default:
+ throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
+ }
+ }
+
+ // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise
+ public boolean isSet(int fieldID) {
+ switch (fieldID) {
+ default:
+ throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
+ }
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof getQueryPlan_args)
+ return this.equals((getQueryPlan_args)that);
+ return false;
+ }
+
+ public boolean equals(getQueryPlan_args that) {
+ if (that == null)
+ return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ public void read(TProtocol iprot) throws TException {
+ TField field;
+ iprot.readStructBegin();
+ while (true)
+ {
+ field = iprot.readFieldBegin();
+ if (field.type == TType.STOP) {
+ break;
+ }
+ switch (field.id)
+ {
+ default:
+ TProtocolUtil.skip(iprot, field.type);
+ break;
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+
+ validate();
+ }
+
+ public void write(TProtocol oprot) throws TException {
+ validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("getQueryPlan_args(");
+ boolean first = true;
+
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws TException {
+ // check for required fields
+ // check that fields of type enum have valid values
+ }
+
+ }
+
+ public static class getQueryPlan_result implements TBase, java.io.Serializable, Cloneable {
+ private static final TStruct STRUCT_DESC = new TStruct("getQueryPlan_result");
+ private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
+ private static final TField EX_FIELD_DESC = new TField("ex", TType.STRUCT, (short)1);
+
+ private org.apache.hadoop.hive.ql.plan.api.QueryPlan success;
+ public static final int SUCCESS = 0;
+ private HiveServerException ex;
+ public static final int EX = 1;
+
+ private final Isset __isset = new Isset();
+ private static final class Isset implements java.io.Serializable {
+ }
+
+ public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{
+ put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT,
+ new StructMetaData(TType.STRUCT, org.apache.hadoop.hive.ql.plan.api.QueryPlan.class)));
+ put(EX, new FieldMetaData("ex", TFieldRequirementType.DEFAULT,
+ new FieldValueMetaData(TType.STRUCT)));
+ }});
+
+ static {
+ FieldMetaData.addStructMetaDataMap(getQueryPlan_result.class, metaDataMap);
+ }
+
+ public getQueryPlan_result() {
+ }
+
+ public getQueryPlan_result(
+ org.apache.hadoop.hive.ql.plan.api.QueryPlan success,
+ HiveServerException ex)
+ {
+ this();
+ this.success = success;
+ this.ex = ex;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public getQueryPlan_result(getQueryPlan_result other) {
+ if (other.isSetSuccess()) {
+ this.success = new org.apache.hadoop.hive.ql.plan.api.QueryPlan(other.success);
+ }
+ if (other.isSetEx()) {
+ this.ex = new HiveServerException(other.ex);
+ }
+ }
+
+ @Override
+ public getQueryPlan_result clone() {
+ return new getQueryPlan_result(this);
+ }
+
+ public org.apache.hadoop.hive.ql.plan.api.QueryPlan getSuccess() {
+ return this.success;
+ }
+
+ public void setSuccess(org.apache.hadoop.hive.ql.plan.api.QueryPlan success) {
+ this.success = success;
+ }
+
+ public void unsetSuccess() {
+ this.success = null;
+ }
+
+ // Returns true if field success is set (has been asigned a value) and false otherwise
+ public boolean isSetSuccess() {
+ return this.success != null;
+ }
+
+ public HiveServerException getEx() {
+ return this.ex;
+ }
+
+ public void setEx(HiveServerException ex) {
+ this.ex = ex;
+ }
+
+ public void unsetEx() {
+ this.ex = null;
+ }
+
+ // Returns true if field ex is set (has been asigned a value) and false otherwise
+ public boolean isSetEx() {
+ return this.ex != null;
+ }
+
+ public void setFieldValue(int fieldID, Object value) {
+ switch (fieldID) {
+ case SUCCESS:
+ if (value == null) {
+ unsetSuccess();
+ } else {
+ setSuccess((org.apache.hadoop.hive.ql.plan.api.QueryPlan)value);
+ }
+ break;
+
+ case EX:
+ if (value == null) {
+ unsetEx();
+ } else {
+ setEx((HiveServerException)value);
+ }
+ break;
+
+ default:
+ throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
+ }
+ }
+
+ public Object getFieldValue(int fieldID) {
+ switch (fieldID) {
+ case SUCCESS:
+ return getSuccess();
+
+ case EX:
+ return getEx();
+
+ default:
+ throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
+ }
+ }
+
+ // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise
+ public boolean isSet(int fieldID) {
+ switch (fieldID) {
+ case SUCCESS:
+ return isSetSuccess();
+ case EX:
+ return isSetEx();
+ default:
+ throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
+ }
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof getQueryPlan_result)
+ return this.equals((getQueryPlan_result)that);
+ return false;
+ }
+
+ public boolean equals(getQueryPlan_result that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_success = true && this.isSetSuccess();
+ boolean that_present_success = true && that.isSetSuccess();
+ if (this_present_success || that_present_success) {
+ if (!(this_present_success && that_present_success))
+ return false;
+ if (!this.success.equals(that.success))
+ return false;
+ }
+
+ boolean this_present_ex = true && this.isSetEx();
+ boolean that_present_ex = true && that.isSetEx();
+ if (this_present_ex || that_present_ex) {
+ if (!(this_present_ex && that_present_ex))
+ return false;
+ if (!this.ex.equals(that.ex))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ public void read(TProtocol iprot) throws TException {
+ TField field;
+ iprot.readStructBegin();
+ while (true)
+ {
+ field = iprot.readFieldBegin();
+ if (field.type == TType.STOP) {
+ break;
+ }
+ switch (field.id)
+ {
+ case SUCCESS:
+ if (field.type == TType.STRUCT) {
+ this.success = new org.apache.hadoop.hive.ql.plan.api.QueryPlan();
+ this.success.read(iprot);
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ case EX:
+ if (field.type == TType.STRUCT) {
+ this.ex = new HiveServerException();
+ this.ex.read(iprot);
+ } else {
+ TProtocolUtil.skip(iprot, field.type);
+ }
+ break;
+ default:
+ TProtocolUtil.skip(iprot, field.type);
+ break;
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+
+ validate();
+ }
+
+ public void write(TProtocol oprot) throws TException {
+ oprot.writeStructBegin(STRUCT_DESC);
+
+ if (this.isSetSuccess()) {
+ oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
+ this.success.write(oprot);
+ oprot.writeFieldEnd();
+ } else if (this.isSetEx()) {
+ oprot.writeFieldBegin(EX_FIELD_DESC);
+ this.ex.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("getQueryPlan_result(");
+ boolean first = true;
+
+ sb.append("success:");
+ if (this.success == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.success);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("ex:");
+ if (this.ex == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.ex);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws TException {
+ // check for required fields
+ // check that fields of type enum have valid values
+ }
+
+ }
+
}