-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(jdbc): implementation of MultipleConditionStorage
- Loading branch information
1 parent
334f895
commit 521ddde
Showing
18 changed files
with
341 additions
and
50 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
15 changes: 15 additions & 0 deletions
15
jdbc-mysql/src/main/java/io/kestra/runner/mysql/MysqlMultipleConditionStorage.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,15 @@ | ||
package io.kestra.runner.mysql; | ||
|
||
import io.kestra.core.models.triggers.multipleflows.MultipleConditionWindow; | ||
import io.kestra.jdbc.runner.AbstractJdbcMultipleConditionStorage; | ||
import io.kestra.repository.mysql.MysqlRepository; | ||
import io.micronaut.context.ApplicationContext; | ||
import jakarta.inject.Singleton; | ||
|
||
@Singleton | ||
@MysqlQueueEnabled | ||
public class MysqlMultipleConditionStorage extends AbstractJdbcMultipleConditionStorage { | ||
public MysqlMultipleConditionStorage(ApplicationContext applicationContext) { | ||
super(new MysqlRepository<>(MultipleConditionWindow.class, applicationContext)); | ||
} | ||
} |
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
35 changes: 35 additions & 0 deletions
35
jdbc-mysql/src/test/java/io/kestra/runner/mysql/MysqlMultipleConditionStorageTest.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,35 @@ | ||
package io.kestra.runner.mysql; | ||
|
||
import io.kestra.core.models.flows.Flow; | ||
import io.kestra.core.models.triggers.multipleflows.AbstractMultipleConditionStorageTest; | ||
import io.kestra.core.models.triggers.multipleflows.MultipleConditionStorageInterface; | ||
import io.kestra.core.models.triggers.multipleflows.MultipleConditionWindow; | ||
import io.kestra.jdbc.JdbcTestUtils; | ||
import io.micronaut.context.ApplicationContext; | ||
import jakarta.inject.Inject; | ||
import org.junit.jupiter.api.BeforeEach; | ||
|
||
import java.util.List; | ||
|
||
class MysqlMultipleConditionStorageTest extends AbstractMultipleConditionStorageTest { | ||
@Inject | ||
ApplicationContext applicationContext; | ||
|
||
@Inject | ||
JdbcTestUtils jdbcTestUtils; | ||
|
||
protected MultipleConditionStorageInterface multipleConditionStorage() { | ||
return new MysqlMultipleConditionStorage(applicationContext); | ||
} | ||
|
||
protected void save(MultipleConditionStorageInterface multipleConditionStorage, Flow flow, List<MultipleConditionWindow> multipleConditionWindows) { | ||
((MysqlMultipleConditionStorage) multipleConditionStorage).save(multipleConditionWindows); | ||
} | ||
|
||
|
||
@BeforeEach | ||
protected void init() { | ||
jdbcTestUtils.drop(); | ||
jdbcTestUtils.migrate(); | ||
} | ||
} |
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
15 changes: 15 additions & 0 deletions
15
jdbc-postgres/src/main/java/io/kestra/runner/postgres/PostgresMultipleConditionStorage.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,15 @@ | ||
package io.kestra.runner.postgres; | ||
|
||
import io.kestra.core.models.triggers.multipleflows.MultipleConditionWindow; | ||
import io.kestra.jdbc.runner.AbstractJdbcMultipleConditionStorage; | ||
import io.kestra.repository.postgres.PostgresRepository; | ||
import io.micronaut.context.ApplicationContext; | ||
import jakarta.inject.Singleton; | ||
|
||
@Singleton | ||
@PostgresQueueEnabled | ||
public class PostgresMultipleConditionStorage extends AbstractJdbcMultipleConditionStorage { | ||
public PostgresMultipleConditionStorage(ApplicationContext applicationContext) { | ||
super(new PostgresRepository<>(MultipleConditionWindow.class, applicationContext)); | ||
} | ||
} |
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.