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
dc71d3d4
Commit
dc71d3d4
authored
6 years ago
by
rmani
Committed by
Madhan Neethiraj
6 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-2542: import-Hbase doesn't update entity already present in Atlas
Signed-off-by:
Madhan Neethiraj
<
madhan@apache.org
>
parent
37d7b8b8
master
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
HBaseBridge.java
.../main/java/org/apache/atlas/hbase/bridge/HBaseBridge.java
+28
-0
No files found.
addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/bridge/HBaseBridge.java
View file @
dc71d3d4
...
...
@@ -52,6 +52,7 @@ import java.io.File;
import
java.io.FileReader
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collection
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -449,6 +450,7 @@ public class HBaseBridge {
try
{
ret
=
findEntityInAtlas
(
HBaseDataTypes
.
HBASE_NAMESPACE
.
getName
(),
nsQualifiedName
);
clearRelationshipAttributes
(
ret
);
}
catch
(
Exception
e
)
{
ret
=
null
;
// entity doesn't exist in Atlas
}
...
...
@@ -461,6 +463,7 @@ public class HBaseBridge {
try
{
ret
=
findEntityInAtlas
(
HBaseDataTypes
.
HBASE_TABLE
.
getName
(),
tableQualifiedName
);
clearRelationshipAttributes
(
ret
);
}
catch
(
Exception
e
)
{
ret
=
null
;
// entity doesn't exist in Atlas
}
...
...
@@ -473,6 +476,7 @@ public class HBaseBridge {
try
{
ret
=
findEntityInAtlas
(
HBaseDataTypes
.
HBASE_COLUMN_FAMILY
.
getName
(),
columnFamilyQualifiedName
);
clearRelationshipAttributes
(
ret
);
}
catch
(
Exception
e
)
{
ret
=
null
;
// entity doesn't exist in Atlas
}
...
...
@@ -658,4 +662,28 @@ public class HBaseBridge {
System
.
out
.
println
(
" namespace1:tbl2"
);
System
.
out
.
println
(
" namespace2:tbl1"
);
}
private
void
clearRelationshipAttributes
(
AtlasEntityWithExtInfo
entity
)
{
if
(
entity
!=
null
)
{
clearRelationshipAttributes
(
entity
.
getEntity
());
if
(
entity
.
getReferredEntities
()
!=
null
)
{
clearRelationshipAttributes
(
entity
.
getReferredEntities
().
values
());
}
}
}
private
void
clearRelationshipAttributes
(
Collection
<
AtlasEntity
>
entities
)
{
if
(
entities
!=
null
)
{
for
(
AtlasEntity
entity
:
entities
)
{
clearRelationshipAttributes
(
entity
);
}
}
}
private
void
clearRelationshipAttributes
(
AtlasEntity
entity
)
{
if
(
entity
!=
null
&&
entity
.
getRelationshipAttributes
()
!=
null
)
{
entity
.
getRelationshipAttributes
().
clear
();
}
}
}
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