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

[HUDI-7106] Fix sqs deletes, deltasync service close and error table default configs. #10117

Merged
merged 2 commits into from
Nov 21, 2023
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 @@ -200,17 +200,21 @@ protected List<List<Message>> createListPartitions(List<Message> singleList, int
* Delete batch of messages from queue.
*/
protected void deleteBatchOfMessages(SqsClient sqs, String queueUrl, List<Message> messagesToBeDeleted) {
DeleteMessageBatchRequest deleteBatchReq =
DeleteMessageBatchRequest.builder().queueUrl(queueUrl).build();
List<DeleteMessageBatchRequestEntry> deleteEntries = new ArrayList<>(deleteBatchReq.entries());
if (messagesToBeDeleted.isEmpty()) {
return;
}
DeleteMessageBatchRequest.Builder builder = DeleteMessageBatchRequest.builder().queueUrl(queueUrl);
List<DeleteMessageBatchRequestEntry> deleteEntries = new ArrayList<>();

for (Message message : messagesToBeDeleted) {
deleteEntries.add(
DeleteMessageBatchRequestEntry.builder()
.id(message.messageId())
.receiptHandle(message.receiptHandle())
.build());
}
DeleteMessageBatchResponse deleteResponse = sqs.deleteMessageBatch(deleteBatchReq);
builder.entries(deleteEntries);
DeleteMessageBatchResponse deleteResponse = sqs.deleteMessageBatch(builder.build());
List<String> deleteFailures =
deleteResponse.failed().stream()
.map(BatchResultErrorEntry::id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public static Option<BaseErrorTableWriter> getErrorTableWriter(HoodieStreamer.Co

public static HoodieErrorTableConfig.ErrorWriteFailureStrategy getErrorWriteFailureStrategy(
TypedProperties props) {
String writeFailureStrategy = props.getString(ERROR_TABLE_WRITE_FAILURE_STRATEGY.key());
String writeFailureStrategy = props.getString(ERROR_TABLE_WRITE_FAILURE_STRATEGY.key(), ERROR_TABLE_WRITE_FAILURE_STRATEGY.defaultValue());
return HoodieErrorTableConfig.ErrorWriteFailureStrategy.valueOf(writeFailureStrategy);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,11 @@
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.function.Function;
import java.util.stream.Collectors;

import scala.Tuple2;
import scala.collection.JavaConversions;
Expand Down Expand Up @@ -975,7 +974,7 @@ private String getSyncClassShortName(String syncClassName) {
}

public void runMetaSync() {
Set<String> syncClientToolClasses = new HashSet<>(Arrays.asList(cfg.syncClientToolClassNames.split(",")));
List<String> syncClientToolClasses = Arrays.stream(cfg.syncClientToolClassNames.split(",")).distinct().collect(Collectors.toList());
// for backward compatibility
if (cfg.enableHiveSync) {
cfg.enableMetaSync = true;
Expand Down
Loading