chamikaramj commented on a change in pull request #15343:
URL: https://github.com/apache/beam/pull/15343#discussion_r702226296



##########
File path: model/pipeline/src/main/proto/external_transforms.proto
##########
@@ -40,3 +41,59 @@ message ExternalConfigurationPayload {
   // schema.
   bytes payload = 2;
 }
+
+// This represents a builder method of the transform class. This may take one
+// or more parameters. This has to return an instance of the transform.
+message BuilderMethod {
+  // Name of the builder method
+  string name = 1;
+
+  // A schema that describes the parameter of the constructor or the 
constructor
+  // method used to create the transform object.
+  // The top level fields of the schema represents the parameters in order.
+  // Top level field names map to parameter names to use.
+  Schema schema = 2;
+
+  // A payload that maps to the provided builder method schema.

Review comment:
       Done.

##########
File path: model/pipeline/src/main/proto/external_transforms.proto
##########
@@ -40,3 +41,59 @@ message ExternalConfigurationPayload {
   // schema.
   bytes payload = 2;
 }
+
+// This represents a builder method of the transform class. This may take one
+// or more parameters. This has to return an instance of the transform.
+message BuilderMethod {
+  // Name of the builder method
+  string name = 1;
+
+  // A schema that describes the parameter of the constructor or the 
constructor

Review comment:
       Outdated now.

##########
File path: model/pipeline/src/main/proto/external_transforms.proto
##########
@@ -40,3 +41,59 @@ message ExternalConfigurationPayload {
   // schema.
   bytes payload = 2;
 }
+
+// This represents a builder method of the transform class. This may take one
+// or more parameters. This has to return an instance of the transform.
+message BuilderMethod {
+  // Name of the builder method
+  string name = 1;
+
+  // A schema that describes the parameter of the constructor or the 
constructor
+  // method used to create the transform object.
+  // The top level fields of the schema represents the parameters in order.
+  // Top level field names map to parameter names to use.
+  Schema schema = 2;
+
+  // A payload that maps to the provided builder method schema.
+  bytes payload = 3;
+}
+
+// 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 class's constructor will be used.
+  string constructor_method = 2;
+
+  // Set of builder methods and corresponding parameters to invoke after the
+  // transform object is constructed.
+  // Given builder methods will be invoked in order when constructing the
+  // transform objects.
+  repeated BuilderMethod builder_methods = 3;
+
+  // A schema that describes the parameter of the constructor or the 
constructor
+  // method used to create the transform object.
+  // The top level fields of the schema represents the parameters in order.
+  // Top level field names map to parameter names to use.
+  Schema constructor_schema = 4;
+
+  // A payload that maps to the provided constructor schema.

Review comment:
       Done.

##########
File path: model/pipeline/src/main/proto/external_transforms.proto
##########
@@ -40,3 +41,62 @@ message ExternalConfigurationPayload {
   // 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;
+
+  // 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 = 3;
+
+  // A schema that describes the parameter of the constructor or the 
constructor
+  // method used to instantiate the intial transform object.
+  // The top level fields of the schema represent the parameters in order.
+  // Top level field names map to parameter names to use.
+  Schema constructor_schema = 4;
+
+  // A payload that maps to the provided constructor schema.
+  bytes constructor_payload = 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;
+
+  // A schema that describes the parameters of the builder method.
+  // The top level fields of the schema represents the parameters in order.
+  // Top level field names map to parameter names to use.
+  Schema schema = 2;
+
+  // A payload that maps to the provided builder method schema.

Review comment:
       Done.

##########
File path: model/pipeline/src/main/proto/external_transforms.proto
##########
@@ -40,3 +41,59 @@ message ExternalConfigurationPayload {
   // schema.
   bytes payload = 2;
 }
+
+// This represents a builder method of the transform class. This may take one
+// or more parameters. This has to return an instance of the transform.
+message BuilderMethod {
+  // Name of the builder method
+  string name = 1;
+
+  // A schema that describes the parameter of the constructor or the 
constructor
+  // method used to create the transform object.
+  // The top level fields of the schema represents the parameters in order.
+  // Top level field names map to parameter names to use.

Review comment:
       We check the number of fields as well as the names of the fields in 
order.

##########
File path: model/pipeline/src/main/proto/external_transforms.proto
##########
@@ -40,3 +41,59 @@ message ExternalConfigurationPayload {
   // schema.
   bytes payload = 2;
 }
+
+// This represents a builder method of the transform class. This may take one
+// or more parameters. This has to return an instance of the transform.
+message BuilderMethod {
+  // Name of the builder method
+  string name = 1;
+
+  // A schema that describes the parameter of the constructor or the 
constructor
+  // method used to create the transform object.
+  // The top level fields of the schema represents the parameters in order.
+  // Top level field names map to parameter names to use.
+  Schema schema = 2;
+
+  // A payload that maps to the provided builder method schema.
+  bytes payload = 3;
+}
+
+// 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 class's constructor will be used.
+  string constructor_method = 2;
+
+  // Set of builder methods and corresponding parameters to invoke after the
+  // transform object is constructed.
+  // Given builder methods will be invoked in order when constructing the
+  // transform objects.
+  repeated BuilderMethod builder_methods = 3;

Review comment:
       Done.

##########
File path: model/pipeline/src/main/proto/external_transforms.proto
##########
@@ -40,3 +41,62 @@ message ExternalConfigurationPayload {
   // 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;
+
+  // 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 = 3;
+
+  // A schema that describes the parameter of the constructor or the 
constructor
+  // method used to instantiate the intial transform object.
+  // The top level fields of the schema represent the parameters in order.
+  // Top level field names map to parameter names to use.

Review comment:
       Done.

##########
File path: model/pipeline/src/main/proto/external_transforms.proto
##########
@@ -40,3 +41,62 @@ message ExternalConfigurationPayload {
   // 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;
+
+  // 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 = 3;
+
+  // A schema that describes the parameter of the constructor or the 
constructor
+  // method used to instantiate the intial transform object.
+  // The top level fields of the schema represent the parameters in order.
+  // Top level field names map to parameter names to use.
+  Schema constructor_schema = 4;
+
+  // A payload that maps to the provided constructor schema.
+  bytes constructor_payload = 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;
+
+  // A schema that describes the parameters of the builder method.
+  // The top level fields of the schema represents the parameters in order.
+  // Top level field names map to parameter names to use.

Review comment:
       Done.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to