Skip to content

Commit

Permalink
try logging table parameters to identify iceberg tables
Browse files Browse the repository at this point in the history
  • Loading branch information
javsanbel2 committed Nov 14, 2024
1 parent fdd37b5 commit 68ff7a3
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<LifecycleEventType, SchedulerService> schedulerServiceMap;
Expand All @@ -55,6 +60,12 @@ public void scheduleBeekeeperEvent() {
BeekeeperEvent beekeeperEvent = housekeepingEntitiesToBeScheduled.get();
List<HousekeepingEntity> housekeepingEntities = beekeeperEvent.getHousekeepingEntities();

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

0 comments on commit 68ff7a3

Please sign in to comment.