Skip to content

NIFI-16271 Allow Stateless Process Groups to buffer FlowFile content in memory - #11676

Merged
pvillard31 merged 5 commits into
apache:mainfrom
markap14:NIFI-16271-stateless-group-in-memory
Oct 2, 2026
Merged

pvillard31 merged 5 commits into
apache:mainfrom
markap14:NIFI-16271-stateless-group-in-memory

Conversation

@markap14

@markap14 markap14 commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

NIFI-16271

Allows a Stateless Process Group to keep FlowFile content in memory up to a configured data-size limit, heap-percentage limit, or the smaller of both limits. Content above the limit spills to the backing Content Repository. The default leaves in-memory content disabled.

Content leaving a Stateless Process Group is transferred to a backing claim before the FlowFile Repository is updated. Failed repository updates roll back claim counts so timed-out and failed runs do not retain content.

The REST API, user interface, flow mapping, and documentation include both settings. The limits cannot be changed while the Stateless Process Group is running. This change uses the released NiFi API 2.13.0 fields.

Verification

  • 66 focused unit tests passed for content repositories, Process Group limits, claim transfer, rollback, and output cleanup
  • All 5 StatelessInMemoryContentIT system tests passed in 13.62 seconds, including NiFi startup
  • Frontend lint, build, and unit tests passed
  • Checkstyle and PMD passed for affected modules
  • git diff --check passed
  • Full ./mvnw clean install -P contrib-check on JDK 21 and JDK 25

No new dependencies were added.

@markap14
markap14 force-pushed the NIFI-16271-stateless-group-in-memory branch from 5db294c to 07ed86b Compare September 27, 2026 21:38
@markap14
markap14 marked this pull request as ready for review September 27, 2026 21:39
markap14 and others added 5 commits September 28, 2026 09:24
…in memory

Adds a Stateless Content Storage Location (INHERITED, CONTENT_REPOSITORY,
IN_MEMORY) to Process Groups so that a Process Group running on the Stateless
Execution Engine can buffer FlowFile content in memory instead of writing to
the Content Repository.

- Bump nifi-api to 2.12.0-SNAPSHOT (StatelessContentStorageLocation enum and
  VersionedProcessGroup.statelessContentStorageLocation).
- Thread the value through the ProcessGroup interface, StandardProcessGroup
  (get/set/resolve/verify), DTO, DtoFactory, DAO, flow mapping and flow
  synchronization, mirroring executionEngine.
- Defer the Stateless engine's ContentRepository selection until the group
  starts via DeferredStatelessContentRepository, so the configured location is
  honored (the group node is created before configuration is applied). When
  resolved to IN_MEMORY, a ByteArrayContentRepository buffers content in
  memory; otherwise the NiFi Content Repository is used.
- Restrict IN_MEMORY to Process Groups that are disconnected from all other
  components so content never crosses repositories: reject setting IN_MEMORY
  when the group has incoming/outgoing connections, and reject connecting into
  or out of a group configured to buffer content in memory.
- Add the FlowFile Content Storage selector to the edit-process-group dialog,
  shown when the Execution Engine is Stateless.
- Add StandardProcessGroup unit tests and StatelessInMemoryContentIT system
  tests (in-memory processing with an on-disk Content Repository scan proving
  nothing is written to disk, plus the connection and inheritance constraints).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Account for allocated buffer capacity, support content beyond 2 GiB, and release zero-count claims when frozen. Reduce runtime overhead with cached limits, 64 KiB segments, and read fast paths while consolidating regression coverage.

Generated with [Snowflake CoCo](https://docs.snowflake.com/en/user-guide/cortex-code/cortex-code)

Co-authored-by: Snowflake CoCo <noreply@snowflake.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@markap14
markap14 force-pushed the NIFI-16271-stateless-group-in-memory branch from 07ed86b to b3c7ef6 Compare September 28, 2026 13:24

@pvillard31 pvillard31 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM and have been playing with it over the last few days, everything worked as expected. Thanks for this improvement @markap14 !

@pvillard31
pvillard31 merged commit a09d868 into apache:main Oct 2, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants