Skip to content

Commit

Permalink
Fix ingestion-sink cross-project inserts
Browse files Browse the repository at this point in the history
Update google cloud library to 1.61.0 to match beam 2.13.0 and pick up googleapis/google-cloud-java#4196

Emit stack traces in ingestion-sink
  • Loading branch information
relud committed Aug 15, 2019
1 parent 7cbd98d commit 2c93cb7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ private synchronized Optional<CompletableFuture<TableRow>> add(TableRow row) {
int index = newSize - 1;
return Optional.of(result.thenApplyAsync(r -> {
List<BigQueryError> errors = r.getErrorsFor(index);
if (!errors.isEmpty()) {
if (errors != null && !errors.isEmpty()) {
throw new WriteErrors(errors);
}
return row;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@

package com.mozilla.telemetry.ingestion.io;

import static java.util.logging.Level.WARNING;

import com.google.cloud.pubsub.v1.Subscriber;
import com.google.common.annotations.VisibleForTesting;
import com.google.pubsub.v1.ProjectSubscriptionName;
import com.google.pubsub.v1.PubsubMessage;
import java.util.concurrent.CompletableFuture;
import java.util.function.Function;
import java.util.logging.Logger;

public class Pubsub {

Expand All @@ -18,6 +21,8 @@ private Pubsub() {

public static class Read {

static Logger logger = Logger.getLogger("Pubsub.Read");

@VisibleForTesting
Subscriber subscriber;

Expand All @@ -30,6 +35,7 @@ public Read(String subscriptionName, Function<PubsubMessage, CompletableFuture<?
if (exception == null) {
consumer.ack();
} else {
logger.log(WARNING, "Exception while attempting to deliver message:", exception);
consumer.nack();
}
})))
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

<!-- Keep these dependency versions in sync with those pulled in by beam;
check https://mvnrepository.com/artifact/org.apache.beam -->
<google-cloud.version>1.49.0</google-cloud.version>
<google-cloud.version>1.61.0</google-cloud.version>
<jackson.version>2.9.9</jackson.version>
</properties>

Expand Down

0 comments on commit 2c93cb7

Please sign in to comment.