Skip to content

Commit

Permalink
Implement the new internal flow engine for Maestro. (#79)
Browse files Browse the repository at this point in the history
* Implement the new internal flow engine for Maestro.
It uses Java virtual thread feature to greatly simplify the concurrency handling.
It is a highly optimized flow engine to power Maestro engine.

* minor improvements

* fix the incorrect flow deletion during shutdown

* Add task retry during resuming

* fix a few bugs and add some extra java docs

* Improve wakeup and timeout and add an active flag
  • Loading branch information
jun-he authored Jan 22, 2025
1 parent 42abcda commit 4e258d1
Show file tree
Hide file tree
Showing 48 changed files with 3,065 additions and 9 deletions.
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,7 @@ configure([project(':maestro-common'), project(':maestro-engine')]) {
pmdTestFixtures.enabled = true
}
}

configure([project(':maestro-flow'), project(':maestro-database')]) {
apply plugin: 'java-library'
}
1 change: 1 addition & 0 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ ext {
conductorDep = 'com.netflix.conductor:conductor-core:2.31.5'
hikaricpDep = 'com.zaxxer:HikariCP:4.+'
flywayDep = 'org.flywaydb:flyway-core:7.6.+'
jacksonAnnotationsDep = 'com.fasterxml.jackson.core:jackson-annotations:2.+'
jacksonDatabindDep = 'com.fasterxml.jackson.core:jackson-databind:2.+'
jacksonYamlDep = 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.+'
javaxInjectDep = 'javax.inject:javax.inject:1'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.netflix.maestro.exceptions;

import com.netflix.maestro.models.error.Details;
import lombok.Getter;

@Getter
public class MaestroDatabaseError extends MaestroRuntimeException {
private static final long serialVersionUID = 7334668492533395123L;

private final Details details;

/**
* Constructor with error message and details.
*
* @param cause cause exception
*/
public MaestroDatabaseError(Throwable cause, String msg) {
super(Code.INTERNAL_ERROR, msg, cause);
this.details = Details.create(cause, false, msg);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* 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 com.netflix.maestro.engine.metrics;
package com.netflix.maestro.metrics;

/** Maestro metrics interface to record metrics. */
public interface MaestroMetrics {
Expand Down
4 changes: 4 additions & 0 deletions maestro-database/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Maestro Database
===================================
This module includes general classes to implement a maestro persistence layer over JDBC for a specific database system.
It also includes the utility interfaces needed by maestro components.
12 changes: 12 additions & 0 deletions maestro-database/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
dependencies {
implementation project(':maestro-common')
implementation jacksonDatabindDep
api hikaricpDep
api flywayDep

testImplementation flywayDep
testImplementation testcontainerDep
testImplementation postgresqlDep
testImplementation hikaricpDep
testRuntimeOnly slf4jLog4jDep
}
12 changes: 12 additions & 0 deletions maestro-database/gradle.lockfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This is a Gradle generated file for dependency locking.
# Manual edits can break the build and are not advised.
# This file is expected to be part of source control.
com.fasterxml.jackson.core:jackson-annotations:2.15.4=compileClasspath
com.fasterxml.jackson.core:jackson-core:2.15.4=compileClasspath
com.fasterxml.jackson.core:jackson-databind:2.15.4=compileClasspath
com.fasterxml.jackson:jackson-bom:2.15.4=compileClasspath
com.zaxxer:HikariCP:4.0.3=compileClasspath
org.flywaydb:flyway-core:7.6.0=compileClasspath
org.projectlombok:lombok:1.18.36=annotationProcessor,compileClasspath
org.slf4j:slf4j-api:1.7.30=compileClasspath
empty=
Loading

0 comments on commit 4e258d1

Please sign in to comment.