You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by tz...@apache.org on 2021/01/28 02:32:04 UTC
[flink-statefun] branch master updated: [FLINK-21154] Move shared
request-reply protobuf files to statefun-sdk-protos
This is an automated email from the ASF dual-hosted git repository.
tzulitai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink-statefun.git
The following commit(s) were added to refs/heads/master by this push:
new 24da73b [FLINK-21154] Move shared request-reply protobuf files to statefun-sdk-protos
24da73b is described below
commit 24da73beb6d38d93c007c1c541ef922c1de60c43
Author: Igal Shilman <ig...@gmail.com>
AuthorDate: Tue Jan 26 10:38:12 2021 +0100
[FLINK-21154] Move shared request-reply protobuf files to statefun-sdk-protos
This closes #194.
---
pom.xml | 1 +
statefun-flink/statefun-flink-core/pom.xml | 59 ++
statefun-python-sdk/build-distribution.sh | 38 +-
statefun-python-sdk/statefun/request_reply_pb2.py | 816 ---------------------
statefun-sdk-protos/pom.xml | 54 ++
.../src/main/protobuf/request-reply.proto | 0
6 files changed, 145 insertions(+), 823 deletions(-)
diff --git a/pom.xml b/pom.xml
index 196a2b0..4a73714 100644
--- a/pom.xml
+++ b/pom.xml
@@ -51,6 +51,7 @@ under the License.
<modules>
<module>statefun-sdk</module>
+ <module>statefun-sdk-protos</module>
<module>statefun-kafka-io</module>
<module>statefun-kinesis-io</module>
<module>statefun-examples</module>
diff --git a/statefun-flink/statefun-flink-core/pom.xml b/statefun-flink/statefun-flink-core/pom.xml
index 99da29e..05c9f7a 100644
--- a/statefun-flink/statefun-flink-core/pom.xml
+++ b/statefun-flink/statefun-flink-core/pom.xml
@@ -31,6 +31,7 @@ under the License.
<properties>
<okhttp.version>3.14.6</okhttp.version>
+ <additional-sources.dir>target/additional-sources</additional-sources.dir>
</properties>
<dependencies>
@@ -43,6 +44,11 @@ under the License.
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
+ <artifactId>statefun-sdk-protos</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.flink</groupId>
<artifactId>statefun-flink-io</artifactId>
<version>${project.version}</version>
</dependency>
@@ -134,10 +140,63 @@ under the License.
<build>
<plugins>
+ <!--
+ The following plugin is executed in the generated-sources phase,
+ and is responsible to extract the additional *.proto files located
+ at statefun-sdk-protos.jar.
+ -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>unpack</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.apache.flink</groupId>
+ <artifactId>statefun-sdk-protos</artifactId>
+ <version>${project.version}</version>
+ <type>jar</type>
+ <outputDirectory>${additional-sources.dir}</outputDirectory>
+ <includes>*.proto</includes>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <!--
+ The following plugin invokes protoc to generate Java classes out of the *.proto
+ definitions located at: (1) src/main/protobuf (2) ${additional-sources.dir}.
+ -->
<plugin>
<groupId>com.github.os72</groupId>
<artifactId>protoc-jar-maven-plugin</artifactId>
<version>${protoc-jar-maven-plugin.version}</version>
+ <executions>
+ <execution>
+ <id>generate-protobuf-sources</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <includeStdTypes>true</includeStdTypes>
+ <protocVersion>${protobuf.version}</protocVersion>
+ <cleanOutputFolder>true</cleanOutputFolder>
+ <inputDirectories>
+ <inputDirectory>src/main/protobuf</inputDirectory>
+ <inputDirectory>${additional-sources.dir}</inputDirectory>
+ </inputDirectories>
+ <outputDirectory>${basedir}/target/generated-sources/protoc-jar</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
</plugin>
</plugins>
</build>
diff --git a/statefun-python-sdk/build-distribution.sh b/statefun-python-sdk/build-distribution.sh
index 7f7eb31..89e564b 100755
--- a/statefun-python-sdk/build-distribution.sh
+++ b/statefun-python-sdk/build-distribution.sh
@@ -17,21 +17,45 @@
CURR_DIR=`pwd`
BASE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+SDK_PROTOS_DIR="${BASE_DIR}/../statefun-sdk-protos/src/main/protobuf"
+IN_DOCKER_BUILD_COMMAND="
+apk add protobuf-dev && \
+protoc *proto --python_out=statefun/ && \
+python3 setup.py sdist bdist_wheel
+"
+
###########################
cd ${BASE_DIR}
-rm -fr dist
+# create a target/ directory like in MAVEN.
+# this directory will contain a temporary copy of the source and
+# addtional generated sources (for example sdk .proto files copied from else where)
+# eventually the built artifact will be copied to ${BASE_DIR}/dist and this target
+# directory will be deleted.
+rm -fr dist/
+rm -fr target/
+mkdir -p target/
+
+# copy all the sources into target
+rsync -a --exclude=target * target/
+
+# copy the addtional .proto files from the SDK
+rsync -a ${SDK_PROTOS_DIR}/* target/
+
+cd target/
+
+# built the Python SDK inside a Docker container.
+# This build step also generates Protobuf files.
+
-docker run \
- -v "$BASE_DIR:/app" \
+docker run -v "${BASE_DIR}/target:/app" \
+ --rm \
--workdir /app \
- -i python:3.7-alpine \
- python3 setup.py sdist bdist_wheel
+ -i python:3.7-alpine /bin/sh -c "${IN_DOCKER_BUILD_COMMAND}"
-rm -fr apache_flink_statefun.egg-info
-rm -fr build
+cp -r "dist/" "${BASE_DIR}/dist"
echo "Built Python SDK wheels and packages at ${BASE_DIR}/dist."
diff --git a/statefun-python-sdk/statefun/request_reply_pb2.py b/statefun-python-sdk/statefun/request_reply_pb2.py
deleted file mode 100644
index dba1ac8..0000000
--- a/statefun-python-sdk/statefun/request_reply_pb2.py
+++ /dev/null
@@ -1,816 +0,0 @@
-# -*- coding: 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.
-################################################################################
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: request-reply.proto
-
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-from google.protobuf import any_pb2 as google_dot_protobuf_dot_any__pb2
-
-
-DESCRIPTOR = _descriptor.FileDescriptor(
- name='request-reply.proto',
- package='org.apache.flink.statefun.flink.core.polyglot',
- syntax='proto3',
- serialized_options=b'\n7org.apache.flink.statefun.flink.core.polyglot.generatedP\001',
- serialized_pb=b'\n\x13request-reply.proto\x12-org.apache.flink.statefun.flink.core.polyglot\x1a\x19google/protobuf/any.proto\"6\n\x07\x41\x64\x64ress\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x0c\n\x04type\x18\x02 \x01(\t\x12\n\n\x02id\x18\x03 \x01(\t\"\xcf\x04\n\nToFunction\x12\x66\n\ninvocation\x18\x64 \x01(\x0b\x32P.org.apache.flink.statefun.flink.core.polyglot.ToFunction.InvocationBatchRequestH\x00\x1a\x39\n\x0ePersistedValue\x12\x12\n\nstate_name\x18\x01 \x01(\t\x12\x13\n\x0bstate_ [...]
- ,
- dependencies=[google_dot_protobuf_dot_any__pb2.DESCRIPTOR,])
-
-
-
-_FROMFUNCTION_PERSISTEDVALUEMUTATION_MUTATIONTYPE = _descriptor.EnumDescriptor(
- name='MutationType',
- full_name='org.apache.flink.statefun.flink.core.polyglot.FromFunction.PersistedValueMutation.MutationType',
- filename=None,
- file=DESCRIPTOR,
- values=[
- _descriptor.EnumValueDescriptor(
- name='DELETE', index=0, number=0,
- serialized_options=None,
- type=None),
- _descriptor.EnumValueDescriptor(
- name='MODIFY', index=1, number=1,
- serialized_options=None,
- type=None),
- ],
- containing_type=None,
- serialized_options=None,
- serialized_start=1192,
- serialized_end=1230,
-)
-_sym_db.RegisterEnumDescriptor(_FROMFUNCTION_PERSISTEDVALUEMUTATION_MUTATIONTYPE)
-
-_FROMFUNCTION_EXPIRATIONSPEC_EXPIREMODE = _descriptor.EnumDescriptor(
- name='ExpireMode',
- full_name='org.apache.flink.statefun.flink.core.polyglot.FromFunction.ExpirationSpec.ExpireMode',
- filename=None,
- file=DESCRIPTOR,
- values=[
- _descriptor.EnumValueDescriptor(
- name='NONE', index=0, number=0,
- serialized_options=None,
- type=None),
- _descriptor.EnumValueDescriptor(
- name='AFTER_WRITE', index=1, number=1,
- serialized_options=None,
- type=None),
- _descriptor.EnumValueDescriptor(
- name='AFTER_INVOKE', index=2, number=2,
- serialized_options=None,
- type=None),
- ],
- containing_type=None,
- serialized_options=None,
- serialized_start=2207,
- serialized_end=2264,
-)
-_sym_db.RegisterEnumDescriptor(_FROMFUNCTION_EXPIRATIONSPEC_EXPIREMODE)
-
-
-_ADDRESS = _descriptor.Descriptor(
- name='Address',
- full_name='org.apache.flink.statefun.flink.core.polyglot.Address',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- fields=[
- _descriptor.FieldDescriptor(
- name='namespace', full_name='org.apache.flink.statefun.flink.core.polyglot.Address.namespace', index=0,
- number=1, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=b"".decode('utf-8'),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR),
- _descriptor.FieldDescriptor(
- name='type', full_name='org.apache.flink.statefun.flink.core.polyglot.Address.type', index=1,
- number=2, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=b"".decode('utf-8'),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR),
- _descriptor.FieldDescriptor(
- name='id', full_name='org.apache.flink.statefun.flink.core.polyglot.Address.id', index=2,
- number=3, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=b"".decode('utf-8'),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=97,
- serialized_end=151,
-)
-
-
-_TOFUNCTION_PERSISTEDVALUE = _descriptor.Descriptor(
- name='PersistedValue',
- full_name='org.apache.flink.statefun.flink.core.polyglot.ToFunction.PersistedValue',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- fields=[
- _descriptor.FieldDescriptor(
- name='state_name', full_name='org.apache.flink.statefun.flink.core.polyglot.ToFunction.PersistedValue.state_name', index=0,
- number=1, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=b"".decode('utf-8'),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR),
- _descriptor.FieldDescriptor(
- name='state_value', full_name='org.apache.flink.statefun.flink.core.polyglot.ToFunction.PersistedValue.state_value', index=1,
- number=2, type=12, cpp_type=9, label=1,
- has_default_value=False, default_value=b"",
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=272,
- serialized_end=329,
-)
-
-_TOFUNCTION_INVOCATION = _descriptor.Descriptor(
- name='Invocation',
- full_name='org.apache.flink.statefun.flink.core.polyglot.ToFunction.Invocation',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- fields=[
- _descriptor.FieldDescriptor(
- name='caller', full_name='org.apache.flink.statefun.flink.core.polyglot.ToFunction.Invocation.caller', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR),
- _descriptor.FieldDescriptor(
- name='argument', full_name='org.apache.flink.statefun.flink.core.polyglot.ToFunction.Invocation.argument', index=1,
- number=2, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=331,
- serialized_end=455,
-)
-
-_TOFUNCTION_INVOCATIONBATCHREQUEST = _descriptor.Descriptor(
- name='InvocationBatchRequest',
- full_name='org.apache.flink.statefun.flink.core.polyglot.ToFunction.InvocationBatchRequest',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- fields=[
- _descriptor.FieldDescriptor(
- name='target', full_name='org.apache.flink.statefun.flink.core.polyglot.ToFunction.InvocationBatchRequest.target', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR),
- _descriptor.FieldDescriptor(
- name='state', full_name='org.apache.flink.statefun.flink.core.polyglot.ToFunction.InvocationBatchRequest.state', index=1,
- number=2, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR),
- _descriptor.FieldDescriptor(
- name='invocations', full_name='org.apache.flink.statefun.flink.core.polyglot.ToFunction.InvocationBatchRequest.invocations', index=2,
- number=3, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=458,
- serialized_end=734,
-)
-
-_TOFUNCTION = _descriptor.Descriptor(
- name='ToFunction',
- full_name='org.apache.flink.statefun.flink.core.polyglot.ToFunction',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- fields=[
- _descriptor.FieldDescriptor(
- name='invocation', full_name='org.apache.flink.statefun.flink.core.polyglot.ToFunction.invocation', index=0,
- number=100, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR),
- ],
- extensions=[
- ],
- nested_types=[_TOFUNCTION_PERSISTEDVALUE, _TOFUNCTION_INVOCATION, _TOFUNCTION_INVOCATIONBATCHREQUEST, ],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- _descriptor.OneofDescriptor(
- name='request', full_name='org.apache.flink.statefun.flink.core.polyglot.ToFunction.request',
- index=0, containing_type=None, fields=[]),
- ],
- serialized_start=154,
- serialized_end=745,
-)
-
-
-_FROMFUNCTION_PERSISTEDVALUEMUTATION = _descriptor.Descriptor(
- name='PersistedValueMutation',
- full_name='org.apache.flink.statefun.flink.core.polyglot.FromFunction.PersistedValueMutation',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- fields=[
- _descriptor.FieldDescriptor(
- name='mutation_type', full_name='org.apache.flink.statefun.flink.core.polyglot.FromFunction.PersistedValueMutation.mutation_type', index=0,
- number=1, type=14, cpp_type=8, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR),
- _descriptor.FieldDescriptor(
- name='state_name', full_name='org.apache.flink.statefun.flink.core.polyglot.FromFunction.PersistedValueMutation.state_name', index=1,
- number=2, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=b"".decode('utf-8'),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR),
- _descriptor.FieldDescriptor(
- name='state_value', full_name='org.apache.flink.statefun.flink.core.polyglot.FromFunction.PersistedValueMutation.state_value', index=2,
- number=3, type=12, cpp_type=9, label=1,
- has_default_value=False, default_value=b"",
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- _FROMFUNCTION_PERSISTEDVALUEMUTATION_MUTATIONTYPE,
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=1005,
- serialized_end=1230,
-)
-
-_FROMFUNCTION_INVOCATION = _descriptor.Descriptor(
- name='Invocation',
- full_name='org.apache.flink.statefun.flink.core.polyglot.FromFunction.Invocation',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- fields=[
- _descriptor.FieldDescriptor(
- name='target', full_name='org.apache.flink.statefun.flink.core.polyglot.FromFunction.Invocation.target', index=0,
- number=1, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR),
- _descriptor.FieldDescriptor(
- name='argument', full_name='org.apache.flink.statefun.flink.core.polyglot.FromFunction.Invocation.argument', index=1,
- number=2, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=1232,
- serialized_end=1356,
-)
-
-_FROMFUNCTION_DELAYEDINVOCATION = _descriptor.Descriptor(
- name='DelayedInvocation',
- full_name='org.apache.flink.statefun.flink.core.polyglot.FromFunction.DelayedInvocation',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- fields=[
- _descriptor.FieldDescriptor(
- name='delay_in_ms', full_name='org.apache.flink.statefun.flink.core.polyglot.FromFunction.DelayedInvocation.delay_in_ms', index=0,
- number=1, type=3, cpp_type=2, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR),
- _descriptor.FieldDescriptor(
- name='target', full_name='org.apache.flink.statefun.flink.core.polyglot.FromFunction.DelayedInvocation.target', index=1,
- number=2, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR),
- _descriptor.FieldDescriptor(
- name='argument', full_name='org.apache.flink.statefun.flink.core.polyglot.FromFunction.DelayedInvocation.argument', index=2,
- number=3, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=1359,
- serialized_end=1511,
-)
-
-_FROMFUNCTION_EGRESSMESSAGE = _descriptor.Descriptor(
- name='EgressMessage',
- full_name='org.apache.flink.statefun.flink.core.polyglot.FromFunction.EgressMessage',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- fields=[
- _descriptor.FieldDescriptor(
- name='egress_namespace', full_name='org.apache.flink.statefun.flink.core.polyglot.FromFunction.EgressMessage.egress_namespace', index=0,
- number=1, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=b"".decode('utf-8'),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR),
- _descriptor.FieldDescriptor(
- name='egress_type', full_name='org.apache.flink.statefun.flink.core.polyglot.FromFunction.EgressMessage.egress_type', index=1,
- number=2, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=b"".decode('utf-8'),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR),
- _descriptor.FieldDescriptor(
- name='argument', full_name='org.apache.flink.statefun.flink.core.polyglot.FromFunction.EgressMessage.argument', index=2,
- number=3, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=1513,
- serialized_end=1615,
-)
-
-_FROMFUNCTION_INVOCATIONRESPONSE = _descriptor.Descriptor(
- name='InvocationResponse',
- full_name='org.apache.flink.statefun.flink.core.polyglot.FromFunction.InvocationResponse',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- fields=[
- _descriptor.FieldDescriptor(
- name='state_mutations', full_name='org.apache.flink.statefun.flink.core.polyglot.FromFunction.InvocationResponse.state_mutations', index=0,
- number=1, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR),
- _descriptor.FieldDescriptor(
- name='outgoing_messages', full_name='org.apache.flink.statefun.flink.core.polyglot.FromFunction.InvocationResponse.outgoing_messages', index=1,
- number=2, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR),
- _descriptor.FieldDescriptor(
- name='delayed_invocations', full_name='org.apache.flink.statefun.flink.core.polyglot.FromFunction.InvocationResponse.delayed_invocations', index=2,
- number=3, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR),
- _descriptor.FieldDescriptor(
- name='outgoing_egresses', full_name='org.apache.flink.statefun.flink.core.polyglot.FromFunction.InvocationResponse.outgoing_egresses', index=3,
- number=4, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=1618,
- serialized_end=2056,
-)
-
-_FROMFUNCTION_EXPIRATIONSPEC = _descriptor.Descriptor(
- name='ExpirationSpec',
- full_name='org.apache.flink.statefun.flink.core.polyglot.FromFunction.ExpirationSpec',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- fields=[
- _descriptor.FieldDescriptor(
- name='mode', full_name='org.apache.flink.statefun.flink.core.polyglot.FromFunction.ExpirationSpec.mode', index=0,
- number=1, type=14, cpp_type=8, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR),
- _descriptor.FieldDescriptor(
- name='expire_after_millis', full_name='org.apache.flink.statefun.flink.core.polyglot.FromFunction.ExpirationSpec.expire_after_millis', index=1,
- number=2, type=3, cpp_type=2, label=1,
- has_default_value=False, default_value=0,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- _FROMFUNCTION_EXPIRATIONSPEC_EXPIREMODE,
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=2059,
- serialized_end=2264,
-)
-
-_FROMFUNCTION_PERSISTEDVALUESPEC = _descriptor.Descriptor(
- name='PersistedValueSpec',
- full_name='org.apache.flink.statefun.flink.core.polyglot.FromFunction.PersistedValueSpec',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- fields=[
- _descriptor.FieldDescriptor(
- name='state_name', full_name='org.apache.flink.statefun.flink.core.polyglot.FromFunction.PersistedValueSpec.state_name', index=0,
- number=1, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=b"".decode('utf-8'),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR),
- _descriptor.FieldDescriptor(
- name='expiration_spec', full_name='org.apache.flink.statefun.flink.core.polyglot.FromFunction.PersistedValueSpec.expiration_spec', index=1,
- number=2, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=2267,
- serialized_end=2408,
-)
-
-_FROMFUNCTION_INCOMPLETEINVOCATIONCONTEXT = _descriptor.Descriptor(
- name='IncompleteInvocationContext',
- full_name='org.apache.flink.statefun.flink.core.polyglot.FromFunction.IncompleteInvocationContext',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- fields=[
- _descriptor.FieldDescriptor(
- name='missing_values', full_name='org.apache.flink.statefun.flink.core.polyglot.FromFunction.IncompleteInvocationContext.missing_values', index=0,
- number=1, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=2411,
- serialized_end=2544,
-)
-
-_FROMFUNCTION = _descriptor.Descriptor(
- name='FromFunction',
- full_name='org.apache.flink.statefun.flink.core.polyglot.FromFunction',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- fields=[
- _descriptor.FieldDescriptor(
- name='invocation_result', full_name='org.apache.flink.statefun.flink.core.polyglot.FromFunction.invocation_result', index=0,
- number=100, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR),
- _descriptor.FieldDescriptor(
- name='incomplete_invocation_context', full_name='org.apache.flink.statefun.flink.core.polyglot.FromFunction.incomplete_invocation_context', index=1,
- number=101, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- serialized_options=None, file=DESCRIPTOR),
- ],
- extensions=[
- ],
- nested_types=[_FROMFUNCTION_PERSISTEDVALUEMUTATION, _FROMFUNCTION_INVOCATION, _FROMFUNCTION_DELAYEDINVOCATION, _FROMFUNCTION_EGRESSMESSAGE, _FROMFUNCTION_INVOCATIONRESPONSE, _FROMFUNCTION_EXPIRATIONSPEC, _FROMFUNCTION_PERSISTEDVALUESPEC, _FROMFUNCTION_INCOMPLETEINVOCATIONCONTEXT, ],
- enum_types=[
- ],
- serialized_options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- _descriptor.OneofDescriptor(
- name='response', full_name='org.apache.flink.statefun.flink.core.polyglot.FromFunction.response',
- index=0, containing_type=None, fields=[]),
- ],
- serialized_start=748,
- serialized_end=2556,
-)
-
-_TOFUNCTION_PERSISTEDVALUE.containing_type = _TOFUNCTION
-_TOFUNCTION_INVOCATION.fields_by_name['caller'].message_type = _ADDRESS
-_TOFUNCTION_INVOCATION.fields_by_name['argument'].message_type = google_dot_protobuf_dot_any__pb2._ANY
-_TOFUNCTION_INVOCATION.containing_type = _TOFUNCTION
-_TOFUNCTION_INVOCATIONBATCHREQUEST.fields_by_name['target'].message_type = _ADDRESS
-_TOFUNCTION_INVOCATIONBATCHREQUEST.fields_by_name['state'].message_type = _TOFUNCTION_PERSISTEDVALUE
-_TOFUNCTION_INVOCATIONBATCHREQUEST.fields_by_name['invocations'].message_type = _TOFUNCTION_INVOCATION
-_TOFUNCTION_INVOCATIONBATCHREQUEST.containing_type = _TOFUNCTION
-_TOFUNCTION.fields_by_name['invocation'].message_type = _TOFUNCTION_INVOCATIONBATCHREQUEST
-_TOFUNCTION.oneofs_by_name['request'].fields.append(
- _TOFUNCTION.fields_by_name['invocation'])
-_TOFUNCTION.fields_by_name['invocation'].containing_oneof = _TOFUNCTION.oneofs_by_name['request']
-_FROMFUNCTION_PERSISTEDVALUEMUTATION.fields_by_name['mutation_type'].enum_type = _FROMFUNCTION_PERSISTEDVALUEMUTATION_MUTATIONTYPE
-_FROMFUNCTION_PERSISTEDVALUEMUTATION.containing_type = _FROMFUNCTION
-_FROMFUNCTION_PERSISTEDVALUEMUTATION_MUTATIONTYPE.containing_type = _FROMFUNCTION_PERSISTEDVALUEMUTATION
-_FROMFUNCTION_INVOCATION.fields_by_name['target'].message_type = _ADDRESS
-_FROMFUNCTION_INVOCATION.fields_by_name['argument'].message_type = google_dot_protobuf_dot_any__pb2._ANY
-_FROMFUNCTION_INVOCATION.containing_type = _FROMFUNCTION
-_FROMFUNCTION_DELAYEDINVOCATION.fields_by_name['target'].message_type = _ADDRESS
-_FROMFUNCTION_DELAYEDINVOCATION.fields_by_name['argument'].message_type = google_dot_protobuf_dot_any__pb2._ANY
-_FROMFUNCTION_DELAYEDINVOCATION.containing_type = _FROMFUNCTION
-_FROMFUNCTION_EGRESSMESSAGE.fields_by_name['argument'].message_type = google_dot_protobuf_dot_any__pb2._ANY
-_FROMFUNCTION_EGRESSMESSAGE.containing_type = _FROMFUNCTION
-_FROMFUNCTION_INVOCATIONRESPONSE.fields_by_name['state_mutations'].message_type = _FROMFUNCTION_PERSISTEDVALUEMUTATION
-_FROMFUNCTION_INVOCATIONRESPONSE.fields_by_name['outgoing_messages'].message_type = _FROMFUNCTION_INVOCATION
-_FROMFUNCTION_INVOCATIONRESPONSE.fields_by_name['delayed_invocations'].message_type = _FROMFUNCTION_DELAYEDINVOCATION
-_FROMFUNCTION_INVOCATIONRESPONSE.fields_by_name['outgoing_egresses'].message_type = _FROMFUNCTION_EGRESSMESSAGE
-_FROMFUNCTION_INVOCATIONRESPONSE.containing_type = _FROMFUNCTION
-_FROMFUNCTION_EXPIRATIONSPEC.fields_by_name['mode'].enum_type = _FROMFUNCTION_EXPIRATIONSPEC_EXPIREMODE
-_FROMFUNCTION_EXPIRATIONSPEC.containing_type = _FROMFUNCTION
-_FROMFUNCTION_EXPIRATIONSPEC_EXPIREMODE.containing_type = _FROMFUNCTION_EXPIRATIONSPEC
-_FROMFUNCTION_PERSISTEDVALUESPEC.fields_by_name['expiration_spec'].message_type = _FROMFUNCTION_EXPIRATIONSPEC
-_FROMFUNCTION_PERSISTEDVALUESPEC.containing_type = _FROMFUNCTION
-_FROMFUNCTION_INCOMPLETEINVOCATIONCONTEXT.fields_by_name['missing_values'].message_type = _FROMFUNCTION_PERSISTEDVALUESPEC
-_FROMFUNCTION_INCOMPLETEINVOCATIONCONTEXT.containing_type = _FROMFUNCTION
-_FROMFUNCTION.fields_by_name['invocation_result'].message_type = _FROMFUNCTION_INVOCATIONRESPONSE
-_FROMFUNCTION.fields_by_name['incomplete_invocation_context'].message_type = _FROMFUNCTION_INCOMPLETEINVOCATIONCONTEXT
-_FROMFUNCTION.oneofs_by_name['response'].fields.append(
- _FROMFUNCTION.fields_by_name['invocation_result'])
-_FROMFUNCTION.fields_by_name['invocation_result'].containing_oneof = _FROMFUNCTION.oneofs_by_name['response']
-_FROMFUNCTION.oneofs_by_name['response'].fields.append(
- _FROMFUNCTION.fields_by_name['incomplete_invocation_context'])
-_FROMFUNCTION.fields_by_name['incomplete_invocation_context'].containing_oneof = _FROMFUNCTION.oneofs_by_name['response']
-DESCRIPTOR.message_types_by_name['Address'] = _ADDRESS
-DESCRIPTOR.message_types_by_name['ToFunction'] = _TOFUNCTION
-DESCRIPTOR.message_types_by_name['FromFunction'] = _FROMFUNCTION
-_sym_db.RegisterFileDescriptor(DESCRIPTOR)
-
-Address = _reflection.GeneratedProtocolMessageType('Address', (_message.Message,), {
- 'DESCRIPTOR' : _ADDRESS,
- '__module__' : 'request_reply_pb2'
- # @@protoc_insertion_point(class_scope:org.apache.flink.statefun.flink.core.polyglot.Address)
- })
-_sym_db.RegisterMessage(Address)
-
-ToFunction = _reflection.GeneratedProtocolMessageType('ToFunction', (_message.Message,), {
-
- 'PersistedValue' : _reflection.GeneratedProtocolMessageType('PersistedValue', (_message.Message,), {
- 'DESCRIPTOR' : _TOFUNCTION_PERSISTEDVALUE,
- '__module__' : 'request_reply_pb2'
- # @@protoc_insertion_point(class_scope:org.apache.flink.statefun.flink.core.polyglot.ToFunction.PersistedValue)
- })
- ,
-
- 'Invocation' : _reflection.GeneratedProtocolMessageType('Invocation', (_message.Message,), {
- 'DESCRIPTOR' : _TOFUNCTION_INVOCATION,
- '__module__' : 'request_reply_pb2'
- # @@protoc_insertion_point(class_scope:org.apache.flink.statefun.flink.core.polyglot.ToFunction.Invocation)
- })
- ,
-
- 'InvocationBatchRequest' : _reflection.GeneratedProtocolMessageType('InvocationBatchRequest', (_message.Message,), {
- 'DESCRIPTOR' : _TOFUNCTION_INVOCATIONBATCHREQUEST,
- '__module__' : 'request_reply_pb2'
- # @@protoc_insertion_point(class_scope:org.apache.flink.statefun.flink.core.polyglot.ToFunction.InvocationBatchRequest)
- })
- ,
- 'DESCRIPTOR' : _TOFUNCTION,
- '__module__' : 'request_reply_pb2'
- # @@protoc_insertion_point(class_scope:org.apache.flink.statefun.flink.core.polyglot.ToFunction)
- })
-_sym_db.RegisterMessage(ToFunction)
-_sym_db.RegisterMessage(ToFunction.PersistedValue)
-_sym_db.RegisterMessage(ToFunction.Invocation)
-_sym_db.RegisterMessage(ToFunction.InvocationBatchRequest)
-
-FromFunction = _reflection.GeneratedProtocolMessageType('FromFunction', (_message.Message,), {
-
- 'PersistedValueMutation' : _reflection.GeneratedProtocolMessageType('PersistedValueMutation', (_message.Message,), {
- 'DESCRIPTOR' : _FROMFUNCTION_PERSISTEDVALUEMUTATION,
- '__module__' : 'request_reply_pb2'
- # @@protoc_insertion_point(class_scope:org.apache.flink.statefun.flink.core.polyglot.FromFunction.PersistedValueMutation)
- })
- ,
-
- 'Invocation' : _reflection.GeneratedProtocolMessageType('Invocation', (_message.Message,), {
- 'DESCRIPTOR' : _FROMFUNCTION_INVOCATION,
- '__module__' : 'request_reply_pb2'
- # @@protoc_insertion_point(class_scope:org.apache.flink.statefun.flink.core.polyglot.FromFunction.Invocation)
- })
- ,
-
- 'DelayedInvocation' : _reflection.GeneratedProtocolMessageType('DelayedInvocation', (_message.Message,), {
- 'DESCRIPTOR' : _FROMFUNCTION_DELAYEDINVOCATION,
- '__module__' : 'request_reply_pb2'
- # @@protoc_insertion_point(class_scope:org.apache.flink.statefun.flink.core.polyglot.FromFunction.DelayedInvocation)
- })
- ,
-
- 'EgressMessage' : _reflection.GeneratedProtocolMessageType('EgressMessage', (_message.Message,), {
- 'DESCRIPTOR' : _FROMFUNCTION_EGRESSMESSAGE,
- '__module__' : 'request_reply_pb2'
- # @@protoc_insertion_point(class_scope:org.apache.flink.statefun.flink.core.polyglot.FromFunction.EgressMessage)
- })
- ,
-
- 'InvocationResponse' : _reflection.GeneratedProtocolMessageType('InvocationResponse', (_message.Message,), {
- 'DESCRIPTOR' : _FROMFUNCTION_INVOCATIONRESPONSE,
- '__module__' : 'request_reply_pb2'
- # @@protoc_insertion_point(class_scope:org.apache.flink.statefun.flink.core.polyglot.FromFunction.InvocationResponse)
- })
- ,
-
- 'ExpirationSpec' : _reflection.GeneratedProtocolMessageType('ExpirationSpec', (_message.Message,), {
- 'DESCRIPTOR' : _FROMFUNCTION_EXPIRATIONSPEC,
- '__module__' : 'request_reply_pb2'
- # @@protoc_insertion_point(class_scope:org.apache.flink.statefun.flink.core.polyglot.FromFunction.ExpirationSpec)
- })
- ,
-
- 'PersistedValueSpec' : _reflection.GeneratedProtocolMessageType('PersistedValueSpec', (_message.Message,), {
- 'DESCRIPTOR' : _FROMFUNCTION_PERSISTEDVALUESPEC,
- '__module__' : 'request_reply_pb2'
- # @@protoc_insertion_point(class_scope:org.apache.flink.statefun.flink.core.polyglot.FromFunction.PersistedValueSpec)
- })
- ,
-
- 'IncompleteInvocationContext' : _reflection.GeneratedProtocolMessageType('IncompleteInvocationContext', (_message.Message,), {
- 'DESCRIPTOR' : _FROMFUNCTION_INCOMPLETEINVOCATIONCONTEXT,
- '__module__' : 'request_reply_pb2'
- # @@protoc_insertion_point(class_scope:org.apache.flink.statefun.flink.core.polyglot.FromFunction.IncompleteInvocationContext)
- })
- ,
- 'DESCRIPTOR' : _FROMFUNCTION,
- '__module__' : 'request_reply_pb2'
- # @@protoc_insertion_point(class_scope:org.apache.flink.statefun.flink.core.polyglot.FromFunction)
- })
-_sym_db.RegisterMessage(FromFunction)
-_sym_db.RegisterMessage(FromFunction.PersistedValueMutation)
-_sym_db.RegisterMessage(FromFunction.Invocation)
-_sym_db.RegisterMessage(FromFunction.DelayedInvocation)
-_sym_db.RegisterMessage(FromFunction.EgressMessage)
-_sym_db.RegisterMessage(FromFunction.InvocationResponse)
-_sym_db.RegisterMessage(FromFunction.ExpirationSpec)
-_sym_db.RegisterMessage(FromFunction.PersistedValueSpec)
-_sym_db.RegisterMessage(FromFunction.IncompleteInvocationContext)
-
-
-DESCRIPTOR._options = None
-# @@protoc_insertion_point(module_scope)
diff --git a/statefun-sdk-protos/pom.xml b/statefun-sdk-protos/pom.xml
new file mode 100644
index 0000000..7545d8b
--- /dev/null
+++ b/statefun-sdk-protos/pom.xml
@@ -0,0 +1,54 @@
+<?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:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>statefun-parent</artifactId>
+ <groupId>org.apache.flink</groupId>
+ <version>2.3-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>statefun-sdk-protos</artifactId>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <phase>package</phase>
+ <goals>
+ <goal>jar-no-fork</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ <resources>
+ <resource>
+ <!-- include src/main/protobuf in the resulting artifact. -->
+ <directory>src/main/protobuf</directory>
+ </resource>
+ </resources>
+ </build>
+</project>
diff --git a/statefun-flink/statefun-flink-core/src/main/protobuf/request-reply.proto b/statefun-sdk-protos/src/main/protobuf/request-reply.proto
similarity index 100%
rename from statefun-flink/statefun-flink-core/src/main/protobuf/request-reply.proto
rename to statefun-sdk-protos/src/main/protobuf/request-reply.proto