Module brod_cg_commits

This is a utility module to help force commit offsets to kafka.

Behaviours: brod_group_member, gen_server.

Description

This is a utility module to help force commit offsets to kafka.

Data Types

group_id()

group_id() = brod:group_id()

group_input()

group_input() = [{prop_key(), prop_val()}]

member_id()

member_id() = brod:group_member_id()

offset()

offset() = brod:offset()

offsets()

offsets() = latest | earliest | [{partition(), offset()}]

partition()

partition() = brod:partition()

prop_key()

prop_key() = id | topic | retention | protocol | offsets

prop_val()

prop_val() = group_id() | topic() | retention() | offsets() | brod_group_coordinator:protocol_name()

retention()

retention() = integer()

-1 to use whatever configured in kafka

topic()

topic() = brod:topic()

Function Index

assign_partitions/3This function is called only when partition_assignment_strategy is set for callback_implemented in group config.
assignments_received/4Called by group coordinator when there is new assignemnt received.
assignments_revoked/1Called by group coordinator before re-joinning the consumer group.
code_change/3
get_committed_offsets/2Called by group coordinator when initializing the assignments for subscriber.
handle_call/3
handle_cast/2
handle_info/2
init/1
run/2Force commit offsets.
start_link/2Start (link) a group member.
stop/1Stop the process.
sync/1Make a call to the resetter process, the call will be blocked until offsets are committed.
terminate/2

Function Details

assign_partitions/3

assign_partitions(Pid::pid(), Members::[brod:group_member()], TopicPartitionList::[{brod:topic(), brod:partition()}]) -> [{member_id(), [brod:partition_assignment()]}]

This function is called only when partition_assignment_strategy is set for callback_implemented in group config.

assignments_received/4

assignments_received(Pid::pid(), MemberId::member_id(), GenerationId::integer(), TopicAssignments::brod:received_assignments()) -> ok

Called by group coordinator when there is new assignemnt received.

assignments_revoked/1

assignments_revoked(Pid::pid()) -> ok

Called by group coordinator before re-joinning the consumer group.

code_change/3

code_change(OldVsn, State, Extra) -> any()

get_committed_offsets/2

get_committed_offsets(Pid::pid(), TopicPartitions::[{brod:topic(), brod:partition()}]) -> {ok, [{{brod:topic(), brod:partition()}, brod:offset()}]}

Called by group coordinator when initializing the assignments for subscriber. NOTE: this function is called only when it is DISABLED to commit offsets to kafka. i.e. offset_commit_policy is set to consumer_managed

handle_call/3

handle_call(Call, From, State0) -> any()

handle_cast/2

handle_cast(Cast, State) -> any()

handle_info/2

handle_info(Info, State) -> any()

init/1

init(X1) -> any()

run/2

run(ClientId, GroupInput) -> any()

Force commit offsets.

start_link/2

start_link(Client::brod:client(), GroupInput::group_input()) -> {ok, pid()} | {error, any()}

Start (link) a group member. The member will try to join the consumer group and get assignments for the given topic-partitions, then commit given offsets to kafka. In case not all given partitions are assigned to it, it will terminate with an exit exception

stop/1

stop(Pid::pid()) -> ok

Stop the process.

sync/1

sync(Pid::pid()) -> ok

Make a call to the resetter process, the call will be blocked until offsets are committed.

terminate/2

terminate(Reason, State) -> any()


Generated by EDoc