Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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 @@ -315,34 +315,38 @@ protected LaunchInfo launchDataflowJob(
String gcsPrefix =
getGcsPath(gcsPathPrefix + "/cdc/", gcsResourceManager)
.replace("gs://" + gcsResourceManager.getBucket(), "");
SubscriptionName subscription =
createPubsubResources(
identifierSuffix, pubsubResourceManager, gcsPrefix, gcsResourceManager);
SubscriptionName subscription = null;
if (pubsubResourceManager != null) {
subscription =
createPubsubResources(
identifierSuffix, pubsubResourceManager, gcsPrefix, gcsResourceManager);
}

String dlqGcsPrefix =
getGcsPath(gcsPathPrefix + "/dlq/", gcsResourceManager)
.replace("gs://" + gcsResourceManager.getBucket(), "");
SubscriptionName dlqSubscription =
createPubsubResources(
identifierSuffix + "dlq", pubsubResourceManager, dlqGcsPrefix, gcsResourceManager);
SubscriptionName dlqSubscription = null;
if (pubsubResourceManager != null) {
dlqSubscription =
createPubsubResources(
identifierSuffix + "dlq", pubsubResourceManager, dlqGcsPrefix, gcsResourceManager);
}

// default parameters
Map<String, String> params =
new HashMap<>() {
{
put("inputFilePattern", getGcsPath(gcsPathPrefix + "/cdc/", gcsResourceManager));
put("instanceId", spannerResourceManager.getInstanceId());
put("databaseId", spannerResourceManager.getDatabaseId());
put("projectId", PROJECT);
put(
"deadLetterQueueDirectory",
getGcsPath(gcsPathPrefix + "/dlq/", gcsResourceManager));
put("gcsPubSubSubscription", subscription.toString());
put("dlqGcsPubSubSubscription", dlqSubscription.toString());
put("inputFileFormat", "avro");
put("workerMachineType", "n2-standard-4");
}
};
Map<String, String> params = new HashMap<>();
params.put("inputFilePattern", getGcsPath(gcsPathPrefix + "/cdc/", gcsResourceManager));
params.put("instanceId", spannerResourceManager.getInstanceId());
params.put("databaseId", spannerResourceManager.getDatabaseId());
params.put("projectId", PROJECT);
params.put("deadLetterQueueDirectory", getGcsPath(gcsPathPrefix + "/dlq/", gcsResourceManager));
if (subscription != null) {
params.put("gcsPubSubSubscription", subscription.toString());
}
if (dlqSubscription != null) {
params.put("dlqGcsPubSubSubscription", dlqSubscription.toString());
}
params.put("inputFileFormat", "avro");
params.put("workerMachineType", "n2-standard-4");

if (jdbcSource != null) {
if (jdbcSource instanceof PostgresqlSource) {
Expand Down
Loading
Loading