You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: connect-file-pulse-plugin/src/main/java/io/streamthoughts/kafka/connect/filepulse/config/CommonSourceConfig.java
+22-5Lines changed: 22 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -50,7 +50,10 @@ public class CommonSourceConfig extends AbstractConfig {
50
50
privatestaticfinalStringFS_SCAN_FILTERS_DOC = "Filters classes which are used to apply list input files.";
privatestaticfinalStringOFFSET_STRATEGY_CLASS_DOC = "Class which is used to determine the source partition and offset that uniquely identify a input record";
@@ -61,10 +64,10 @@ public class CommonSourceConfig extends AbstractConfig {
61
64
privatestaticfinalStringFILTER_DOC = "List of filters aliases to apply on each value (order is important).";
publicstaticfinalStringTASKS_FILE_STATUS_STORAGE_CLASS_DOC = "The FileObjectStateBackingStore class to be used for storing status state of file objects.";
67
+
privatestaticfinalStringTASKS_FILE_STATUS_STORAGE_CLASS_DOC = "The FileObjectStateBackingStore class to be used for storing status state of file objects.";
Copy file name to clipboardExpand all lines: connect-file-pulse-plugin/src/main/java/io/streamthoughts/kafka/connect/filepulse/source/DefaultFileRecordsPollingConsumer.java
Copy file name to clipboardExpand all lines: connect-file-pulse-plugin/src/main/java/io/streamthoughts/kafka/connect/filepulse/source/FilePulseSourceTask.java
+23-16Lines changed: 23 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -174,22 +174,29 @@ public List<SourceRecord> poll() throws InterruptedException {
174
174
}
175
175
} else {
176
176
177
-
finalRecordsIterable<FileRecord<TypedStruct>> records = consumer.next();
178
-
179
-
if (!records.isEmpty()) {
180
-
finalFileContextcontext = consumer.context();
181
-
LOG.debug("Returning {} records for {}", records.size(), context.metadata());
182
-
results = records.stream()
183
-
.map(r -> buildSourceRecord(context, r))
184
-
.collect(Collectors.toList());
185
-
186
-
// Check if the SourceTask is still running to
187
-
// return immediately instead of waiting
188
-
} elseif (running.get() &&
189
-
consumer.hasNext() &&
190
-
consecutiveWaits.checkAndDecrement()) {
191
-
busyWait();
192
-
continue;
177
+
try {
178
+
finalRecordsIterable<FileRecord<TypedStruct>> records = consumer.next();
179
+
if (!records.isEmpty()) {
180
+
finalFileContextcontext = consumer.context();
181
+
LOG.debug("Returning {} records for {}", records.size(), context.metadata());
182
+
results = records.stream()
183
+
.map(r -> buildSourceRecord(context, r))
184
+
.collect(Collectors.toList());
185
+
186
+
// Check if the SourceTask is still running to
187
+
// return immediately instead of waiting
188
+
} elseif (running.get() &&
189
+
consumer.hasNext() &&
190
+
consecutiveWaits.checkAndDecrement()) {
191
+
busyWait();
192
+
continue;
193
+
}
194
+
} catch (ConnectFilePulseExceptione) {
195
+
if (taskConfig.isTaskHaltOnError()) {
196
+
throwe;
197
+
} else {
198
+
LOG.error("Caught unexpected error while processing file. Ignore and continue", e);
Copy file name to clipboardExpand all lines: connect-file-pulse-plugin/src/test/java/io/streamthoughts/kafka/connect/filepulse/config/SourceTaskConfigTest.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ public void should_configure_filter_given_on_failure() {
0 commit comments