Refactor JNI `jni_writer_data_sink`
- 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
Assessment
This issue has not been assessed yet.