Skip to content
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

CreateColumnFamilies with column family descriptors is not available via the C API #12887

Open
sadderchris opened this issue Jul 25, 2024 · 4 comments · May be fixed by #12896
Open

CreateColumnFamilies with column family descriptors is not available via the C API #12887

sadderchris opened this issue Jul 25, 2024 · 4 comments · May be fixed by #12896

Comments

@sadderchris
Copy link

Note: Please use Issues only for bug reports. For questions, discussions, feature requests, etc. post to dev group: https://groups.google.com/forum/#!forum/rocksdb or https://www.facebook.com/groups/rocksdb.dev

Expected behavior

Using the C API, I can batch create column families from column family descriptors

Actual behavior

It's possible to create a single column family (1), or a batch of column families that all use the same options (2), but not from column family descriptors

Steps to reproduce the behavior

N/A

@rhubner
Copy link
Contributor

rhubner commented Jul 26, 2024

Hello @sadderchris ,

I'm looking into C API and it looks like column family descriptors are not exposed at all. Usually where API expect column family descriptor, we pass two parameters, column_family_names and column_family_options. This obviously missing for rocksdb_create_column_families. Can you please check API proposal bellow if it describe your requirements ?

rocksdb_column_family_handle_t** rocksdb_create_column_families(
    rocksdb_t* db, 
    int num_column_families,
    const char* const* column_family_names,
    const rocksdb_options_t* const* column_family_options,
    size_t* lencfs, char** errptr);

Radek

cc: @adamretter @pdillinger

@sadderchris
Copy link
Author

Wouldn't this break any existing callers of rocksdb_create_column_families? Or is backwards compatibility in the C API not a concern?

@rhubner
Copy link
Contributor

rhubner commented Jul 29, 2024

Hello @sadderchris ,

of course you are correct. Too much time in Java/C++ that I almost forgot C doesn't support overloading.

rocksdb_column_family_handle_t** rocksdb_create_column_families_with_options(
                               rocksdb_t* db,
                               int num_column_families,
                               const char* const* column_family_names,
                               const rocksdb_options_t* const* column_family_options,
                               size_t* lencfs, char** errptr);

Radek

@sadderchris
Copy link
Author

Thanks for the quick turnaround, this looks like it would work for our purposes.

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 a pull request may close this issue.

2 participants