-
Notifications
You must be signed in to change notification settings - Fork 949
Refactor jni writer data sink #12458
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor jni writer data sink #12458
Conversation
This change adds JNI bindings to write tables out as CSV, to either the filesystem or memory. The Java Table class now has additional methods: 1. Table.writeCSVToFile(): Writes the current table out to the specified file on the filesystem. 2. Table.writeCSVToBuffer(): Writes the current table out to a HostBufferConsumer. These calls are analogous to cudf::io::write_csv(). Current limitations: 1. The cudf::io::csv_writer_options interface binds the CSV options tightly to the Table being written. This makes it a little clumsy to write multiple Tables to the same HostBufferConsumer, because each could be written with different, contradictory options. 2. cudf::io::write_csv(file_name) overwrites the specified file, if it exists. There currently isn't a way to keep a file open, and write multiple tables to it; each write call overwrites the previous file.
1. Added setter to change Table instance in csv_writer_options. 2. Plumbing for new chunked writer. 3. Tests.
1. Formatting. 2. Better names for JNI CSV functions.
Moved commonality between host_write() and device_write() to common place. Signed-off-by: MithunR <[email protected]>
Codecov ReportBase: 86.58% // Head: 85.71% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## branch-23.02 #12458 +/- ##
================================================
- Coverage 86.58% 85.71% -0.87%
================================================
Files 155 155
Lines 24368 24798 +430
================================================
+ Hits 21098 21255 +157
- Misses 3270 3543 +273
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
…or-jni-writer-data-sink
Closing this. I'm not sure we need to chase this down. Mostly nitpicks. |
Description
Fixes #12456.
This is purely a JNI change. The implementation of
jni_writer_data_sink
has been streamlined a little:device_write()
andhost_write()
has been moved to a common function.rotate_buffer()
has been renamed tohandle_buffer_and_reallocate()
.jni_writer_data_sink
has been moved to thecudf::jni::io
namespace.jni_writer_data_sink
is now namedwriter_data_sink
.Checklist
Note: This is purely a JNI change. This is a follow-up to #12425, which has yet to be merged. The changes in that PR are included in this one. Once #12425 is merged, this changes here will be revealed as minuscule.