kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ha...@apache.org
Subject kudu git commit: [hms] relax the notification format restriction
Date Wed, 19 Sep 2018 01:39:19 GMT
Repository: kudu
Updated Branches:
  refs/heads/master 80ebaeda8 -> 42dd8f842

[hms] relax the notification format restriction

'messageFormat' is an optional field in NotificationEvent thrift object
introduced in HIVE-10562. In order to be compatible with Hive
distributions that do not include HIVE-10652, this commit relaxes the
restriction of HMS notification message format, so that the
notification log listener can process the message even when the format
type is not provided. Removing this restriction should not cause any
regressions as long as the required fields are present in the messages.

Change-Id: I09d0e36cebe2074d975504d6bbc5677107e33fe3
Reviewed-on: http://gerrit.cloudera.org:8080/11460
Reviewed-by: Adar Dembo <adar@cloudera.com>
Tested-by: Kudu Jenkins

Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/42dd8f84
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/42dd8f84
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/42dd8f84

Branch: refs/heads/master
Commit: 42dd8f842bc242a19bfe569baa97112daf180e55
Parents: 80ebaed
Author: Hao Hao <hao.hao@cloudera.com>
Authored: Mon Sep 17 18:07:04 2018 -0700
Committer: Hao Hao <hao.hao@cloudera.com>
Committed: Wed Sep 19 01:38:39 2018 +0000

 src/kudu/master/hms_notification_log_listener.cc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/kudu/master/hms_notification_log_listener.cc b/src/kudu/master/hms_notification_log_listener.cc
index 14e99b4..0c751a6 100644
--- a/src/kudu/master/hms_notification_log_listener.cc
+++ b/src/kudu/master/hms_notification_log_listener.cc
@@ -180,8 +180,12 @@ string EventDebugString(const hive::NotificationEvent& event) {
 // MessageFactory, this method is specialized to return the Document type. If
 // another MessageFactory instance becomes used in the future this method should
 // be updated to handle it accordingly.
+// Also because 'messageFormat' is an optional field introduced in HIVE-10562.
+// We consider message without this field valid, to be compatible with HIVE
+// distributions that do not include HIVE-10562 but still have the proper
+// JSONMessageFactory.
 Status ParseMessage(const hive::NotificationEvent& event, Document* message) {
-  if (event.messageFormat != "json-0.2") {
+  if (!event.messageFormat.empty() && event.messageFormat != "json-0.2") {
     return Status::NotSupported("unknown message format", event.messageFormat);
   if (message->Parse<0>(event.message.c_str()).HasParseError()) {

View raw message