From 5e33f3a16b6b1b740a5b1b90d5ae2110176c9929 Mon Sep 17 00:00:00 2001 From: Ernest Hill Date: Tue, 29 Oct 2024 15:22:27 +0300 Subject: [PATCH] Add additional logging --- .../main/kotlin/com/atlan/pkg/serde/cell/AssetRefXformer.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/package-toolkit/runtime/src/main/kotlin/com/atlan/pkg/serde/cell/AssetRefXformer.kt b/package-toolkit/runtime/src/main/kotlin/com/atlan/pkg/serde/cell/AssetRefXformer.kt index e678df5405..677bbc2d4e 100644 --- a/package-toolkit/runtime/src/main/kotlin/com/atlan/pkg/serde/cell/AssetRefXformer.kt +++ b/package-toolkit/runtime/src/main/kotlin/com/atlan/pkg/serde/cell/AssetRefXformer.kt @@ -17,6 +17,7 @@ import com.atlan.pkg.cache.LinkCache import com.atlan.serde.Serde import com.atlan.util.ParallelBatch import mu.KLogger +import mu.KotlinLogging import java.util.concurrent.atomic.AtomicLong /** @@ -24,6 +25,7 @@ import java.util.concurrent.atomic.AtomicLong */ object AssetRefXformer { const val TYPE_QN_DELIMITER = "@" + private val logger = KotlinLogging.logger {} /** * Encodes (serializes) an asset reference into a string form. @@ -142,16 +144,20 @@ object AssetRefXformer { var update: Link? = null for (link in existingLinks) { if (link.link == related.link) { + logger.debug { "Found matching link for: ${link.link}" } if (link.name == related.name) { // If the link is identical, skip it + logger.debug { "Found matching name: ${link.name}" } found = true } else { // If the name has changed, update the name on the existing link + logger.debug { "Name changed from : ${link.name} to ${related.name} with qualifiedName: ${link.qualifiedName}" } update = Link.updater(link.qualifiedName, related.name).nullFields(related.nullFields).build() } } } if (!found && update == null) { + logger.debug { "No match found for : ${related.link} creating new link" } // Otherwise create an entirely new link (idempotently) update = Link.creator(from, related.name, related.link, true).nullFields(related.nullFields).build() }