-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature][scaleph-workflow] update scaleph workflow (#699)
* feature: flink kuberentes job detail web * feature: flink kuberentes job detail web * feature: add queue module * feature: update workflow * feature: upgrade workflow implementions * feature: upgrade workflow implementions * feature: upgrade workflow implementions * feature: upgrade workflow implementions * feature: upgrade workflow implementions * feature: upgrade workflow implementions * feature: upgrade workflow implementions * feature: upgrade workflow implementions * feature: upgrade workflow implementions * feature: update workflow * feature: add redission dependency * feature: add pekko dependency * feature: add pekko dependency * feature: add pekko dependency --------- Co-authored-by: wangqi <wangqi@xinxuan.net>
- Loading branch information
Showing
71 changed files
with
1,761 additions
and
201 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
75 changes: 75 additions & 0 deletions
75
scaleph-api/src/main/java/cn/sliew/scaleph/api/config/PekkoConfig.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,75 @@ | ||
/* | ||
* 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 cn.sliew.scaleph.api.config; | ||
|
||
import org.apache.pekko.actor.typed.ActorSystem; | ||
import org.apache.pekko.actor.typed.SpawnProtocol; | ||
import org.apache.pekko.actor.typed.javadsl.Behaviors; | ||
import org.apache.pekko.cluster.ClusterEvent; | ||
import org.apache.pekko.cluster.typed.Cluster; | ||
import org.apache.pekko.cluster.typed.Join; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.boot.ApplicationArguments; | ||
import org.springframework.boot.ApplicationRunner; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Configuration | ||
public class PekkoConfig { | ||
|
||
@Value("${spring.application.name}") | ||
private String application; | ||
|
||
@Bean(destroyMethod = "terminate") | ||
public ActorSystem<SpawnProtocol.Command> actorSystem() { | ||
ActorSystem<SpawnProtocol.Command> actorSystem = ActorSystem.create(Behaviors.setup(ctx -> SpawnProtocol.create()), application); | ||
actorSystem.whenTerminated().onComplete(done -> { | ||
if (done.isSuccess()) { | ||
actorSystem.log().info("pekko ActorSystem terminate success!"); | ||
} else { | ||
actorSystem.log().error("pekko ActorSystem terminate failure!", done.failed().get()); | ||
} | ||
return done.get(); | ||
}, actorSystem.executionContext()); | ||
return actorSystem; | ||
} | ||
|
||
@Bean | ||
public Cluster actorCluster(ActorSystem actorSystem) { | ||
return Cluster.get(actorSystem); | ||
} | ||
|
||
@Component | ||
public static class PekkoClusterBootstrap implements ApplicationRunner { | ||
|
||
@Autowired | ||
private Cluster cluster; | ||
|
||
@Override | ||
public void run(ApplicationArguments args) throws Exception { | ||
cluster.manager().tell(Join.create(cluster.selfMember().address())); | ||
ClusterEvent.CurrentClusterState state = cluster.state(); | ||
// cluster.subscriptions().tell(Subscribe.create(null, ClusterEvent.MemberEvent.class)); | ||
} | ||
} | ||
|
||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
pekko { | ||
log-config-on-start = on | ||
actor { | ||
provider = "cluster" | ||
default-dispatcher { | ||
fork-join-executor { | ||
parallelism-min = 8 | ||
parallelism-factor = 3.0 | ||
parallelism-max = 128 | ||
} | ||
} | ||
} | ||
|
||
cluster { | ||
log-info = on | ||
log-info-verbose = on | ||
min-nr-of-members = 1 | ||
} | ||
|
||
serialization.jackson { | ||
deserialization-features { | ||
FAIL_ON_UNKNOWN_PROPERTIES = off | ||
} | ||
} | ||
} |
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
60 changes: 0 additions & 60 deletions
60
scaleph-common/src/main/java/cn/sliew/scaleph/common/concurrent/RunnableWrapper.java
This file was deleted.
Oops, something went wrong.
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.