Skip to content

Commit

Permalink
add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Hamza Jugon committed Nov 26, 2024
1 parent e71a5ae commit eea8403
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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;
Expand All @@ -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;

Expand Down Expand Up @@ -64,6 +66,16 @@ public void scheduleBeekeeperEvent() {
BeekeeperEvent beekeeperEvent = housekeepingEntitiesToBeScheduled.get();
List<HousekeepingEntity> housekeepingEntities = beekeeperEvent.getHousekeepingEntities();

Map<String, String> 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());
Expand Down

0 comments on commit eea8403

Please sign in to comment.