This repository has been archived by the owner on Jun 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
instance termination plugin api #10
Open
adyach
wants to merge
3
commits into
master
Choose a base branch
from
termination-notification
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
group 'org.zalando' | ||
version '3.2.1' | ||
version '3.3.0' | ||
|
||
apply plugin: 'java' | ||
apply plugin: 'maven' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#Mon Dec 23 14:08:03 CET 2019 | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-all.zip | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME |
10 changes: 10 additions & 0 deletions
10
src/main/java/org/zalando/nakadi/plugin/api/termination/TerminationListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.zalando.nakadi.plugin.api.termination; | ||
|
||
@FunctionalInterface | ||
public interface TerminationListener extends Runnable { | ||
|
||
/** | ||
* Listener code to be executed upon arrival of termination event. | ||
*/ | ||
void run(); | ||
} |
25 changes: 25 additions & 0 deletions
25
src/main/java/org/zalando/nakadi/plugin/api/termination/TerminationService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package org.zalando.nakadi.plugin.api.termination; | ||
|
||
import org.zalando.nakadi.plugin.api.exceptions.PluginException; | ||
|
||
/** | ||
* Termination service provides functionality to notify user about coming Nakadi instance termination. | ||
*/ | ||
public interface TerminationService { | ||
|
||
/** | ||
* Registers lister to be executed once termination event happens. | ||
* | ||
* @param terminationRunnable action to execute once termination event happens | ||
* @throws PluginException | ||
*/ | ||
void register(final TerminationListener terminationRunnable) throws PluginException; | ||
|
||
/** | ||
* Current status of the termination. | ||
* | ||
* @throws PluginException | ||
*/ | ||
boolean isTerminating() throws PluginException; | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/org/zalando/nakadi/plugin/api/termination/TerminationServiceFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package org.zalando.nakadi.plugin.api.termination; | ||
|
||
import org.zalando.nakadi.plugin.api.SystemProperties; | ||
import org.zalando.nakadi.plugin.api.exceptions.PluginException; | ||
|
||
public interface TerminationServiceFactory { | ||
|
||
/** | ||
* @param properties system properties to initialize plugin | ||
* @return constructed ApplicationService instance | ||
* @throws PluginException if an error occurred on plugin initialization | ||
*/ | ||
TerminationService init(SystemProperties properties) throws PluginException; | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/lister/listener/