forked from apache/beam
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a utility for starting up the Transform Service from Java (apach…
…e#26834) * Adds a utility for starting up the Transform Service from Java and adds an option for enabling it * Address reviewer comments * Addressing reviewer comments
- Loading branch information
1 parent
2e47975
commit 7cf8e82
Showing
11 changed files
with
525 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
...n/src/main/java/org/apache/beam/sdk/extensions/python/PythonExternalTransformOptions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* 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.beam.sdk.extensions.python; | ||
|
||
import org.apache.beam.sdk.options.Default; | ||
import org.apache.beam.sdk.options.Description; | ||
import org.apache.beam.sdk.options.PipelineOptions; | ||
|
||
/** Pipeline options for {@link PythonExternalTransform}. */ | ||
public interface PythonExternalTransformOptions extends PipelineOptions { | ||
|
||
@Description("Use Docker Compose based Beam Transform Service to expand transforms.") | ||
@Default.Boolean(false) | ||
boolean getUseTransformService(); | ||
|
||
void setUseTransformService(boolean useTransformService); | ||
} |
37 changes: 37 additions & 0 deletions
37
...n/java/org/apache/beam/sdk/extensions/python/PythonExternalTransformOptionsRegistrar.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* 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.beam.sdk.extensions.python; | ||
|
||
import com.google.auto.service.AutoService; | ||
import org.apache.beam.sdk.annotations.Internal; | ||
import org.apache.beam.sdk.options.PipelineOptions; | ||
import org.apache.beam.sdk.options.PipelineOptionsRegistrar; | ||
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList; | ||
|
||
/** A registrar for {@link PythonExternalTransformOptions}. */ | ||
@AutoService(PipelineOptionsRegistrar.class) | ||
@Internal | ||
public class PythonExternalTransformOptionsRegistrar implements PipelineOptionsRegistrar { | ||
|
||
@Override | ||
public Iterable<Class<? extends PipelineOptions>> getPipelineOptions() { | ||
return ImmutableList.<Class<? extends PipelineOptions>>builder() | ||
.add(PythonExternalTransformOptions.class) | ||
.build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* 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. | ||
*/ | ||
apply plugin: 'org.apache.beam.module' | ||
apply plugin: 'application' | ||
mainClassName = "org.apache.beam.sdk.transformservice.launcher.TransformServiceLauncher" | ||
|
||
applyJavaNature( | ||
automaticModuleName: 'org.apache.beam.sdk.transform.service', | ||
exportJavadoc: false, | ||
validateShadowJar: false, | ||
shadowClosure: {}, | ||
) | ||
|
||
|
||
description = "Apache Beam :: SDKs :: Java :: Transform Service :: Launcher" | ||
ext.summary = """Contains code that can be used to run an transform service.""" | ||
|
||
|
||
// Exclude tests that need a runner | ||
test { | ||
systemProperty "beamUseDummyRunner", "true" | ||
useJUnit { | ||
excludeCategories "org.apache.beam.sdk.testing.NeedsRunner" | ||
} | ||
} | ||
|
||
dependencies { | ||
shadow library.java.vendored_guava_26_0_jre | ||
shadow library.java.slf4j_api | ||
shadow library.java.args4j | ||
runtimeOnly library.java.slf4j_jdk14 | ||
} | ||
|
||
sourceSets { | ||
main { | ||
resources { | ||
srcDirs "../docker-compose" | ||
} | ||
output.resourcesDir = "$buildDir/resources/docker-compose/$name" | ||
} | ||
} | ||
|
||
jar { | ||
manifest { | ||
attributes 'Main-Class': application.mainClass | ||
} | ||
} |
Oops, something went wrong.