You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by kh...@apache.org on 2015/01/07 21:15:11 UTC
svn commit: r1650145 [8/8] - in /hive/trunk:
common/src/java/org/apache/hadoop/hive/conf/
hcatalog/server-extensions/src/main/java/org/apache/hive/hcatalog/listener/
hcatalog/server-extensions/src/main/java/org/apache/hive/hcatalog/messaging/json/
ites...
Modified: hive/trunk/metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py?rev=1650145&r1=1650144&r2=1650145&view=diff
==============================================================================
--- hive/trunk/metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py (original)
+++ hive/trunk/metastore/src/gen/thrift/gen-py/hive_metastore/ttypes.py Wed Jan 7 20:15:10 2015
@@ -8143,6 +8143,341 @@ class ShowCompactResponse:
def __ne__(self, other):
return not (self == other)
+class NotificationEventRequest:
+ """
+ Attributes:
+ - lastEvent
+ - maxEvents
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.I64, 'lastEvent', None, None, ), # 1
+ (2, TType.I32, 'maxEvents', None, None, ), # 2
+ )
+
+ def __init__(self, lastEvent=None, maxEvents=None,):
+ self.lastEvent = lastEvent
+ self.maxEvents = maxEvents
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.I64:
+ self.lastEvent = iprot.readI64();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.I32:
+ self.maxEvents = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('NotificationEventRequest')
+ if self.lastEvent is not None:
+ oprot.writeFieldBegin('lastEvent', TType.I64, 1)
+ oprot.writeI64(self.lastEvent)
+ oprot.writeFieldEnd()
+ if self.maxEvents is not None:
+ oprot.writeFieldBegin('maxEvents', TType.I32, 2)
+ oprot.writeI32(self.maxEvents)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def validate(self):
+ if self.lastEvent is None:
+ raise TProtocol.TProtocolException(message='Required field lastEvent is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class NotificationEvent:
+ """
+ Attributes:
+ - eventId
+ - eventTime
+ - eventType
+ - dbName
+ - tableName
+ - message
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.I64, 'eventId', None, None, ), # 1
+ (2, TType.I32, 'eventTime', None, None, ), # 2
+ (3, TType.STRING, 'eventType', None, None, ), # 3
+ (4, TType.STRING, 'dbName', None, None, ), # 4
+ (5, TType.STRING, 'tableName', None, None, ), # 5
+ (6, TType.STRING, 'message', None, None, ), # 6
+ )
+
+ def __init__(self, eventId=None, eventTime=None, eventType=None, dbName=None, tableName=None, message=None,):
+ self.eventId = eventId
+ self.eventTime = eventTime
+ self.eventType = eventType
+ self.dbName = dbName
+ self.tableName = tableName
+ self.message = message
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.I64:
+ self.eventId = iprot.readI64();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.I32:
+ self.eventTime = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.STRING:
+ self.eventType = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 4:
+ if ftype == TType.STRING:
+ self.dbName = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 5:
+ if ftype == TType.STRING:
+ self.tableName = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 6:
+ if ftype == TType.STRING:
+ self.message = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('NotificationEvent')
+ if self.eventId is not None:
+ oprot.writeFieldBegin('eventId', TType.I64, 1)
+ oprot.writeI64(self.eventId)
+ oprot.writeFieldEnd()
+ if self.eventTime is not None:
+ oprot.writeFieldBegin('eventTime', TType.I32, 2)
+ oprot.writeI32(self.eventTime)
+ oprot.writeFieldEnd()
+ if self.eventType is not None:
+ oprot.writeFieldBegin('eventType', TType.STRING, 3)
+ oprot.writeString(self.eventType)
+ oprot.writeFieldEnd()
+ if self.dbName is not None:
+ oprot.writeFieldBegin('dbName', TType.STRING, 4)
+ oprot.writeString(self.dbName)
+ oprot.writeFieldEnd()
+ if self.tableName is not None:
+ oprot.writeFieldBegin('tableName', TType.STRING, 5)
+ oprot.writeString(self.tableName)
+ oprot.writeFieldEnd()
+ if self.message is not None:
+ oprot.writeFieldBegin('message', TType.STRING, 6)
+ oprot.writeString(self.message)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def validate(self):
+ if self.eventId is None:
+ raise TProtocol.TProtocolException(message='Required field eventId is unset!')
+ if self.eventTime is None:
+ raise TProtocol.TProtocolException(message='Required field eventTime is unset!')
+ if self.eventType is None:
+ raise TProtocol.TProtocolException(message='Required field eventType is unset!')
+ if self.message is None:
+ raise TProtocol.TProtocolException(message='Required field message is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class NotificationEventResponse:
+ """
+ Attributes:
+ - events
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.LIST, 'events', (TType.STRUCT,(NotificationEvent, NotificationEvent.thrift_spec)), None, ), # 1
+ )
+
+ def __init__(self, events=None,):
+ self.events = events
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.LIST:
+ self.events = []
+ (_etype437, _size434) = iprot.readListBegin()
+ for _i438 in xrange(_size434):
+ _elem439 = NotificationEvent()
+ _elem439.read(iprot)
+ self.events.append(_elem439)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('NotificationEventResponse')
+ if self.events is not None:
+ oprot.writeFieldBegin('events', TType.LIST, 1)
+ oprot.writeListBegin(TType.STRUCT, len(self.events))
+ for iter440 in self.events:
+ iter440.write(oprot)
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def validate(self):
+ if self.events is None:
+ raise TProtocol.TProtocolException(message='Required field events is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class CurrentNotificationEventId:
+ """
+ Attributes:
+ - eventId
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.I64, 'eventId', None, None, ), # 1
+ )
+
+ def __init__(self, eventId=None,):
+ self.eventId = eventId
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.I64:
+ self.eventId = iprot.readI64();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('CurrentNotificationEventId')
+ if self.eventId is not None:
+ oprot.writeFieldBegin('eventId', TType.I64, 1)
+ oprot.writeI64(self.eventId)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def validate(self):
+ if self.eventId is None:
+ raise TProtocol.TProtocolException(message='Required field eventId is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
class MetaException(TException):
"""
Attributes:
Modified: hive/trunk/metastore/src/gen/thrift/gen-rb/hive_metastore_types.rb
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/gen/thrift/gen-rb/hive_metastore_types.rb?rev=1650145&r1=1650144&r2=1650145&view=diff
==============================================================================
--- hive/trunk/metastore/src/gen/thrift/gen-rb/hive_metastore_types.rb (original)
+++ hive/trunk/metastore/src/gen/thrift/gen-rb/hive_metastore_types.rb Wed Jan 7 20:15:10 2015
@@ -1986,6 +1986,89 @@ class ShowCompactResponse
::Thrift::Struct.generate_accessors self
end
+class NotificationEventRequest
+ include ::Thrift::Struct, ::Thrift::Struct_Union
+ LASTEVENT = 1
+ MAXEVENTS = 2
+
+ FIELDS = {
+ LASTEVENT => {:type => ::Thrift::Types::I64, :name => 'lastEvent'},
+ MAXEVENTS => {:type => ::Thrift::Types::I32, :name => 'maxEvents', :optional => true}
+ }
+
+ def struct_fields; FIELDS; end
+
+ def validate
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field lastEvent is unset!') unless @lastEvent
+ end
+
+ ::Thrift::Struct.generate_accessors self
+end
+
+class NotificationEvent
+ include ::Thrift::Struct, ::Thrift::Struct_Union
+ EVENTID = 1
+ EVENTTIME = 2
+ EVENTTYPE = 3
+ DBNAME = 4
+ TABLENAME = 5
+ MESSAGE = 6
+
+ FIELDS = {
+ EVENTID => {:type => ::Thrift::Types::I64, :name => 'eventId'},
+ EVENTTIME => {:type => ::Thrift::Types::I32, :name => 'eventTime'},
+ EVENTTYPE => {:type => ::Thrift::Types::STRING, :name => 'eventType'},
+ DBNAME => {:type => ::Thrift::Types::STRING, :name => 'dbName', :optional => true},
+ TABLENAME => {:type => ::Thrift::Types::STRING, :name => 'tableName', :optional => true},
+ MESSAGE => {:type => ::Thrift::Types::STRING, :name => 'message'}
+ }
+
+ def struct_fields; FIELDS; end
+
+ def validate
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field eventId is unset!') unless @eventId
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field eventTime is unset!') unless @eventTime
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field eventType is unset!') unless @eventType
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field message is unset!') unless @message
+ end
+
+ ::Thrift::Struct.generate_accessors self
+end
+
+class NotificationEventResponse
+ include ::Thrift::Struct, ::Thrift::Struct_Union
+ EVENTS = 1
+
+ FIELDS = {
+ EVENTS => {:type => ::Thrift::Types::LIST, :name => 'events', :element => {:type => ::Thrift::Types::STRUCT, :class => ::NotificationEvent}}
+ }
+
+ def struct_fields; FIELDS; end
+
+ def validate
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field events is unset!') unless @events
+ end
+
+ ::Thrift::Struct.generate_accessors self
+end
+
+class CurrentNotificationEventId
+ include ::Thrift::Struct, ::Thrift::Struct_Union
+ EVENTID = 1
+
+ FIELDS = {
+ EVENTID => {:type => ::Thrift::Types::I64, :name => 'eventId'}
+ }
+
+ def struct_fields; FIELDS; end
+
+ def validate
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field eventId is unset!') unless @eventId
+ end
+
+ ::Thrift::Struct.generate_accessors self
+end
+
class MetaException < ::Thrift::Exception
include ::Thrift::Struct, ::Thrift::Struct_Union
def initialize(message=nil)
Modified: hive/trunk/metastore/src/gen/thrift/gen-rb/thrift_hive_metastore.rb
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/gen/thrift/gen-rb/thrift_hive_metastore.rb?rev=1650145&r1=1650144&r2=1650145&view=diff
==============================================================================
--- hive/trunk/metastore/src/gen/thrift/gen-rb/thrift_hive_metastore.rb (original)
+++ hive/trunk/metastore/src/gen/thrift/gen-rb/thrift_hive_metastore.rb Wed Jan 7 20:15:10 2015
@@ -1977,6 +1977,36 @@ module ThriftHiveMetastore
raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'show_compact failed: unknown result')
end
+ def getNextNotification(rqst)
+ send_getNextNotification(rqst)
+ return recv_getNextNotification()
+ end
+
+ def send_getNextNotification(rqst)
+ send_message('getNextNotification', GetNextNotification_args, :rqst => rqst)
+ end
+
+ def recv_getNextNotification()
+ result = receive_message(GetNextNotification_result)
+ return result.success unless result.success.nil?
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'getNextNotification failed: unknown result')
+ end
+
+ def getCurrentNotificationEventId()
+ send_getCurrentNotificationEventId()
+ return recv_getCurrentNotificationEventId()
+ end
+
+ def send_getCurrentNotificationEventId()
+ send_message('getCurrentNotificationEventId', GetCurrentNotificationEventId_args)
+ end
+
+ def recv_getCurrentNotificationEventId()
+ result = receive_message(GetCurrentNotificationEventId_result)
+ return result.success unless result.success.nil?
+ raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'getCurrentNotificationEventId failed: unknown result')
+ end
+
end
class Processor < ::FacebookService::Processor
@@ -3493,6 +3523,20 @@ module ThriftHiveMetastore
write_result(result, oprot, 'show_compact', seqid)
end
+ def process_getNextNotification(seqid, iprot, oprot)
+ args = read_args(iprot, GetNextNotification_args)
+ result = GetNextNotification_result.new()
+ result.success = @handler.getNextNotification(args.rqst)
+ write_result(result, oprot, 'getNextNotification', seqid)
+ end
+
+ def process_getCurrentNotificationEventId(seqid, iprot, oprot)
+ args = read_args(iprot, GetCurrentNotificationEventId_args)
+ result = GetCurrentNotificationEventId_result.new()
+ result.success = @handler.getCurrentNotificationEventId()
+ write_result(result, oprot, 'getCurrentNotificationEventId', seqid)
+ end
+
end
# HELPER FUNCTIONS AND STRUCTURES
@@ -7974,6 +8018,69 @@ module ThriftHiveMetastore
}
def struct_fields; FIELDS; end
+
+ def validate
+ end
+
+ ::Thrift::Struct.generate_accessors self
+ end
+
+ class GetNextNotification_args
+ include ::Thrift::Struct, ::Thrift::Struct_Union
+ RQST = 1
+
+ FIELDS = {
+ RQST => {:type => ::Thrift::Types::STRUCT, :name => 'rqst', :class => ::NotificationEventRequest}
+ }
+
+ def struct_fields; FIELDS; end
+
+ def validate
+ end
+
+ ::Thrift::Struct.generate_accessors self
+ end
+
+ class GetNextNotification_result
+ include ::Thrift::Struct, ::Thrift::Struct_Union
+ SUCCESS = 0
+
+ FIELDS = {
+ SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::NotificationEventResponse}
+ }
+
+ def struct_fields; FIELDS; end
+
+ def validate
+ end
+
+ ::Thrift::Struct.generate_accessors self
+ end
+
+ class GetCurrentNotificationEventId_args
+ include ::Thrift::Struct, ::Thrift::Struct_Union
+
+ FIELDS = {
+
+ }
+
+ def struct_fields; FIELDS; end
+
+ def validate
+ end
+
+ ::Thrift::Struct.generate_accessors self
+ end
+
+ class GetCurrentNotificationEventId_result
+ include ::Thrift::Struct, ::Thrift::Struct_Union
+ SUCCESS = 0
+
+ FIELDS = {
+ SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::CurrentNotificationEventId}
+ }
+
+ def struct_fields; FIELDS; end
def validate
end
Modified: hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java?rev=1650145&r1=1650144&r2=1650145&view=diff
==============================================================================
--- hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java (original)
+++ hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java Wed Jan 7 20:15:10 2015
@@ -77,6 +77,7 @@ import org.apache.hadoop.hive.metastore.
import org.apache.hadoop.hive.metastore.api.CommitTxnRequest;
import org.apache.hadoop.hive.metastore.api.CompactionRequest;
import org.apache.hadoop.hive.metastore.api.ConfigValSecurityException;
+import org.apache.hadoop.hive.metastore.api.CurrentNotificationEventId;
import org.apache.hadoop.hive.metastore.api.Database;
import org.apache.hadoop.hive.metastore.api.DropPartitionsExpr;
import org.apache.hadoop.hive.metastore.api.DropPartitionsRequest;
@@ -111,6 +112,8 @@ import org.apache.hadoop.hive.metastore.
import org.apache.hadoop.hive.metastore.api.NoSuchLockException;
import org.apache.hadoop.hive.metastore.api.NoSuchObjectException;
import org.apache.hadoop.hive.metastore.api.NoSuchTxnException;
+import org.apache.hadoop.hive.metastore.api.NotificationEventRequest;
+import org.apache.hadoop.hive.metastore.api.NotificationEventResponse;
import org.apache.hadoop.hive.metastore.api.OpenTxnRequest;
import org.apache.hadoop.hive.metastore.api.OpenTxnsResponse;
import org.apache.hadoop.hive.metastore.api.Partition;
@@ -5579,6 +5582,19 @@ public class HiveMetaStore extends Thrif
}
return ret;
}
+
+ @Override
+ public NotificationEventResponse getNextNotification(NotificationEventRequest rqst)
+ throws TException {
+ RawStore ms = getMS();
+ return ms.getNextNotification(rqst);
+ }
+
+ @Override
+ public CurrentNotificationEventId getCurrentNotificationEventId() throws TException {
+ RawStore ms = getMS();
+ return ms.getCurrentNotificationEventId();
+ }
}
Modified: hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java?rev=1650145&r1=1650144&r2=1650145&view=diff
==============================================================================
--- hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java (original)
+++ hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java Wed Jan 7 20:15:10 2015
@@ -62,6 +62,7 @@ import org.apache.hadoop.hive.metastore.
import org.apache.hadoop.hive.metastore.api.CompactionRequest;
import org.apache.hadoop.hive.metastore.api.CompactionType;
import org.apache.hadoop.hive.metastore.api.ConfigValSecurityException;
+import org.apache.hadoop.hive.metastore.api.CurrentNotificationEventId;
import org.apache.hadoop.hive.metastore.api.Database;
import org.apache.hadoop.hive.metastore.api.DropPartitionsExpr;
import org.apache.hadoop.hive.metastore.api.DropPartitionsRequest;
@@ -94,6 +95,9 @@ import org.apache.hadoop.hive.metastore.
import org.apache.hadoop.hive.metastore.api.NoSuchLockException;
import org.apache.hadoop.hive.metastore.api.NoSuchObjectException;
import org.apache.hadoop.hive.metastore.api.NoSuchTxnException;
+import org.apache.hadoop.hive.metastore.api.NotificationEvent;
+import org.apache.hadoop.hive.metastore.api.NotificationEventRequest;
+import org.apache.hadoop.hive.metastore.api.NotificationEventResponse;
import org.apache.hadoop.hive.metastore.api.OpenTxnRequest;
import org.apache.hadoop.hive.metastore.api.OpenTxnsResponse;
import org.apache.hadoop.hive.metastore.api.Partition;
@@ -1421,7 +1425,8 @@ public class HiveMetaStoreClient impleme
@Override
public Partition getPartition(String db, String tableName, String partName)
throws MetaException, TException, UnknownTableException, NoSuchObjectException {
- return deepCopy(filterHook.filterPartition(client.get_partition_by_name(db, tableName, partName)));
+ return deepCopy(
+ filterHook.filterPartition(client.get_partition_by_name(db, tableName, partName)));
}
public Partition appendPartitionByName(String dbName, String tableName, String partName)
@@ -1829,6 +1834,31 @@ public class HiveMetaStoreClient impleme
return client.show_compact(new ShowCompactRequest());
}
+ @Override
+ public NotificationEventResponse getNextNotification(long lastEventId, int maxEvents,
+ NotificationFilter filter) throws TException {
+ NotificationEventRequest rqst = new NotificationEventRequest(lastEventId);
+ rqst.setMaxEvents(maxEvents);
+ NotificationEventResponse rsp = client.getNextNotification(rqst);
+ LOG.debug("Got back " + rsp.getEventsSize() + " events");
+ if (filter == null) {
+ return rsp;
+ } else {
+ NotificationEventResponse filtered = new NotificationEventResponse();
+ if (rsp != null && rsp.getEvents() != null) {
+ for (NotificationEvent e : rsp.getEvents()) {
+ if (filter.accept(e)) filtered.addToEvents(e);
+ }
+ }
+ return filtered;
+ }
+ }
+
+ @Override
+ public CurrentNotificationEventId getCurrentNotificationEventId() throws TException {
+ return client.getCurrentNotificationEventId();
+ }
+
/**
* Creates a synchronized wrapper for any {@link IMetaStoreClient}.
* This may be used by multi-threaded applications until we have
Modified: hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java?rev=1650145&r1=1650144&r2=1650145&view=diff
==============================================================================
--- hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java (original)
+++ hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java Wed Jan 7 20:15:10 2015
@@ -21,12 +21,16 @@ package org.apache.hadoop.hive.metastore
import org.apache.hadoop.hive.common.ValidTxnList;
import org.apache.hadoop.hive.conf.HiveConf;
import org.apache.hadoop.hive.metastore.api.CompactionType;
+import org.apache.hadoop.hive.metastore.api.CurrentNotificationEventId;
import org.apache.hadoop.hive.metastore.api.GetOpenTxnsInfoResponse;
import org.apache.hadoop.hive.metastore.api.HeartbeatTxnRangeResponse;
import org.apache.hadoop.hive.metastore.api.LockRequest;
import org.apache.hadoop.hive.metastore.api.LockResponse;
import org.apache.hadoop.hive.metastore.api.NoSuchLockException;
import org.apache.hadoop.hive.metastore.api.NoSuchTxnException;
+import org.apache.hadoop.hive.metastore.api.NotificationEvent;
+import org.apache.hadoop.hive.metastore.api.NotificationEventRequest;
+import org.apache.hadoop.hive.metastore.api.NotificationEventResponse;
import org.apache.hadoop.hive.metastore.api.OpenTxnsResponse;
import org.apache.hadoop.hive.metastore.api.PartitionSpec;
import org.apache.hadoop.hive.metastore.api.ShowCompactResponse;
@@ -1306,6 +1310,41 @@ public interface IMetaStoreClient {
*/
ShowCompactResponse showCompactions() throws TException;
+ /**
+ * A filter provided by the client that determines if a given notification event should be
+ * returned.
+ */
+ interface NotificationFilter {
+ /**
+ * Whether a notification event should be accepted
+ * @param event
+ * @return if true, event will be added to list, if false it will be ignored
+ */
+ boolean accept(NotificationEvent event);
+ }
+
+ /**
+ * Get the next set of notifications from the database.
+ * @param lastEventId The last event id that was consumed by this reader. The returned
+ * notifications will start at the next eventId available after this eventId.
+ * @param maxEvents Maximum number of events to return. If < 1, then all available events will
+ * be returned.
+ * @param filter User provided filter to remove unwanted events. If null, all events will be
+ * returned.
+ * @return list of notifications, sorted by eventId. It is guaranteed that the events are in
+ * the order that the operations were done on the database.
+ * @throws TException
+ */
+ NotificationEventResponse getNextNotification(long lastEventId, int maxEvents,
+ NotificationFilter filter) throws TException;
+
+ /**
+ * Get the last used notification event id.
+ * @return last used id
+ * @throws TException
+ */
+ CurrentNotificationEventId getCurrentNotificationEventId() throws TException;
+
class IncompatibleMetastoreException extends MetaException {
IncompatibleMetastoreException(String message) {
super(message);
Modified: hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java?rev=1650145&r1=1650144&r2=1650145&view=diff
==============================================================================
--- hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java (original)
+++ hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java Wed Jan 7 20:15:10 2015
@@ -67,6 +67,7 @@ import org.apache.hadoop.hive.metastore.
import org.apache.hadoop.hive.metastore.api.ColumnStatistics;
import org.apache.hadoop.hive.metastore.api.ColumnStatisticsDesc;
import org.apache.hadoop.hive.metastore.api.ColumnStatisticsObj;
+import org.apache.hadoop.hive.metastore.api.CurrentNotificationEventId;
import org.apache.hadoop.hive.metastore.api.Database;
import org.apache.hadoop.hive.metastore.api.FieldSchema;
import org.apache.hadoop.hive.metastore.api.Function;
@@ -80,6 +81,9 @@ import org.apache.hadoop.hive.metastore.
import org.apache.hadoop.hive.metastore.api.InvalidPartitionException;
import org.apache.hadoop.hive.metastore.api.MetaException;
import org.apache.hadoop.hive.metastore.api.NoSuchObjectException;
+import org.apache.hadoop.hive.metastore.api.NotificationEvent;
+import org.apache.hadoop.hive.metastore.api.NotificationEventRequest;
+import org.apache.hadoop.hive.metastore.api.NotificationEventResponse;
import org.apache.hadoop.hive.metastore.api.Order;
import org.apache.hadoop.hive.metastore.api.Partition;
import org.apache.hadoop.hive.metastore.api.PartitionEventType;
@@ -107,6 +111,8 @@ import org.apache.hadoop.hive.metastore.
import org.apache.hadoop.hive.metastore.model.MGlobalPrivilege;
import org.apache.hadoop.hive.metastore.model.MIndex;
import org.apache.hadoop.hive.metastore.model.MMasterKey;
+import org.apache.hadoop.hive.metastore.model.MNotificationLog;
+import org.apache.hadoop.hive.metastore.model.MNotificationNextId;
import org.apache.hadoop.hive.metastore.model.MOrder;
import org.apache.hadoop.hive.metastore.model.MPartition;
import org.apache.hadoop.hive.metastore.model.MPartitionColumnPrivilege;
@@ -6962,4 +6968,128 @@ public class ObjectStore implements RawS
}
return funcs;
}
+
+ @Override
+ public NotificationEventResponse getNextNotification(NotificationEventRequest rqst) {
+ boolean commited = false;
+ try {
+ openTransaction();
+ long lastEvent = rqst.getLastEvent();
+ Query query = pm.newQuery(MNotificationLog.class, "eventId > lastEvent");
+ query.declareParameters("java.lang.Long lastEvent");
+ query.setOrdering("eventId ascending");
+ Collection<MNotificationLog> events = (Collection)query.execute(lastEvent);
+ commited = commitTransaction();
+ if (events == null) {
+ return null;
+ }
+ Iterator<MNotificationLog> i = events.iterator();
+ NotificationEventResponse result = new NotificationEventResponse();
+ int maxEvents = rqst.getMaxEvents() > 0 ? rqst.getMaxEvents() : Integer.MAX_VALUE;
+ int numEvents = 0;
+ while (i.hasNext() && numEvents++ < maxEvents) {
+ result.addToEvents(translateDbToThrift(i.next()));
+ }
+ return result;
+ } finally {
+ if (!commited) {
+ rollbackTransaction();
+ return null;
+ }
+ }
+ }
+
+ @Override
+ public void addNotificationEvent(NotificationEvent entry) {
+ boolean commited = false;
+ try {
+ openTransaction();
+ Query query = pm.newQuery(MNotificationNextId.class);
+ Collection<MNotificationNextId> ids = (Collection) query.execute();
+ MNotificationNextId id = null;
+ boolean needToPersistId;
+ if (ids == null || ids.size() == 0) {
+ id = new MNotificationNextId(1L);
+ needToPersistId = true;
+ } else {
+ id = ids.iterator().next();
+ needToPersistId = false;
+ }
+ entry.setEventId(id.getNextEventId());
+ id.incrementEventId();
+ if (needToPersistId) pm.makePersistent(id);
+ pm.makePersistent(translateThriftToDb(entry));
+ commited = commitTransaction();
+ } finally {
+ if (!commited) {
+ rollbackTransaction();
+ }
+ }
+ }
+
+ @Override
+ public void cleanNotificationEvents(int olderThan) {
+ boolean commited = false;
+ try {
+ openTransaction();
+ long tmp = System.currentTimeMillis() / 1000 - olderThan;
+ int tooOld = (tmp > Integer.MAX_VALUE) ? 0 : (int)tmp;
+ Query query = pm.newQuery(MNotificationLog.class, "eventTime < tooOld");
+ query.declareParameters("java.lang.Integer tooOld");
+ Collection<MNotificationLog> toBeRemoved = (Collection)query.execute(tooOld);
+ if (toBeRemoved != null && toBeRemoved.size() > 0) {
+ pm.deletePersistent(toBeRemoved);
+ }
+ commited = commitTransaction();
+ } finally {
+ if (!commited) {
+ rollbackTransaction();
+ }
+ }
+ }
+
+ @Override
+ public CurrentNotificationEventId getCurrentNotificationEventId() {
+ boolean commited = false;
+ try {
+ openTransaction();
+ Query query = pm.newQuery(MNotificationNextId.class);
+ Collection<MNotificationNextId> ids = (Collection)query.execute();
+ long id = 0;
+ if (ids != null && ids.size() > 0) {
+ id = ids.iterator().next().getNextEventId() - 1;
+ }
+ commited = commitTransaction();
+ return new CurrentNotificationEventId(id);
+ } finally {
+ if (!commited) {
+ rollbackTransaction();
+ }
+ }
+ }
+
+ private MNotificationLog translateThriftToDb(NotificationEvent entry) {
+ MNotificationLog dbEntry = new MNotificationLog();
+ dbEntry.setEventId(entry.getEventId());
+ dbEntry.setEventTime(entry.getEventTime());
+ dbEntry.setEventType(entry.getEventType());
+ dbEntry.setDbName(entry.getDbName());
+ dbEntry.setTableName(entry.getTableName());
+ dbEntry.setMessage(entry.getMessage());
+ return dbEntry;
+ }
+
+ private NotificationEvent translateDbToThrift(MNotificationLog dbEvent) {
+ NotificationEvent event = new NotificationEvent();
+ event.setEventId(dbEvent.getEventId());
+ event.setEventTime(dbEvent.getEventTime());
+ event.setEventType(dbEvent.getEventType());
+ event.setDbName(dbEvent.getDbName());
+ event.setTableName(dbEvent.getTableName());
+ event.setMessage((dbEvent.getMessage()));
+ return event;
+ }
+
+
+
}
Modified: hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/RawStore.java
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/RawStore.java?rev=1650145&r1=1650144&r2=1650145&view=diff
==============================================================================
--- hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/RawStore.java (original)
+++ hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/RawStore.java Wed Jan 7 20:15:10 2015
@@ -24,11 +24,13 @@ import java.lang.annotation.RetentionPol
import java.lang.annotation.Target;
import java.util.List;
import java.util.Map;
+import java.util.SortedSet;
import org.apache.hadoop.conf.Configurable;
import org.apache.hadoop.hive.metastore.api.AggrStats;
import org.apache.hadoop.hive.metastore.api.ColumnStatistics;
import org.apache.hadoop.hive.metastore.api.ColumnStatisticsObj;
+import org.apache.hadoop.hive.metastore.api.CurrentNotificationEventId;
import org.apache.hadoop.hive.metastore.api.Database;
import org.apache.hadoop.hive.metastore.api.Function;
import org.apache.hadoop.hive.metastore.api.HiveObjectPrivilege;
@@ -38,6 +40,9 @@ import org.apache.hadoop.hive.metastore.
import org.apache.hadoop.hive.metastore.api.InvalidPartitionException;
import org.apache.hadoop.hive.metastore.api.MetaException;
import org.apache.hadoop.hive.metastore.api.NoSuchObjectException;
+import org.apache.hadoop.hive.metastore.api.NotificationEvent;
+import org.apache.hadoop.hive.metastore.api.NotificationEventRequest;
+import org.apache.hadoop.hive.metastore.api.NotificationEventResponse;
import org.apache.hadoop.hive.metastore.api.Partition;
import org.apache.hadoop.hive.metastore.api.PartitionEventType;
import org.apache.hadoop.hive.metastore.api.PrincipalPrivilegeSet;
@@ -556,5 +561,33 @@ public interface RawStore extends Config
public AggrStats get_aggr_stats_for(String dbName, String tblName,
List<String> partNames, List<String> colNames) throws MetaException, NoSuchObjectException;
+
+ /**
+ * Get the next notification event.
+ * @param rqst Request containing information on the last processed notification.
+ * @return list of notifications, sorted by eventId
+ */
+ public NotificationEventResponse getNextNotification(NotificationEventRequest rqst);
+
+
+ /**
+ * Add a notification entry. This should only be called from inside the metastore
+ * @param event the notification to add
+ */
+ public void addNotificationEvent(NotificationEvent event);
+
+ /**
+ * Remove older notification events.
+ * @param olderThan Remove any events older than a given number of seconds
+ */
+ public void cleanNotificationEvents(int olderThan);
+
+ /**
+ * Get the last issued notification event id. This is intended for use by the export command
+ * so that users can determine the state of the system at the point of the export,
+ * and determine which notification events happened before or after the export.
+ * @return
+ */
+ public CurrentNotificationEventId getCurrentNotificationEventId();
}
Added: hive/trunk/metastore/src/model/org/apache/hadoop/hive/metastore/model/MNotificationLog.java
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/model/org/apache/hadoop/hive/metastore/model/MNotificationLog.java?rev=1650145&view=auto
==============================================================================
--- hive/trunk/metastore/src/model/org/apache/hadoop/hive/metastore/model/MNotificationLog.java (added)
+++ hive/trunk/metastore/src/model/org/apache/hadoop/hive/metastore/model/MNotificationLog.java Wed Jan 7 20:15:10 2015
@@ -0,0 +1,89 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hive.metastore.model;
+
+public class MNotificationLog {
+
+ private long eventId; // This is not the datanucleus id, but the id assigned by the sequence
+ private int eventTime;
+ private String eventType;
+ private String dbName;
+ private String tableName;
+ private String message;
+
+ public MNotificationLog() {
+ }
+
+ public MNotificationLog(int eventId, String eventType, String dbName, String tableName,
+ String message) {
+ this.eventId = eventId;
+ this.eventType = eventType;
+ this.dbName = dbName;
+ this.tableName = tableName;
+ this.message = message;
+ }
+
+ public void setEventId(long eventId) {
+ this.eventId = eventId;
+ }
+
+ public long getEventId() {
+ return eventId;
+
+ }
+
+ public int getEventTime() {
+ return eventTime;
+ }
+
+ public void setEventTime(int eventTime) {
+ this.eventTime = eventTime;
+ }
+
+ public String getEventType() {
+ return eventType;
+ }
+
+ public void setEventType(String eventType) {
+ this.eventType = eventType;
+ }
+
+ public String getDbName() {
+ return dbName;
+ }
+
+ public void setDbName(String dbName) {
+ this.dbName = dbName;
+ }
+
+ public String getTableName() {
+ return tableName;
+ }
+
+ public void setTableName(String tableName) {
+ this.tableName = tableName;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+}
Added: hive/trunk/metastore/src/model/org/apache/hadoop/hive/metastore/model/MNotificationNextId.java
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/model/org/apache/hadoop/hive/metastore/model/MNotificationNextId.java?rev=1650145&view=auto
==============================================================================
--- hive/trunk/metastore/src/model/org/apache/hadoop/hive/metastore/model/MNotificationNextId.java (added)
+++ hive/trunk/metastore/src/model/org/apache/hadoop/hive/metastore/model/MNotificationNextId.java Wed Jan 7 20:15:10 2015
@@ -0,0 +1,42 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hive.metastore.model;
+
+public class MNotificationNextId {
+
+ private long nextEventId;
+
+ public MNotificationNextId() {
+ }
+
+ public MNotificationNextId(long nextEventId) {
+ this.nextEventId = nextEventId;
+ }
+
+ public long getNextEventId() {
+ return nextEventId;
+ }
+
+ public void setNextEventId(long nextEventId) {
+ this.nextEventId = nextEventId;
+ }
+
+ public void incrementEventId() {
+ nextEventId++;
+ }
+}
Modified: hive/trunk/metastore/src/model/package.jdo
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/model/package.jdo?rev=1650145&r1=1650144&r2=1650145&view=diff
==============================================================================
--- hive/trunk/metastore/src/model/package.jdo (original)
+++ hive/trunk/metastore/src/model/package.jdo Wed Jan 7 20:15:10 2015
@@ -985,6 +985,41 @@
</field>
</class>
+ <class name="MNotificationLog" table="NOTIFICATION_LOG" identity-type="datastore" detachable="true">
+ <datastore-identity>
+ <column name="NL_ID"/>
+ </datastore-identity>
+ <field name="eventId">
+ <column name="EVENT_ID" jdbc-type="BIGINT" allows-null="false"/>
+ </field>
+ <field name="eventTime">
+ <column name="EVENT_TIME" jdbc-type="INTEGER" allows-null="false"/>
+ </field>
+ <field name="eventType">
+ <column name="EVENT_TYPE" length="32" jdbc-type="VARCHAR" allows-null="false"/>
+ </field>
+ <field name="dbName">
+ <column name="DB_NAME" length="128" jdbc-type="VARCHAR" allows-null="true"/>
+ </field>
+ <field name="tableName">
+ <column name="TBL_NAME" length="128" jdbc-type="VARCHAR" allows-null="true"/>
+ </field>
+ <field name="message">
+ <column name="MESSAGE" length="1024" jdbc-type="VARCHAR" allows-null="false"/>
+ </field>
+ </class>
+
+ <!-- I tried to use a sequence here but derby didn't handle it well. -->
+ <class name="MNotificationNextId" table="NOTIFICATION_SEQUENCE" identity-type="datastore" detachable="true">
+ <datastore-identity>
+ <column name="NNI_ID"/>
+ </datastore-identity>
+ <field name="nextEventId">
+ <column name="NEXT_EVENT_ID" jdbc-type="BIGINT" allows-null="false"/>
+ </field>
+ </class>
+
+
</package>
</jdo>
Modified: hive/trunk/metastore/src/test/org/apache/hadoop/hive/metastore/DummyRawStoreControlledCommit.java
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/test/org/apache/hadoop/hive/metastore/DummyRawStoreControlledCommit.java?rev=1650145&r1=1650144&r2=1650145&view=diff
==============================================================================
--- hive/trunk/metastore/src/test/org/apache/hadoop/hive/metastore/DummyRawStoreControlledCommit.java (original)
+++ hive/trunk/metastore/src/test/org/apache/hadoop/hive/metastore/DummyRawStoreControlledCommit.java Wed Jan 7 20:15:10 2015
@@ -21,12 +21,14 @@ package org.apache.hadoop.hive.metastore
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
+import java.util.SortedSet;
import org.apache.hadoop.conf.Configurable;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hive.metastore.api.AggrStats;
import org.apache.hadoop.hive.metastore.api.ColumnStatistics;
import org.apache.hadoop.hive.metastore.api.ColumnStatisticsObj;
+import org.apache.hadoop.hive.metastore.api.CurrentNotificationEventId;
import org.apache.hadoop.hive.metastore.api.Database;
import org.apache.hadoop.hive.metastore.api.Function;
import org.apache.hadoop.hive.metastore.api.HiveObjectPrivilege;
@@ -36,6 +38,9 @@ import org.apache.hadoop.hive.metastore.
import org.apache.hadoop.hive.metastore.api.InvalidPartitionException;
import org.apache.hadoop.hive.metastore.api.MetaException;
import org.apache.hadoop.hive.metastore.api.NoSuchObjectException;
+import org.apache.hadoop.hive.metastore.api.NotificationEvent;
+import org.apache.hadoop.hive.metastore.api.NotificationEventRequest;
+import org.apache.hadoop.hive.metastore.api.NotificationEventResponse;
import org.apache.hadoop.hive.metastore.api.Partition;
import org.apache.hadoop.hive.metastore.api.PartitionEventType;
import org.apache.hadoop.hive.metastore.api.PartitionsStatsRequest;
@@ -349,7 +354,7 @@ public class DummyRawStoreControlledComm
public boolean grantRole(Role role, String userName, PrincipalType principalType,
String grantor, PrincipalType grantorType, boolean grantOption)
throws MetaException, NoSuchObjectException, InvalidObjectException {
- return objectStore.grantRole(role, userName, principalType, grantor, grantorType,
+ return objectStore.grantRole(role, userName, principalType, grantor, grantorType,
grantOption);
}
@@ -403,13 +408,13 @@ public class DummyRawStoreControlledComm
@Override
public List<MDBPrivilege> listPrincipalDBGrants(String principalName,
PrincipalType principalType, String dbName) {
- return objectStore.listPrincipalDBGrants(principalName, principalType, dbName);
+ return objectStore.listPrincipalDBGrants(principalName, principalType, dbName);
}
@Override
public List<MTablePrivilege> listAllTableGrants(String principalName,
PrincipalType principalType, String dbName, String tableName) {
- return objectStore.listAllTableGrants(principalName, principalType,
+ return objectStore.listAllTableGrants(principalName, principalType,
dbName, tableName);
}
@@ -726,4 +731,25 @@ public class DummyRawStoreControlledComm
return null;
}
+ @Override
+ public NotificationEventResponse getNextNotification(NotificationEventRequest rqst) {
+ return objectStore.getNextNotification(rqst);
+ }
+
+ @Override
+ public void addNotificationEvent(NotificationEvent event) {
+ objectStore.addNotificationEvent(event);
+ }
+
+ @Override
+ public void cleanNotificationEvents(int olderThan) {
+ objectStore.cleanNotificationEvents(olderThan);
+ }
+
+ @Override
+ public CurrentNotificationEventId getCurrentNotificationEventId() {
+ return objectStore.getCurrentNotificationEventId();
+ }
+
+
}
Modified: hive/trunk/metastore/src/test/org/apache/hadoop/hive/metastore/DummyRawStoreForJdoConnection.java
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/test/org/apache/hadoop/hive/metastore/DummyRawStoreForJdoConnection.java?rev=1650145&r1=1650144&r2=1650145&view=diff
==============================================================================
--- hive/trunk/metastore/src/test/org/apache/hadoop/hive/metastore/DummyRawStoreForJdoConnection.java (original)
+++ hive/trunk/metastore/src/test/org/apache/hadoop/hive/metastore/DummyRawStoreForJdoConnection.java Wed Jan 7 20:15:10 2015
@@ -20,6 +20,7 @@ package org.apache.hadoop.hive.metastore
import java.util.List;
import java.util.Map;
+import java.util.SortedSet;
import junit.framework.Assert;
@@ -28,6 +29,7 @@ import org.apache.hadoop.hive.conf.HiveC
import org.apache.hadoop.hive.metastore.api.AggrStats;
import org.apache.hadoop.hive.metastore.api.ColumnStatistics;
import org.apache.hadoop.hive.metastore.api.ColumnStatisticsObj;
+import org.apache.hadoop.hive.metastore.api.CurrentNotificationEventId;
import org.apache.hadoop.hive.metastore.api.Database;
import org.apache.hadoop.hive.metastore.api.Function;
import org.apache.hadoop.hive.metastore.api.HiveObjectPrivilege;
@@ -37,6 +39,9 @@ import org.apache.hadoop.hive.metastore.
import org.apache.hadoop.hive.metastore.api.InvalidPartitionException;
import org.apache.hadoop.hive.metastore.api.MetaException;
import org.apache.hadoop.hive.metastore.api.NoSuchObjectException;
+import org.apache.hadoop.hive.metastore.api.NotificationEvent;
+import org.apache.hadoop.hive.metastore.api.NotificationEventRequest;
+import org.apache.hadoop.hive.metastore.api.NotificationEventResponse;
import org.apache.hadoop.hive.metastore.api.Partition;
import org.apache.hadoop.hive.metastore.api.PartitionEventType;
import org.apache.hadoop.hive.metastore.api.PartitionsStatsRequest;
@@ -742,7 +747,28 @@ public class DummyRawStoreForJdoConnecti
throws MetaException {
return null;
}
-
+
+ @Override
+ public NotificationEventResponse getNextNotification(NotificationEventRequest rqst) {
+ return null;
+ }
+
+ @Override
+ public void addNotificationEvent(NotificationEvent event) {
+
+ }
+
+ @Override
+ public void cleanNotificationEvents(int olderThan) {
+
+ }
+
+ @Override
+ public CurrentNotificationEventId getCurrentNotificationEventId() {
+ return null;
+ }
+
+
}