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 2023/01/18 20:59:42 UTC

[GitHub] [streampipes] tenthe opened a new pull request, #1122: [#1121] Add replay once option to FileStreamProtocol

tenthe opened a new pull request, #1122:
URL: https://github.com/apache/streampipes/pull/1122

   <!--
     ~ 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.
     ~
     -->
     
     <!--
   Thanks for contributing! Here are some tips you can follow to help us incorporate your contribution quickly and easily:
   1. If this is your first time, please read our contributor guidelines:
       - https://streampipes.apache.org/getinvolved.html
       - https://cwiki.apache.org/confluence/display/STREAMPIPES/Getting+Started
   2. Make sure the PR title is formatted like: `[#<GitHub issue id>] PR title ...`
   3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., `[WIP][#<GitHub issue id>] PR title ...`.
   4. Please write your PR title to summarize what this PR proposes/fixes.
   5. Link the PR to the corresponding GitHub issue (if present) in the `Development` section in the right menu bar. 
   6. Be sure to keep the PR description updated to reflect all changes.
   7. If possible, provide a concise example to reproduce the issue for a faster review.
   8. Make sure tests pass via `mvn clean install`.
   9. (Optional) If the contribution is large, please file an Apache ICLA
       - http://apache.org/licenses/icla.pdf
   -->
   
   ### Purpose
   <!--
   Please clarify what changes you are proposing and describe how those changes will address the issue.
   Furthermore, describe potential consequences the changes might have.
   -->
   - Fixes #1121
   - Implements the ability for the `FileStreamAdapter` to replay a file only once
   - Additional parameter added to the `FileStreamAdapter` configuration to enable this feature
   - Default behavior set to continuously replay the file
   
   ### Remarks
   @dominikriemer do we need an update script for old adapters using the `FileStreamAdapters`?
   Since we will update the connection API, should we implement this update now or later for the new data model?
   <!--
   Is there anything left we need to pay attention on?
   Are there some references that might be important? E.g. links to Confluence, or discussions
   on the mailing list or GitHub.
   -->
   PR introduces (a) breaking change(s): yes
   PR introduces (a) deprecation(s): no
   


-- 
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: dev-unsubscribe@streampipes.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [streampipes] tenthe commented on a diff in pull request #1122: [#1121] Add replay once option to FileStreamProtocol

Posted by "tenthe (via GitHub)" <gi...@apache.org>.
tenthe commented on code in PR #1122:
URL: https://github.com/apache/streampipes/pull/1122#discussion_r1083265528


##########
streampipes-extensions/streampipes-connect-adapters-iiot/src/main/java/org/apache/streampipes/connect/iiot/protocol/stream/FileStreamProtocol.java:
##########
@@ -199,10 +274,16 @@ public ProtocolDescription declareModel() {
         .withLocales(Locales.EN)
         .sourceType(AdapterSourceType.STREAM)
         .category(AdapterType.Generic)
-        .requiredFile(Labels.withId("filePath"), Filetypes.CSV, Filetypes.JSON, Filetypes.XML)
-        .requiredMultiValueSelection(Labels.withId("replaceTimestamp"),
+        .requiredFile(Labels.withId(FILE_PATH), Filetypes.CSV, Filetypes.JSON, Filetypes.XML)
+        .requiredMultiValueSelection(Labels.withId(REPLACE_TIMESTAMP),
             Options.from(""))
-        .requiredFloatParameter(Labels.withId("speed"))
+        .requiredSingleValueSelection(Labels.withId(REPLAY_ONCE), Options.from("no", "yes"))
+        .requiredAlternatives(Labels.withId(SPEED),
+            Alternatives.from(Labels.withId(KEEP_ORIGINAL_TIME), true),
+            Alternatives.from(Labels.withId(FASTEST)),
+            Alternatives.from(Labels.withId(SPEED_UP_FACTOR),
+                StaticProperties.group(Labels.withId("speed-up-factor-group"),

Review Comment:
   Good point. I left it as a String because it is only used once, but I can change it to a variable



-- 
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: dev-unsubscribe@streampipes.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [streampipes] bossenti commented on a diff in pull request #1122: [#1121] Add replay once option to FileStreamProtocol

Posted by "bossenti (via GitHub)" <gi...@apache.org>.
bossenti commented on code in PR #1122:
URL: https://github.com/apache/streampipes/pull/1122#discussion_r1083270693


##########
streampipes-extensions/streampipes-connect-adapters-iiot/src/main/java/org/apache/streampipes/connect/iiot/protocol/stream/FileStreamProtocol.java:
##########
@@ -199,10 +274,16 @@ public ProtocolDescription declareModel() {
         .withLocales(Locales.EN)
         .sourceType(AdapterSourceType.STREAM)
         .category(AdapterType.Generic)
-        .requiredFile(Labels.withId("filePath"), Filetypes.CSV, Filetypes.JSON, Filetypes.XML)
-        .requiredMultiValueSelection(Labels.withId("replaceTimestamp"),
+        .requiredFile(Labels.withId(FILE_PATH), Filetypes.CSV, Filetypes.JSON, Filetypes.XML)
+        .requiredMultiValueSelection(Labels.withId(REPLACE_TIMESTAMP),
             Options.from(""))
-        .requiredFloatParameter(Labels.withId("speed"))
+        .requiredSingleValueSelection(Labels.withId(REPLAY_ONCE), Options.from("no", "yes"))
+        .requiredAlternatives(Labels.withId(SPEED),
+            Alternatives.from(Labels.withId(KEEP_ORIGINAL_TIME), true),
+            Alternatives.from(Labels.withId(FASTEST)),
+            Alternatives.from(Labels.withId(SPEED_UP_FACTOR),
+                StaticProperties.group(Labels.withId("speed-up-factor-group"),

Review Comment:
   I see, would just be for the sake of consistency



-- 
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: dev-unsubscribe@streampipes.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [streampipes] bossenti commented on a diff in pull request #1122: [#1121] Add replay once option to FileStreamProtocol

Posted by "bossenti (via GitHub)" <gi...@apache.org>.
bossenti commented on code in PR #1122:
URL: https://github.com/apache/streampipes/pull/1122#discussion_r1082919131


##########
streampipes-extensions/streampipes-connect-adapters-iiot/src/main/java/org/apache/streampipes/connect/iiot/protocol/stream/FileStreamProtocol.java:
##########
@@ -199,10 +274,16 @@ public ProtocolDescription declareModel() {
         .withLocales(Locales.EN)
         .sourceType(AdapterSourceType.STREAM)
         .category(AdapterType.Generic)
-        .requiredFile(Labels.withId("filePath"), Filetypes.CSV, Filetypes.JSON, Filetypes.XML)
-        .requiredMultiValueSelection(Labels.withId("replaceTimestamp"),
+        .requiredFile(Labels.withId(FILE_PATH), Filetypes.CSV, Filetypes.JSON, Filetypes.XML)
+        .requiredMultiValueSelection(Labels.withId(REPLACE_TIMESTAMP),
             Options.from(""))
-        .requiredFloatParameter(Labels.withId("speed"))
+        .requiredSingleValueSelection(Labels.withId(REPLAY_ONCE), Options.from("no", "yes"))
+        .requiredAlternatives(Labels.withId(SPEED),
+            Alternatives.from(Labels.withId(KEEP_ORIGINAL_TIME), true),
+            Alternatives.from(Labels.withId(FASTEST)),
+            Alternatives.from(Labels.withId(SPEED_UP_FACTOR),
+                StaticProperties.group(Labels.withId("speed-up-factor-group"),

Review Comment:
   Do we want to use a variable here as well?



-- 
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: dev-unsubscribe@streampipes.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [streampipes] tenthe merged pull request #1122: [#1121] Add replay once option to FileStreamProtocol

Posted by "tenthe (via GitHub)" <gi...@apache.org>.
tenthe merged PR #1122:
URL: https://github.com/apache/streampipes/pull/1122


-- 
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: dev-unsubscribe@streampipes.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org