Skip to content

Commit

Permalink
Merge a164a4a into e282ba0
Browse files Browse the repository at this point in the history
  • Loading branch information
efonsell committed Oct 22, 2019
2 parents e282ba0 + a164a4a commit 8522073
Show file tree
Hide file tree
Showing 15 changed files with 69 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@
- Add MariaDB support
- Add Kotlin example using nFlow with Spring Boot, and integrated nFlow Explorer
- Expose wakeup via REST-API
- Update database indices to match workflow instance polling code

**Details**
- `nflow-engine`
- Separate workflow definition scanning from `WorkflowDefinitionService` by introducing `WorkflowDefinitionSpringBeanScanner` and `WorkflowDefinitionClassNameScanner`. This allows breaking the circular dependency when a workflow definition uses `WorkflowInstanceService` (which depends on `WorkflowDefinitionService`, which depended on all workflow definitions). This enabled using constructor injection in all nFlow classes.
- Add `disableMariaDbDriver` to default MySQL JDBC URL so that in case there are both MySQL and MariaDB JDBC drivers in the classpath then MariaDB will not steal the MySQL URL.
- Add support for `nflow.db.mariadb` profile.
- Update database indices to match current workflow instance polling code.
- Create indices for foreign keys in MS SQL database.
- Fix create database scripts to work with empty database.
- Dependency updates:
- reactor.netty 0.8.11.RELEASE
- jackson 2.9.10
Expand Down
2 changes: 2 additions & 0 deletions nflow-engine/src/main/resources/scripts/db/db2.create.ddl.sql
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ create or replace trigger nflow_workflow_update_modified
drop index nflow_workflow_activation;
create index nflow_workflow_activation on nflow_workflow(next_activation, modified);

create index nflow_workflow_polling on nflow_workflow(next_activation, status, executor_id, executor_group);

create table nflow_workflow_action (
id int primary key generated always as identity,
workflow_id int not null,
Expand Down
2 changes: 2 additions & 0 deletions nflow-engine/src/main/resources/scripts/db/h2.create.ddl.sql
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ create unique index if not exists nflow_workflow_uniq on nflow_workflow (type, e

create index if not exists nflow_workflow_next_activation on nflow_workflow(next_activation, modified);

create index if not exists nflow_workflow_polling on nflow_workflow(next_activation, status, executor_id, executor_group);

create table if not exists nflow_workflow_action (
id int not null auto_increment primary key,
workflow_id int not null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ create table if not exists nflow_workflow (
drop index nflow_workflow_activation;
create index nflow_workflow_activation on nflow_workflow(next_activation, modified);

create index nflow_workflow_polling on nflow_workflow(next_activation, status, executor_id, executor_group);

create table if not exists nflow_workflow_action (
id int not null auto_increment primary key,
workflow_id int not null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ create table if not exists nflow_workflow (
drop index nflow_workflow_activation;
create index nflow_workflow_activation on nflow_workflow(next_activation, modified);

create index nflow_workflow_polling on nflow_workflow(next_activation, status, executor_id, executor_group);

drop trigger if exists nflow_workflow_insert;

create trigger nflow_workflow_insert before insert on `nflow_workflow`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ create table nflow_workflow (
create index nflow_workflow_activation on nflow_workflow (next_activation)
/

create index nflow_workflow_polling on nflow_workflow (next_activation, status, executor_id, executor_group)
/

create sequence nflow_workflow_id_seq
/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ create trigger update_nflow_modified before update on nflow_workflow for each ro
drop index if exists nflow_workflow_activation;
create index nflow_workflow_activation on nflow_workflow(next_activation, modified);

drop index if exists nflow_workflow_polling;
create index nflow_workflow_polling on nflow_workflow(next_activation, status, executor_id, executor_group);

create type action_type as enum ('stateExecution', 'stateExecutionFailed', 'recovery', 'externalChange');
create table if not exists nflow_workflow_action (
id serial primary key,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ end;
drop index nflow_workflow_activation;
create index nflow_workflow_activation on nflow_workflow(next_activation, modified);

create index nflow_workflow_polling on nflow_workflow(next_activation, status, executor_id, executor_group);

create table nflow_workflow_action (
id int not null identity(1,1) primary key,
workflow_id int not null,
Expand All @@ -46,12 +48,18 @@ create table nflow_workflow_action (
constraint nflow_workflow_action_uniq unique (workflow_id, id)
);

create index nflow_workflow_action_workflow on nflow_workflow_action(workflow_id);

alter table nflow_workflow add constraint fk_workflow_parent
foreign key (parent_workflow_id, parent_action_id) references nflow_workflow_action (workflow_id, id) on update no action;

create index nflow_workflow_parent on nflow_workflow(parent_workflow_id, parent_action_id);

alter table nflow_workflow add constraint fk_workflow_root
foreign key (root_workflow_id) references nflow_workflow (id) on update no action;

create index nflow_workflow_root on nflow_workflow(root_workflow_id);

create table nflow_workflow_state (
workflow_id int not null,
action_id int not null,
Expand All @@ -61,6 +69,8 @@ create table nflow_workflow_state (
foreign key (workflow_id) references nflow_workflow(id) on delete cascade
);

create index nflow_workflow_state_workflow on nflow_workflow_state(workflow_id);

create table nflow_executor (
id int not null identity(1,1) primary key,
host varchar(253) not null,
Expand Down Expand Up @@ -120,6 +130,14 @@ create table nflow_archive_workflow (
constraint nflow_archive_workflow_uniq unique (type, external_id, executor_group)
);

create index nflow_archive_workflow_activation on nflow_archive_workflow(next_activation, modified);

create index nflow_archive_workflow_polling on nflow_archive_workflow(next_activation, status, executor_id, executor_group);

create index nflow_archive_workflow_parent on nflow_archive_workflow(parent_workflow_id, parent_action_id);

create index nflow_archive_workflow_root on nflow_archive_workflow(root_workflow_id);

create table nflow_archive_workflow_action (
id int not null primary key,
workflow_id int not null,
Expand All @@ -134,6 +152,8 @@ create table nflow_archive_workflow_action (
constraint nflow_archive_workflow_action_uniq unique (workflow_id, id)
);

create index nflow_archive_workflow_action_workflow on nflow_archive_workflow_action(workflow_id);

create table nflow_archive_workflow_state (
workflow_id int not null,
action_id int not null,
Expand All @@ -142,3 +162,5 @@ create table nflow_archive_workflow_state (
primary key (workflow_id, action_id, state_key),
foreign key (workflow_id) references nflow_archive_workflow(id) on delete cascade
);

create index nflow_archive_workflow_state_workflow on nflow_archive_workflow_state(workflow_id);
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
create index nflow_workflow_polling on nflow_workflow(next_activation, status, executor_id, executor_group);
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
create index if not exists nflow_workflow_polling on nflow_workflow(next_activation, status, executor_id, executor_group);
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
create index nflow_workflow_polling on nflow_workflow(next_activation, status, executor_id, executor_group);
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
create index nflow_workflow_polling on nflow_workflow(next_activation, status, executor_id, executor_group);
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
create index nflow_workflow_polling on nflow_workflow (next_activation, status, executor_id, executor_group)
/
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
drop index if exists nflow_workflow_polling;
create index nflow_workflow_polling on nflow_workflow(next_activation, status, executor_id, executor_group);
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
create index nflow_workflow_polling on nflow_workflow(next_activation, status, executor_id, executor_group);

create index nflow_workflow_parent on nflow_workflow(parent_workflow_id, parent_action_id);

create index nflow_workflow_root on nflow_workflow(root_workflow_id);

create index nflow_workflow_action_workflow on nflow_workflow_action(workflow_id);

create index nflow_workflow_state_workflow on nflow_workflow_state(workflow_id);

create index nflow_archive_workflow_activation on nflow_archive_workflow(next_activation, modified);

create index nflow_archive_workflow_polling on nflow_archive_workflow(next_activation, status, executor_id, executor_group);

create index nflow_archive_workflow_parent on nflow_archive_workflow(parent_workflow_id, parent_action_id);

create index nflow_archive_workflow_root on nflow_archive_workflow(root_workflow_id);

create index nflow_archive_workflow_action_workflow on nflow_archive_workflow_action(workflow_id);

create index nflow_archive_workflow_state_workflow on nflow_archive_workflow_state(workflow_id);

0 comments on commit 8522073

Please sign in to comment.