Skip to content

Conversation

@hugofriant
Copy link
Contributor

@hugofriant hugofriant commented Nov 20, 2024

I would like to control the name of the control consumer group to have more fine grained accesses when deploying the Iceberg Sink connector on my infrastructure.

This PR aims to replace the DEFAULT_CONTROL_GROUP_PREFIX by a configurable variable

| iceberg.table.\<table name\>.partition-by | Comma-separated list of partition fields to use when creating the table |
| iceberg.table.\<table name\>.route-regex | The regex used to match a record's `routeField` to a table |
| iceberg.control.topic | Name of the control topic, default is `control-iceberg` |
| iceberg.control.group-id-prefix | Prefix for the control consuler group, default is `cg-control` |
Copy link
Member

Choose a reason for hiding this comment

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

There's a type here: I guess you mean consumer (not consuler :)).

I would rather name this property iceberg.control.consumer-group-id-prefix to keep the kafka semantic.

private static final String TABLES_SCHEMA_CASE_INSENSITIVE_PROP =
"iceberg.tables.schema-case-insensitive";
private static final String CONTROL_TOPIC_PROP = "iceberg.control.topic";
private static final String CONTROL_GROUP_PREFIX_PROP = "iceberg.control.group-id-prefix";
Copy link
Member

Choose a reason for hiding this comment

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

As suggested before, I would use consumer-group-id-prefix.

@jbonofre
Copy link
Member

@bryanck @rdblue I reviewed this PR and worked with @hugofriant on nit changes. I think this PR is ready to be merged 😄 Can you please take a look as well ? Thanks !

@jbonofre
Copy link
Member

@RussellSpitzer I reviewed this PR and worked with @hugofriant on nit changes. I think this PR is ready to be merged 😄 Can you also please take a look (and merge) ? Thanks !

private static final String TABLES_SCHEMA_CASE_INSENSITIVE_PROP =
"iceberg.tables.schema-case-insensitive";
private static final String CONTROL_TOPIC_PROP = "iceberg.control.topic";
private static final String CONTROL_GROUP_ID_PREFIX_PROP = "iceberg.control.consumer-group-id-prefix";
Copy link
Contributor

Choose a reason for hiding this comment

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

We should name this iceberg.control.group-id-prefix which is more consistent (and shorter).

Copy link
Member

Choose a reason for hiding this comment

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

It was the first proposal, but I proposed to keep the consumer-group semantic. OK for just group.

Copy link
Contributor

@bryanck bryanck Nov 21, 2024

Choose a reason for hiding this comment

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

I think it's OK to shorten it, e.g. Kafka's consumer property is group.id.

ConfigDef.Type.STRING,
DEFAULT_CONTROL_GROUP_PREFIX,
Importance.LOW,
"Prefix of the control consumer group, should not be set under normal conditions");
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it is reasonable to set this, so I'd make this Prefix of the control consumer group

return getString(CONTROL_TOPIC_PROP);
}

public String prefixControlConsumerGroup() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Rename to controlGroupIdPrefix

Copy link
Member

Choose a reason for hiding this comment

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

Again, it was the first proposal, I asked for consumer to clear with the kafka semantic.

@bryanck
Copy link
Contributor

bryanck commented Nov 21, 2024

Thanks for the PR @hugofriant , I had just a few naming nits

Copy link
Member

@jbonofre jbonofre left a comment

Choose a reason for hiding this comment

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

Thanks @hugofriant !

It looks good to me.

@bryanck @RussellSpitzer ok for you guys ?

@bryanck
Copy link
Contributor

bryanck commented Nov 22, 2024

Looks good to me, thanks @hugofriant for the contribution, and @jbonofre for the review!

@hugofriant
Copy link
Contributor Author

I had to fix the format @bryanck. Could you relaunch the workflows ? Thx

@hugofriant
Copy link
Contributor Author

Hello @bryanck, can you merge the PR ? Thank you !

@bryanck bryanck merged commit 9288d98 into apache:main Nov 27, 2024
zachdisc pushed a commit to zachdisc/iceberg that referenced this pull request Dec 23, 2024
…e#11599)

* Add the ability to change the control group prefix

* Add doc

* Review naming

* Review naming

* Fix violations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants