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
fe1c299c
Commit
fe1c299c
authored
6 years ago
by
Madhan Neethiraj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3053: updated notification processing to propagate classifications only when specified
parent
ee99930f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
1 deletion
+18
-1
EntityGraphMapper.java
...he/atlas/repository/store/graph/v2/EntityGraphMapper.java
+7
-1
RequestContext.java
...er-api/src/main/java/org/apache/atlas/RequestContext.java
+10
-0
NotificationHookConsumer.java
...g/apache/atlas/notification/NotificationHookConsumer.java
+1
-0
No files found.
repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java
View file @
fe1c299c
...
...
@@ -1379,6 +1379,8 @@ public class EntityGraphMapper {
public
void
addClassifications
(
final
EntityMutationContext
context
,
String
guid
,
List
<
AtlasClassification
>
classifications
)
throws
AtlasBaseException
{
if
(
CollectionUtils
.
isNotEmpty
(
classifications
))
{
MetricRecorder
metric
=
RequestContext
.
get
().
startMetricRecord
(
"addClassifications"
);
final
AtlasVertex
entityVertex
=
context
.
getVertex
(
guid
);
final
AtlasEntityType
entityType
=
context
.
getType
(
guid
);
List
<
AtlasVertex
>
entitiesToPropagateTo
=
null
;
...
...
@@ -1398,7 +1400,9 @@ public class EntityGraphMapper {
}
if
(
propagateTags
==
null
)
{
if
(
RequestContext
.
get
().
isImportInProgress
())
{
RequestContext
reqContext
=
RequestContext
.
get
();
if
(
reqContext
.
isImportInProgress
()
||
reqContext
.
isInNotificationProcessing
())
{
propagateTags
=
false
;
classification
.
setPropagate
(
propagateTags
);
}
else
{
...
...
@@ -1497,6 +1501,8 @@ public class EntityGraphMapper {
entityChangeNotifier
.
onClassificationAddedToEntity
(
entity
,
addedClassifications
);
}
}
RequestContext
.
get
().
endMetricRecord
(
metric
);
}
}
...
...
This diff is collapsed.
Click to expand it.
server-api/src/main/java/org/apache/atlas/RequestContext.java
View file @
fe1c299c
...
...
@@ -55,6 +55,7 @@ public class RequestContext {
private
int
maxAttempts
=
1
;
private
int
attemptCount
=
1
;
private
boolean
isImportInProgress
=
false
;
private
boolean
isInNotificationProcessing
=
false
;
private
RequestContext
()
{
...
...
@@ -164,6 +165,15 @@ public class RequestContext {
isImportInProgress
=
importInProgress
;
}
public
boolean
isInNotificationProcessing
()
{
return
isInNotificationProcessing
;
}
public
void
setInNotificationProcessing
(
boolean
inNotificationProcessing
)
{
isInNotificationProcessing
=
inNotificationProcessing
;
}
public
void
recordEntityUpdate
(
AtlasEntityHeader
entity
)
{
if
(
entity
!=
null
&&
entity
.
getGuid
()
!=
null
)
{
updatedEntities
.
put
(
entity
.
getGuid
(),
entity
);
...
...
This diff is collapsed.
Click to expand it.
webapp/src/main/java/org/apache/atlas/notification/NotificationHookConsumer.java
View file @
fe1c299c
...
...
@@ -487,6 +487,7 @@ public class NotificationHookConsumer implements Service, ActiveStateChangeHandl
requestContext
.
setMaxAttempts
(
maxRetries
);
requestContext
.
setUser
(
messageUser
,
null
);
requestContext
.
setInNotificationProcessing
(
true
);
switch
(
message
.
getType
())
{
case
ENTITY_CREATE:
{
...
...
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