Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
ffa96f75
Commit
ffa96f75
authored
Mar 05, 2019
by
Madhan Neethiraj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3065: added type-patch to remove legacy attributes - #2
parent
18ac31db
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
2 deletions
+16
-2
Constants.java
.../src/main/java/org/apache/atlas/repository/Constants.java
+1
-0
AtlasRelationshipDefStoreV2.java
...epository/store/graph/v2/AtlasRelationshipDefStoreV2.java
+9
-2
AtlasStructDefStoreV2.java
...tlas/repository/store/graph/v2/AtlasStructDefStoreV2.java
+6
-0
No files found.
common/src/main/java/org/apache/atlas/repository/Constants.java
View file @
ffa96f75
...
...
@@ -70,6 +70,7 @@ public final class Constants {
public
static
final
String
RELATIONSHIPTYPE_END1_KEY
=
"endDef1"
;
public
static
final
String
RELATIONSHIPTYPE_END2_KEY
=
"endDef2"
;
public
static
final
String
RELATIONSHIPTYPE_CATEGORY_KEY
=
"relationshipCategory"
;
public
static
final
String
RELATIONSHIPTYPE_LABEL_KEY
=
"relationshipLabel"
;
public
static
final
String
RELATIONSHIPTYPE_TAG_PROPAGATION_KEY
=
encodePropertyKey
(
"tagPropagation"
);
public
static
final
String
RELATIONSHIPTYPE_BLOCKED_PROPAGATED_CLASSIFICATIONS_KEY
=
encodePropertyKey
(
"blockedPropagatedClassifications"
);
...
...
repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipDefStoreV2.java
View file @
ffa96f75
...
...
@@ -450,14 +450,18 @@ public class AtlasRelationshipDefStoreV2 extends AtlasAbstractDefStoreV2<AtlasRe
public
static
void
setVertexPropertiesFromRelationshipDef
(
AtlasRelationshipDef
relationshipDef
,
AtlasVertex
vertex
)
{
vertex
.
setProperty
(
Constants
.
RELATIONSHIPTYPE_END1_KEY
,
AtlasType
.
toJson
(
relationshipDef
.
getEndDef1
()));
vertex
.
setProperty
(
Constants
.
RELATIONSHIPTYPE_END2_KEY
,
AtlasType
.
toJson
(
relationshipDef
.
getEndDef2
()));
// default the relationship category to association if it has not been specified.
String
relationshipCategory
=
RelationshipCategory
.
ASSOCIATION
.
name
();
if
(
relationshipDef
.
getRelationshipCategory
()!=
null
)
{
relationshipCategory
=
relationshipDef
.
getRelationshipCategory
().
name
();
}
// Update RelationshipCategory
vertex
.
setProperty
(
Constants
.
RELATIONSHIPTYPE_CATEGORY_KEY
,
relationshipCategory
);
vertex
.
setProperty
(
Constants
.
RELATIONSHIPTYPE_LABEL_KEY
,
relationshipDef
.
getRelationshipLabel
());
if
(
relationshipDef
.
getPropagateTags
()
==
null
)
{
vertex
.
setProperty
(
Constants
.
RELATIONSHIPTYPE_TAG_PROPAGATION_KEY
,
AtlasRelationshipDef
.
PropagateTags
.
NONE
.
name
());
}
else
{
...
...
@@ -472,8 +476,9 @@ public class AtlasRelationshipDefStoreV2 extends AtlasAbstractDefStoreV2<AtlasRe
String
name
=
vertex
.
getProperty
(
Constants
.
TYPENAME_PROPERTY_KEY
,
String
.
class
);
String
description
=
vertex
.
getProperty
(
Constants
.
TYPEDESCRIPTION_PROPERTY_KEY
,
String
.
class
);
String
version
=
vertex
.
getProperty
(
Constants
.
TYPEVERSION_PROPERTY_KEY
,
String
.
class
);
String
end1Str
=
vertex
.
getProperty
(
Constants
.
RELATIONSHIPTYPE_END1_KEY
,
String
.
class
);
String
end2Str
=
vertex
.
getProperty
(
Constants
.
RELATIONSHIPTYPE_END2_KEY
,
String
.
class
);
String
label
=
vertex
.
getProperty
(
Constants
.
RELATIONSHIPTYPE_LABEL_KEY
,
String
.
class
);
String
end1Str
=
vertex
.
getProperty
(
Constants
.
RELATIONSHIPTYPE_END1_KEY
,
String
.
class
);
String
end2Str
=
vertex
.
getProperty
(
Constants
.
RELATIONSHIPTYPE_END2_KEY
,
String
.
class
);
String
relationStr
=
vertex
.
getProperty
(
Constants
.
RELATIONSHIPTYPE_CATEGORY_KEY
,
String
.
class
);
String
propagateStr
=
vertex
.
getProperty
(
Constants
.
RELATIONSHIPTYPE_TAG_PROPAGATION_KEY
,
String
.
class
);
...
...
@@ -499,6 +504,8 @@ public class AtlasRelationshipDefStoreV2 extends AtlasAbstractDefStoreV2<AtlasRe
ret
=
new
AtlasRelationshipDef
(
name
,
description
,
version
,
relationshipCategory
,
propagateTags
,
endDef1
,
endDef2
);
ret
.
setRelationshipLabel
(
label
);
// add in the attributes
AtlasStructDefStoreV2
.
toStructDef
(
vertex
,
ret
,
typeDefStore
);
}
...
...
repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasStructDefStoreV2.java
View file @
ffa96f75
...
...
@@ -477,6 +477,12 @@ public class AtlasStructDefStoreV2 extends AtlasAbstractDefStoreV2<AtlasStructDe
String
encodedAttrPropertyKey
=
AtlasGraphUtilsV2
.
encodePropertyKey
(
attrPropertyKey
);
String
attrJson
=
vertex
.
getProperty
(
encodedAttrPropertyKey
,
String
.
class
);
if
(
StringUtils
.
isEmpty
(
attrJson
))
{
LOG
.
warn
(
"attribute not found {}.{}. Ignoring.."
,
structDef
.
getName
(),
attrName
);
continue
;
}
attributeDefs
.
add
(
toAttributeDefFromJson
(
structDef
,
AtlasType
.
fromJson
(
attrJson
,
Map
.
class
),
typeDefStore
));
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment