Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Changelog

## [Unreleased]
### Fixed
- Fixed http sink NEP issue when flink job restore from checkpoint.

## [0.23.0] - 2025-11-07

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,7 @@ protected HttpSinkInternal(
public StatefulSinkWriter<InputT, BufferedRequestState<HttpSinkRequestEntry>> createWriter(
InitContext context) throws IOException {

ElementConverter<InputT, HttpSinkRequestEntry> elementConverter = getElementConverter();
if (elementConverter instanceof SchemaLifecycleAwareElementConverter) {
// This cast is needed for Flink 1.15.3 build
((SchemaLifecycleAwareElementConverter<?, ?>) elementConverter).open(context);
}
ElementConverter<InputT, HttpSinkRequestEntry> elementConverter = initElementConverterOfSchema(context);

return new HttpSinkWriter<>(
elementConverter,
Expand All @@ -144,12 +140,22 @@ public StatefulSinkWriter<InputT, BufferedRequestState<HttpSinkRequestEntry>> cr
);
}

private ElementConverter<InputT, HttpSinkRequestEntry> initElementConverterOfSchema(InitContext context) {
ElementConverter<InputT, HttpSinkRequestEntry> elementConverter = getElementConverter();
if (elementConverter instanceof SchemaLifecycleAwareElementConverter) {
((SchemaLifecycleAwareElementConverter<?, ?>) elementConverter).open(context);
}
return elementConverter;
}

@Override
public StatefulSinkWriter<InputT, BufferedRequestState<HttpSinkRequestEntry>> restoreWriter(
InitContext context,
Collection<BufferedRequestState<HttpSinkRequestEntry>> recoveredState)
throws IOException {

initElementConverterOfSchema(context);
Copy link
Collaborator

Choose a reason for hiding this comment

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

please could you add a unit test for the new line.


return new HttpSinkWriter<>(
getElementConverter(),
context,
Expand Down