Skip to content

Commit

Permalink
[FLINK-33450][autoscaler] Support the JDBCAutoScalerStateStore
Browse files Browse the repository at this point in the history
  • Loading branch information
1996fanrui committed Dec 29, 2023
1 parent 515f018 commit fb5541c
Show file tree
Hide file tree
Showing 35 changed files with 2,391 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ jobs:
cd flink-kubernetes-webhook
mvn verify -Dit.skip=false
cd ..
- name: Tests in flink-autoscaler-plugin-jdbc
run: |
cd flink-autoscaler-plugin-jdbc
mvn verify -Dit.skip=false
cd ..
e2e_ci:
runs-on: ubuntu-latest
strategy:
Expand Down
129 changes: 129 additions & 0 deletions flink-autoscaler-plugin-jdbc/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<artifactId>flink-kubernetes-operator-parent</artifactId>
<groupId>org.apache.flink</groupId>
<version>1.8-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

<artifactId>flink-autoscaler-plugin-jdbc</artifactId>
<name>Flink Autoscaler Plugin JDBC</name>
<packaging>jar</packaging>

<properties>
<testcontainers.version>1.18.2</testcontainers.version>
<postgres.version>42.5.1</postgres.version>
<mysql.version>8.0.29</mysql.version>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers-bom</artifactId>
<version>${testcontainers.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>

</dependencyManagement>

<dependencies>

<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-autoscaler</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-runtime</artifactId>
<version>${flink.version}</version>
<scope>provided</scope>
</dependency>

<!-- TODO FLINK-33098: These jackson dependencies can be replaced with flink shaded jackson. It can be done
after the flink-1.18.1 is released. -->
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>

<!-- Test dependencies -->

<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-test-utils-junit</artifactId>
<version>${flink.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>slf4j-api</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
</exclusions>
</dependency>

<!-- Derby tests -->
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<version>10.14.2.0</version>
<scope>test</scope>
</dependency>

<!-- Postgres tests -->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${postgres.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>postgresql</artifactId>
<scope>test</scope>
</dependency>

<!-- MySQL tests -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>mysql</artifactId>
<scope>test</scope>
</dependency>

</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* 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 org.apache.flink.autoscaler.jdbc;

import org.apache.flink.annotation.Experimental;

/**
* The serializer of job key.
*
* @param <KEY> job key.
*/
@Experimental
public interface JobKeySerializer<KEY> {

String serialize(KEY originalJobKey);

KEY deserialize(String serializedJobKey);
}
Loading

0 comments on commit fb5541c

Please sign in to comment.