NVIDIA / NVIDIA/cudf

Refactor JNI `jni_writer_data_sink`

Open
#12,456 0 comments 0 reactions 1 assignee Claimed by @mythrocks View on GitHub
improvement Java Spark
Dominant language
C++
Stars
9.8k
Forks
1.1k
Avg merge
3d 6m
Merged PRs (30d)
278

Description

This is a follow-up task arising from @hyperbolic2346's review of #12425. #12425 moved the implementation of `jni_writer_data_sink` from `TableJni.cpp` to its own header, with no changes to its implementation.

The implementation of `jni_writer_data_sink` could use some streamlining:
1. There is a lot of commonality in `device_write` and `host_write`. It would be good to move the common bit out to its own function.
2. `rotate_buffer()` could stand to have a better name.
3. `jni_writer_data_sink` should probably move to the `cudf::jni::io` namespace.
4. If moved to the appropriate namespace, `jni_writer_data_sink` need no longer reference `jni_` in its name.
5. `device_write_async()` might need implementing. It might simply be a matter of calling `device_write` via `std::async`. This is not currently exercised.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.