Skip to content
This repository was archived by the owner on May 14, 2025. It is now read-only.

Commit a17662f

Browse files
committed
Update DAOs to no longer use aggregate
Update tests to remove Schema Version checks * Update tests so that they no longer use aggregate views * Update SimpleJobService MariaDB and PostgresDB to match was is in 2.11 tests This was to resolve the sporadic connection pool problems Remove AggregateJobQueryDao * remove unused tests * Update SimpleServiceFactory to remove use to the aggregate code Rename AggregateTaskconfigruation/AggreageTaskExplorer to an accurate name Rename aggregate package to composite Remove uses of AppBootSchema and spring-cloud-dataflow-schema-core module Re-enable more tests Remove or update tests that are Boot3 specific
1 parent 7a6567b commit a17662f

File tree

117 files changed

+370
-3643
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+370
-3643
lines changed

pom.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,7 @@
5858
<module>spring-cloud-dataflow-container-registry</module>
5959
<module>spring-cloud-dataflow-configuration-metadata</module>
6060
<module>spring-cloud-dataflow-core-dsl</module>
61-
<module>spring-cloud-dataflow-schema-core</module>
6261
<module>spring-cloud-dataflow-core</module>
63-
<module>spring-cloud-dataflow-schema</module>
6462
<module>spring-cloud-dataflow-aggregate-task</module>
6563
<module>spring-cloud-dataflow-server-core</module>
6664
<module>spring-cloud-dataflow-rest-resource</module>

spring-cloud-dataflow-aggregate-task/pom.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@
4040
<artifactId>spring-cloud-dataflow-registry</artifactId>
4141
<version>${project.version}</version>
4242
</dependency>
43-
<dependency>
44-
<groupId>org.springframework.cloud</groupId>
45-
<artifactId>spring-cloud-dataflow-schema</artifactId>
46-
<version>${project.version}</version>
47-
</dependency>
4843
<dependency>
4944
<groupId>org.slf4j</groupId>
5045
<artifactId>slf4j-api</artifactId>
Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,13 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package org.springframework.cloud.dataflow.aggregate.task;
16+
package org.springframework.cloud.dataflow.composite.task;
1717

1818
import javax.sql.DataSource;
1919

20-
import org.springframework.cloud.dataflow.aggregate.task.impl.DefaultAggregateTaskExplorer;
21-
import org.springframework.cloud.dataflow.schema.service.SchemaService;
22-
import org.springframework.cloud.dataflow.schema.service.SchemaServiceConfiguration;
20+
import org.springframework.cloud.dataflow.composite.task.impl.DefaultCompositeTaskExplorer;
2321
import org.springframework.context.annotation.Bean;
2422
import org.springframework.context.annotation.Configuration;
25-
import org.springframework.context.annotation.Import;
2623
import org.springframework.util.Assert;
2724

2825
/**
@@ -31,23 +28,20 @@
3128
* @author Corneil du Plessis
3229
*/
3330
@Configuration
34-
@Import(SchemaServiceConfiguration.class)
35-
public class AggregateTaskConfiguration {
31+
public class CompositeTaskConfiguration {
3632

3733
@Bean
38-
public AggregateTaskExplorer aggregateTaskExplorer(
34+
public CompositeTaskExplorer aggregateTaskExplorer(
3935
DataSource dataSource,
4036
DataflowTaskExecutionQueryDao taskExecutionQueryDao,
41-
SchemaService schemaService,
4237
TaskDefinitionReader taskDefinitionReader,
4338
TaskDeploymentReader taskDeploymentReader
4439
) {
4540
Assert.notNull(dataSource, "dataSource required");
4641
Assert.notNull(taskExecutionQueryDao, "taskExecutionQueryDao required");
47-
Assert.notNull(schemaService, "schemaService required");
4842
Assert.notNull(taskDefinitionReader, "taskDefinitionReader required");
4943
Assert.notNull(taskDeploymentReader, "taskDeploymentReader required");
50-
return new DefaultAggregateTaskExplorer(dataSource,
44+
return new DefaultCompositeTaskExplorer(dataSource,
5145
taskExecutionQueryDao,
5246
taskDefinitionReader,
5347
taskDeploymentReader);
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package org.springframework.cloud.dataflow.aggregate.task;
16+
package org.springframework.cloud.dataflow.composite.task;
1717

1818
import java.util.Collection;
1919
import java.util.Date;
@@ -29,7 +29,7 @@
2929
*
3030
* @author Corneil du Plessis
3131
*/
32-
public interface AggregateTaskExplorer {
32+
public interface CompositeTaskExplorer {
3333
/**
3434
* find a task execution given an execution id and schema target.
3535
*
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package org.springframework.cloud.dataflow.aggregate.task;
16+
package org.springframework.cloud.dataflow.composite.task;
1717

1818
import java.util.Collection;
1919
import java.util.Date;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.springframework.cloud.dataflow.aggregate.task;
1+
package org.springframework.cloud.dataflow.composite.task;
22

33
import org.springframework.cloud.dataflow.core.TaskDefinition;
44

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.springframework.cloud.dataflow.aggregate.task;
1+
package org.springframework.cloud.dataflow.composite.task;
22

33
import java.util.List;
44

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package org.springframework.cloud.dataflow.aggregate.task.impl;
16+
package org.springframework.cloud.dataflow.composite.task.impl;
1717

1818
import javax.sql.DataSource;
1919
import java.util.ArrayList;
@@ -25,10 +25,10 @@
2525
import org.slf4j.Logger;
2626
import org.slf4j.LoggerFactory;
2727

28-
import org.springframework.cloud.dataflow.aggregate.task.AggregateTaskExplorer;
29-
import org.springframework.cloud.dataflow.aggregate.task.DataflowTaskExecutionQueryDao;
30-
import org.springframework.cloud.dataflow.aggregate.task.TaskDefinitionReader;
31-
import org.springframework.cloud.dataflow.aggregate.task.TaskDeploymentReader;
28+
import org.springframework.cloud.dataflow.composite.task.CompositeTaskExplorer;
29+
import org.springframework.cloud.dataflow.composite.task.DataflowTaskExecutionQueryDao;
30+
import org.springframework.cloud.dataflow.composite.task.TaskDefinitionReader;
31+
import org.springframework.cloud.dataflow.composite.task.TaskDeploymentReader;
3232
import org.springframework.cloud.dataflow.core.TaskDefinition;
3333
import org.springframework.cloud.dataflow.core.TaskDeployment;
3434
import org.springframework.cloud.task.repository.TaskExecution;
@@ -45,8 +45,8 @@
4545
*
4646
* @author Corneil du Plessis
4747
*/
48-
public class DefaultAggregateTaskExplorer implements AggregateTaskExplorer {
49-
private final static Logger logger = LoggerFactory.getLogger(DefaultAggregateTaskExplorer.class);
48+
public class DefaultCompositeTaskExplorer implements CompositeTaskExplorer {
49+
private final static Logger logger = LoggerFactory.getLogger(DefaultCompositeTaskExplorer.class);
5050

5151
private final TaskExplorer taskExplorer;
5252

@@ -56,7 +56,7 @@ public class DefaultAggregateTaskExplorer implements AggregateTaskExplorer {
5656

5757
private final TaskDeploymentReader taskDeploymentReader;
5858

59-
public DefaultAggregateTaskExplorer(
59+
public DefaultCompositeTaskExplorer(
6060
DataSource dataSource,
6161
DataflowTaskExecutionQueryDao taskExecutionQueryDao,
6262
TaskDefinitionReader taskDefinitionReader,
Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package org.springframework.cloud.dataflow.aggregate.task.impl;
16+
package org.springframework.cloud.dataflow.composite.task.impl;
1717

1818
import java.sql.ResultSet;
1919
import java.sql.SQLException;
@@ -35,7 +35,7 @@
3535
import org.slf4j.LoggerFactory;
3636

3737
import org.springframework.batch.item.database.Order;
38-
import org.springframework.cloud.dataflow.aggregate.task.DataflowTaskExecutionQueryDao;
38+
import org.springframework.cloud.dataflow.composite.task.DataflowTaskExecutionQueryDao;
3939
import org.springframework.cloud.task.repository.TaskExecution;
4040
import org.springframework.cloud.task.repository.database.PagingQueryProvider;
4141
import org.springframework.cloud.task.repository.database.support.SqlPagingQueryProviderFactoryBean;
@@ -55,13 +55,13 @@
5555
import org.springframework.util.StringUtils;
5656

5757
/**
58-
* Provide aggregate data for Boot 3 and Boot &lt;=2 TaskExecutions.
58+
* Implementation of the {@link DataflowTaskExecutionQueryDao}.
5959
*
6060
* @author Corneil du Plessis
6161
*/
6262

63-
public class AggregateDataFlowTaskExecutionQueryDao implements DataflowTaskExecutionQueryDao {
64-
private final static Logger logger = LoggerFactory.getLogger(AggregateDataFlowTaskExecutionQueryDao.class);
63+
public class DefaultDataFlowTaskExecutionQueryDao implements DataflowTaskExecutionQueryDao {
64+
private final static Logger logger = LoggerFactory.getLogger(DefaultDataFlowTaskExecutionQueryDao.class);
6565

6666
/**
6767
* SELECT clause for task execution.
@@ -74,7 +74,7 @@ public class AggregateDataFlowTaskExecutionQueryDao implements DataflowTaskExecu
7474
/**
7575
* FROM clause for task execution.
7676
*/
77-
public static final String FROM_CLAUSE = "AGGREGATE_TASK_EXECUTION";
77+
public static final String FROM_CLAUSE = "TASK_EXECUTION";
7878

7979
private static final String FIND_TASK_ARGUMENTS = "SELECT TASK_EXECUTION_ID, "
8080
+ "TASK_PARAM from TASK_EXECUTION_PARAMS where TASK_EXECUTION_ID = :taskExecutionId";
@@ -87,7 +87,7 @@ public class AggregateDataFlowTaskExecutionQueryDao implements DataflowTaskExecu
8787

8888
private final static String GET_CHILD_EXECUTION_BY_ID = GET_EXECUTIONS +
8989
" where PARENT_EXECUTION_ID = :taskExecutionId" +
90-
" and (SELECT COUNT(*) FROM AGGREGATE_TASK_EXECUTION_PARAMS P " +
90+
" and (SELECT COUNT(*) FROM TASK_EXECUTION_PARAMS P " +
9191
" WHERE P.TASK_EXECUTION_ID=TASK_EXECUTION_ID " +
9292
" AND P.SCHEMA_TARGET=SCHEMA_TARGET" +
9393
" AND P.TASK_PARAM = :schemaTarget) > 0";
@@ -122,40 +122,35 @@ public class AggregateDataFlowTaskExecutionQueryDao implements DataflowTaskExecu
122122
private static final String TASK_EXECUTION_COUNT_BY_NAME = "SELECT COUNT(*) FROM "
123123
+ "TASK_EXECUTION where TASK_NAME = :taskName";
124124

125-
private static final String TASK_EXECUTION_COUNT_BY_NAME_AND_BEFORE_END_TIME = "SELECT COUNT(*) FROM "
126-
+ "AGGREGATE_TASK_EXECUTION where TASK_NAME = :taskName AND END_TIME < :endTime";
127-
128125
private static final String COMPLETED_TASK_EXECUTION_COUNT = "SELECT COUNT(*) FROM "
129126
+ "TASK_EXECUTION WHERE END_TIME IS NOT NULL";
130127

131128
private static final String COMPLETED_TASK_EXECUTION_COUNT_AND_BEFORE_END_TIME = "SELECT COUNT(*) FROM "
132129
+ "TASK_EXECUTION WHERE END_TIME IS NOT NULL AND END_TIME < :endTime";
133130

134131
private static final String COMPLETED_TASK_EXECUTION_COUNT_BY_NAME = "SELECT COUNT(*) FROM "
135-
+ "AGGREGATE_TASK_EXECUTION where TASK_NAME = :taskName AND END_TIME IS NOT NULL ";
132+
+ "TASK_EXECUTION where TASK_NAME = :taskName AND END_TIME IS NOT NULL ";
136133

137134
private static final String COMPLETED_TASK_EXECUTION_COUNT_BY_NAME_AND_BEFORE_END_TIME = "SELECT COUNT(*) FROM "
138135
+ "TASK_EXECUTION where TASK_NAME = :taskName AND END_TIME IS NOT NULL AND END_TIME < :endTime ";
139136

140137

141138
private static final String RUNNING_TASK_EXECUTION_COUNT_BY_NAME = "SELECT COUNT(*) FROM "
142-
+ "AGGREGATE_TASK_EXECUTION where TASK_NAME = :taskName AND END_TIME IS NULL ";
139+
+ "TASK_EXECUTION where TASK_NAME = :taskName AND END_TIME IS NULL ";
143140

144141
private static final String RUNNING_TASK_EXECUTION_COUNT = "SELECT COUNT(*) FROM "
145-
+ "AGGREGATE_TASK_EXECUTION where END_TIME IS NULL ";
142+
+ "TASK_EXECUTION where END_TIME IS NULL ";
146143

147144
private static final String LAST_TASK_EXECUTIONS_BY_TASK_NAMES = "select TE2.* from ("
148145
+ "select MAX(TE.TASK_EXECUTION_ID) as TASK_EXECUTION_ID, TE.TASK_NAME, TE.START_TIME from ("
149146
+ "select TASK_NAME, MAX(START_TIME) as START_TIME"
150-
+ " FROM AGGREGATE_TASK_EXECUTION where TASK_NAME in (:taskNames)"
147+
+ " FROM TASK_EXECUTION where TASK_NAME in (:taskNames)"
151148
+ " GROUP BY TASK_NAME) TE_MAX"
152-
+ " inner join AGGREGATE_TASK_EXECUTION TE ON TE.TASK_NAME = TE_MAX.TASK_NAME AND TE.START_TIME = TE_MAX.START_TIME"
149+
+ " inner join TASK_EXECUTION TE ON TE.TASK_NAME = TE_MAX.TASK_NAME AND TE.START_TIME = TE_MAX.START_TIME"
153150
+ " group by TE.TASK_NAME, TE.START_TIME" + ") TE1"
154-
+ " inner join AGGREGATE_TASK_EXECUTION TE2 ON TE1.TASK_EXECUTION_ID = TE2.TASK_EXECUTION_ID AND TE1.SCHEMA_TARGET = TE2.SCHEMA_TARGET"
151+
+ " inner join TASK_EXECUTION TE2 ON TE1.TASK_EXECUTION_ID = TE2.TASK_EXECUTION_ID AND TE1.SCHEMA_TARGET = TE2.SCHEMA_TARGET"
155152
+ " order by TE2.START_TIME DESC, TE2.TASK_EXECUTION_ID DESC";
156153

157-
private static final String FIND_TASK_NAMES = "SELECT distinct TASK_NAME from AGGREGATE_TASK_EXECUTION order by TASK_NAME";
158-
159154
private static final Set<String> validSortColumns = new HashSet<>(10);
160155

161156
static {
@@ -179,11 +174,11 @@ public class AggregateDataFlowTaskExecutionQueryDao implements DataflowTaskExecu
179174
private final LinkedHashMap<String, Order> orderMap;
180175

181176
/**
182-
* Initializes the AggregateDataFlowJobExecutionDao.
177+
* Initializes the DefaultDataFlowJobExecutionDao.
183178
*
184179
* @param dataSource used by the dao to execute queries and update the tables.
185180
*/
186-
public AggregateDataFlowTaskExecutionQueryDao(DataSource dataSource) {
181+
public DefaultDataFlowTaskExecutionQueryDao(DataSource dataSource) {
187182
Assert.notNull(dataSource, "The dataSource must not be null.");
188183
this.jdbcTemplate = new NamedParameterJdbcTemplate(dataSource);
189184
this.dataSource = dataSource;

spring-cloud-dataflow-autoconfigure/src/test/java/org/springframework/cloud/dataflow/autoconfigure/local/AbstractSchedulerPerPlatformTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
import org.springframework.boot.cloud.CloudPlatform;
3030
import org.springframework.boot.test.context.SpringBootTest;
3131
import org.springframework.boot.test.mock.mockito.MockBean;
32-
import org.springframework.cloud.dataflow.aggregate.task.DataflowTaskExecutionQueryDao;
33-
import org.springframework.cloud.dataflow.aggregate.task.TaskDefinitionReader;
34-
import org.springframework.cloud.dataflow.aggregate.task.TaskDeploymentReader;
32+
import org.springframework.cloud.dataflow.composite.task.DataflowTaskExecutionQueryDao;
33+
import org.springframework.cloud.dataflow.composite.task.TaskDefinitionReader;
34+
import org.springframework.cloud.dataflow.composite.task.TaskDeploymentReader;
3535
import org.springframework.cloud.dataflow.registry.service.AppRegistryService;
3636
import org.springframework.cloud.deployer.spi.cloudfoundry.CloudFoundryConnectionProperties;
3737
import org.springframework.cloud.deployer.spi.cloudfoundry.CloudFoundryDeployerAutoConfiguration;

spring-cloud-dataflow-build/pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -482,11 +482,11 @@
482482
<plugin>
483483
<groupId>org.apache.maven.plugins</groupId>
484484
<artifactId>maven-compiler-plugin</artifactId>
485-
<configuration>
486-
<source>${java.version}</source>
487-
<target>${java.version}</target>
488-
<parameters>true</parameters>
489-
</configuration>
485+
<configuration>
486+
<source>17</source>
487+
<target>17</target>
488+
<parameters>true</parameters>
489+
</configuration>
490490
</plugin>
491491
<plugin>
492492
<groupId>org.apache.maven.plugins</groupId>

spring-cloud-dataflow-core/src/main/java/org/springframework/cloud/dataflow/core/AppRegistration.java

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,10 @@
2121
import java.util.Objects;
2222

2323
import jakarta.persistence.Entity;
24-
import jakarta.persistence.EnumType;
25-
import jakarta.persistence.Enumerated;
2624
import jakarta.persistence.Lob;
2725
import jakarta.persistence.Table;
2826
import jakarta.persistence.Transient;
2927

30-
import org.springframework.cloud.dataflow.schema.AppBootSchemaVersion;
3128
import org.springframework.util.Assert;
3229

3330
/**
@@ -78,12 +75,6 @@ public class AppRegistration extends AbstractEntity implements Comparable<AppReg
7875
*/
7976
private Boolean defaultVersion = false;
8077

81-
/**
82-
* Boot version to identify Task / Batch Schema.
83-
*/
84-
@Enumerated(EnumType.STRING)
85-
private AppBootSchemaVersion bootVersion;
86-
8778
@Transient
8879
private HashSet<String> versions;
8980

@@ -134,21 +125,6 @@ public AppRegistration(String name, ApplicationType type, String version, URI ur
134125
this.metadataUri = metadataUri;
135126
}
136127

137-
/**
138-
* Construct an {@code AppRegistration} object.
139-
*
140-
* @param name app name
141-
* @param type app type
142-
* @param version app version
143-
* @param uri URI for the app resource
144-
* @param metadataUri URI for the app metadata resource
145-
* @param bootVersion The bootVersion of the application.
146-
*/
147-
public AppRegistration(String name, ApplicationType type, String version, URI uri, URI metadataUri, AppBootSchemaVersion bootVersion) {
148-
this(name,type,version,uri,metadataUri);
149-
this.bootVersion = bootVersion;
150-
}
151-
152128
/**
153129
* @return the name of the app
154130
*/
@@ -201,14 +177,6 @@ public void setMetadataUri(URI metadataUri) {
201177
this.metadataUri = metadataUri;
202178
}
203179

204-
public AppBootSchemaVersion getBootVersion() {
205-
return bootVersion == null ? AppBootSchemaVersion.defaultVersion() : bootVersion;
206-
}
207-
208-
public void setBootVersion(AppBootSchemaVersion bootVersion) {
209-
this.bootVersion = bootVersion;
210-
}
211-
212180
public Boolean isDefaultVersion() {
213181
return this.defaultVersion;
214182
}
@@ -229,8 +197,7 @@ public void setVersions(HashSet<String> versions) {
229197
public String toString() {
230198
return "AppRegistration{" + "name='" + this.getName() + '\'' + ", type='" + this.getType()
231199
+ '\'' + ", version='" + this.getVersion() + '\'' + ", uri=" + this.getUri()
232-
+ ", metadataUri=" + this.getMetadataUri() +
233-
", bootVersion='" + this.getBootVersion().getBootVersion() + '}';
200+
+ ", metadataUri=" + this.getMetadataUri() + '}';
234201
}
235202

236203
@Override

0 commit comments

Comments
 (0)