Skip to content

Commit a1e1c74

Browse files
Rafal Wojdylamxm
authored andcommitted
Add registrat
1 parent 573c5d2 commit a1e1c74

2 files changed

Lines changed: 57 additions & 0 deletions

File tree

runner/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@
8383
</exclusion>
8484
</exclusions>
8585
</dependency>
86+
<dependency>
87+
<groupId>com.google.auto.service</groupId>
88+
<artifactId>auto-service</artifactId>
89+
<version>1.0-rc2</version>
90+
</dependency>
8691
<!-- Test scoped -->
8792
<dependency>
8893
<groupId>com.google.cloud.dataflow</groupId>
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
package com.dataartisans.flink.dataflow;/*
2+
* Copyright 2016 Data Artisans GmbH
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import com.google.auto.service.AutoService;
18+
import com.dataartisans.flink.dataflow.FlinkPipelineOptions;
19+
import com.dataartisans.flink.dataflow.FlinkPipelineRunner;
20+
import com.google.cloud.dataflow.sdk.options.PipelineOptions;
21+
import com.google.cloud.dataflow.sdk.options.PipelineOptionsRegistrar;
22+
import com.google.cloud.dataflow.sdk.runners.PipelineRunner;
23+
import com.google.cloud.dataflow.sdk.runners.PipelineRunnerRegistrar;
24+
import com.google.common.collect.ImmutableList;
25+
26+
27+
/**
28+
* AuteService registrar - will register FlinkRunner and FlinkOptions
29+
* as possible pipeline runner services.
30+
*
31+
* It ends up in META-INF/services and gets picked up by Dataflow.
32+
*
33+
*/
34+
public class FlinkRunnerRegistrar {
35+
private FlinkRunnerRegistrar() { }
36+
37+
@AutoService(PipelineRunnerRegistrar.class)
38+
public static class Runner implements PipelineRunnerRegistrar {
39+
@Override
40+
public Iterable<Class<? extends PipelineRunner<?>>> getPipelineRunners() {
41+
return ImmutableList.<Class<? extends PipelineRunner<?>>>of(FlinkPipelineRunner.class);
42+
}
43+
}
44+
45+
@AutoService(PipelineOptionsRegistrar.class)
46+
public static class Options implements PipelineOptionsRegistrar {
47+
@Override
48+
public Iterable<Class<? extends PipelineOptions>> getPipelineOptions() {
49+
return ImmutableList.<Class<? extends PipelineOptions>>of(FlinkPipelineOptions.class);
50+
}
51+
}
52+
}

0 commit comments

Comments
 (0)