edgent-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rui Shen (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (EDGENT-308) Is it possible to use poll() with FileStreams together
Date Thu, 10 Nov 2016 02:20:58 GMT

    [ https://issues.apache.org/jira/browse/EDGENT-308?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15652766#comment-15652766

Rui Shen commented on EDGENT-308:

Currently, our requirement is to return one line in the current file content every <poll>
unit (if users enable the <poll> feature). Otherwise, the default behavior is return
all lines in file without any interval. So for directoryWatcher method, the case is similar,
once new files are found and new content are loaded, we hope to return each line at the frequency
of <poll> unit. 

Actually we are not very sure if users will use it like this way or not, but we would like
provide this option to users. Eventually It's users' call to use it or not. 

What we are working on is a SDK, and it also includes some connectors. In general, we are
going to wrap Edgent connectors. In current release, we are planning to provide File, JDBC,Mqtt
and Kafka connectors. So maybe in future releases, we will provide more connectors, like CommandStreams.
So the reason why I said CommandStreams does not work for me is because we are working on
a SDK, but not just a solution. And for File connectors, we would like to provide <poll>
method, so I opened this issue in Edgent community. 

> Is it possible to use poll() with FileStreams together
> ------------------------------------------------------
>                 Key: EDGENT-308
>                 URL: https://issues.apache.org/jira/browse/EDGENT-308
>             Project: Edgent
>          Issue Type: New Feature
>          Components: Connectors
>            Reporter: Rui Shen
> My requirement is to load data from a file and polling with a specific frequency (say
every 1 second). 
> I found Topology.poll() can do this, but it requires a Supplier parameter and the get
method is called periodically. With this way, I have to read the file content myself and create
a Iterable instance, then a Supplier. 
> I want to use FileStreams.textFileReader() to handle the file reading. The problem is
how to use it with Topology.poll() together? I could not find a way to do this. 
> Is there any way to do this? Or connectors does not support "polling" at all? 

This message was sent by Atlassian JIRA

View raw message