pandaapo commented on code in PR #4650:
URL: https://github.com/apache/eventmesh/pull/4650#discussion_r1440254095
##########
eventmesh-connectors/eventmesh-connector-file/src/main/java/org/apache/eventmesh/connector/file/source/connector/FileSourceConnector.java:
##########
@@ -73,12 +93,48 @@ public String name() {
@Override
public void stop() {
-
+ try {
+ if (bufferedReader != null) {
+ bufferedReader.close();
+ }
+ } catch (Exception e) {
+ log.error("Error closing resources: {}", e.getMessage());
+ }
}
@Override
public List<ConnectRecord> poll() {
- return null;
+ List<ConnectRecord> connectRecords = new ArrayList<>();
+ try {
+ String line;
+ while ((line = bufferedReader.readLine()) != null) {
+ ConnectRecord connectRecord = new ConnectRecord(new
RecordPartition(), new RecordOffset(), System.currentTimeMillis(), line);
Review Comment:
I didn't see that this Connector implements memory limitation and fragmented
reads through offset. If it is indeed achieved, could you explain how it was
achieved? Thank you.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]