Unverified Commit e0ba0c54 authored by ZackYoung's avatar ZackYoung Committed by GitHub

[Bug] [Flink]fix add jar some bug (#2974)

parent 757a298b
...@@ -46,9 +46,9 @@ jobs: ...@@ -46,9 +46,9 @@ jobs:
key: ${{ runner.os }}-maven-${{ hashFiles('pom.xml') }} key: ${{ runner.os }}-maven-${{ hashFiles('pom.xml') }}
restore-keys: | restore-keys: |
${{ runner.os }}-maven- ${{ runner.os }}-maven-
# - name: Check Style # - name: Check Style
# run: | # run: |
# ./mvnw -T 4C -B --no-snapshot-updates clean spotless:check # ./mvnw -T 4C -B --no-snapshot-updates clean spotless:check
- name: Build and Package - name: Build and Package
run: | run: |
./mvnw -B clean install \ ./mvnw -B clean install \
...@@ -114,7 +114,7 @@ jobs: ...@@ -114,7 +114,7 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Move Dockerfile - name: Move Dockerfile
run: | run: |
cp ./docker/Dockerfile* ./ cp -r ./docker/Dockerfile* ./
- name: Download math result for job 1 - name: Download math result for job 1
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
with: with:
...@@ -173,7 +173,7 @@ jobs: ...@@ -173,7 +173,7 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Move Dockerfile - name: Move Dockerfile
run: | run: |
cp ./docker/Dockerfile* ./ cp -r ./docker/Dockerfile* ./
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: set the flink_big_version - name: set the flink_big_version
run: | run: |
...@@ -204,7 +204,7 @@ jobs: ...@@ -204,7 +204,7 @@ jobs:
FLINK_VERSION=${{ matrix.FLINK_VERSION }} FLINK_VERSION=${{ matrix.FLINK_VERSION }}
DINKY_IMAGE=${{ matrix.url }}/${{ matrix.namespace }}/dinky-standalone-server:${{ inputs.version }} DINKY_IMAGE=${{ matrix.url }}/${{ matrix.namespace }}/dinky-standalone-server:${{ inputs.version }}
FLINK_BIG_VERSION=${{ matrix.FLINK_BIG_VERSION }} FLINK_BIG_VERSION=${{ matrix.FLINK_BIG_VERSION }}
file: ./docker/DockerfileDinkyFlink file: DockerfileDinkyFlink
context: . context: .
push: true push: true
tags: ${{ matrix.url }}/${{ matrix.namespace }}/dinky-standalone-server:${{ inputs.version }}-flink-${{matrix.FLINK_BIG_VERSION }} tags: ${{ matrix.url }}/${{ matrix.namespace }}/dinky-standalone-server:${{ inputs.version }}-flink-${{matrix.FLINK_BIG_VERSION }}
...@@ -69,24 +69,12 @@ public class SinkBuilderFactory { ...@@ -69,24 +69,12 @@ public class SinkBuilderFactory {
sinkBuilders.add(factory); sinkBuilders.add(factory);
} }
Map<String, Supplier<SinkBuilder>> plusSinkBuilder = sinkBuilders.stream() Map<String, Supplier<SinkBuilder>> plusSinkBuilder =
.collect(Collectors.toMap(SinkBuilderFactory::getKeyWord, SinkBuilderFactory::getSupplier)); sinkBuilders.stream().collect(Collectors.toMap(SinkBuilderFactory::getKeyWord, x -> () -> x));
map.putAll(plusSinkBuilder); map.putAll(plusSinkBuilder);
return map; return map;
} }
@SuppressWarnings("unchecked")
private static Supplier<SinkBuilder> getSupplier(SinkBuilder clazz) {
return () -> {
try {
return SinkBuilder.class.newInstance();
} catch (InstantiationException | IllegalAccessException e) {
logger.warn("Could not get constructor supplier : {}", e.getMessage());
}
return null;
};
}
public static String getKeyWord(SinkBuilder c) { public static String getKeyWord(SinkBuilder c) {
String fieldName = "KEY_WORD"; String fieldName = "KEY_WORD";
String result = null; String result = null;
......
...@@ -209,7 +209,7 @@ public abstract class Executor { ...@@ -209,7 +209,7 @@ public abstract class Executor {
Configuration configuration = tableEnvironment.getRootConfiguration(); Configuration configuration = tableEnvironment.getRootConfiguration();
List<String> jars = configuration.get(PipelineOptions.JARS); List<String> jars = configuration.get(PipelineOptions.JARS);
if (jars == null) { if (jars == null) {
configuration.set(PipelineOptions.JARS, CollUtil.newArrayList(jarPath)); tableEnvironment.addConfiguration(PipelineOptions.JARS, CollUtil.newArrayList(jarPath));
} else { } else {
CollUtil.addAll(jars, jarPath); CollUtil.addAll(jars, jarPath);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment