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

[ISSUE #4770] Empty class member cause NullpointerException #4777

Merged
merged 6 commits into from
Feb 20, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public static CloudEvent convertRecordToEvent(ConnectRecord connectRecord) {
public static ConnectRecord convertEventToRecord(CloudEvent event) {
byte[] body = Objects.requireNonNull(event.getData()).toBytes();
LogUtil.info(log, "handle receive events {}", () -> new String(event.getData().toBytes(), Constants.DEFAULT_CHARSET));
// todo: recordPartition & recordOffset

ConnectRecord connectRecord = new ConnectRecord(null, null, System.currentTimeMillis(), body);
for (String extensionName : event.getExtensionNames()) {
connectRecord.addExtension(extensionName, Objects.requireNonNull(event.getExtension(extensionName)).toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,12 @@ public OffsetStorageWriterImpl(String connectorName, OffsetManagementService off
}

@Override
public void writeOffset(RecordPartition partition, RecordOffset position) {
ConnectorRecordPartition extendRecordPartition = new ConnectorRecordPartition(connectorName, partition.getPartition());
data.put(extendRecordPartition, position);
public void writeOffset(RecordPartition partition, RecordOffset offset) {
ConnectorRecordPartition extendRecordPartition;
if (partition != null) {
extendRecordPartition = new ConnectorRecordPartition(connectorName, partition.getPartition());
data.put(extendRecordPartition, offset);
}
}

/**
Expand Down
Loading