forked from apache/beam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
external_transforms.proto
105 lines (87 loc) · 3.69 KB
/
external_transforms.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/*
* 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.
*/
/*
* Protocol Buffers describing the external transforms available.
*/
syntax = "proto3";
package org.apache.beam.model.pipeline.v1;
option go_package = "github.com/apache/beam/sdks/v2/go/pkg/beam/model/pipeline_v1;pipeline_v1";
option java_package = "org.apache.beam.model.pipeline.v1";
option java_outer_classname = "ExternalTransforms";
import "schema.proto";
import "beam_runner_api.proto";
// A configuration payload for an external transform.
// Used as the payload of ExternalTransform as part of an ExpansionRequest.
message ExternalConfigurationPayload {
// A schema for use in beam:coder:row:v1
Schema schema = 1;
// A payload which can be decoded using beam:coder:row:v1 and the given
// schema.
bytes payload = 2;
}
// Defines specific expansion methods that may be used to expand cross-language
// transforms.
// Has to be set as the URN of the transform of the expansion request.
message ExpansionMethods {
enum Enum {
// Expand a Java transform using specified constructor and builder methods.
// Transform payload will be of type JavaClassLookupPayload.
JAVA_CLASS_LOOKUP = 0 [(org.apache.beam.model.pipeline.v1.beam_urn) =
"beam:expansion:payload:java_class_lookup:v1"];
}
}
// A configuration payload for an external transform.
// Used to define a Java transform that can be directly instantiated by a Java
// expansion service.
message JavaClassLookupPayload {
// Name of the Java transform class.
string class_name = 1;
// A static method to construct the initial instance of the transform.
// If not provided, the transform should be instantiated using a class
// constructor.
string constructor_method = 2;
// The top level fields of the schema represent the method parameters in
// order.
// If able, top level field names are also verified against the method
// parameters for a match.
Schema constructor_schema = 3;
// A payload which can be decoded using beam:coder:row:v1 and the provided
// constructor schema.
bytes constructor_payload = 4;
// Set of builder methods and corresponding parameters to apply after the
// transform object is constructed.
// When constructing the transform object, given builder methods will be
// applied in order.
repeated BuilderMethod builder_methods = 5;
}
// This represents a builder method of the transform class that should be
// applied in-order after instantiating the initial transform object.
// Each builder method may take one or more parameters and has to return an
// instance of the transform object.
message BuilderMethod {
// Name of the builder method
string name = 1;
// The top level fields of the schema represent the method parameters in
// order.
// If able, top level field names are also verified against the method
// parameters for a match.
Schema schema = 2;
// A payload which can be decoded using beam:coder:row:v1 and the builder
// method schema.
bytes payload = 3;
}