You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@streampipes.apache.org by GitBox <gi...@apache.org> on 2021/04/22 08:47:58 UTC
[GitHub] [incubator-streampipes-extensions] Samarth08 opened a new pull request #43: [STREAMPIPES-343] Added timeinterval between the two events
Samarth08 opened a new pull request #43:
URL: https://github.com/apache/incubator-streampipes-extensions/pull/43
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
Fixes: https://issues.apache.org/jira/browse/STREAMPIPES-343
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-streampipes-extensions] bossenti commented on pull request #43: [STREAMPIPES-343] Added timeinterval between the two events
Posted by GitBox <gi...@apache.org>.
bossenti commented on pull request #43:
URL: https://github.com/apache/incubator-streampipes-extensions/pull/43#issuecomment-829230030
@Samarth08, thanks for your proposal.
Unfortunately, your solution does not yet produce to the desired behavior.
The FileSetAdapter is meant to read a file, e.g. csv files, json files etc., at once and create an event for each instance described by the file.
In contrast to processing elements, it does not have an `onEvent` method.
Instead, the `run` method is called once when the adapter is invoked (in this case, when the corresponding pipeline is started).
Accordingly, the `parser.parse(in, stk)` emits all instances in the file before the waiting time begins and the `run` method ends.
Therefore, we need to come up with something different here. For example, we could extend the implementation of the `parse` method or create something similar to the `ZipFileIterator` you already imported.
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-streampipes-extensions] bossenti commented on a change in pull request #43: [STREAMPIPES-343] Added timeinterval between the two events
Posted by GitBox <gi...@apache.org>.
bossenti commented on a change in pull request #43:
URL: https://github.com/apache/incubator-streampipes-extensions/pull/43#discussion_r627508588
##########
File path: streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/protocol/set/FileProtocol.java
##########
@@ -79,11 +84,32 @@ public ProtocolDescription declareModel() {
@Override
public Protocol getInstance(ProtocolDescription protocolDescription, Parser parser, Format format) {
StaticPropertyExtractor extractor = StaticPropertyExtractor.from(protocolDescription.getConfig());
-
+ this.timeBetweenReplay = extractor.singleValueParameter(INTERVAL_KEY, Integer.class);
Review comment:
```suggestion
int timeBetweenReplay = extractor.singleValueParameter(INTERVAL_KEY, Integer.class);
```
##########
File path: streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/protocol/set/FileProtocol.java
##########
@@ -79,11 +84,32 @@ public ProtocolDescription declareModel() {
@Override
public Protocol getInstance(ProtocolDescription protocolDescription, Parser parser, Format format) {
StaticPropertyExtractor extractor = StaticPropertyExtractor.from(protocolDescription.getConfig());
-
+ this.timeBetweenReplay = extractor.singleValueParameter(INTERVAL_KEY, Integer.class);
String fileFetchUrl = extractor.selectedFileFetchUrl("filePath");
return new FileProtocol(parser, format, fileFetchUrl);
Review comment:
```suggestion
return new FileProtocol(parser, format, fileFetchUrl, timeBetweenReplay);
```
Please adapt the constructor accordingly
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-streampipes-extensions] bossenti merged pull request #43: [STREAMPIPES-343] Added timeinterval between the two events
Posted by GitBox <gi...@apache.org>.
bossenti merged pull request #43:
URL: https://github.com/apache/incubator-streampipes-extensions/pull/43
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-streampipes-extensions] Samarth08 commented on pull request #43: [STREAMPIPES-343] Added timeinterval between the two events
Posted by GitBox <gi...@apache.org>.
Samarth08 commented on pull request #43:
URL: https://github.com/apache/incubator-streampipes-extensions/pull/43#issuecomment-829334107
@bossenti I have added parse method which will emit individual events in the file.I have added time interval between each event.Let me know if this works for 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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-streampipes-extensions] bossenti commented on pull request #43: [STREAMPIPES-343] Added timeinterval between the two events
Posted by GitBox <gi...@apache.org>.
bossenti commented on pull request #43:
URL: https://github.com/apache/incubator-streampipes-extensions/pull/43#issuecomment-839560445
looks great, 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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-streampipes-extensions] Samarth08 commented on pull request #43: [STREAMPIPES-343] Added timeinterval between the two events
Posted by GitBox <gi...@apache.org>.
Samarth08 commented on pull request #43:
URL: https://github.com/apache/incubator-streampipes-extensions/pull/43#issuecomment-836311080
@bossenti I have made the suggested changes.
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org