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

KIP 396 ListOffsets #1029

Merged
merged 12 commits into from
Oct 23, 2023
Merged

KIP 396 ListOffsets #1029

merged 12 commits into from
Oct 23, 2023

Conversation

mahajanadhitya
Copy link
Contributor

No description provided.

@cla-assistant
Copy link

cla-assistant bot commented Aug 4, 2023

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@milindl milindl left a comment

Choose a reason for hiding this comment

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

Some initial comments for Round 1.
Mostly addresses the code, some comments on test, and example is not reviewed.
For the public API stuff and how OffsetSpec will be used, we can also discuss internally with everyone to arrive at a consensus on all the bindings at once.

kafka/adminapi.go Outdated Show resolved Hide resolved
kafka/adminapi.go Outdated Show resolved Hide resolved
kafka/adminapi.go Outdated Show resolved Hide resolved
kafka/adminapi.go Outdated Show resolved Hide resolved
kafka/adminapi.go Show resolved Hide resolved
kafka/adminapi.go Outdated Show resolved Hide resolved
kafka/adminapi.go Outdated Show resolved Hide resolved
kafka/adminapi.go Outdated Show resolved Hide resolved
kafka/adminapi.go Outdated Show resolved Hide resolved
kafka/adminoptions.go Outdated Show resolved Hide resolved
Copy link
Contributor

@milindl milindl left a comment

Choose a reason for hiding this comment

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

Example is missing from README.md of the examples/ directory, and also the .gitgnore (see how the other examples are added)

I also checked valgrind for memory leaks in the example. No issues

Mostly, great work, thanks @mahajanadhitya !

kafka/adminapi.go Outdated Show resolved Hide resolved
examples/admin_list_offsets/admin_list_offsets.go Outdated Show resolved Hide resolved
examples/admin_list_offsets/admin_list_offsets.go Outdated Show resolved Hide resolved
examples/admin_list_offsets/admin_list_offsets.go Outdated Show resolved Hide resolved
kafka/adminapi.go Outdated Show resolved Hide resolved
kafka/integration_test.go Outdated Show resolved Hide resolved
kafka/adminapi.go Outdated Show resolved Hide resolved
kafka/adminoptions.go Show resolved Hide resolved
kafka/integration_test.go Outdated Show resolved Hide resolved
kafka/adminoptions.go Show resolved Hide resolved
Copy link
Contributor

@milindl milindl left a comment

Choose a reason for hiding this comment

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

Minor comments on the addressal itself.
Almost ready to merge.

kafka/adminoptions.go Outdated Show resolved Hide resolved
kafka/integration_test.go Outdated Show resolved Hide resolved
kafka/adminoptions.go Outdated Show resolved Hide resolved
Copy link
Contributor

@milindl milindl left a comment

Choose a reason for hiding this comment

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

Approved, don't merge until librdkafka bundle is merged.
Good work @mahajanadhitya !

Copy link
Contributor

@emasab emasab left a comment

Choose a reason for hiding this comment

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

Great job! Some small changes

kafka/adminapi.go Outdated Show resolved Hide resolved
kafka/adminapi.go Outdated Show resolved Hide resolved
kafka/adminapi.go Outdated Show resolved Hide resolved
kafka/adminapi.go Outdated Show resolved Hide resolved
kafka/adminapi.go Outdated Show resolved Hide resolved

const (
// ReadUncommitted IsolationLevel
ReadUncommitted = IsolationLevel(C.RD_KAFKA_ISOLATION_LEVEL_READ_UNCOMMITTED)
Copy link
Contributor

Choose a reason for hiding this comment

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

As other enums:

Suggested change
ReadUncommitted = IsolationLevel(C.RD_KAFKA_ISOLATION_LEVEL_READ_UNCOMMITTED)
IsolationLevelReadUncommitted = IsolationLevel(C.RD_KAFKA_ISOLATION_LEVEL_READ_UNCOMMITTED)

// ReadUncommitted IsolationLevel
ReadUncommitted = IsolationLevel(C.RD_KAFKA_ISOLATION_LEVEL_READ_UNCOMMITTED)
// ReadCommitted IsolationLevel
ReadCommitted = IsolationLevel(C.RD_KAFKA_ISOLATION_LEVEL_READ_COMMITTED)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
ReadCommitted = IsolationLevel(C.RD_KAFKA_ISOLATION_LEVEL_READ_COMMITTED)
IsolationLevelReadCommitted = IsolationLevel(C.RD_KAFKA_ISOLATION_LEVEL_READ_COMMITTED)

cPartition := C.rd_kafka_ListOffsetsResultInfo_topic_partition(cResultInfo)
Topic := C.GoString(cPartition.topic)
Partition := TopicPartition{Topic: &Topic, Partition: int32(cPartition.partition)}
Value.Offset = int64(cPartition.offset)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Value.Offset = int64(cPartition.offset)
Value.Offset = kafka.Offset(cPartition.offset)

Copy link
Contributor

Choose a reason for hiding this comment

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

Just using Offset() here since the package is already kafka

@milindl
Copy link
Contributor

milindl commented Oct 23, 2023

Addressed comments and merged master.

@milindl milindl requested a review from emasab October 23, 2023 04:50
Copy link
Contributor

@emasab emasab left a comment

Choose a reason for hiding this comment

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

LGTM!

@milindl milindl merged commit 115e03b into master Oct 23, 2023
2 checks passed
@milindl milindl deleted the feature/AdminClient-ListOffsets branch October 23, 2023 08:09
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 this pull request may close these issues.

3 participants