morningman commented on code in PR #15401:
URL: https://github.com/apache/doris/pull/15401#discussion_r1060251495
##########
fe/fe-core/src/main/java/org/apache/doris/datasource/HMSExternalCatalog.java:
##########
@@ -170,4 +180,48 @@ public List<Column> getSchema(String dbName, String
tblName) {
}
return tmpSchema;
}
+
+ public void setLastSyncedEventId(long lastSyncedEventId) {
+ this.lastSyncedEventId = lastSyncedEventId;
+ }
+
+ public NotificationEventResponse getNextEventResponse(HMSExternalCatalog
hmsExternalCatalog)
+ throws MetastoreNotificationFetchException {
+ makeSureInitialized();
+ if (lastSyncedEventId < 0) {
+ lastSyncedEventId = getCurrentEventId();
+ refreshCatalog(hmsExternalCatalog);
+ LOG.info(
+ "First pulling events on catalog [{}],refreshCatalog and
init lastSyncedEventId,"
+ + "lastSyncedEventId is [{}]",
+ hmsExternalCatalog.getName(), lastSyncedEventId);
+ return null;
+ }
+
+ long currentEventId = getCurrentEventId();
+ LOG.debug("Catalog [{}] getNextEventResponse的currentEventId is
{},lastSyncedEventId is {}",
+ hmsExternalCatalog.getName(), currentEventId,
lastSyncedEventId);
+ if (currentEventId == lastSyncedEventId) {
+ LOG.info("Event id not updated when pulling events on catalog
[{}]", hmsExternalCatalog.getName());
+ return null;
+ }
+ return client.getNextNotification(lastSyncedEventId,
Config.hms_events_batch_size_per_rpc, null);
Review Comment:
OK
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]