Skip to content

[WIP][CORE] Pass Spark task attempt id and pool name from Java to native runtime/memory-manager#12376

Open
taiyang-li wants to merge 1 commit into
apache:mainfrom
taiyang-li:extract/jni-pass-task-attempt-id
Open

[WIP][CORE] Pass Spark task attempt id and pool name from Java to native runtime/memory-manager#12376
taiyang-li wants to merge 1 commit into
apache:mainfrom
taiyang-li:extract/jni-pass-task-attempt-id

Conversation

@taiyang-li

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

This patch extends the JNI bridge between the Java/Scala layer and the native C++ layer to propagate Spark task-level identification information:

  • RuntimeJniWrapper.createRuntime: Added long taskAttemptId parameter
  • NativeMemoryManagerJniWrapper.create: Added String name (pool name) parameter
  • NativeMemoryManagerJniWrapper.hold: Added String name and long taskAttemptId parameters
  • NativeMemoryManagerJniWrapper.release: Added long taskAttemptId parameter

On the native C++ side:

  • Runtime gains a taskAttemptId_ member with getter/setter
  • MemoryManager gains a name_ member with getter/setter

The values are set via setters after object creation, so no changes are needed for existing backend subclasses (Velox, ClickHouse). The Factory typedefs and constructor signatures remain unchanged.

This makes per-task diagnostics and per-pool logging possible, and unblocks future backends (e.g. Bolt) that need task-level identification at the native layer.

How was this patch tested?

  • Static verification: All JNI method signatures match between Java and C++ (parameter count and types verified).
  • No changes to Velox/CH backend code - all existing subclasses compile unchanged.
  • The patch is purely additive (new members + getters/setters), with no behavioral changes for existing backends.
  • Full build verification is pending; this is a minimal infrastructure patch.

Was this patch authored or co-authored using generative AI tooling?

Generated-by: Claude claude-sonnet-4-6

…native runtime/memory-manager

This patch extends RuntimeJniWrapper.createRuntime and the NativeMemoryManagerJniWrapper
create/hold/release JNI methods with extra parameters that propagate the Spark task
attempt id (and a memory-pool name) from the JVM down to the native side.

The native Runtime and NativeMemoryManager just store the values and expose simple
getters; no behavior change for existing Velox/CH backends. This makes per-task
diagnostics and per-pool logging possible, and unblocks future backends (e.g. Bolt)
that need task-level identification at the native layer.

Generated-by: Claude claude-sonnet-4-6
Co-Authored-By: Aime <aime@bytedance.com>
Change-Id: Iff1124ec0e8946f46dbbed096f9197ff45c9f433
@github-actions github-actions Bot added the VELOX label Jun 26, 2026
@taiyang-li taiyang-li changed the title [CORE] Pass Spark task attempt id and pool name from Java to native runtime/memory-manager [WIP][CORE] Pass Spark task attempt id and pool name from Java to native runtime/memory-manager Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant