Skip to content

Commit

Permalink
HIVE-21851: FireEventResponse should include event id when available …
Browse files Browse the repository at this point in the history
…(Vihang Karajgaonkar, reviewed by Naveen Gangam)
  • Loading branch information
Vihang Karajgaonkar committed Mar 30, 2020
1 parent 5ed2ec0 commit 7426703
Show file tree
Hide file tree
Showing 9 changed files with 219 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import org.apache.hadoop.hive.metastore.api.FieldSchema;
import org.apache.hadoop.hive.metastore.api.FireEventRequest;
import org.apache.hadoop.hive.metastore.api.FireEventRequestData;
import org.apache.hadoop.hive.metastore.api.FireEventResponse;
import org.apache.hadoop.hive.metastore.api.Function;
import org.apache.hadoop.hive.metastore.api.FunctionType;
import org.apache.hadoop.hive.metastore.api.InsertEventRequestData;
Expand Down Expand Up @@ -98,6 +99,7 @@
import org.apache.hive.hcatalog.api.repl.ReplicationV1CompatRule;
import org.apache.hive.hcatalog.data.Pair;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Rule;
Expand Down Expand Up @@ -1047,7 +1049,10 @@ public void insertTable() throws Exception {
rqst.setDbName(defaultDbName);
rqst.setTableName(tblName);
// Event 2
msClient.fireListenerEvent(rqst);
FireEventResponse response = msClient.fireListenerEvent(rqst);
assertTrue("Event id must be set in the fireEvent response", response.isSetEventId());
Assert.assertNotNull(response.getEventId());
Assert.assertTrue(response.getEventId() != -1);

// Get notifications from metastore
NotificationEventResponse rsp = msClient.getNextNotification(firstEventId, 0, null);
Expand Down Expand Up @@ -1116,7 +1121,10 @@ public void insertPartition() throws Exception {
rqst.setTableName(tblName);
rqst.setPartitionVals(partCol1Vals);
// Event 3
msClient.fireListenerEvent(rqst);
FireEventResponse response = msClient.fireListenerEvent(rqst);
assertTrue("Event id must be set in the fireEvent response", response.isSetEventId());
Assert.assertNotNull(response.getEventId());
Assert.assertTrue(response.getEventId() != -1);

// Get notifications from metastore
NotificationEventResponse rsp = msClient.getNextNotification(firstEventId, 0, null);
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 13 additions & 2 deletions standalone-metastore/src/gen/thrift/gen-cpp/hive_metastore_types.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7426703

Please sign in to comment.