Skip to content
Merged
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 @@ -51,6 +51,7 @@
import org.apache.beam.sdk.transforms.display.DisplayData;
import org.apache.beam.sdk.transforms.windowing.BoundedWindow;
import org.apache.beam.sdk.util.BackOffUtils;
import org.apache.beam.sdk.util.Preconditions;
import org.apache.beam.sdk.values.KV;
import org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.annotations.VisibleForTesting;
import org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.collect.ImmutableList;
Expand Down Expand Up @@ -87,7 +88,6 @@ static final class BatchWriteFnWithSummary extends BaseBatchWriteFn<WriteSuccess
@Override
void handleWriteFailures(
ContextAdapter<WriteSuccessSummary> context,
Instant timestamp,
List<KV<WriteFailure, BoundedWindow>> writeFailures,
Runnable logMessage) {
throw new FailedWritesException(
Expand Down Expand Up @@ -125,12 +125,11 @@ static final class BatchWriteFnWithDeadLetterQueue extends BaseBatchWriteFn<Writ
@Override
void handleWriteFailures(
ContextAdapter<WriteFailure> context,
Instant timestamp,
List<KV<WriteFailure, BoundedWindow>> writeFailures,
Runnable logMessage) {
logMessage.run();
for (KV<WriteFailure, BoundedWindow> kv : writeFailures) {
context.output(kv.getKey(), timestamp, kv.getValue());
context.output(kv.getKey(), kv.getValue().maxTimestamp(), kv.getValue());
}
}

Expand Down Expand Up @@ -274,7 +273,6 @@ public void processElement(ProcessContext context, BoundedWindow window) throws
getWriteType(write), getName(write));
handleWriteFailures(
contextAdapter,
clock.instant(),
ImmutableList.of(
KV.of(
new WriteFailure(
Expand Down Expand Up @@ -466,7 +464,7 @@ private DoFlushStatus doFlush(
if (okCount == writesCount) {
handleWriteSummary(
context,
end,
Preconditions.checkArgumentNotNull(okWindow).maxTimestamp(),
KV.of(new WriteSuccessSummary(okCount, okBytes), coerceNonNull(okWindow)),
() ->
LOG.debug(
Expand All @@ -481,7 +479,6 @@ private DoFlushStatus doFlush(
int finalOkCount = okCount;
handleWriteFailures(
context,
end,
ImmutableList.copyOf(nonRetryableWrites),
() ->
LOG.warn(
Expand All @@ -506,7 +503,7 @@ private DoFlushStatus doFlush(
if (okCount > 0) {
handleWriteSummary(
context,
end,
Preconditions.checkArgumentNotNull(okWindow).maxTimestamp(),
KV.of(new WriteSuccessSummary(okCount, okBytes), coerceNonNull(okWindow)),
logMessage);
} else {
Expand Down Expand Up @@ -542,7 +539,6 @@ private enum DoFlushStatus {

abstract void handleWriteFailures(
ContextAdapter<OutT> context,
Instant timestamp,
List<KV<WriteFailure, BoundedWindow>> writeFailures,
Runnable logMessage);

Expand Down
Loading