Skip to content

Commit 8bdc38c

Browse files
chesfeast-ci-bot
authored andcommitted
Introduce datatypes/java module for proto generation (feast-dev#391)
Rather than the Maven protobuf plugin running on the same symlinked definitions in several Java modules, localize this process into one module that the others depend on. This provides a single module that can be depended on by third-party extensions with the bare minimum of dependencies. Also removes proto files that are no longer used.
1 parent c82ba8f commit 8bdc38c

File tree

19 files changed

+135
-123
lines changed

19 files changed

+135
-123
lines changed

core/pom.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@
3939
<skip>false</skip>
4040
</configuration>
4141
</plugin>
42-
<plugin>
43-
<groupId>org.xolstice.maven.plugins</groupId>
44-
<artifactId>protobuf-maven-plugin</artifactId>
45-
</plugin>
4642
</plugins>
4743
</build>
4844

core/src/main/proto/feast

Lines changed: 0 additions & 1 deletion
This file was deleted.

core/src/main/proto/third_party

Lines changed: 0 additions & 1 deletion
This file was deleted.

datatypes/java/README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
Feast Data Types for Java
2+
=========================
3+
4+
This module produces Java class files for Feast's data type and gRPC service
5+
definitions, from Protobuf IDL. These are used across Feast components for wire
6+
interchange, contracts, etc.
7+
8+
End users of Feast will be best served by our Java SDK which adds higher-level
9+
conveniences, but the data types are published independently for custom needs,
10+
without any additional dependencies the SDK may add.
11+
12+
Dependency Coordinates
13+
----------------------
14+
15+
```xml
16+
<dependency>
17+
<groupId>dev.feast</groupId>
18+
<artifactId>datatypes-java</artifactId>
19+
<version>0.4.0-SNAPSHOT</version>
20+
</dependency>
21+
```
22+
23+
Using the `.proto` Definitions
24+
------------------------------
25+
26+
The `.proto` definitions are packaged as resources within the Maven artifact,
27+
which may be useful to `include` them in dependent Protobuf definitions in a
28+
downstream project, or for other JVM languages to consume from their builds to
29+
generate more idiomatic bindings.
30+
31+
Google's Gradle plugin, for instance, [can use protos in dependencies][Gradle]
32+
either for `include` or to compile with a different `protoc` plugin than Java.
33+
34+
[sbt-protoc] offers similar functionality for sbt/Scala.
35+
36+
[Gradle]: https://github.com/google/protobuf-gradle-plugin#protos-in-dependencies
37+
[sbt-protoc]: https://github.com/thesamet/sbt-protoc
38+
39+
Publishing
40+
----------
41+
42+
TODO: this module should be published to Maven Central upon Feast releases—this
43+
needs to be set up in POM configuration and release automation.

datatypes/java/pom.xml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Copyright 2019 The Feast Authors
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ https://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License.
16+
~
17+
-->
18+
<project xmlns="http://maven.apache.org/POM/4.0.0"
19+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
20+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
21+
<modelVersion>4.0.0</modelVersion>
22+
23+
<name>Feast Data Types for Java</name>
24+
<description>
25+
Data types and service contracts used throughout Feast components and
26+
their interchanges. These are generated from Protocol Buffers and gRPC
27+
definitions included in the package.
28+
</description>
29+
<artifactId>datatypes-java</artifactId>
30+
31+
<parent>
32+
<groupId>dev.feast</groupId>
33+
<artifactId>feast-parent</artifactId>
34+
<version>${revision}</version>
35+
<relativePath>../..</relativePath>
36+
</parent>
37+
38+
<build>
39+
<plugins>
40+
<plugin>
41+
<groupId>org.xolstice.maven.plugins</groupId>
42+
<artifactId>protobuf-maven-plugin</artifactId>
43+
<configuration>
44+
<checkStaleness>true</checkStaleness>
45+
<protocArtifact>
46+
com.google.protobuf:protoc:${protocVersion}:exe:${os.detected.classifier}
47+
</protocArtifact>
48+
<pluginId>grpc-java</pluginId>
49+
<pluginArtifact>
50+
io.grpc:protoc-gen-grpc-java:${grpcVersion}:exe:${os.detected.classifier}
51+
</pluginArtifact>
52+
</configuration>
53+
<executions>
54+
<execution>
55+
<goals>
56+
<goal>compile</goal>
57+
<goal>compile-custom</goal>
58+
<goal>test-compile</goal>
59+
</goals>
60+
</execution>
61+
</executions>
62+
</plugin>
63+
</plugins>
64+
</build>
65+
66+
<dependencies>
67+
<dependency>
68+
<groupId>io.grpc</groupId>
69+
<artifactId>grpc-services</artifactId>
70+
</dependency>
71+
</dependencies>
72+
</project>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../../protos/third_party

ingestion/pom.xml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@
3131

3232
<build>
3333
<plugins>
34-
<plugin>
35-
<groupId>org.xolstice.maven.plugins</groupId>
36-
<artifactId>protobuf-maven-plugin</artifactId>
37-
</plugin>
3834
<plugin>
3935
<groupId>org.apache.maven.plugins</groupId>
4036
<artifactId>maven-shade-plugin</artifactId>
@@ -90,6 +86,12 @@
9086
</build>
9187

9288
<dependencies>
89+
<dependency>
90+
<groupId>dev.feast</groupId>
91+
<artifactId>datatypes-java</artifactId>
92+
<version>${project.version}</version>
93+
</dependency>
94+
9395
<dependency>
9496
<groupId>org.glassfish</groupId>
9597
<artifactId>javax.el</artifactId>

ingestion/src/main/proto/feast

Lines changed: 0 additions & 1 deletion
This file was deleted.

ingestion/src/main/proto/feast_ingestion/types/CoalesceAccum.proto

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)