From 68ff7a3e7ffd2a24fca879b1a4a06f1374169c56 Mon Sep 17 00:00:00 2001 From: javsanbel2 Date: Thu, 14 Nov 2024 12:42:09 +0100 Subject: [PATCH] try logging table parameters to identify iceberg tables --- .../scheduler/apiary/service/SchedulerApiary.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/beekeeper-scheduler-apiary/src/main/java/com/expediagroup/beekeeper/scheduler/apiary/service/SchedulerApiary.java b/beekeeper-scheduler-apiary/src/main/java/com/expediagroup/beekeeper/scheduler/apiary/service/SchedulerApiary.java index 4cc1e165..ab1a9e26 100644 --- a/beekeeper-scheduler-apiary/src/main/java/com/expediagroup/beekeeper/scheduler/apiary/service/SchedulerApiary.java +++ b/beekeeper-scheduler-apiary/src/main/java/com/expediagroup/beekeeper/scheduler/apiary/service/SchedulerApiary.java @@ -20,8 +20,11 @@ import java.io.IOException; import java.util.EnumMap; import java.util.List; +import java.util.Map; import java.util.Optional; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; @@ -30,11 +33,13 @@ import com.expediagroup.beekeeper.core.model.HousekeepingEntity; import com.expediagroup.beekeeper.core.model.LifecycleEventType; import com.expediagroup.beekeeper.scheduler.apiary.messaging.BeekeeperEventReader; +import com.expediagroup.beekeeper.scheduler.apiary.messaging.MessageReaderAdapter; import com.expediagroup.beekeeper.scheduler.apiary.model.BeekeeperEvent; import com.expediagroup.beekeeper.scheduler.service.SchedulerService; @Component public class SchedulerApiary { + private static final Logger log = LoggerFactory.getLogger(SchedulerApiary.class); private final BeekeeperEventReader beekeeperEventReader; private final EnumMap schedulerServiceMap; @@ -55,6 +60,12 @@ public void scheduleBeekeeperEvent() { BeekeeperEvent beekeeperEvent = housekeepingEntitiesToBeScheduled.get(); List housekeepingEntities = beekeeperEvent.getHousekeepingEntities(); + Map tableParameters = beekeeperEvent.getMessageEvent().getEvent().getTableParameters(); + log.info("Table parameters for event {}", tableParameters); + if (tableParameters.containsKey("format")) { + String tableType = tableParameters.get("format"); + log.info("Table type is {}", tableType.split("/")[0]); + } for (HousekeepingEntity entity : housekeepingEntities) { try { LifecycleEventType eventType = LifecycleEventType.valueOf(entity.getLifecycleType());