Skip to content

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

Draft
markap14 wants to merge 4 commits into
apache:mainfrom
markap14:NIFI-16271-stateless-group-in-memory
Draft

markap14 wants to merge 4 commits into
apache:mainfrom
markap14:NIFI-16271-stateless-group-in-memory

Conversation

@markap14

Copy link
Copy Markdown
Contributor

Summary

NIFI-16271

Allows a Stateless Process Group to buffer FlowFile content in memory up to a data-size cap and/or a heap-percentage cap, then spill to the Content Repository. Content that leaves the group is written to on-disk claims before the FlowFile Repository is updated.

  • Default is 0% heap and an unset data size, which uses no in-memory content.
  • Zero means zero; unset means not configured. If only one limit is set, that limit is used. If both are set, the smaller of the two is used (for example, 80% up to 4 GB).
  • The budget applies to the Stateless group as a whole, including Concurrent Tasks.
  • The in-memory limits cannot be changed while the Stateless group is running.

Draft: this PR depends on nifi-api 2.12.0-SNAPSHOT from apache/nifi-api#108. It cannot merge until that API change is released.

Test plan

  • Unit tests for spillable in-memory content, Process Group limit resolution (size-only, percent-only, min of both, unset/zero), and related Stateless flow-task behavior
  • System test StatelessInMemoryContentIT for under-budget in-memory content, spill-over, and rejecting limit changes while running
  • ./mvnw clean install -P contrib-check (JDK 21 / JDK 25) after the API snapshot is available in CI
  • UI: Stateless Process Group dialog shows both limits and disables them while the group is running

markap14 and others added 4 commits September 1, 2026 14:25
…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>
Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant