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
a6cdb608
Commit
a6cdb608
authored
Feb 03, 2020
by
Sarath Subramanian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3602: Provide option to Ignore relationship attribute mapping in getAndCacheEntity()
parent
121ccbd8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
8 deletions
+21
-8
AtlasConfiguration.java
intg/src/main/java/org/apache/atlas/AtlasConfiguration.java
+1
-0
AtlasInstanceConverter.java
...e/atlas/repository/converters/AtlasInstanceConverter.java
+14
-4
EntityGraphMapper.java
...he/atlas/repository/store/graph/v2/EntityGraphMapper.java
+6
-4
No files found.
intg/src/main/java/org/apache/atlas/AtlasConfiguration.java
View file @
a6cdb608
...
...
@@ -54,6 +54,7 @@ public enum AtlasConfiguration {
GRAPHSTORE_INDEXED_STRING_SAFE_LENGTH
(
"atlas.graphstore.indexed.string.safe.length"
,
Short
.
MAX_VALUE
),
// based on org.apache.hadoop.hbase.client.Mutation.checkRow()
RELATIONSHIP_WARN_NO_RELATIONSHIPS
(
"atlas.relationships.warnOnNoRelationships"
,
false
),
ENTITY_CHANGE_NOTIFY_IGNORE_RELATIONSHIP_ATTRIBUTES
(
"atlas.entity.change.notify.ignore.relationship.attributes"
,
true
),
//search configuration
SEARCH_MAX_LIMIT
(
"atlas.search.maxlimit"
,
10000
),
...
...
repository/src/main/java/org/apache/atlas/repository/converters/AtlasInstanceConverter.java
View file @
a6cdb608
...
...
@@ -65,12 +65,14 @@ public class AtlasInstanceConverter {
private
final
AtlasTypeRegistry
typeRegistry
;
private
final
AtlasFormatConverters
instanceFormatters
;
private
final
EntityGraphRetriever
entityGraphRetriever
;
private
final
EntityGraphRetriever
entityGraphRetrieverIgnoreRelationshipAttrs
;
@Inject
public
AtlasInstanceConverter
(
AtlasTypeRegistry
typeRegistry
,
AtlasFormatConverters
instanceFormatters
)
{
this
.
typeRegistry
=
typeRegistry
;
this
.
instanceFormatters
=
instanceFormatters
;
this
.
entityGraphRetriever
=
new
EntityGraphRetriever
(
typeRegistry
);
this
.
typeRegistry
=
typeRegistry
;
this
.
instanceFormatters
=
instanceFormatters
;
this
.
entityGraphRetriever
=
new
EntityGraphRetriever
(
typeRegistry
);
this
.
entityGraphRetrieverIgnoreRelationshipAttrs
=
new
EntityGraphRetriever
(
typeRegistry
,
true
);
}
public
Referenceable
[]
getReferenceables
(
Collection
<
AtlasEntity
>
entities
)
throws
AtlasBaseException
{
...
...
@@ -293,11 +295,19 @@ public class AtlasInstanceConverter {
}
public
AtlasEntity
getAndCacheEntity
(
String
guid
)
throws
AtlasBaseException
{
return
getAndCacheEntity
(
guid
,
false
);
}
public
AtlasEntity
getAndCacheEntity
(
String
guid
,
boolean
ignoreRelationshipAttributes
)
throws
AtlasBaseException
{
RequestContext
context
=
RequestContext
.
get
();
AtlasEntity
entity
=
context
.
getEntity
(
guid
);
if
(
entity
==
null
)
{
entity
=
entityGraphRetriever
.
toAtlasEntity
(
guid
);
if
(
ignoreRelationshipAttributes
)
{
entity
=
entityGraphRetrieverIgnoreRelationshipAttrs
.
toAtlasEntity
(
guid
);
}
else
{
entity
=
entityGraphRetriever
.
toAtlasEntity
(
guid
);
}
if
(
entity
!=
null
)
{
context
.
cache
(
entity
);
...
...
repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java
View file @
a6cdb608
...
...
@@ -124,6 +124,8 @@ public class EntityGraphMapper {
private
static
final
int
CUSTOM_ATTRIBUTE_KEY_MAX_LENGTH
=
AtlasConfiguration
.
CUSTOM_ATTRIBUTE_KEY_MAX_LENGTH
.
getInt
();
private
static
final
int
CUSTOM_ATTRIBUTE_VALUE_MAX_LENGTH
=
AtlasConfiguration
.
CUSTOM_ATTRIBUTE_VALUE_MAX_LENGTH
.
getInt
();
private
static
final
boolean
ENTITY_CHANGE_NOTIFY_IGNORE_RELATIONSHIP_ATTRIBUTES
=
AtlasConfiguration
.
ENTITY_CHANGE_NOTIFY_IGNORE_RELATIONSHIP_ATTRIBUTES
.
getBoolean
();
private
final
GraphHelper
graphHelper
=
GraphHelper
.
getInstance
();
private
final
AtlasGraph
graph
;
private
final
DeleteHandlerDelegate
deleteDelegate
;
...
...
@@ -1916,7 +1918,7 @@ public class EntityGraphMapper {
private
AtlasEntity
updateClassificationText
(
AtlasVertex
vertex
)
throws
AtlasBaseException
{
String
guid
=
GraphHelper
.
getGuid
(
vertex
);
AtlasEntity
entity
=
instanceConverter
.
getAndCacheEntity
(
guid
);
AtlasEntity
entity
=
instanceConverter
.
getAndCacheEntity
(
guid
,
ENTITY_CHANGE_NOTIFY_IGNORE_RELATIONSHIP_ATTRIBUTES
);
vertex
.
setProperty
(
CLASSIFICATION_TEXT_KEY
,
fullTextMapperV2
.
getClassificationTextForEntity
(
entity
));
return
entity
;
...
...
@@ -1929,7 +1931,7 @@ public class EntityGraphMapper {
}
String
guid
=
GraphHelper
.
getGuid
(
vertex
);
AtlasEntity
entity
=
instanceConverter
.
getAndCacheEntity
(
guid
);
AtlasEntity
entity
=
instanceConverter
.
getAndCacheEntity
(
guid
,
ENTITY_CHANGE_NOTIFY_IGNORE_RELATIONSHIP_ATTRIBUTES
);
List
<
String
>
classificationNames
=
new
ArrayList
<>();
List
<
String
>
propagatedClassificationNames
=
new
ArrayList
<>();
...
...
@@ -2139,7 +2141,7 @@ public class EntityGraphMapper {
for
(
AtlasVertex
vertex
:
notificationVertices
)
{
String
entityGuid
=
GraphHelper
.
getGuid
(
vertex
);
AtlasEntity
entity
=
instanceConverter
.
getAndCacheEntity
(
entityGuid
);
AtlasEntity
entity
=
instanceConverter
.
getAndCacheEntity
(
entityGuid
,
ENTITY_CHANGE_NOTIFY_IGNORE_RELATIONSHIP_ATTRIBUTES
);
if
(
isActive
(
entity
))
{
vertex
.
setProperty
(
CLASSIFICATION_TEXT_KEY
,
fullTextMapperV2
.
getClassificationTextForEntity
(
entity
));
...
...
@@ -2382,7 +2384,7 @@ public class EntityGraphMapper {
if
(
CollectionUtils
.
isNotEmpty
(
propagatedVertices
))
{
for
(
AtlasVertex
vertex
:
propagatedVertices
)
{
AtlasEntity
entity
=
instanceConverter
.
getAndCacheEntity
(
GraphHelper
.
getGuid
(
vertex
));
AtlasEntity
entity
=
instanceConverter
.
getAndCacheEntity
(
GraphHelper
.
getGuid
(
vertex
)
,
ENTITY_CHANGE_NOTIFY_IGNORE_RELATIONSHIP_ATTRIBUTES
);
if
(
isActive
(
entity
))
{
vertex
.
setProperty
(
CLASSIFICATION_TEXT_KEY
,
fullTextMapperV2
.
getClassificationTextForEntity
(
entity
));
...
...
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