Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional logging #959

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ 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

/**
* Static object to transform asset references.
*/
object AssetRefXformer {
const val TYPE_QN_DELIMITER = "@"
private val logger = KotlinLogging.logger {}

/**
* Encodes (serializes) an asset reference into a string form.
Expand Down Expand Up @@ -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()
}
Expand Down
Loading