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

use cluster default for compaction strategy #393

Merged
merged 2 commits into from
Nov 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,12 @@
package dev.responsive.kafka.internal.db.spec;

import com.datastax.oss.driver.api.querybuilder.schema.CreateTableWithOptions;
import com.datastax.oss.driver.api.querybuilder.schema.compaction.CompactionStrategy;
import com.datastax.oss.driver.internal.querybuilder.schema.compaction.DefaultLeveledCompactionStrategy;
import dev.responsive.kafka.internal.db.partitioning.TablePartitioner;
import dev.responsive.kafka.internal.stores.TtlResolver;
import java.util.Optional;

public class DefaultTableSpec implements RemoteTableSpec {

private static final CompactionStrategy<?> DEFAULT_CASSANDRA_COMPACTION_STRATEGY =
new DefaultLeveledCompactionStrategy();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason I chose this was because I saw it was used as the default in a few places (maybe not everywhere like I thought) -- we should make sure we keep this in those places right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sadly I don't remember off the top of my head but I think if you do a search for the DefaultLeveledCompactionStrategy in my first TTL PR it should show where it used to be used

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(lmk if you want my help in finding that)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think ICS is generally a good general starting point, and since we don't have prod deployments of other compaction strategies I'm keen to just keep the default.


private final String name;
private final TablePartitioner<?, ?> partitioner;
private final Optional<TtlResolver<?, ?>> ttlResolver;
Expand Down Expand Up @@ -55,6 +50,6 @@ public String tableName() {

@Override
public CreateTableWithOptions applyDefaultOptions(final CreateTableWithOptions base) {
return base.withCompaction(DEFAULT_CASSANDRA_COMPACTION_STRATEGY);
return base;
}
}
Loading