Skip to content

Commit 2541fc7

Browse files
committed
Refactoring
1 parent aae48ec commit 2541fc7

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

sdks/java/io/debezium/src/main/java/org/apache/beam/io/debezium/DebeziumReadSchemaTransformProvider.java

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,13 @@ public PCollectionRowTuple expand(PCollectionRowTuple input) {
151151
.withMaxNumberOfRecords(testLimitRecords)
152152
.withMaxTimeToRun(testLimitMilliseconds);
153153
} else {
154-
if (configuration.getMaxNumberOfRecords() != null) {
155-
readTransform =
156-
readTransform.withMaxNumberOfRecords(configuration.getMaxNumberOfRecords());
154+
Integer maxNumberOfRecords = configuration.getMaxNumberOfRecords();
155+
if (maxNumberOfRecords != null) {
156+
readTransform = readTransform.withMaxNumberOfRecords(maxNumberOfRecords);
157157
}
158-
159-
if (configuration.getMaxTimeToRun() != null) {
160-
readTransform = readTransform.withMaxTimeToRun(configuration.getMaxTimeToRun());
158+
Long maxTimeToRun = configuration.getMaxTimeToRun();
159+
if (maxTimeToRun != null) {
160+
readTransform = readTransform.withMaxTimeToRun(maxTimeToRun);
161161
}
162162
}
163163

@@ -196,13 +196,12 @@ public PCollectionRowTuple expand(PCollectionRowTuple input) {
196196
@DefaultSchema(AutoValueSchema.class)
197197
@AutoValue
198198
public abstract static class DebeziumReadSchemaTransformConfiguration {
199-
@Nullable
199+
200200
@SchemaFieldDescription("Maximum number of records to read before stopping.")
201-
public abstract Integer getMaxNumberOfRecords();
201+
public abstract @Nullable Integer getMaxNumberOfRecords();
202202

203-
@Nullable
204203
@SchemaFieldDescription("Maximum time in milliseconds to run before stopping.")
205-
public abstract Long getMaxTimeToRun();
204+
public abstract @Nullable Long getMaxTimeToRun();
206205

207206
@SchemaFieldDescription("Username used to connect to the source database.")
208207
public abstract String getUsername();

0 commit comments

Comments
 (0)