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

[Bug] Could not find option: compression_type #65

Open
YesOrNo828 opened this issue Apr 18, 2023 · 0 comments
Open

[Bug] Could not find option: compression_type #65

YesOrNo828 opened this issue Apr 18, 2023 · 0 comments

Comments

@YesOrNo828
Copy link

YesOrNo828 commented Apr 18, 2023

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

I'm trying to flip between a bulk-load mode and a regular mode. e.g. Disable auto_compaction and compression when the app starts up, load the data, then enable auto_compaction and compression.

Actual behavior

Invoking method: RocksDB.setOptions(...) got an exception.

Steps to reproduce the behavior

Version:

com.ververica
frocksdbjni
6.20.3-ververica-1.0

Error log:

org.rocksdb.RocksDBException: Could not find option: : compression_type

	at org.rocksdb.RocksDB.setOptions(Native Method)
	at org.rocksdb.RocksDB.setOptions(RocksDB.java:3577)

Demo:

        String dbPath = temp.newFolder().getPath();
        final DBOptions dbOptions = new DBOptions().setCreateIfMissing(true).setCreateMissingColumnFamilies(true)
            .setWalDir(dbPath).setStatsDumpPeriodSec(300).setStatistics(new Statistics());
        String columnFamilyName = "test_option_dynamic";
        ColumnFamilyOptions columnFamilyOptions = new ColumnFamilyOptions();
        columnFamilyOptions.setDisableAutoCompactions(true);
        columnFamilyOptions.setCompressionType(CompressionType.NO_COMPRESSION);

        ColumnFamilyDescriptor descriptor = new ColumnFamilyDescriptor(columnFamilyName.getBytes(), columnFamilyOptions);
        ColumnFamilyDescriptor defaultDes = new ColumnFamilyDescriptor("default".getBytes(), new ColumnFamilyOptions());

        final List<ColumnFamilyDescriptor> descriptors = new ArrayList<>();
        descriptors.add(descriptor);
        descriptors.add(defaultDes);
        final List<ColumnFamilyHandle> managedHandles = new ArrayList<>();

        RocksDB rocksDB = RocksDB.open(dbOptions, dbPath, descriptors, managedHandles);

        Assert.assertEquals(descriptors.size(), managedHandles.size());
        ColumnFamilyHandle columnFamilyHandle = managedHandles.get(0);

        rocksDB.put(columnFamilyHandle, "key1".getBytes(), "value1".getBytes());

        rocksDB.setOptions(
            columnFamilyHandle,
            MutableColumnFamilyOptions.builder()
                .setCompressionType(CompressionType.SNAPPY_COMPRESSION)
                .setDisableAutoCompactions(false)
                .build());
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

No branches or pull requests

1 participant