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
bd0c5a8a
Commit
bd0c5a8a
authored
6 years ago
by
Ashutosh Mestry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-2996: Conditionally Prevent Notification Processing. With support for HA mode.
parent
5307e498
No related merge requests found
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
NotificationHookConsumer.java
...g/apache/atlas/notification/NotificationHookConsumer.java
+13
-2
No files found.
webapp/src/main/java/org/apache/atlas/notification/NotificationHookConsumer.java
View file @
bd0c5a8a
...
@@ -161,8 +161,7 @@ public class NotificationHookConsumer implements Service, ActiveStateChangeHandl
...
@@ -161,8 +161,7 @@ public class NotificationHookConsumer implements Service, ActiveStateChangeHandl
@Override
@Override
public
void
start
()
throws
AtlasException
{
public
void
start
()
throws
AtlasException
{
if
(
consumerDisabled
)
{
if
(
consumerDisabled
)
{
LOG
.
info
(
"Hook consumer stopped. No hook messages will be processed. "
+
LOG
.
info
(
"No hook messages will be processed. {} = {}"
,
CONSUMER_DISABLED
,
consumerDisabled
);
"Set property '{}' to false to start consuming hook messages."
,
CONSUMER_DISABLED
);
return
;
return
;
}
}
...
@@ -205,6 +204,10 @@ public class NotificationHookConsumer implements Service, ActiveStateChangeHandl
...
@@ -205,6 +204,10 @@ public class NotificationHookConsumer implements Service, ActiveStateChangeHandl
public
void
stop
()
{
public
void
stop
()
{
//Allow for completion of outstanding work
//Allow for completion of outstanding work
try
{
try
{
if
(
consumerDisabled
)
{
return
;
}
stopConsumerThreads
();
stopConsumerThreads
();
if
(
executors
!=
null
)
{
if
(
executors
!=
null
)
{
executors
.
shutdown
();
executors
.
shutdown
();
...
@@ -244,6 +247,10 @@ public class NotificationHookConsumer implements Service, ActiveStateChangeHandl
...
@@ -244,6 +247,10 @@ public class NotificationHookConsumer implements Service, ActiveStateChangeHandl
*/
*/
@Override
@Override
public
void
instanceIsActive
()
{
public
void
instanceIsActive
()
{
if
(
consumerDisabled
)
{
return
;
}
LOG
.
info
(
"Reacting to active state: initializing Kafka consumers"
);
LOG
.
info
(
"Reacting to active state: initializing Kafka consumers"
);
startConsumers
(
executors
);
startConsumers
(
executors
);
...
@@ -257,6 +264,10 @@ public class NotificationHookConsumer implements Service, ActiveStateChangeHandl
...
@@ -257,6 +264,10 @@ public class NotificationHookConsumer implements Service, ActiveStateChangeHandl
*/
*/
@Override
@Override
public
void
instanceIsPassive
()
{
public
void
instanceIsPassive
()
{
if
(
consumerDisabled
)
{
return
;
}
LOG
.
info
(
"Reacting to passive state: shutting down Kafka consumers."
);
LOG
.
info
(
"Reacting to passive state: shutting down Kafka consumers."
);
stop
();
stop
();
...
...
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