Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ testng = "7.11.0"
log4j = "2.25.2"
wiremock = "3.13.2"
jnanoid = "2.0.0"
awssdk = "2.39.2"
awssdk = "2.39.3"
gcs = "26.72.0"
system-stubs = "2.1.8"
fastcsv = "4.1.0"
poi = "5.5.0"
parsson = "1.1.7"
simplejavamail = "8.12.6"
swagger = "2.1.35"
swagger = "2.1.36"
jsonpath = "2.10.0"
jsonsmart = "2.6.0"
commons-compress = "1.28.0"
Expand Down
28 changes: 27 additions & 1 deletion sdk/src/main/java/com/atlan/generators/ModelCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.atlan.exception.AtlanException;
import com.atlan.model.enums.AtlanTypeCategory;
import com.atlan.model.typedefs.*;
import com.atlan.net.HttpClient;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -61,14 +62,39 @@ private ModelCache(AtlanClient client) throws AtlanException {
private static ModelCache createInstance(AtlanClient client) {
try {
ModelCache cache = new ModelCache(client);
cache = retryIfNeeded(client, cache, 1);
cache.cacheInheritance(cache.getEntityDefCache().values());
return cache;
} catch (AtlanException e) {
} catch (AtlanException | InterruptedException e) {
log.error("Unable to refresh typedef caches.", e);
return null;
}
}

private static ModelCache retryIfNeeded(AtlanClient client, ModelCache cache, int retryAttempt)
throws AtlanException, InterruptedException {
EntityDef ref = cache.getEntityDefCache().get("Referenceable");
boolean retry = true;
if (ref != null) {
Optional<AttributeDef> qn = ref.getAttributeDefs().stream()
.filter(attr -> attr.getName().equals("qualifiedName"))
.findFirst();
if (qn.isPresent()) {
String desc = qn.get().getDescription();
if (desc != null && !desc.isEmpty()) {
retry = false;
}
}
}
if (retry) {
log.info("Referenceable had empty qualifiedName, retrying (attempt #{})...", retryAttempt);
Thread.sleep(HttpClient.waitTime(retryAttempt).toMillis());
return retryIfNeeded(client, new ModelCache(client), retryAttempt + 1);
} else {
return cache;
}
}

public static ModelCache getInstance(AtlanClient client) {
if (INSTANCE == null) {
INSTANCE = createInstance(client);
Expand Down
2 changes: 2 additions & 0 deletions sdk/src/main/java/com/atlan/model/assets/Connection.java
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ public static boolean restore(AtlanClient client, String qualifiedName) throws A
* @return the connector type, or null if the qualifiedName is not for a connected asset
*/
public static AtlanConnectorType getConnectorTypeFromQualifiedName(String qualifiedName) {
if (qualifiedName == null) return null;
return getConnectorTypeFromQualifiedName(qualifiedName.split("/"));
}

Expand All @@ -475,6 +476,7 @@ public static AtlanConnectorType getConnectorTypeFromQualifiedName(String[] toke
* @return the connector type, or null if the qualifiedName is not for a connected asset
*/
public static String getConnectorFromQualifiedName(String qualifiedName) {
if (qualifiedName == null) return null;
String[] tokens = qualifiedName.split("/");
AtlanConnectorType ct = getConnectorTypeFromQualifiedName(tokens);
if (ct == null || ct == AtlanConnectorType.UNKNOWN_CUSTOM) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ public class DomoDatasetColumn extends Asset
@Attribute
IDomoDataset domoDataset;

/** Expression used to create this calculated column. */
@Attribute
String domoDatasetColumnExpression;

/** If the column is a calculated column. */
@Attribute
Boolean domoDatasetColumnIsCalculated;

/** Type of Domo Dataset Column. */
@Attribute
String domoDatasetColumnType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.atlan.model.enums.DataQualityScheduleType;
import com.atlan.model.enums.DataQualitySourceSyncStatus;
import com.atlan.model.enums.SourceCostUnitType;
import com.atlan.model.fields.BooleanField;
import com.atlan.model.fields.KeywordField;
import com.atlan.model.fields.RelationField;
import com.atlan.model.relations.RelationshipAttributes;
Expand Down Expand Up @@ -41,6 +42,14 @@ public interface IDomoDatasetColumn {
/** Domo Dataset that contains this Domo Dataset Column. */
RelationField DOMO_DATASET = new RelationField("domoDataset");

/** Expression used to create this calculated column. */
KeywordField DOMO_DATASET_COLUMN_EXPRESSION =
new KeywordField("domoDatasetColumnExpression", "domoDatasetColumnExpression");

/** If the column is a calculated column. */
BooleanField DOMO_DATASET_COLUMN_IS_CALCULATED =
new BooleanField("domoDatasetColumnIsCalculated", "domoDatasetColumnIsCalculated");

/** Type of Domo Dataset Column. */
KeywordField DOMO_DATASET_COLUMN_TYPE = new KeywordField("domoDatasetColumnType", "domoDatasetColumnType");

Expand Down Expand Up @@ -449,6 +458,12 @@ public interface IDomoDatasetColumn {
/** Domo Dataset that contains this Domo Dataset Column. */
IDomoDataset getDomoDataset();

/** Expression used to create this calculated column. */
String getDomoDatasetColumnExpression();

/** If the column is a calculated column. */
Boolean getDomoDatasetColumnIsCalculated();

/** Type of Domo Dataset Column. */
String getDomoDatasetColumnType();

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/* SPDX-License-Identifier: Apache-2.0
Copyright 2022 Atlan Pte. Ltd. */
package com.atlan.model.structs;

import com.fasterxml.jackson.annotation.JsonIgnore;
import javax.annotation.processing.Generated;
import lombok.*;
import lombok.experimental.SuperBuilder;
import lombok.extern.jackson.Jacksonized;

/**
* Detailed information about the External DQ Test metric.
*/
@Generated(value = "com.atlan.generators.ModelGeneratorV2")
@Getter
@Jacksonized
@SuperBuilder(toBuilder = true)
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@SuppressWarnings("serial")
public class AssetExternalDQTestMetric extends AtlanStruct {
private static final long serialVersionUID = 2L;

public static final String TYPE_NAME = "AssetExternalDQTestMetric";

/** Fixed typeName for AssetExternalDQTestMetric. */
@JsonIgnore
@Getter(onMethod_ = {@Override})
@Builder.Default
String typeName = TYPE_NAME;

/** Metric value generated in the particular run for the asset on the external DQ tool. */
String assetExternalDQTestMetricObservedValue;

/** Represents the upper threshold of acceptable metric values in the particular run for the asset on the external DQ tool based on historical trends. */
String assetExternalDQTestMetricUpperBound;

/** Represents the lower threshold of acceptable metric values in the particular run for the asset on the external DQ tool based on historical trends. */
String assetExternalDQTestMetricLowerBound;

/**
* Quickly create a new AssetExternalDQTestMetric.
* @param assetExternalDQTestMetricObservedValue Metric value generated in the particular run for the asset on the external DQ tool.
* @param assetExternalDQTestMetricUpperBound Represents the upper threshold of acceptable metric values in the particular run for the asset on the external DQ tool based on historical trends.
* @param assetExternalDQTestMetricLowerBound Represents the lower threshold of acceptable metric values in the particular run for the asset on the external DQ tool based on historical trends.
* @return a AssetExternalDQTestMetric with the provided information
*/
public static AssetExternalDQTestMetric of(
String assetExternalDQTestMetricObservedValue,
String assetExternalDQTestMetricUpperBound,
String assetExternalDQTestMetricLowerBound) {
return AssetExternalDQTestMetric.builder()
.assetExternalDQTestMetricObservedValue(assetExternalDQTestMetricObservedValue)
.assetExternalDQTestMetricUpperBound(assetExternalDQTestMetricUpperBound)
.assetExternalDQTestMetricLowerBound(assetExternalDQTestMetricLowerBound)
.build();
}

public abstract static class AssetExternalDQTestMetricBuilder<
C extends AssetExternalDQTestMetric, B extends AssetExternalDQTestMetricBuilder<C, B>>
extends AtlanStruct.AtlanStructBuilder<C, B> {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,27 @@ public class AssetExternalDQTestRunHistory extends AtlanStruct {
/** Overall status of the last DQ Test run for the asset on the external DQ tool. */
String assetExternalDQTestRunStatus;

/** Metric details of each DQ Test run for the asset on the external DQ tool. */
AssetExternalDQTestMetric assetExternalDQTestMetricInfo;

/**
* Quickly create a new AssetExternalDQTestRunHistory.
* @param assetExternalDQTestRunStartedAt Start timestamp of the last DQ Test run for the asset on the external DQ tool.
* @param assetExternalDQTestRunEndedAt End timestamp of the last DQ Test run for the asset on the external DQ tool.
* @param assetExternalDQTestRunStatus Overall status of the last DQ Test run for the asset on the external DQ tool.
* @param assetExternalDQTestMetricInfo Metric details of each DQ Test run for the asset on the external DQ tool.
* @return a AssetExternalDQTestRunHistory with the provided information
*/
public static AssetExternalDQTestRunHistory of(
Long assetExternalDQTestRunStartedAt,
Long assetExternalDQTestRunEndedAt,
String assetExternalDQTestRunStatus) {
String assetExternalDQTestRunStatus,
AssetExternalDQTestMetric assetExternalDQTestMetricInfo) {
return AssetExternalDQTestRunHistory.builder()
.assetExternalDQTestRunStartedAt(assetExternalDQTestRunStartedAt)
.assetExternalDQTestRunEndedAt(assetExternalDQTestRunEndedAt)
.assetExternalDQTestRunStatus(assetExternalDQTestRunStatus)
.assetExternalDQTestMetricInfo(assetExternalDQTestMetricInfo)
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
value = AssetExternalDQScoreBreakdownByDimension.class,
name = AssetExternalDQScoreBreakdownByDimension.TYPE_NAME),
@JsonSubTypes.Type(value = AssetExternalDQTestDetails.class, name = AssetExternalDQTestDetails.TYPE_NAME),
@JsonSubTypes.Type(value = AssetExternalDQTestMetric.class, name = AssetExternalDQTestMetric.TYPE_NAME),
@JsonSubTypes.Type(value = AssetExternalDQTestRunHistory.class, name = AssetExternalDQTestRunHistory.TYPE_NAME),
@JsonSubTypes.Type(value = AssetHistogram.class, name = AssetHistogram.TYPE_NAME),
@JsonSubTypes.Type(value = AuthPolicyCondition.class, name = AuthPolicyCondition.TYPE_NAME),
Expand Down
2 changes: 2 additions & 0 deletions sdk/src/main/resources/templates/Connection.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* @return the connector type, or null if the qualifiedName is not for a connected asset
*/
public static AtlanConnectorType getConnectorTypeFromQualifiedName(String qualifiedName) {
if (qualifiedName == null) return null;
return getConnectorTypeFromQualifiedName(qualifiedName.split("/"));
}

Expand All @@ -29,6 +30,7 @@
* @return the connector type, or null if the qualifiedName is not for a connected asset
*/
public static String getConnectorFromQualifiedName(String qualifiedName) {
if (qualifiedName == null) return null;
String[] tokens = qualifiedName.split("/");
AtlanConnectorType ct = getConnectorTypeFromQualifiedName(tokens);
if (ct == null || ct == AtlanConnectorType.UNKNOWN_CUSTOM) {
Expand Down
Loading
Loading