-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(#2002): Align adapter registration with other pipeline elements * Fix checkstyle * style: remove trailing whitespace * Add initial draft of migration concept * refactor: fix logger configuration * refactor: extend storage implementations by method to get all instances by the app id * refactor: update generated typescript model * feat: add version to models & builders * refactor: implement string representation of Notification * feat: implement data model for migration * feat: register migrations at service * Revert "refactor: implement string representation of Notification" This reverts commit 646e792. * refactor: use correct Notification class * feat: introduce migrate extensions resource * feat: introduce migrate adapter endpoint * feat: implement adapter migration at the core * remove data lake migration * ensure order & uniqueness of migrations * remove redundant exception * remove redundant exception * add tests * remove outdated test * refactor: separate adapter migration from pipeline element migrations * refactor: move MigrationResult to StreamPipes model * refactor: migration result * refactor: introduce generic migration request * feat: send migration requests to core * feat: process migrations at core * refactor: remove legacy generic * refactor: introduce versioned StreamPipes entity * refactor: remove deprecated generic type * feat: implement migration for processing elements & data sinks * docs: add endpoint documentation * refactor: move to correct module * feature: add update for descriptions * refactor: adapt ProcessingElementBuilder to be capable of versions * refactor: minor improvements * style: fix checkstyle issues * refactor: remove legacy type definition * refactor: update generated TS models * fix: add missing license header * Fix adapter model migration, add OPC adapter migration as sample * Fix typo * Extract MigrationResource logic into smaller units * Use single request for submitting migrations from extensions to core * Improve execution order of migrations and service startup tasks * Improve exception logging * Improve pipeline health check * Properly execute migration of adapter models * Fix adapter model migration * Improve service health check * Add more checks to adapter migration * Simplify migration request handling * Fix registration --------- Co-authored-by: bossenti <[email protected]>
- Loading branch information
1 parent
2c60d52
commit 552f3fe
Showing
36 changed files
with
692 additions
and
198 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...l/src/main/java/org/apache/streampipes/model/configuration/SpCoreConfigurationStatus.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* 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.model.configuration; | ||
|
||
public enum SpCoreConfigurationStatus { | ||
INSTALLING, | ||
MIGRATING, | ||
READY | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
...l/src/main/java/org/apache/streampipes/model/extensions/svcdiscovery/SpServiceStatus.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* 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.model.extensions.svcdiscovery; | ||
|
||
public enum SpServiceStatus { | ||
REGISTERED, | ||
MIGRATING, | ||
HEALTHY, | ||
UNHEALTHY | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
...agement/src/main/java/org/apache/streampipes/manager/health/CoreServiceStatusManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* 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.manager.health; | ||
|
||
import org.apache.streampipes.model.configuration.SpCoreConfiguration; | ||
import org.apache.streampipes.model.configuration.SpCoreConfigurationStatus; | ||
import org.apache.streampipes.storage.api.ISpCoreConfigurationStorage; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
public class CoreServiceStatusManager { | ||
|
||
private static final Logger LOG = LoggerFactory.getLogger(CoreServiceStatusManager.class); | ||
|
||
private final ISpCoreConfigurationStorage storage; | ||
|
||
public CoreServiceStatusManager(ISpCoreConfigurationStorage storage) { | ||
this.storage = storage; | ||
} | ||
|
||
public boolean existsConfig() { | ||
return storage.exists(); | ||
} | ||
|
||
public boolean isCoreReady() { | ||
return existsConfig() && storage.get().getServiceStatus() == SpCoreConfigurationStatus.READY; | ||
} | ||
|
||
public void updateCoreStatus(SpCoreConfigurationStatus status) { | ||
var config = storage.get(); | ||
config.setServiceStatus(status); | ||
storage.updateElement(config); | ||
logService(config); | ||
} | ||
|
||
private void logService(SpCoreConfiguration coreConfig) { | ||
LOG.info( | ||
"Core is now in {} state", | ||
coreConfig.getServiceStatus() | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.