From eea8403152a25b00c426bb48f7b5a53407d97b3b Mon Sep 17 00:00:00 2001 From: Hamza Jugon Date: Tue, 26 Nov 2024 15:53:48 +0000 Subject: [PATCH] add logging --- .../scheduler/apiary/service/SchedulerApiary.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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 c07a5381..4af8d8b9 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 @@ -1,5 +1,5 @@ /** - * Copyright (C) 2019-2024 Expedia, Inc. + * Copyright (C) 2019-2020 Expedia, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ import java.io.IOException; import java.util.EnumMap; import java.util.List; +import java.util.Map; import java.util.Optional; import org.slf4j.Logger; @@ -34,6 +35,7 @@ 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; @@ -64,6 +66,16 @@ public void scheduleBeekeeperEvent() { BeekeeperEvent beekeeperEvent = housekeepingEntitiesToBeScheduled.get(); List housekeepingEntities = beekeeperEvent.getHousekeepingEntities(); + Map tableParameters = beekeeperEvent.getMessageEvent().getEvent().getTableParameters(); + + // logging: Print all table parameters + if (tableParameters != null && !tableParameters.isEmpty()) { + log.info("Processing table parameters for event:"); + tableParameters.forEach((key, value) -> log.info(" - {}: {}", key, value)); + } else { + log.info("No table parameters found for event."); + } + for (HousekeepingEntity entity : housekeepingEntities) { try { icebergValidator.throwExceptionIfIceberg(entity.getDatabaseName(), entity.getTableName());