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
de7fe47a
Commit
de7fe47a
authored
6 years ago
by
Ashutosh Mestry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3029, ATLAS-3020: Audit APIs for classification updates. Part-2.
parent
fa7d1675
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
78 additions
and
1 deletion
+78
-1
ClassificationAssociator.java
...s/repository/store/graph/v2/ClassificationAssociator.java
+3
-1
ClassificationAssociatorTest.java
...pository/store/graph/v2/ClassificationAssociatorTest.java
+5
-0
col-entity-T1-prop-Tn-No-Guid.json
...sification-association/col-entity-T1-prop-Tn-No-Guid.json
+31
-0
header-Tx-prop-T1-No-Guid.json
...classification-association/header-Tx-prop-T1-No-Guid.json
+39
-0
No files found.
repository/src/main/java/org/apache/atlas/repository/store/graph/v2/ClassificationAssociator.java
View file @
de7fe47a
...
@@ -310,7 +310,9 @@ public class ClassificationAssociator {
...
@@ -310,7 +310,9 @@ public class ClassificationAssociator {
return
list
;
return
list
;
}
}
return
list
.
stream
().
filter
(
x
->
x
.
getEntityGuid
().
equals
(
guid
)).
collect
(
Collectors
.
toList
());
return
list
.
stream
().
filter
(
x
->
x
!=
null
&&
(
StringUtils
.
isEmpty
(
guid
)
||
StringUtils
.
isEmpty
(
x
.
getEntityGuid
()))
||
x
.
getEntityGuid
().
equals
(
guid
)).
collect
(
Collectors
.
toList
());
}
}
}
}
}
}
This diff is collapsed.
Click to expand it.
repository/src/test/java/org/apache/atlas/repository/store/graph/v2/ClassificationAssociatorTest.java
View file @
de7fe47a
...
@@ -163,6 +163,7 @@ public class ClassificationAssociatorTest {
...
@@ -163,6 +163,7 @@ public class ClassificationAssociatorTest {
@Test
@Test
public
void
updaterTests
()
throws
IOException
{
public
void
updaterTests
()
throws
IOException
{
updaterAssert
(
"header-None"
,
"col-entity-None"
);
updaterAssert
(
"header-PII"
,
"col-entity-None"
,
PROCESS_ADD
+
":PII"
);
updaterAssert
(
"header-PII"
,
"col-entity-None"
,
PROCESS_ADD
+
":PII"
);
updaterAssert
(
"header-PII"
,
"col-entity-PII"
,
new
String
[]{
PROCESS_UPDATE
+
":PII"
});
updaterAssert
(
"header-PII"
,
"col-entity-PII"
,
new
String
[]{
PROCESS_UPDATE
+
":PII"
});
updaterAssert
(
"header-None"
,
"col-entity-PII"
,
new
String
[]{
PROCESS_DELETE
+
":PII"
});
updaterAssert
(
"header-None"
,
"col-entity-PII"
,
new
String
[]{
PROCESS_DELETE
+
":PII"
});
...
@@ -181,6 +182,10 @@ public class ClassificationAssociatorTest {
...
@@ -181,6 +182,10 @@ public class ClassificationAssociatorTest {
updaterAssert
(
"header-Tx-prop-T1"
,
"col-entity-T1-prop-Tn"
,
updaterAssert
(
"header-Tx-prop-T1"
,
"col-entity-T1-prop-Tn"
,
PROCESS_DELETE
+
":T1"
,
PROCESS_DELETE
+
":T1"
,
PROCESS_ADD
+
":Tx"
);
PROCESS_ADD
+
":Tx"
);
updaterAssert
(
"header-Tx-prop-T1-No-Guid"
,
"col-entity-T1-prop-Tn-No-Guid"
,
PROCESS_DELETE
+
":Tn"
,
PROCESS_UPDATE
+
":T1"
,
PROCESS_ADD
+
":Tx"
);
}
}
...
...
This diff is collapsed.
Click to expand it.
repository/src/test/resources/json/classification-association/col-entity-T1-prop-Tn-No-Guid.json
0 → 100644
View file @
de7fe47a
{
"typeName"
:
"hive_column"
,
"attributes"
:
{
"owner"
:
"hive"
,
"createTime"
:
1547071410000
,
"qualifiedName"
:
"stocks.daily@cl1"
,
"name"
:
"daily"
},
"status"
:
"ACTIVE"
,
"displayText"
:
"daily"
,
"classifications"
:
[
{
"typeName"
:
"T1"
,
"attributes"
:
{},
"entityStatus"
:
"ACTIVE"
,
"propagate"
:
false
,
"validityPeriods"
:
[],
"removePropagationsOnEntityDelete"
:
false
},
{
"typeName"
:
"Tn"
,
"attributes"
:
{},
"entityStatus"
:
"ACTIVE"
,
"propagate"
:
false
,
"validityPeriods"
:
[],
"removePropagationsOnEntityDelete"
:
false
}
],
"meaningNames"
:
[],
"meanings"
:
[]
}
This diff is collapsed.
Click to expand it.
repository/src/test/resources/json/classification-association/header-Tx-prop-T1-No-Guid.json
0 → 100644
View file @
de7fe47a
{
"guidHeaderMap"
:
{
"0ce68113-77fe-4ed1-9585-69371202bd74"
:
{
"typeName"
:
"hive_column"
,
"attributes"
:
{
"owner"
:
"hive"
,
"qualifiedName"
:
"hortoniabank.us_customers.nationalid@cl1"
,
"name"
:
"nationalid"
},
"status"
:
"ACTIVE"
,
"displayText"
:
"nationalid"
,
"classificationNames"
:
[
"T1"
,
"Tx"
],
"classifications"
:
[
{
"typeName"
:
"Tx"
,
"attributes"
:
{
"type"
:
"ssn"
},
"entityStatus"
:
"ACTIVE"
,
"propagate"
:
true
,
"removePropagationsOnEntityDelete"
:
false
},
{
"typeName"
:
"T1"
,
"attributes"
:
{
"type"
:
"ssn"
},
"entityStatus"
:
"ACTIVE"
,
"propagate"
:
true
,
"removePropagationsOnEntityDelete"
:
false
}
],
"meaningNames"
:
[],
"meanings"
:
[]
}
}
}
This diff is collapsed.
Click to expand it.
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