Skip to content

Commit 06ae728

Browse files
aditya-gupta36Pinal Shah
authored andcommitted
ATLAS-5198: Review and Improve logging of create/update entity flow (#512)
(cherry picked from commit f00d373)
1 parent 1647ec3 commit 06ae728

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

intg/src/main/java/org/apache/atlas/AtlasErrorCode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public enum AtlasErrorCode {
8282
RELATIONSHIPDEF_COMPOSITION_MULTIPLE_PARENTS(400, "ATLAS-400-00-033", "COMPOSITION relationshipDef {0} can only have one parent; so cannot have SET cardinality on children"),
8383
RELATIONSHIPDEF_LIST_ON_END(400, "ATLAS-400-00-034", "relationshipDef {0} cannot have a LIST cardinality on an end"),
8484
RELATIONSHIPDEF_INVALID_END_TYPE(400, "ATLAS-400-00-035", "relationshipDef {0} has invalid end type {1}"),
85-
INVALID_RELATIONSHIP_END_TYPE(400, "ATLAS-400-00-036", "invalid relationshipDef: {0}: end type 1: {1}, end type 2: {2}"),
85+
INVALID_RELATIONSHIP_END_TYPE(400, "ATLAS-400-00-036", "invalid relationshipDef: {0}: actual: [end type 1: {1}, end type 2: {2}]. expected: [end type 1: {3}, end type 2: {4}]"),
8686
RELATIONSHIPDEF_INVALID_END1_UPDATE(400, "ATLAS-400-00-037", "invalid update for relationshipDef {0}: new end1 {1}, existing end1 {2}"),
8787
RELATIONSHIPDEF_INVALID_END2_UPDATE(400, "ATLAS-400-00-038", "invalid update for relationshipDef {0}: new end2 {1}, existing end2 {2}"),
8888
RELATIONSHIPDEF_INVALID_CATEGORY_UPDATE(400, "ATLAS-400-00-039", "invalid update for relationship {0}: new relationshipDef category {1}, existing relationshipDef category {2}"),

repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,7 @@ public List<AtlasClassification> retrieveClassifications(String guid) throws Atl
11091109
}
11101110

11111111
private EntityMutationResponse createOrUpdate(EntityStream entityStream, boolean isPartialUpdate, boolean replaceClassifications, boolean replaceBusinessAttributes) throws AtlasBaseException {
1112-
LOG.debug("==> createOrUpdate()");
1112+
LOG.debug("==> createOrUpdate(isPartialUpdate={}, replaceClassifications={}, replaceBusinessAttributes={})", isPartialUpdate, replaceClassifications, replaceBusinessAttributes);
11131113

11141114
if (entityStream == null || !entityStream.hasNext()) {
11151115
throw new AtlasBaseException(AtlasErrorCode.INVALID_PARAMETERS, "no entities to create/update.");
@@ -1303,7 +1303,6 @@ private EntityMutationContext preCreateOrUpdate(EntityStream entityStream, Entit
13031303
}
13041304

13051305
RequestContext.get().endMetricRecord(metric);
1306-
13071306
return context;
13081307
}
13091308

repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ private void validateRelationship(AtlasRelationship relationship) throws AtlasBa
480480
}
481481

482482
if (!validEndTypes) {
483-
throw new AtlasBaseException(AtlasErrorCode.INVALID_RELATIONSHIP_END_TYPE, relationshipName, relationshipType.getEnd2Type().getTypeName(), end1TypeName);
483+
throw new AtlasBaseException(AtlasErrorCode.INVALID_RELATIONSHIP_END_TYPE, relationshipName, end1TypeName, end2TypeName, relationshipType.getEnd1Type().getTypeName(), relationshipType.getEnd2Type().getTypeName());
484484
}
485485

486486
validateEnds(relationship);
@@ -517,7 +517,7 @@ private void validateRelationship(AtlasVertex end1Vertex, AtlasVertex end2Vertex
517517
}
518518

519519
if (!validEndTypes) {
520-
throw new AtlasBaseException(AtlasErrorCode.INVALID_RELATIONSHIP_END_TYPE, relationshipName, relationshipType.getEnd2Type().getTypeName(), end1TypeName);
520+
throw new AtlasBaseException(AtlasErrorCode.INVALID_RELATIONSHIP_END_TYPE, relationshipName, end1TypeName, end2TypeName, relationshipType.getEnd1Type().getTypeName(), relationshipType.getEnd2Type().getTypeName());
521521
}
522522

523523
PropagateTags typePropagation = relationshipType.getRelationshipDef().getPropagateTags();

0 commit comments

Comments
 (0)