You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by smarthi <gi...@git.apache.org> on 2016/05/29 06:16:56 UTC

[GitHub] flink pull request: FLINK-3405: Extend NiFiSource with interface S...

GitHub user smarthi opened a pull request:

    https://github.com/apache/flink/pull/2047

    FLINK-3405: Extend NiFiSource with interface StoppableFunction

    Thanks for contributing to Apache Flink. Before you open your pull request, please take the following check list into consideration.
    If your changes take all of the items into account, feel free to open your pull request. For more information and/or questions please refer to the [How To Contribute guide](http://flink.apache.org/how-to-contribute.html).
    In addition to going through the list, please provide a meaningful description of your changes.
    
    - [ ] General
      - The pull request references the related JIRA issue ("[FLINK-XXX] Jira title text")
      - The pull request addresses only one issue
      - Each commit in the PR has a meaningful commit message (including the JIRA id)
    
    - [ ] Documentation
      - Documentation has been added for new functionality
      - Old documentation affected by the pull request has been updated
      - JavaDoc for public methods has been added
    
    - [ ] Tests & Build
      - Functionality added by the pull request is covered by tests
      - `mvn clean verify` has been executed successfully locally or a Travis build has passed
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/smarthi/flink Flink-3405

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/2047.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2047
    
----
commit c2daeb8eb81d7b1a0151bb0237ee94d048da6f44
Author: smarthi <sm...@apache.org>
Date:   2016-05-29T06:15:16Z

    FLINK-3405: Extend NiFiSource with interface StoppableFunction

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: FLINK-3405: Extend NiFiSource with interface S...

Posted by StephanEwen <gi...@git.apache.org>.
Github user StephanEwen commented on the pull request:

    https://github.com/apache/flink/pull/2047#issuecomment-222640704
  
    I would do one change here: Make the `isRunning` flag non transient, and set it to true initially, rather than in open.
    
    That can act as a safeguard against very early stopping (before open is even completed), were stop would set the flag to false, and open would set it back to true.
    
    I think the runtime does prevent open to happen after stop, but cannot hurt to guard this in the source as well.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: FLINK-3405: Extend NiFiSource with interface S...

Posted by zentol <gi...@git.apache.org>.
Github user zentol commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2047#discussion_r65093152
  
    --- Diff: flink-streaming-connectors/flink-connector-nifi/src/main/java/org/apache/flink/streaming/connectors/nifi/NiFiSource.java ---
    @@ -143,4 +144,13 @@ public void close() throws Exception {
     		client.close();
     	}
     
    + /**
    +	* {@inheritDoc}
    +	* <p>
    +	* Sets the {@link #isRunning} flag to {@code false}.
    +	*/
    +	@Override
    +	public void stop() {
    +		this.isRunning = false;
    --- End diff --
    
    @StephanEwen could you point me to the code where close() is called for a stopped source?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink issue #2047: FLINK-3405: Extend NiFiSource with interface StoppableFun...

Posted by StephanEwen <gi...@git.apache.org>.
Github user StephanEwen commented on the issue:

    https://github.com/apache/flink/pull/2047
  
    All right, merging this, thanks!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: FLINK-3405: Extend NiFiSource with interface S...

Posted by zentol <gi...@git.apache.org>.
Github user zentol commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2047#discussion_r65068621
  
    --- Diff: flink-streaming-connectors/flink-connector-nifi/src/main/java/org/apache/flink/streaming/connectors/nifi/NiFiSource.java ---
    @@ -143,4 +144,13 @@ public void close() throws Exception {
     		client.close();
     	}
     
    + /**
    +	* {@inheritDoc}
    +	* <p>
    +	* Sets the {@link #isRunning} flag to {@code false}.
    +	*/
    +	@Override
    +	public void stop() {
    +		this.isRunning = false;
    --- End diff --
    
    I'd like other to chime in here: do you have to call close() within stop()? The Twitter source is doing this.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: FLINK-3405: Extend NiFiSource with interface S...

Posted by StephanEwen <gi...@git.apache.org>.
Github user StephanEwen commented on the pull request:

    https://github.com/apache/flink/pull/2047#issuecomment-222532431
  
    close() is called by all operators when the operator finishes without an exception of canceling. Have a look at the AbstractUDFStream
    
    Stop() is thought to be merely a trigger to make an unbounded source stop its unbounded loop. After that, it should finish like a bounded source, including the close() call.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: FLINK-3405: Extend NiFiSource with interface S...

Posted by smarthi <gi...@git.apache.org>.
Github user smarthi commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2047#discussion_r65068847
  
    --- Diff: flink-streaming-connectors/flink-connector-nifi/src/main/java/org/apache/flink/streaming/connectors/nifi/NiFiSource.java ---
    @@ -143,4 +144,13 @@ public void close() throws Exception {
     		client.close();
     	}
     
    + /**
    +	* {@inheritDoc}
    +	* <p>
    +	* Sets the {@link #isRunning} flag to {@code false}.
    +	*/
    +	@Override
    +	public void stop() {
    +		this.isRunning = false;
    --- End diff --
    
    I guess we need to for now, until stop() is wired into the StreamGraph i.e. Thanks for pointing that out.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: FLINK-3405: Extend NiFiSource with interface S...

Posted by StephanEwen <gi...@git.apache.org>.
Github user StephanEwen commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2047#discussion_r65087502
  
    --- Diff: flink-streaming-connectors/flink-connector-nifi/src/main/java/org/apache/flink/streaming/connectors/nifi/NiFiSource.java ---
    @@ -143,4 +144,13 @@ public void close() throws Exception {
     		client.close();
     	}
     
    + /**
    +	* {@inheritDoc}
    +	* <p>
    +	* Sets the {@link #isRunning} flag to {@code false}.
    +	*/
    +	@Override
    +	public void stop() {
    +		this.isRunning = false;
    --- End diff --
    
    Stop should not call close(), actually. It should just cause the main source loop to gracefully exit.
    Close() will happen anyways after that.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: FLINK-3405: Extend NiFiSource with interface S...

Posted by smarthi <gi...@git.apache.org>.
Github user smarthi commented on the pull request:

    https://github.com/apache/flink/pull/2047#issuecomment-222344951
  
    I started to add some NiFi integration tests which are presently lacking, but realized that it would be better to have that as part of a different jira.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: FLINK-3405: Extend NiFiSource with interface S...

Posted by zentol <gi...@git.apache.org>.
Github user zentol commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2047#discussion_r65093352
  
    --- Diff: flink-streaming-connectors/flink-connector-nifi/src/main/java/org/apache/flink/streaming/connectors/nifi/NiFiSource.java ---
    @@ -143,4 +144,13 @@ public void close() throws Exception {
     		client.close();
     	}
     
    + /**
    +	* {@inheritDoc}
    +	* <p>
    +	* Sets the {@link #isRunning} flag to {@code false}.
    +	*/
    +	@Override
    +	public void stop() {
    +		this.isRunning = false;
    --- End diff --
    
    nvm, found it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #2047: FLINK-3405: Extend NiFiSource with interface Stopp...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/flink/pull/2047


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---