You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "EndzeitBegins (via GitHub)" <gi...@apache.org> on 2024/04/22 17:16:12 UTC
[PR] NIFI-12986 Remove depreciation warning from ProcessSession.commit [nifi]
EndzeitBegins opened a new pull request, #8683:
URL: https://github.com/apache/nifi/pull/8683
<!-- Licensed to the Apache Software Foundation (ASF) under one or more -->
<!-- contributor license agreements. See the NOTICE file distributed with -->
<!-- this work for additional information regarding copyright ownership. -->
<!-- The ASF licenses this file to You under the Apache License, Version 2.0 -->
<!-- (the "License"); you may not use this file except in compliance with -->
<!-- the License. You may obtain a copy of the License at -->
<!-- http://www.apache.org/licenses/LICENSE-2.0 -->
<!-- Unless required by applicable law or agreed to in writing, software -->
<!-- distributed under the License is distributed on an "AS IS" BASIS, -->
<!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -->
<!-- See the License for the specific language governing permissions and -->
<!-- limitations under the License. -->
# Summary
Removes deprecation notice as discussed in issue
[NIFI-12986](https://issues.apache.org/jira/browse/NIFI-12986).
# Tracking
Please complete the following tracking steps prior to pull request creation.
### Issue Tracking
- [x] [Apache NiFi Jira](https://issues.apache.org/jira/browse/NIFI) issue created
### Pull Request Tracking
- [x] Pull Request title starts with Apache NiFi Jira issue number, such as `NIFI-00000`
- [x] Pull Request commit message starts with Apache NiFi Jira issue number, as such `NIFI-00000`
### Pull Request Formatting
- [x] Pull Request based on current revision of the `main` branch
- [x] Pull Request refers to a feature branch with one commit containing changes
# Verification
Please indicate the verification steps performed prior to pull request creation.
### Build
- [ ] Build completed using `mvn clean install -P contrib-check`
- [ ] JDK 21
### Licensing
- [ ] New dependencies are compatible with the [Apache License 2.0](https://apache.org/licenses/LICENSE-2.0) according to the [License Policy](https://www.apache.org/legal/resolved.html)
- [ ] New dependencies are documented in applicable `LICENSE` and `NOTICE` files
### Documentation
- [ ] Documentation formatting appears as expected in rendered files
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NIFI-12986 Remove depreciation warning from ProcessSession.commit [nifi]
Posted by "EndzeitBegins (via GitHub)" <gi...@apache.org>.
EndzeitBegins commented on code in PR #8683:
URL: https://github.com/apache/nifi/pull/8683#discussion_r1575136767
##########
nifi-api/src/main/java/org/apache/nifi/processor/ProcessSession.java:
##########
@@ -75,10 +75,11 @@ public interface ProcessSession {
* All FlowFiles operated on within this session must be accounted for by transfer or removal or the commit will fail.
* <p>
* As soon as the commit completes the session is again ready to be used.
+ * <p>
+ * As of NiFi 1.14.0, an asynchronous API was introduced, see {@link #commitAsync()}, {@link #commitAsync(Runnable)}, and {@link #commitAsync(Runnable, Consumer)}.
+ * In most cases, users should prefer to use the asynchronous API. The synchronous API is less suited for execution in different runtimes, e.g. MiNiFi or Stateless NiFi,
+ * and may cause the dataflow in such runtimes to get stuck.
Review Comment:
Thanks for the recommendation. I applied the change you suggested.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NIFI-12986 Remove depreciation warning from ProcessSession.commit [nifi]
Posted by "asfgit (via GitHub)" <gi...@apache.org>.
asfgit closed pull request #8683: NIFI-12986 Remove depreciation warning from ProcessSession.commit
URL: https://github.com/apache/nifi/pull/8683
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NIFI-12986 Remove depreciation warning from ProcessSession.commit [nifi]
Posted by "joewitt (via GitHub)" <gi...@apache.org>.
joewitt commented on code in PR #8683:
URL: https://github.com/apache/nifi/pull/8683#discussion_r1575119122
##########
nifi-api/src/main/java/org/apache/nifi/processor/ProcessSession.java:
##########
@@ -75,10 +75,11 @@ public interface ProcessSession {
* All FlowFiles operated on within this session must be accounted for by transfer or removal or the commit will fail.
* <p>
* As soon as the commit completes the session is again ready to be used.
+ * <p>
+ * As of NiFi 1.14.0, an asynchronous API was introduced, see {@link #commitAsync()}, {@link #commitAsync(Runnable)}, and {@link #commitAsync(Runnable, Consumer)}.
+ * In most cases, users should prefer to use the asynchronous API. The synchronous API is less suited for execution in different runtimes, e.g. MiNiFi or Stateless NiFi,
+ * and may cause the dataflow in such runtimes to get stuck.
Review Comment:
@EndzeitBegins The 'nifi-api' is the most definitive/canonical API we have. We do not want to be talking about how a given method would cause things to get stuck and if that were the case we should fix that. This is 'the api' so it should just work. The downside of commit is that it is synchronous and immediate. The upside of asyncCommit is that it is asynchronous meaning the framework gets to choose the optimal time to make the commit happen.
I recommend the following phrasing be considered instead of this whole block.
See {@link #commitAsync()}, {@link #commitAsync(Runnable)}, and {@link #commitAsync(Runnable, Consumer)}. The asynchronous session commit methods are preferable to this commit call for most cases as it defers when the actual commit happens to the framework so that it can optimize when the commit call takes place.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org