You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@streampipes.apache.org by "bossenti (via GitHub)" <gi...@apache.org> on 2023/10/23 12:10:37 UTC

[PR] 2045 implement migration for adapter and pipeline element configurations

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

   <!--
     ~ 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.
   -->
   
   ### Remarks
   <!--
   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/no>
   
   PR introduces (a) deprecation(s): <yes/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


Re: [PR] implement migration for adapter and pipeline element configurations

Posted by "dominikriemer (via GitHub)" <gi...@apache.org>.
dominikriemer commented on PR #2077:
URL: https://github.com/apache/streampipes/pull/2077#issuecomment-1783784303

   I create a PR which breaks down the migration into smaller code units and creates a single request from extensions to core for submitting migration configs: #2101 


-- 
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


Re: [PR] implement migration for adapter and pipeline element configurations

Posted by "dominikriemer (via GitHub)" <gi...@apache.org>.
dominikriemer commented on PR #2077:
URL: https://github.com/apache/streampipes/pull/2077#issuecomment-1784599619

   @bossenti I didn't address the comments above - do you know where the equals method is used from the `AdapterMigrator` or can we change it to an interface?


-- 
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


Re: [PR] implement migration for adapter and pipeline element configurations

Posted by "bossenti (via GitHub)" <gi...@apache.org>.
bossenti commented on PR #2077:
URL: https://github.com/apache/streampipes/pull/2077#issuecomment-1784613714

   @dominikriemer Yes it is. We use it to determine if a migration has already been registered at the extensions service so that we can't register the same migration multiple times.


-- 
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


Re: [PR] implement migration for adapter and pipeline element configurations

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


##########
streampipes-model/src/main/java/org/apache/streampipes/model/graph/DataProcessorInvocation.java:
##########
@@ -67,28 +69,31 @@ public DataProcessorInvocation(DataProcessorInvocation other) {
     }
     this.pathName = other.getPathName();
     this.category = new Cloner().epaTypes(other.getCategory());
+    this.serviceTagPrefix = SpServiceTagPrefix.DATA_PROCESSOR;
   }
 
   public DataProcessorInvocation(DataProcessorDescription sepa, String domId) {
     this(sepa);
     this.dom = domId;
+    this.serviceTagPrefix = SpServiceTagPrefix.DATA_PROCESSOR;

Review Comment:
   Can this line be removed since it's already assigned in the called constructor?



-- 
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


Re: [PR] implement migration for adapter and pipeline element configurations

Posted by "bossenti (via GitHub)" <gi...@apache.org>.
bossenti commented on PR #2077:
URL: https://github.com/apache/streampipes/pull/2077#issuecomment-1784580188

   @dominikriemer you already addressed all your comments in your PR #2101, right?


-- 
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


Re: [PR] implement migration for adapter and pipeline element configurations

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


##########
streampipes-extensions-api/src/main/java/org/apache/streampipes/extensions/api/migration/AdapterMigrator.java:
##########
@@ -0,0 +1,33 @@
+/*
+ * 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.
+ *
+ */
+
+package org.apache.streampipes.extensions.api.migration;
+
+import org.apache.streampipes.extensions.api.extractor.IStaticPropertyExtractor;
+import org.apache.streampipes.model.connect.adapter.AdapterDescription;
+
+public abstract class AdapterMigrator implements ModelMigrator<AdapterDescription, IStaticPropertyExtractor> {
+
+  @Override
+  public boolean equals(Object obj) {
+    if (obj instanceof ModelMigrator<?, ?>) {
+      return this.config().equals(((ModelMigrator<?, ?>) obj).config());
+    }
+    return false;

Review Comment:
   Just out of curiosity, where is this `equals` method used? Is this the only reason the `AdapterMigrator` has to be an abstract class instead of an interface?



-- 
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


Re: [PR] implement migration for adapter and pipeline element configurations

Posted by "dominikriemer (via GitHub)" <gi...@apache.org>.
dominikriemer commented on PR #2077:
URL: https://github.com/apache/streampipes/pull/2077#issuecomment-1783753304

   @bossenti Is there a reason why we have two endpoints at the core side for managing migrations of adapters and pipeline elements?
   Does it have any implications if we remove the filtering logic from `ExtensionsModelSubmitter` to the core and have a single migration method there for adapters and pipeline elements?
   This would ease managing the status of services.


-- 
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


Re: [PR] implement migration for adapter and pipeline element configurations

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


-- 
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


Re: [PR] implement migration for adapter and pipeline element configurations

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


##########
streampipes-model/src/main/java/org/apache/streampipes/model/graph/DataSinkInvocation.java:
##########
@@ -51,16 +53,19 @@ public DataSinkInvocation(DataSinkDescription other) {
     this.setIncludesAssets(other.isIncludesAssets());
     this.setElementId(ElementIdGenerator.makeElementId(this));
     this.setIncludedAssets(other.getIncludedAssets());
+    this.serviceTagPrefix = SpServiceTagPrefix.DATA_SINK;
   }
 
   public DataSinkInvocation(DataSinkDescription sec, String domId) {
     this(sec);
     this.setDom(domId);
+    this.serviceTagPrefix = SpServiceTagPrefix.DATA_SINK;

Review Comment:
   same here



-- 
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


Re: [PR] implement migration for adapter and pipeline element configurations

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


##########
streampipes-client/src/main/java/org/apache/streampipes/client/api/AdminApi.java:
##########
@@ -98,4 +112,16 @@ private StreamPipesApiPath getFunctionsPath() {
   private StreamPipesApiPath getDeleteFunctionPath(String functionId) {
     return getFunctionsPath().addToPath(functionId);
   }
+
+  private StreamPipesApiPath getAdapterMigrationPath() {
+    return StreamPipesApiPath
+            .fromBaseApiPath()
+            .addToPath("migrations/adapter");

Review Comment:
   I suggest to use `addToPath` for every URL part: `addToPath("migrations").addToPath("adapter") and then to reuse the migrations path in a constant



-- 
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