blob: c636677d24216784041b31dc920b0e27c162a164 [file] [log] [blame]
//
// DO NOT EDIT.
// swift-format-ignore-file
//
// Generated by the protocol buffer compiler.
// Source: org/apache/beam/model/fn_execution/v1/beam_fn_api.proto
//
//
// Copyright 2018, gRPC Authors All rights reserved.
//
// Licensed 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.
//
import GRPC
import NIO
import NIOConcurrencyHelpers
import SwiftProtobuf
/// An API that describes the work that a SDK harness is meant to do.
/// Stable
///
/// Usage: instantiate `Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlClient`, then call methods of this protocol to make API calls.
internal protocol Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlClientProtocol: GRPCClient {
var serviceName: String { get }
var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlClientInterceptorFactoryProtocol? { get }
func control(
callOptions: CallOptions?,
handler: @escaping (Org_Apache_Beam_Model_FnExecution_V1_InstructionRequest) -> Void
) -> BidirectionalStreamingCall<Org_Apache_Beam_Model_FnExecution_V1_InstructionResponse, Org_Apache_Beam_Model_FnExecution_V1_InstructionRequest>
func getProcessBundleDescriptor(
_ request: Org_Apache_Beam_Model_FnExecution_V1_GetProcessBundleDescriptorRequest,
callOptions: CallOptions?
) -> UnaryCall<Org_Apache_Beam_Model_FnExecution_V1_GetProcessBundleDescriptorRequest, Org_Apache_Beam_Model_FnExecution_V1_ProcessBundleDescriptor>
}
extension Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlClientProtocol {
internal var serviceName: String {
return "org.apache.beam.model.fn_execution.v1.BeamFnControl"
}
/// Instructions sent by the runner to the SDK requesting different types
/// of work.
///
/// Callers should use the `send` method on the returned object to send messages
/// to the server. The caller should send an `.end` after the final message has been sent.
///
/// - Parameters:
/// - callOptions: Call options.
/// - handler: A closure called when each response is received from the server.
/// - Returns: A `ClientStreamingCall` with futures for the metadata and status.
internal func control(
callOptions: CallOptions? = nil,
handler: @escaping (Org_Apache_Beam_Model_FnExecution_V1_InstructionRequest) -> Void
) -> BidirectionalStreamingCall<Org_Apache_Beam_Model_FnExecution_V1_InstructionResponse, Org_Apache_Beam_Model_FnExecution_V1_InstructionRequest> {
return self.makeBidirectionalStreamingCall(
path: Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlClientMetadata.Methods.control.path,
callOptions: callOptions ?? self.defaultCallOptions,
interceptors: self.interceptors?.makeControlInterceptors() ?? [],
handler: handler
)
}
/// Used to get the full process bundle descriptors for bundles one
/// is asked to process.
///
/// - Parameters:
/// - request: Request to send to GetProcessBundleDescriptor.
/// - callOptions: Call options.
/// - Returns: A `UnaryCall` with futures for the metadata, status and response.
internal func getProcessBundleDescriptor(
_ request: Org_Apache_Beam_Model_FnExecution_V1_GetProcessBundleDescriptorRequest,
callOptions: CallOptions? = nil
) -> UnaryCall<Org_Apache_Beam_Model_FnExecution_V1_GetProcessBundleDescriptorRequest, Org_Apache_Beam_Model_FnExecution_V1_ProcessBundleDescriptor> {
return self.makeUnaryCall(
path: Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlClientMetadata.Methods.getProcessBundleDescriptor.path,
request: request,
callOptions: callOptions ?? self.defaultCallOptions,
interceptors: self.interceptors?.makeGetProcessBundleDescriptorInterceptors() ?? []
)
}
}
@available(*, deprecated)
extension Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlClient: @unchecked Sendable {}
@available(*, deprecated, renamed: "Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlNIOClient")
internal final class Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlClient: Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlClientProtocol {
private let lock = Lock()
private var _defaultCallOptions: CallOptions
private var _interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlClientInterceptorFactoryProtocol?
internal let channel: GRPCChannel
internal var defaultCallOptions: CallOptions {
get { self.lock.withLock { return self._defaultCallOptions } }
set { self.lock.withLockVoid { self._defaultCallOptions = newValue } }
}
internal var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlClientInterceptorFactoryProtocol? {
get { self.lock.withLock { return self._interceptors } }
set { self.lock.withLockVoid { self._interceptors = newValue } }
}
/// Creates a client for the org.apache.beam.model.fn_execution.v1.BeamFnControl service.
///
/// - Parameters:
/// - channel: `GRPCChannel` to the service host.
/// - defaultCallOptions: Options to use for each service call if the user doesn't provide them.
/// - interceptors: A factory providing interceptors for each RPC.
internal init(
channel: GRPCChannel,
defaultCallOptions: CallOptions = CallOptions(),
interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlClientInterceptorFactoryProtocol? = nil
) {
self.channel = channel
self._defaultCallOptions = defaultCallOptions
self._interceptors = interceptors
}
}
internal struct Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlNIOClient: Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlClientProtocol {
internal var channel: GRPCChannel
internal var defaultCallOptions: CallOptions
internal var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlClientInterceptorFactoryProtocol?
/// Creates a client for the org.apache.beam.model.fn_execution.v1.BeamFnControl service.
///
/// - Parameters:
/// - channel: `GRPCChannel` to the service host.
/// - defaultCallOptions: Options to use for each service call if the user doesn't provide them.
/// - interceptors: A factory providing interceptors for each RPC.
internal init(
channel: GRPCChannel,
defaultCallOptions: CallOptions = CallOptions(),
interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlClientInterceptorFactoryProtocol? = nil
) {
self.channel = channel
self.defaultCallOptions = defaultCallOptions
self.interceptors = interceptors
}
}
/// An API that describes the work that a SDK harness is meant to do.
/// Stable
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
internal protocol Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlAsyncClientProtocol: GRPCClient {
static var serviceDescriptor: GRPCServiceDescriptor { get }
var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlClientInterceptorFactoryProtocol? { get }
func makeControlCall(
callOptions: CallOptions?
) -> GRPCAsyncBidirectionalStreamingCall<Org_Apache_Beam_Model_FnExecution_V1_InstructionResponse, Org_Apache_Beam_Model_FnExecution_V1_InstructionRequest>
func makeGetProcessBundleDescriptorCall(
_ request: Org_Apache_Beam_Model_FnExecution_V1_GetProcessBundleDescriptorRequest,
callOptions: CallOptions?
) -> GRPCAsyncUnaryCall<Org_Apache_Beam_Model_FnExecution_V1_GetProcessBundleDescriptorRequest, Org_Apache_Beam_Model_FnExecution_V1_ProcessBundleDescriptor>
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlAsyncClientProtocol {
internal static var serviceDescriptor: GRPCServiceDescriptor {
return Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlClientMetadata.serviceDescriptor
}
internal var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlClientInterceptorFactoryProtocol? {
return nil
}
internal func makeControlCall(
callOptions: CallOptions? = nil
) -> GRPCAsyncBidirectionalStreamingCall<Org_Apache_Beam_Model_FnExecution_V1_InstructionResponse, Org_Apache_Beam_Model_FnExecution_V1_InstructionRequest> {
return self.makeAsyncBidirectionalStreamingCall(
path: Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlClientMetadata.Methods.control.path,
callOptions: callOptions ?? self.defaultCallOptions,
interceptors: self.interceptors?.makeControlInterceptors() ?? []
)
}
internal func makeGetProcessBundleDescriptorCall(
_ request: Org_Apache_Beam_Model_FnExecution_V1_GetProcessBundleDescriptorRequest,
callOptions: CallOptions? = nil
) -> GRPCAsyncUnaryCall<Org_Apache_Beam_Model_FnExecution_V1_GetProcessBundleDescriptorRequest, Org_Apache_Beam_Model_FnExecution_V1_ProcessBundleDescriptor> {
return self.makeAsyncUnaryCall(
path: Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlClientMetadata.Methods.getProcessBundleDescriptor.path,
request: request,
callOptions: callOptions ?? self.defaultCallOptions,
interceptors: self.interceptors?.makeGetProcessBundleDescriptorInterceptors() ?? []
)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlAsyncClientProtocol {
internal func control<RequestStream>(
_ requests: RequestStream,
callOptions: CallOptions? = nil
) -> GRPCAsyncResponseStream<Org_Apache_Beam_Model_FnExecution_V1_InstructionRequest> where RequestStream: Sequence, RequestStream.Element == Org_Apache_Beam_Model_FnExecution_V1_InstructionResponse {
return self.performAsyncBidirectionalStreamingCall(
path: Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlClientMetadata.Methods.control.path,
requests: requests,
callOptions: callOptions ?? self.defaultCallOptions,
interceptors: self.interceptors?.makeControlInterceptors() ?? []
)
}
internal func control<RequestStream>(
_ requests: RequestStream,
callOptions: CallOptions? = nil
) -> GRPCAsyncResponseStream<Org_Apache_Beam_Model_FnExecution_V1_InstructionRequest> where RequestStream: AsyncSequence & Sendable, RequestStream.Element == Org_Apache_Beam_Model_FnExecution_V1_InstructionResponse {
return self.performAsyncBidirectionalStreamingCall(
path: Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlClientMetadata.Methods.control.path,
requests: requests,
callOptions: callOptions ?? self.defaultCallOptions,
interceptors: self.interceptors?.makeControlInterceptors() ?? []
)
}
internal func getProcessBundleDescriptor(
_ request: Org_Apache_Beam_Model_FnExecution_V1_GetProcessBundleDescriptorRequest,
callOptions: CallOptions? = nil
) async throws -> Org_Apache_Beam_Model_FnExecution_V1_ProcessBundleDescriptor {
return try await self.performAsyncUnaryCall(
path: Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlClientMetadata.Methods.getProcessBundleDescriptor.path,
request: request,
callOptions: callOptions ?? self.defaultCallOptions,
interceptors: self.interceptors?.makeGetProcessBundleDescriptorInterceptors() ?? []
)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
internal struct Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlAsyncClient: Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlAsyncClientProtocol {
internal var channel: GRPCChannel
internal var defaultCallOptions: CallOptions
internal var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlClientInterceptorFactoryProtocol?
internal init(
channel: GRPCChannel,
defaultCallOptions: CallOptions = CallOptions(),
interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlClientInterceptorFactoryProtocol? = nil
) {
self.channel = channel
self.defaultCallOptions = defaultCallOptions
self.interceptors = interceptors
}
}
internal protocol Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlClientInterceptorFactoryProtocol: Sendable {
/// - Returns: Interceptors to use when invoking 'control'.
func makeControlInterceptors() -> [ClientInterceptor<Org_Apache_Beam_Model_FnExecution_V1_InstructionResponse, Org_Apache_Beam_Model_FnExecution_V1_InstructionRequest>]
/// - Returns: Interceptors to use when invoking 'getProcessBundleDescriptor'.
func makeGetProcessBundleDescriptorInterceptors() -> [ClientInterceptor<Org_Apache_Beam_Model_FnExecution_V1_GetProcessBundleDescriptorRequest, Org_Apache_Beam_Model_FnExecution_V1_ProcessBundleDescriptor>]
}
internal enum Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlClientMetadata {
internal static let serviceDescriptor = GRPCServiceDescriptor(
name: "BeamFnControl",
fullName: "org.apache.beam.model.fn_execution.v1.BeamFnControl",
methods: [
Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlClientMetadata.Methods.control,
Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlClientMetadata.Methods.getProcessBundleDescriptor,
]
)
internal enum Methods {
internal static let control = GRPCMethodDescriptor(
name: "Control",
path: "/org.apache.beam.model.fn_execution.v1.BeamFnControl/Control",
type: GRPCCallType.bidirectionalStreaming
)
internal static let getProcessBundleDescriptor = GRPCMethodDescriptor(
name: "GetProcessBundleDescriptor",
path: "/org.apache.beam.model.fn_execution.v1.BeamFnControl/GetProcessBundleDescriptor",
type: GRPCCallType.unary
)
}
}
/// Stable
///
/// Usage: instantiate `Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataClient`, then call methods of this protocol to make API calls.
internal protocol Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataClientProtocol: GRPCClient {
var serviceName: String { get }
var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataClientInterceptorFactoryProtocol? { get }
func data(
callOptions: CallOptions?,
handler: @escaping (Org_Apache_Beam_Model_FnExecution_V1_Elements) -> Void
) -> BidirectionalStreamingCall<Org_Apache_Beam_Model_FnExecution_V1_Elements, Org_Apache_Beam_Model_FnExecution_V1_Elements>
}
extension Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataClientProtocol {
internal var serviceName: String {
return "org.apache.beam.model.fn_execution.v1.BeamFnData"
}
/// Used to send data between harnesses.
///
/// Callers should use the `send` method on the returned object to send messages
/// to the server. The caller should send an `.end` after the final message has been sent.
///
/// - Parameters:
/// - callOptions: Call options.
/// - handler: A closure called when each response is received from the server.
/// - Returns: A `ClientStreamingCall` with futures for the metadata and status.
internal func data(
callOptions: CallOptions? = nil,
handler: @escaping (Org_Apache_Beam_Model_FnExecution_V1_Elements) -> Void
) -> BidirectionalStreamingCall<Org_Apache_Beam_Model_FnExecution_V1_Elements, Org_Apache_Beam_Model_FnExecution_V1_Elements> {
return self.makeBidirectionalStreamingCall(
path: Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataClientMetadata.Methods.data.path,
callOptions: callOptions ?? self.defaultCallOptions,
interceptors: self.interceptors?.makeDataInterceptors() ?? [],
handler: handler
)
}
}
@available(*, deprecated)
extension Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataClient: @unchecked Sendable {}
@available(*, deprecated, renamed: "Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataNIOClient")
internal final class Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataClient: Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataClientProtocol {
private let lock = Lock()
private var _defaultCallOptions: CallOptions
private var _interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataClientInterceptorFactoryProtocol?
internal let channel: GRPCChannel
internal var defaultCallOptions: CallOptions {
get { self.lock.withLock { return self._defaultCallOptions } }
set { self.lock.withLockVoid { self._defaultCallOptions = newValue } }
}
internal var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataClientInterceptorFactoryProtocol? {
get { self.lock.withLock { return self._interceptors } }
set { self.lock.withLockVoid { self._interceptors = newValue } }
}
/// Creates a client for the org.apache.beam.model.fn_execution.v1.BeamFnData service.
///
/// - Parameters:
/// - channel: `GRPCChannel` to the service host.
/// - defaultCallOptions: Options to use for each service call if the user doesn't provide them.
/// - interceptors: A factory providing interceptors for each RPC.
internal init(
channel: GRPCChannel,
defaultCallOptions: CallOptions = CallOptions(),
interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataClientInterceptorFactoryProtocol? = nil
) {
self.channel = channel
self._defaultCallOptions = defaultCallOptions
self._interceptors = interceptors
}
}
internal struct Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataNIOClient: Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataClientProtocol {
internal var channel: GRPCChannel
internal var defaultCallOptions: CallOptions
internal var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataClientInterceptorFactoryProtocol?
/// Creates a client for the org.apache.beam.model.fn_execution.v1.BeamFnData service.
///
/// - Parameters:
/// - channel: `GRPCChannel` to the service host.
/// - defaultCallOptions: Options to use for each service call if the user doesn't provide them.
/// - interceptors: A factory providing interceptors for each RPC.
internal init(
channel: GRPCChannel,
defaultCallOptions: CallOptions = CallOptions(),
interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataClientInterceptorFactoryProtocol? = nil
) {
self.channel = channel
self.defaultCallOptions = defaultCallOptions
self.interceptors = interceptors
}
}
/// Stable
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
internal protocol Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataAsyncClientProtocol: GRPCClient {
static var serviceDescriptor: GRPCServiceDescriptor { get }
var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataClientInterceptorFactoryProtocol? { get }
func makeDataCall(
callOptions: CallOptions?
) -> GRPCAsyncBidirectionalStreamingCall<Org_Apache_Beam_Model_FnExecution_V1_Elements, Org_Apache_Beam_Model_FnExecution_V1_Elements>
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataAsyncClientProtocol {
internal static var serviceDescriptor: GRPCServiceDescriptor {
return Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataClientMetadata.serviceDescriptor
}
internal var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataClientInterceptorFactoryProtocol? {
return nil
}
internal func makeDataCall(
callOptions: CallOptions? = nil
) -> GRPCAsyncBidirectionalStreamingCall<Org_Apache_Beam_Model_FnExecution_V1_Elements, Org_Apache_Beam_Model_FnExecution_V1_Elements> {
return self.makeAsyncBidirectionalStreamingCall(
path: Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataClientMetadata.Methods.data.path,
callOptions: callOptions ?? self.defaultCallOptions,
interceptors: self.interceptors?.makeDataInterceptors() ?? []
)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataAsyncClientProtocol {
internal func data<RequestStream>(
_ requests: RequestStream,
callOptions: CallOptions? = nil
) -> GRPCAsyncResponseStream<Org_Apache_Beam_Model_FnExecution_V1_Elements> where RequestStream: Sequence, RequestStream.Element == Org_Apache_Beam_Model_FnExecution_V1_Elements {
return self.performAsyncBidirectionalStreamingCall(
path: Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataClientMetadata.Methods.data.path,
requests: requests,
callOptions: callOptions ?? self.defaultCallOptions,
interceptors: self.interceptors?.makeDataInterceptors() ?? []
)
}
internal func data<RequestStream>(
_ requests: RequestStream,
callOptions: CallOptions? = nil
) -> GRPCAsyncResponseStream<Org_Apache_Beam_Model_FnExecution_V1_Elements> where RequestStream: AsyncSequence & Sendable, RequestStream.Element == Org_Apache_Beam_Model_FnExecution_V1_Elements {
return self.performAsyncBidirectionalStreamingCall(
path: Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataClientMetadata.Methods.data.path,
requests: requests,
callOptions: callOptions ?? self.defaultCallOptions,
interceptors: self.interceptors?.makeDataInterceptors() ?? []
)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
internal struct Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataAsyncClient: Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataAsyncClientProtocol {
internal var channel: GRPCChannel
internal var defaultCallOptions: CallOptions
internal var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataClientInterceptorFactoryProtocol?
internal init(
channel: GRPCChannel,
defaultCallOptions: CallOptions = CallOptions(),
interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataClientInterceptorFactoryProtocol? = nil
) {
self.channel = channel
self.defaultCallOptions = defaultCallOptions
self.interceptors = interceptors
}
}
internal protocol Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataClientInterceptorFactoryProtocol: Sendable {
/// - Returns: Interceptors to use when invoking 'data'.
func makeDataInterceptors() -> [ClientInterceptor<Org_Apache_Beam_Model_FnExecution_V1_Elements, Org_Apache_Beam_Model_FnExecution_V1_Elements>]
}
internal enum Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataClientMetadata {
internal static let serviceDescriptor = GRPCServiceDescriptor(
name: "BeamFnData",
fullName: "org.apache.beam.model.fn_execution.v1.BeamFnData",
methods: [
Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataClientMetadata.Methods.data,
]
)
internal enum Methods {
internal static let data = GRPCMethodDescriptor(
name: "Data",
path: "/org.apache.beam.model.fn_execution.v1.BeamFnData/Data",
type: GRPCCallType.bidirectionalStreaming
)
}
}
/// Usage: instantiate `Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateClient`, then call methods of this protocol to make API calls.
internal protocol Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateClientProtocol: GRPCClient {
var serviceName: String { get }
var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateClientInterceptorFactoryProtocol? { get }
func state(
callOptions: CallOptions?,
handler: @escaping (Org_Apache_Beam_Model_FnExecution_V1_StateResponse) -> Void
) -> BidirectionalStreamingCall<Org_Apache_Beam_Model_FnExecution_V1_StateRequest, Org_Apache_Beam_Model_FnExecution_V1_StateResponse>
}
extension Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateClientProtocol {
internal var serviceName: String {
return "org.apache.beam.model.fn_execution.v1.BeamFnState"
}
/// Used to get/append/clear state stored by the runner on behalf of the SDK.
///
/// Callers should use the `send` method on the returned object to send messages
/// to the server. The caller should send an `.end` after the final message has been sent.
///
/// - Parameters:
/// - callOptions: Call options.
/// - handler: A closure called when each response is received from the server.
/// - Returns: A `ClientStreamingCall` with futures for the metadata and status.
internal func state(
callOptions: CallOptions? = nil,
handler: @escaping (Org_Apache_Beam_Model_FnExecution_V1_StateResponse) -> Void
) -> BidirectionalStreamingCall<Org_Apache_Beam_Model_FnExecution_V1_StateRequest, Org_Apache_Beam_Model_FnExecution_V1_StateResponse> {
return self.makeBidirectionalStreamingCall(
path: Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateClientMetadata.Methods.state.path,
callOptions: callOptions ?? self.defaultCallOptions,
interceptors: self.interceptors?.makeStateInterceptors() ?? [],
handler: handler
)
}
}
@available(*, deprecated)
extension Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateClient: @unchecked Sendable {}
@available(*, deprecated, renamed: "Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateNIOClient")
internal final class Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateClient: Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateClientProtocol {
private let lock = Lock()
private var _defaultCallOptions: CallOptions
private var _interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateClientInterceptorFactoryProtocol?
internal let channel: GRPCChannel
internal var defaultCallOptions: CallOptions {
get { self.lock.withLock { return self._defaultCallOptions } }
set { self.lock.withLockVoid { self._defaultCallOptions = newValue } }
}
internal var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateClientInterceptorFactoryProtocol? {
get { self.lock.withLock { return self._interceptors } }
set { self.lock.withLockVoid { self._interceptors = newValue } }
}
/// Creates a client for the org.apache.beam.model.fn_execution.v1.BeamFnState service.
///
/// - Parameters:
/// - channel: `GRPCChannel` to the service host.
/// - defaultCallOptions: Options to use for each service call if the user doesn't provide them.
/// - interceptors: A factory providing interceptors for each RPC.
internal init(
channel: GRPCChannel,
defaultCallOptions: CallOptions = CallOptions(),
interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateClientInterceptorFactoryProtocol? = nil
) {
self.channel = channel
self._defaultCallOptions = defaultCallOptions
self._interceptors = interceptors
}
}
internal struct Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateNIOClient: Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateClientProtocol {
internal var channel: GRPCChannel
internal var defaultCallOptions: CallOptions
internal var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateClientInterceptorFactoryProtocol?
/// Creates a client for the org.apache.beam.model.fn_execution.v1.BeamFnState service.
///
/// - Parameters:
/// - channel: `GRPCChannel` to the service host.
/// - defaultCallOptions: Options to use for each service call if the user doesn't provide them.
/// - interceptors: A factory providing interceptors for each RPC.
internal init(
channel: GRPCChannel,
defaultCallOptions: CallOptions = CallOptions(),
interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateClientInterceptorFactoryProtocol? = nil
) {
self.channel = channel
self.defaultCallOptions = defaultCallOptions
self.interceptors = interceptors
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
internal protocol Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateAsyncClientProtocol: GRPCClient {
static var serviceDescriptor: GRPCServiceDescriptor { get }
var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateClientInterceptorFactoryProtocol? { get }
func makeStateCall(
callOptions: CallOptions?
) -> GRPCAsyncBidirectionalStreamingCall<Org_Apache_Beam_Model_FnExecution_V1_StateRequest, Org_Apache_Beam_Model_FnExecution_V1_StateResponse>
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateAsyncClientProtocol {
internal static var serviceDescriptor: GRPCServiceDescriptor {
return Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateClientMetadata.serviceDescriptor
}
internal var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateClientInterceptorFactoryProtocol? {
return nil
}
internal func makeStateCall(
callOptions: CallOptions? = nil
) -> GRPCAsyncBidirectionalStreamingCall<Org_Apache_Beam_Model_FnExecution_V1_StateRequest, Org_Apache_Beam_Model_FnExecution_V1_StateResponse> {
return self.makeAsyncBidirectionalStreamingCall(
path: Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateClientMetadata.Methods.state.path,
callOptions: callOptions ?? self.defaultCallOptions,
interceptors: self.interceptors?.makeStateInterceptors() ?? []
)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateAsyncClientProtocol {
internal func state<RequestStream>(
_ requests: RequestStream,
callOptions: CallOptions? = nil
) -> GRPCAsyncResponseStream<Org_Apache_Beam_Model_FnExecution_V1_StateResponse> where RequestStream: Sequence, RequestStream.Element == Org_Apache_Beam_Model_FnExecution_V1_StateRequest {
return self.performAsyncBidirectionalStreamingCall(
path: Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateClientMetadata.Methods.state.path,
requests: requests,
callOptions: callOptions ?? self.defaultCallOptions,
interceptors: self.interceptors?.makeStateInterceptors() ?? []
)
}
internal func state<RequestStream>(
_ requests: RequestStream,
callOptions: CallOptions? = nil
) -> GRPCAsyncResponseStream<Org_Apache_Beam_Model_FnExecution_V1_StateResponse> where RequestStream: AsyncSequence & Sendable, RequestStream.Element == Org_Apache_Beam_Model_FnExecution_V1_StateRequest {
return self.performAsyncBidirectionalStreamingCall(
path: Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateClientMetadata.Methods.state.path,
requests: requests,
callOptions: callOptions ?? self.defaultCallOptions,
interceptors: self.interceptors?.makeStateInterceptors() ?? []
)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
internal struct Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateAsyncClient: Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateAsyncClientProtocol {
internal var channel: GRPCChannel
internal var defaultCallOptions: CallOptions
internal var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateClientInterceptorFactoryProtocol?
internal init(
channel: GRPCChannel,
defaultCallOptions: CallOptions = CallOptions(),
interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateClientInterceptorFactoryProtocol? = nil
) {
self.channel = channel
self.defaultCallOptions = defaultCallOptions
self.interceptors = interceptors
}
}
internal protocol Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateClientInterceptorFactoryProtocol: Sendable {
/// - Returns: Interceptors to use when invoking 'state'.
func makeStateInterceptors() -> [ClientInterceptor<Org_Apache_Beam_Model_FnExecution_V1_StateRequest, Org_Apache_Beam_Model_FnExecution_V1_StateResponse>]
}
internal enum Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateClientMetadata {
internal static let serviceDescriptor = GRPCServiceDescriptor(
name: "BeamFnState",
fullName: "org.apache.beam.model.fn_execution.v1.BeamFnState",
methods: [
Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateClientMetadata.Methods.state,
]
)
internal enum Methods {
internal static let state = GRPCMethodDescriptor(
name: "State",
path: "/org.apache.beam.model.fn_execution.v1.BeamFnState/State",
type: GRPCCallType.bidirectionalStreaming
)
}
}
/// Stable
///
/// Usage: instantiate `Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingClient`, then call methods of this protocol to make API calls.
internal protocol Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingClientProtocol: GRPCClient {
var serviceName: String { get }
var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingClientInterceptorFactoryProtocol? { get }
func logging(
callOptions: CallOptions?,
handler: @escaping (Org_Apache_Beam_Model_FnExecution_V1_LogControl) -> Void
) -> BidirectionalStreamingCall<Org_Apache_Beam_Model_FnExecution_V1_LogEntry.List, Org_Apache_Beam_Model_FnExecution_V1_LogControl>
}
extension Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingClientProtocol {
internal var serviceName: String {
return "org.apache.beam.model.fn_execution.v1.BeamFnLogging"
}
/// Allows for the SDK to emit log entries which the runner can
/// associate with the active job.
///
/// Callers should use the `send` method on the returned object to send messages
/// to the server. The caller should send an `.end` after the final message has been sent.
///
/// - Parameters:
/// - callOptions: Call options.
/// - handler: A closure called when each response is received from the server.
/// - Returns: A `ClientStreamingCall` with futures for the metadata and status.
internal func logging(
callOptions: CallOptions? = nil,
handler: @escaping (Org_Apache_Beam_Model_FnExecution_V1_LogControl) -> Void
) -> BidirectionalStreamingCall<Org_Apache_Beam_Model_FnExecution_V1_LogEntry.List, Org_Apache_Beam_Model_FnExecution_V1_LogControl> {
return self.makeBidirectionalStreamingCall(
path: Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingClientMetadata.Methods.logging.path,
callOptions: callOptions ?? self.defaultCallOptions,
interceptors: self.interceptors?.makeLoggingInterceptors() ?? [],
handler: handler
)
}
}
@available(*, deprecated)
extension Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingClient: @unchecked Sendable {}
@available(*, deprecated, renamed: "Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingNIOClient")
internal final class Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingClient: Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingClientProtocol {
private let lock = Lock()
private var _defaultCallOptions: CallOptions
private var _interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingClientInterceptorFactoryProtocol?
internal let channel: GRPCChannel
internal var defaultCallOptions: CallOptions {
get { self.lock.withLock { return self._defaultCallOptions } }
set { self.lock.withLockVoid { self._defaultCallOptions = newValue } }
}
internal var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingClientInterceptorFactoryProtocol? {
get { self.lock.withLock { return self._interceptors } }
set { self.lock.withLockVoid { self._interceptors = newValue } }
}
/// Creates a client for the org.apache.beam.model.fn_execution.v1.BeamFnLogging service.
///
/// - Parameters:
/// - channel: `GRPCChannel` to the service host.
/// - defaultCallOptions: Options to use for each service call if the user doesn't provide them.
/// - interceptors: A factory providing interceptors for each RPC.
internal init(
channel: GRPCChannel,
defaultCallOptions: CallOptions = CallOptions(),
interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingClientInterceptorFactoryProtocol? = nil
) {
self.channel = channel
self._defaultCallOptions = defaultCallOptions
self._interceptors = interceptors
}
}
internal struct Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingNIOClient: Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingClientProtocol {
internal var channel: GRPCChannel
internal var defaultCallOptions: CallOptions
internal var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingClientInterceptorFactoryProtocol?
/// Creates a client for the org.apache.beam.model.fn_execution.v1.BeamFnLogging service.
///
/// - Parameters:
/// - channel: `GRPCChannel` to the service host.
/// - defaultCallOptions: Options to use for each service call if the user doesn't provide them.
/// - interceptors: A factory providing interceptors for each RPC.
internal init(
channel: GRPCChannel,
defaultCallOptions: CallOptions = CallOptions(),
interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingClientInterceptorFactoryProtocol? = nil
) {
self.channel = channel
self.defaultCallOptions = defaultCallOptions
self.interceptors = interceptors
}
}
/// Stable
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
internal protocol Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingAsyncClientProtocol: GRPCClient {
static var serviceDescriptor: GRPCServiceDescriptor { get }
var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingClientInterceptorFactoryProtocol? { get }
func makeLoggingCall(
callOptions: CallOptions?
) -> GRPCAsyncBidirectionalStreamingCall<Org_Apache_Beam_Model_FnExecution_V1_LogEntry.List, Org_Apache_Beam_Model_FnExecution_V1_LogControl>
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingAsyncClientProtocol {
internal static var serviceDescriptor: GRPCServiceDescriptor {
return Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingClientMetadata.serviceDescriptor
}
internal var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingClientInterceptorFactoryProtocol? {
return nil
}
internal func makeLoggingCall(
callOptions: CallOptions? = nil
) -> GRPCAsyncBidirectionalStreamingCall<Org_Apache_Beam_Model_FnExecution_V1_LogEntry.List, Org_Apache_Beam_Model_FnExecution_V1_LogControl> {
return self.makeAsyncBidirectionalStreamingCall(
path: Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingClientMetadata.Methods.logging.path,
callOptions: callOptions ?? self.defaultCallOptions,
interceptors: self.interceptors?.makeLoggingInterceptors() ?? []
)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingAsyncClientProtocol {
internal func logging<RequestStream>(
_ requests: RequestStream,
callOptions: CallOptions? = nil
) -> GRPCAsyncResponseStream<Org_Apache_Beam_Model_FnExecution_V1_LogControl> where RequestStream: Sequence, RequestStream.Element == Org_Apache_Beam_Model_FnExecution_V1_LogEntry.List {
return self.performAsyncBidirectionalStreamingCall(
path: Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingClientMetadata.Methods.logging.path,
requests: requests,
callOptions: callOptions ?? self.defaultCallOptions,
interceptors: self.interceptors?.makeLoggingInterceptors() ?? []
)
}
internal func logging<RequestStream>(
_ requests: RequestStream,
callOptions: CallOptions? = nil
) -> GRPCAsyncResponseStream<Org_Apache_Beam_Model_FnExecution_V1_LogControl> where RequestStream: AsyncSequence & Sendable, RequestStream.Element == Org_Apache_Beam_Model_FnExecution_V1_LogEntry.List {
return self.performAsyncBidirectionalStreamingCall(
path: Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingClientMetadata.Methods.logging.path,
requests: requests,
callOptions: callOptions ?? self.defaultCallOptions,
interceptors: self.interceptors?.makeLoggingInterceptors() ?? []
)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
internal struct Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingAsyncClient: Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingAsyncClientProtocol {
internal var channel: GRPCChannel
internal var defaultCallOptions: CallOptions
internal var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingClientInterceptorFactoryProtocol?
internal init(
channel: GRPCChannel,
defaultCallOptions: CallOptions = CallOptions(),
interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingClientInterceptorFactoryProtocol? = nil
) {
self.channel = channel
self.defaultCallOptions = defaultCallOptions
self.interceptors = interceptors
}
}
internal protocol Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingClientInterceptorFactoryProtocol: Sendable {
/// - Returns: Interceptors to use when invoking 'logging'.
func makeLoggingInterceptors() -> [ClientInterceptor<Org_Apache_Beam_Model_FnExecution_V1_LogEntry.List, Org_Apache_Beam_Model_FnExecution_V1_LogControl>]
}
internal enum Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingClientMetadata {
internal static let serviceDescriptor = GRPCServiceDescriptor(
name: "BeamFnLogging",
fullName: "org.apache.beam.model.fn_execution.v1.BeamFnLogging",
methods: [
Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingClientMetadata.Methods.logging,
]
)
internal enum Methods {
internal static let logging = GRPCMethodDescriptor(
name: "Logging",
path: "/org.apache.beam.model.fn_execution.v1.BeamFnLogging/Logging",
type: GRPCCallType.bidirectionalStreaming
)
}
}
/// Usage: instantiate `Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolClient`, then call methods of this protocol to make API calls.
internal protocol Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolClientProtocol: GRPCClient {
var serviceName: String { get }
var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolClientInterceptorFactoryProtocol? { get }
func startWorker(
_ request: Org_Apache_Beam_Model_FnExecution_V1_StartWorkerRequest,
callOptions: CallOptions?
) -> UnaryCall<Org_Apache_Beam_Model_FnExecution_V1_StartWorkerRequest, Org_Apache_Beam_Model_FnExecution_V1_StartWorkerResponse>
func stopWorker(
_ request: Org_Apache_Beam_Model_FnExecution_V1_StopWorkerRequest,
callOptions: CallOptions?
) -> UnaryCall<Org_Apache_Beam_Model_FnExecution_V1_StopWorkerRequest, Org_Apache_Beam_Model_FnExecution_V1_StopWorkerResponse>
}
extension Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolClientProtocol {
internal var serviceName: String {
return "org.apache.beam.model.fn_execution.v1.BeamFnExternalWorkerPool"
}
/// Start the SDK worker with the given ID.
///
/// - Parameters:
/// - request: Request to send to StartWorker.
/// - callOptions: Call options.
/// - Returns: A `UnaryCall` with futures for the metadata, status and response.
internal func startWorker(
_ request: Org_Apache_Beam_Model_FnExecution_V1_StartWorkerRequest,
callOptions: CallOptions? = nil
) -> UnaryCall<Org_Apache_Beam_Model_FnExecution_V1_StartWorkerRequest, Org_Apache_Beam_Model_FnExecution_V1_StartWorkerResponse> {
return self.makeUnaryCall(
path: Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolClientMetadata.Methods.startWorker.path,
request: request,
callOptions: callOptions ?? self.defaultCallOptions,
interceptors: self.interceptors?.makeStartWorkerInterceptors() ?? []
)
}
/// Stop the SDK worker.
///
/// - Parameters:
/// - request: Request to send to StopWorker.
/// - callOptions: Call options.
/// - Returns: A `UnaryCall` with futures for the metadata, status and response.
internal func stopWorker(
_ request: Org_Apache_Beam_Model_FnExecution_V1_StopWorkerRequest,
callOptions: CallOptions? = nil
) -> UnaryCall<Org_Apache_Beam_Model_FnExecution_V1_StopWorkerRequest, Org_Apache_Beam_Model_FnExecution_V1_StopWorkerResponse> {
return self.makeUnaryCall(
path: Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolClientMetadata.Methods.stopWorker.path,
request: request,
callOptions: callOptions ?? self.defaultCallOptions,
interceptors: self.interceptors?.makeStopWorkerInterceptors() ?? []
)
}
}
@available(*, deprecated)
extension Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolClient: @unchecked Sendable {}
@available(*, deprecated, renamed: "Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolNIOClient")
internal final class Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolClient: Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolClientProtocol {
private let lock = Lock()
private var _defaultCallOptions: CallOptions
private var _interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolClientInterceptorFactoryProtocol?
internal let channel: GRPCChannel
internal var defaultCallOptions: CallOptions {
get { self.lock.withLock { return self._defaultCallOptions } }
set { self.lock.withLockVoid { self._defaultCallOptions = newValue } }
}
internal var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolClientInterceptorFactoryProtocol? {
get { self.lock.withLock { return self._interceptors } }
set { self.lock.withLockVoid { self._interceptors = newValue } }
}
/// Creates a client for the org.apache.beam.model.fn_execution.v1.BeamFnExternalWorkerPool service.
///
/// - Parameters:
/// - channel: `GRPCChannel` to the service host.
/// - defaultCallOptions: Options to use for each service call if the user doesn't provide them.
/// - interceptors: A factory providing interceptors for each RPC.
internal init(
channel: GRPCChannel,
defaultCallOptions: CallOptions = CallOptions(),
interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolClientInterceptorFactoryProtocol? = nil
) {
self.channel = channel
self._defaultCallOptions = defaultCallOptions
self._interceptors = interceptors
}
}
internal struct Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolNIOClient: Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolClientProtocol {
internal var channel: GRPCChannel
internal var defaultCallOptions: CallOptions
internal var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolClientInterceptorFactoryProtocol?
/// Creates a client for the org.apache.beam.model.fn_execution.v1.BeamFnExternalWorkerPool service.
///
/// - Parameters:
/// - channel: `GRPCChannel` to the service host.
/// - defaultCallOptions: Options to use for each service call if the user doesn't provide them.
/// - interceptors: A factory providing interceptors for each RPC.
internal init(
channel: GRPCChannel,
defaultCallOptions: CallOptions = CallOptions(),
interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolClientInterceptorFactoryProtocol? = nil
) {
self.channel = channel
self.defaultCallOptions = defaultCallOptions
self.interceptors = interceptors
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
internal protocol Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolAsyncClientProtocol: GRPCClient {
static var serviceDescriptor: GRPCServiceDescriptor { get }
var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolClientInterceptorFactoryProtocol? { get }
func makeStartWorkerCall(
_ request: Org_Apache_Beam_Model_FnExecution_V1_StartWorkerRequest,
callOptions: CallOptions?
) -> GRPCAsyncUnaryCall<Org_Apache_Beam_Model_FnExecution_V1_StartWorkerRequest, Org_Apache_Beam_Model_FnExecution_V1_StartWorkerResponse>
func makeStopWorkerCall(
_ request: Org_Apache_Beam_Model_FnExecution_V1_StopWorkerRequest,
callOptions: CallOptions?
) -> GRPCAsyncUnaryCall<Org_Apache_Beam_Model_FnExecution_V1_StopWorkerRequest, Org_Apache_Beam_Model_FnExecution_V1_StopWorkerResponse>
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolAsyncClientProtocol {
internal static var serviceDescriptor: GRPCServiceDescriptor {
return Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolClientMetadata.serviceDescriptor
}
internal var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolClientInterceptorFactoryProtocol? {
return nil
}
internal func makeStartWorkerCall(
_ request: Org_Apache_Beam_Model_FnExecution_V1_StartWorkerRequest,
callOptions: CallOptions? = nil
) -> GRPCAsyncUnaryCall<Org_Apache_Beam_Model_FnExecution_V1_StartWorkerRequest, Org_Apache_Beam_Model_FnExecution_V1_StartWorkerResponse> {
return self.makeAsyncUnaryCall(
path: Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolClientMetadata.Methods.startWorker.path,
request: request,
callOptions: callOptions ?? self.defaultCallOptions,
interceptors: self.interceptors?.makeStartWorkerInterceptors() ?? []
)
}
internal func makeStopWorkerCall(
_ request: Org_Apache_Beam_Model_FnExecution_V1_StopWorkerRequest,
callOptions: CallOptions? = nil
) -> GRPCAsyncUnaryCall<Org_Apache_Beam_Model_FnExecution_V1_StopWorkerRequest, Org_Apache_Beam_Model_FnExecution_V1_StopWorkerResponse> {
return self.makeAsyncUnaryCall(
path: Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolClientMetadata.Methods.stopWorker.path,
request: request,
callOptions: callOptions ?? self.defaultCallOptions,
interceptors: self.interceptors?.makeStopWorkerInterceptors() ?? []
)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolAsyncClientProtocol {
internal func startWorker(
_ request: Org_Apache_Beam_Model_FnExecution_V1_StartWorkerRequest,
callOptions: CallOptions? = nil
) async throws -> Org_Apache_Beam_Model_FnExecution_V1_StartWorkerResponse {
return try await self.performAsyncUnaryCall(
path: Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolClientMetadata.Methods.startWorker.path,
request: request,
callOptions: callOptions ?? self.defaultCallOptions,
interceptors: self.interceptors?.makeStartWorkerInterceptors() ?? []
)
}
internal func stopWorker(
_ request: Org_Apache_Beam_Model_FnExecution_V1_StopWorkerRequest,
callOptions: CallOptions? = nil
) async throws -> Org_Apache_Beam_Model_FnExecution_V1_StopWorkerResponse {
return try await self.performAsyncUnaryCall(
path: Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolClientMetadata.Methods.stopWorker.path,
request: request,
callOptions: callOptions ?? self.defaultCallOptions,
interceptors: self.interceptors?.makeStopWorkerInterceptors() ?? []
)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
internal struct Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolAsyncClient: Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolAsyncClientProtocol {
internal var channel: GRPCChannel
internal var defaultCallOptions: CallOptions
internal var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolClientInterceptorFactoryProtocol?
internal init(
channel: GRPCChannel,
defaultCallOptions: CallOptions = CallOptions(),
interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolClientInterceptorFactoryProtocol? = nil
) {
self.channel = channel
self.defaultCallOptions = defaultCallOptions
self.interceptors = interceptors
}
}
internal protocol Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolClientInterceptorFactoryProtocol: Sendable {
/// - Returns: Interceptors to use when invoking 'startWorker'.
func makeStartWorkerInterceptors() -> [ClientInterceptor<Org_Apache_Beam_Model_FnExecution_V1_StartWorkerRequest, Org_Apache_Beam_Model_FnExecution_V1_StartWorkerResponse>]
/// - Returns: Interceptors to use when invoking 'stopWorker'.
func makeStopWorkerInterceptors() -> [ClientInterceptor<Org_Apache_Beam_Model_FnExecution_V1_StopWorkerRequest, Org_Apache_Beam_Model_FnExecution_V1_StopWorkerResponse>]
}
internal enum Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolClientMetadata {
internal static let serviceDescriptor = GRPCServiceDescriptor(
name: "BeamFnExternalWorkerPool",
fullName: "org.apache.beam.model.fn_execution.v1.BeamFnExternalWorkerPool",
methods: [
Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolClientMetadata.Methods.startWorker,
Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolClientMetadata.Methods.stopWorker,
]
)
internal enum Methods {
internal static let startWorker = GRPCMethodDescriptor(
name: "StartWorker",
path: "/org.apache.beam.model.fn_execution.v1.BeamFnExternalWorkerPool/StartWorker",
type: GRPCCallType.unary
)
internal static let stopWorker = GRPCMethodDescriptor(
name: "StopWorker",
path: "/org.apache.beam.model.fn_execution.v1.BeamFnExternalWorkerPool/StopWorker",
type: GRPCCallType.unary
)
}
}
/// API for SDKs to report debug-related statuses to runner during pipeline execution.
///
/// Usage: instantiate `Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusClient`, then call methods of this protocol to make API calls.
internal protocol Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusClientProtocol: GRPCClient {
var serviceName: String { get }
var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusClientInterceptorFactoryProtocol? { get }
func workerStatus(
callOptions: CallOptions?,
handler: @escaping (Org_Apache_Beam_Model_FnExecution_V1_WorkerStatusRequest) -> Void
) -> BidirectionalStreamingCall<Org_Apache_Beam_Model_FnExecution_V1_WorkerStatusResponse, Org_Apache_Beam_Model_FnExecution_V1_WorkerStatusRequest>
}
extension Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusClientProtocol {
internal var serviceName: String {
return "org.apache.beam.model.fn_execution.v1.BeamFnWorkerStatus"
}
/// Bidirectional streaming call to WorkerStatus
///
/// Callers should use the `send` method on the returned object to send messages
/// to the server. The caller should send an `.end` after the final message has been sent.
///
/// - Parameters:
/// - callOptions: Call options.
/// - handler: A closure called when each response is received from the server.
/// - Returns: A `ClientStreamingCall` with futures for the metadata and status.
internal func workerStatus(
callOptions: CallOptions? = nil,
handler: @escaping (Org_Apache_Beam_Model_FnExecution_V1_WorkerStatusRequest) -> Void
) -> BidirectionalStreamingCall<Org_Apache_Beam_Model_FnExecution_V1_WorkerStatusResponse, Org_Apache_Beam_Model_FnExecution_V1_WorkerStatusRequest> {
return self.makeBidirectionalStreamingCall(
path: Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusClientMetadata.Methods.workerStatus.path,
callOptions: callOptions ?? self.defaultCallOptions,
interceptors: self.interceptors?.makeWorkerStatusInterceptors() ?? [],
handler: handler
)
}
}
@available(*, deprecated)
extension Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusClient: @unchecked Sendable {}
@available(*, deprecated, renamed: "Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusNIOClient")
internal final class Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusClient: Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusClientProtocol {
private let lock = Lock()
private var _defaultCallOptions: CallOptions
private var _interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusClientInterceptorFactoryProtocol?
internal let channel: GRPCChannel
internal var defaultCallOptions: CallOptions {
get { self.lock.withLock { return self._defaultCallOptions } }
set { self.lock.withLockVoid { self._defaultCallOptions = newValue } }
}
internal var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusClientInterceptorFactoryProtocol? {
get { self.lock.withLock { return self._interceptors } }
set { self.lock.withLockVoid { self._interceptors = newValue } }
}
/// Creates a client for the org.apache.beam.model.fn_execution.v1.BeamFnWorkerStatus service.
///
/// - Parameters:
/// - channel: `GRPCChannel` to the service host.
/// - defaultCallOptions: Options to use for each service call if the user doesn't provide them.
/// - interceptors: A factory providing interceptors for each RPC.
internal init(
channel: GRPCChannel,
defaultCallOptions: CallOptions = CallOptions(),
interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusClientInterceptorFactoryProtocol? = nil
) {
self.channel = channel
self._defaultCallOptions = defaultCallOptions
self._interceptors = interceptors
}
}
internal struct Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusNIOClient: Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusClientProtocol {
internal var channel: GRPCChannel
internal var defaultCallOptions: CallOptions
internal var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusClientInterceptorFactoryProtocol?
/// Creates a client for the org.apache.beam.model.fn_execution.v1.BeamFnWorkerStatus service.
///
/// - Parameters:
/// - channel: `GRPCChannel` to the service host.
/// - defaultCallOptions: Options to use for each service call if the user doesn't provide them.
/// - interceptors: A factory providing interceptors for each RPC.
internal init(
channel: GRPCChannel,
defaultCallOptions: CallOptions = CallOptions(),
interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusClientInterceptorFactoryProtocol? = nil
) {
self.channel = channel
self.defaultCallOptions = defaultCallOptions
self.interceptors = interceptors
}
}
/// API for SDKs to report debug-related statuses to runner during pipeline execution.
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
internal protocol Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusAsyncClientProtocol: GRPCClient {
static var serviceDescriptor: GRPCServiceDescriptor { get }
var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusClientInterceptorFactoryProtocol? { get }
func makeWorkerStatusCall(
callOptions: CallOptions?
) -> GRPCAsyncBidirectionalStreamingCall<Org_Apache_Beam_Model_FnExecution_V1_WorkerStatusResponse, Org_Apache_Beam_Model_FnExecution_V1_WorkerStatusRequest>
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusAsyncClientProtocol {
internal static var serviceDescriptor: GRPCServiceDescriptor {
return Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusClientMetadata.serviceDescriptor
}
internal var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusClientInterceptorFactoryProtocol? {
return nil
}
internal func makeWorkerStatusCall(
callOptions: CallOptions? = nil
) -> GRPCAsyncBidirectionalStreamingCall<Org_Apache_Beam_Model_FnExecution_V1_WorkerStatusResponse, Org_Apache_Beam_Model_FnExecution_V1_WorkerStatusRequest> {
return self.makeAsyncBidirectionalStreamingCall(
path: Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusClientMetadata.Methods.workerStatus.path,
callOptions: callOptions ?? self.defaultCallOptions,
interceptors: self.interceptors?.makeWorkerStatusInterceptors() ?? []
)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusAsyncClientProtocol {
internal func workerStatus<RequestStream>(
_ requests: RequestStream,
callOptions: CallOptions? = nil
) -> GRPCAsyncResponseStream<Org_Apache_Beam_Model_FnExecution_V1_WorkerStatusRequest> where RequestStream: Sequence, RequestStream.Element == Org_Apache_Beam_Model_FnExecution_V1_WorkerStatusResponse {
return self.performAsyncBidirectionalStreamingCall(
path: Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusClientMetadata.Methods.workerStatus.path,
requests: requests,
callOptions: callOptions ?? self.defaultCallOptions,
interceptors: self.interceptors?.makeWorkerStatusInterceptors() ?? []
)
}
internal func workerStatus<RequestStream>(
_ requests: RequestStream,
callOptions: CallOptions? = nil
) -> GRPCAsyncResponseStream<Org_Apache_Beam_Model_FnExecution_V1_WorkerStatusRequest> where RequestStream: AsyncSequence & Sendable, RequestStream.Element == Org_Apache_Beam_Model_FnExecution_V1_WorkerStatusResponse {
return self.performAsyncBidirectionalStreamingCall(
path: Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusClientMetadata.Methods.workerStatus.path,
requests: requests,
callOptions: callOptions ?? self.defaultCallOptions,
interceptors: self.interceptors?.makeWorkerStatusInterceptors() ?? []
)
}
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
internal struct Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusAsyncClient: Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusAsyncClientProtocol {
internal var channel: GRPCChannel
internal var defaultCallOptions: CallOptions
internal var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusClientInterceptorFactoryProtocol?
internal init(
channel: GRPCChannel,
defaultCallOptions: CallOptions = CallOptions(),
interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusClientInterceptorFactoryProtocol? = nil
) {
self.channel = channel
self.defaultCallOptions = defaultCallOptions
self.interceptors = interceptors
}
}
internal protocol Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusClientInterceptorFactoryProtocol: Sendable {
/// - Returns: Interceptors to use when invoking 'workerStatus'.
func makeWorkerStatusInterceptors() -> [ClientInterceptor<Org_Apache_Beam_Model_FnExecution_V1_WorkerStatusResponse, Org_Apache_Beam_Model_FnExecution_V1_WorkerStatusRequest>]
}
internal enum Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusClientMetadata {
internal static let serviceDescriptor = GRPCServiceDescriptor(
name: "BeamFnWorkerStatus",
fullName: "org.apache.beam.model.fn_execution.v1.BeamFnWorkerStatus",
methods: [
Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusClientMetadata.Methods.workerStatus,
]
)
internal enum Methods {
internal static let workerStatus = GRPCMethodDescriptor(
name: "WorkerStatus",
path: "/org.apache.beam.model.fn_execution.v1.BeamFnWorkerStatus/WorkerStatus",
type: GRPCCallType.bidirectionalStreaming
)
}
}
/// An API that describes the work that a SDK harness is meant to do.
/// Stable
///
/// To build a server, implement a class that conforms to this protocol.
internal protocol Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlProvider: CallHandlerProvider {
var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlServerInterceptorFactoryProtocol? { get }
/// Instructions sent by the runner to the SDK requesting different types
/// of work.
func control(context: StreamingResponseCallContext<Org_Apache_Beam_Model_FnExecution_V1_InstructionRequest>) -> EventLoopFuture<(StreamEvent<Org_Apache_Beam_Model_FnExecution_V1_InstructionResponse>) -> Void>
/// Used to get the full process bundle descriptors for bundles one
/// is asked to process.
func getProcessBundleDescriptor(request: Org_Apache_Beam_Model_FnExecution_V1_GetProcessBundleDescriptorRequest, context: StatusOnlyCallContext) -> EventLoopFuture<Org_Apache_Beam_Model_FnExecution_V1_ProcessBundleDescriptor>
}
extension Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlProvider {
internal var serviceName: Substring {
return Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlServerMetadata.serviceDescriptor.fullName[...]
}
/// Determines, calls and returns the appropriate request handler, depending on the request's method.
/// Returns nil for methods not handled by this service.
internal func handle(
method name: Substring,
context: CallHandlerContext
) -> GRPCServerHandlerProtocol? {
switch name {
case "Control":
return BidirectionalStreamingServerHandler(
context: context,
requestDeserializer: ProtobufDeserializer<Org_Apache_Beam_Model_FnExecution_V1_InstructionResponse>(),
responseSerializer: ProtobufSerializer<Org_Apache_Beam_Model_FnExecution_V1_InstructionRequest>(),
interceptors: self.interceptors?.makeControlInterceptors() ?? [],
observerFactory: self.control(context:)
)
case "GetProcessBundleDescriptor":
return UnaryServerHandler(
context: context,
requestDeserializer: ProtobufDeserializer<Org_Apache_Beam_Model_FnExecution_V1_GetProcessBundleDescriptorRequest>(),
responseSerializer: ProtobufSerializer<Org_Apache_Beam_Model_FnExecution_V1_ProcessBundleDescriptor>(),
interceptors: self.interceptors?.makeGetProcessBundleDescriptorInterceptors() ?? [],
userFunction: self.getProcessBundleDescriptor(request:context:)
)
default:
return nil
}
}
}
/// An API that describes the work that a SDK harness is meant to do.
/// Stable
///
/// To implement a server, implement an object which conforms to this protocol.
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
internal protocol Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlAsyncProvider: CallHandlerProvider, Sendable {
static var serviceDescriptor: GRPCServiceDescriptor { get }
var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlServerInterceptorFactoryProtocol? { get }
/// Instructions sent by the runner to the SDK requesting different types
/// of work.
func control(
requestStream: GRPCAsyncRequestStream<Org_Apache_Beam_Model_FnExecution_V1_InstructionResponse>,
responseStream: GRPCAsyncResponseStreamWriter<Org_Apache_Beam_Model_FnExecution_V1_InstructionRequest>,
context: GRPCAsyncServerCallContext
) async throws
/// Used to get the full process bundle descriptors for bundles one
/// is asked to process.
func getProcessBundleDescriptor(
request: Org_Apache_Beam_Model_FnExecution_V1_GetProcessBundleDescriptorRequest,
context: GRPCAsyncServerCallContext
) async throws -> Org_Apache_Beam_Model_FnExecution_V1_ProcessBundleDescriptor
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlAsyncProvider {
internal static var serviceDescriptor: GRPCServiceDescriptor {
return Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlServerMetadata.serviceDescriptor
}
internal var serviceName: Substring {
return Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlServerMetadata.serviceDescriptor.fullName[...]
}
internal var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlServerInterceptorFactoryProtocol? {
return nil
}
internal func handle(
method name: Substring,
context: CallHandlerContext
) -> GRPCServerHandlerProtocol? {
switch name {
case "Control":
return GRPCAsyncServerHandler(
context: context,
requestDeserializer: ProtobufDeserializer<Org_Apache_Beam_Model_FnExecution_V1_InstructionResponse>(),
responseSerializer: ProtobufSerializer<Org_Apache_Beam_Model_FnExecution_V1_InstructionRequest>(),
interceptors: self.interceptors?.makeControlInterceptors() ?? [],
wrapping: { try await self.control(requestStream: $0, responseStream: $1, context: $2) }
)
case "GetProcessBundleDescriptor":
return GRPCAsyncServerHandler(
context: context,
requestDeserializer: ProtobufDeserializer<Org_Apache_Beam_Model_FnExecution_V1_GetProcessBundleDescriptorRequest>(),
responseSerializer: ProtobufSerializer<Org_Apache_Beam_Model_FnExecution_V1_ProcessBundleDescriptor>(),
interceptors: self.interceptors?.makeGetProcessBundleDescriptorInterceptors() ?? [],
wrapping: { try await self.getProcessBundleDescriptor(request: $0, context: $1) }
)
default:
return nil
}
}
}
internal protocol Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlServerInterceptorFactoryProtocol: Sendable {
/// - Returns: Interceptors to use when handling 'control'.
/// Defaults to calling `self.makeInterceptors()`.
func makeControlInterceptors() -> [ServerInterceptor<Org_Apache_Beam_Model_FnExecution_V1_InstructionResponse, Org_Apache_Beam_Model_FnExecution_V1_InstructionRequest>]
/// - Returns: Interceptors to use when handling 'getProcessBundleDescriptor'.
/// Defaults to calling `self.makeInterceptors()`.
func makeGetProcessBundleDescriptorInterceptors() -> [ServerInterceptor<Org_Apache_Beam_Model_FnExecution_V1_GetProcessBundleDescriptorRequest, Org_Apache_Beam_Model_FnExecution_V1_ProcessBundleDescriptor>]
}
internal enum Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlServerMetadata {
internal static let serviceDescriptor = GRPCServiceDescriptor(
name: "BeamFnControl",
fullName: "org.apache.beam.model.fn_execution.v1.BeamFnControl",
methods: [
Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlServerMetadata.Methods.control,
Org_Apache_Beam_Model_FnExecution_V1_BeamFnControlServerMetadata.Methods.getProcessBundleDescriptor,
]
)
internal enum Methods {
internal static let control = GRPCMethodDescriptor(
name: "Control",
path: "/org.apache.beam.model.fn_execution.v1.BeamFnControl/Control",
type: GRPCCallType.bidirectionalStreaming
)
internal static let getProcessBundleDescriptor = GRPCMethodDescriptor(
name: "GetProcessBundleDescriptor",
path: "/org.apache.beam.model.fn_execution.v1.BeamFnControl/GetProcessBundleDescriptor",
type: GRPCCallType.unary
)
}
}
/// Stable
///
/// To build a server, implement a class that conforms to this protocol.
internal protocol Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataProvider: CallHandlerProvider {
var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataServerInterceptorFactoryProtocol? { get }
/// Used to send data between harnesses.
func data(context: StreamingResponseCallContext<Org_Apache_Beam_Model_FnExecution_V1_Elements>) -> EventLoopFuture<(StreamEvent<Org_Apache_Beam_Model_FnExecution_V1_Elements>) -> Void>
}
extension Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataProvider {
internal var serviceName: Substring {
return Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataServerMetadata.serviceDescriptor.fullName[...]
}
/// Determines, calls and returns the appropriate request handler, depending on the request's method.
/// Returns nil for methods not handled by this service.
internal func handle(
method name: Substring,
context: CallHandlerContext
) -> GRPCServerHandlerProtocol? {
switch name {
case "Data":
return BidirectionalStreamingServerHandler(
context: context,
requestDeserializer: ProtobufDeserializer<Org_Apache_Beam_Model_FnExecution_V1_Elements>(),
responseSerializer: ProtobufSerializer<Org_Apache_Beam_Model_FnExecution_V1_Elements>(),
interceptors: self.interceptors?.makeDataInterceptors() ?? [],
observerFactory: self.data(context:)
)
default:
return nil
}
}
}
/// Stable
///
/// To implement a server, implement an object which conforms to this protocol.
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
internal protocol Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataAsyncProvider: CallHandlerProvider, Sendable {
static var serviceDescriptor: GRPCServiceDescriptor { get }
var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataServerInterceptorFactoryProtocol? { get }
/// Used to send data between harnesses.
func data(
requestStream: GRPCAsyncRequestStream<Org_Apache_Beam_Model_FnExecution_V1_Elements>,
responseStream: GRPCAsyncResponseStreamWriter<Org_Apache_Beam_Model_FnExecution_V1_Elements>,
context: GRPCAsyncServerCallContext
) async throws
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataAsyncProvider {
internal static var serviceDescriptor: GRPCServiceDescriptor {
return Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataServerMetadata.serviceDescriptor
}
internal var serviceName: Substring {
return Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataServerMetadata.serviceDescriptor.fullName[...]
}
internal var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataServerInterceptorFactoryProtocol? {
return nil
}
internal func handle(
method name: Substring,
context: CallHandlerContext
) -> GRPCServerHandlerProtocol? {
switch name {
case "Data":
return GRPCAsyncServerHandler(
context: context,
requestDeserializer: ProtobufDeserializer<Org_Apache_Beam_Model_FnExecution_V1_Elements>(),
responseSerializer: ProtobufSerializer<Org_Apache_Beam_Model_FnExecution_V1_Elements>(),
interceptors: self.interceptors?.makeDataInterceptors() ?? [],
wrapping: { try await self.data(requestStream: $0, responseStream: $1, context: $2) }
)
default:
return nil
}
}
}
internal protocol Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataServerInterceptorFactoryProtocol: Sendable {
/// - Returns: Interceptors to use when handling 'data'.
/// Defaults to calling `self.makeInterceptors()`.
func makeDataInterceptors() -> [ServerInterceptor<Org_Apache_Beam_Model_FnExecution_V1_Elements, Org_Apache_Beam_Model_FnExecution_V1_Elements>]
}
internal enum Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataServerMetadata {
internal static let serviceDescriptor = GRPCServiceDescriptor(
name: "BeamFnData",
fullName: "org.apache.beam.model.fn_execution.v1.BeamFnData",
methods: [
Org_Apache_Beam_Model_FnExecution_V1_BeamFnDataServerMetadata.Methods.data,
]
)
internal enum Methods {
internal static let data = GRPCMethodDescriptor(
name: "Data",
path: "/org.apache.beam.model.fn_execution.v1.BeamFnData/Data",
type: GRPCCallType.bidirectionalStreaming
)
}
}
/// To build a server, implement a class that conforms to this protocol.
internal protocol Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateProvider: CallHandlerProvider {
var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateServerInterceptorFactoryProtocol? { get }
/// Used to get/append/clear state stored by the runner on behalf of the SDK.
func state(context: StreamingResponseCallContext<Org_Apache_Beam_Model_FnExecution_V1_StateResponse>) -> EventLoopFuture<(StreamEvent<Org_Apache_Beam_Model_FnExecution_V1_StateRequest>) -> Void>
}
extension Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateProvider {
internal var serviceName: Substring {
return Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateServerMetadata.serviceDescriptor.fullName[...]
}
/// Determines, calls and returns the appropriate request handler, depending on the request's method.
/// Returns nil for methods not handled by this service.
internal func handle(
method name: Substring,
context: CallHandlerContext
) -> GRPCServerHandlerProtocol? {
switch name {
case "State":
return BidirectionalStreamingServerHandler(
context: context,
requestDeserializer: ProtobufDeserializer<Org_Apache_Beam_Model_FnExecution_V1_StateRequest>(),
responseSerializer: ProtobufSerializer<Org_Apache_Beam_Model_FnExecution_V1_StateResponse>(),
interceptors: self.interceptors?.makeStateInterceptors() ?? [],
observerFactory: self.state(context:)
)
default:
return nil
}
}
}
/// To implement a server, implement an object which conforms to this protocol.
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
internal protocol Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateAsyncProvider: CallHandlerProvider, Sendable {
static var serviceDescriptor: GRPCServiceDescriptor { get }
var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateServerInterceptorFactoryProtocol? { get }
/// Used to get/append/clear state stored by the runner on behalf of the SDK.
func state(
requestStream: GRPCAsyncRequestStream<Org_Apache_Beam_Model_FnExecution_V1_StateRequest>,
responseStream: GRPCAsyncResponseStreamWriter<Org_Apache_Beam_Model_FnExecution_V1_StateResponse>,
context: GRPCAsyncServerCallContext
) async throws
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateAsyncProvider {
internal static var serviceDescriptor: GRPCServiceDescriptor {
return Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateServerMetadata.serviceDescriptor
}
internal var serviceName: Substring {
return Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateServerMetadata.serviceDescriptor.fullName[...]
}
internal var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateServerInterceptorFactoryProtocol? {
return nil
}
internal func handle(
method name: Substring,
context: CallHandlerContext
) -> GRPCServerHandlerProtocol? {
switch name {
case "State":
return GRPCAsyncServerHandler(
context: context,
requestDeserializer: ProtobufDeserializer<Org_Apache_Beam_Model_FnExecution_V1_StateRequest>(),
responseSerializer: ProtobufSerializer<Org_Apache_Beam_Model_FnExecution_V1_StateResponse>(),
interceptors: self.interceptors?.makeStateInterceptors() ?? [],
wrapping: { try await self.state(requestStream: $0, responseStream: $1, context: $2) }
)
default:
return nil
}
}
}
internal protocol Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateServerInterceptorFactoryProtocol: Sendable {
/// - Returns: Interceptors to use when handling 'state'.
/// Defaults to calling `self.makeInterceptors()`.
func makeStateInterceptors() -> [ServerInterceptor<Org_Apache_Beam_Model_FnExecution_V1_StateRequest, Org_Apache_Beam_Model_FnExecution_V1_StateResponse>]
}
internal enum Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateServerMetadata {
internal static let serviceDescriptor = GRPCServiceDescriptor(
name: "BeamFnState",
fullName: "org.apache.beam.model.fn_execution.v1.BeamFnState",
methods: [
Org_Apache_Beam_Model_FnExecution_V1_BeamFnStateServerMetadata.Methods.state,
]
)
internal enum Methods {
internal static let state = GRPCMethodDescriptor(
name: "State",
path: "/org.apache.beam.model.fn_execution.v1.BeamFnState/State",
type: GRPCCallType.bidirectionalStreaming
)
}
}
/// Stable
///
/// To build a server, implement a class that conforms to this protocol.
internal protocol Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingProvider: CallHandlerProvider {
var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingServerInterceptorFactoryProtocol? { get }
/// Allows for the SDK to emit log entries which the runner can
/// associate with the active job.
func logging(context: StreamingResponseCallContext<Org_Apache_Beam_Model_FnExecution_V1_LogControl>) -> EventLoopFuture<(StreamEvent<Org_Apache_Beam_Model_FnExecution_V1_LogEntry.List>) -> Void>
}
extension Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingProvider {
internal var serviceName: Substring {
return Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingServerMetadata.serviceDescriptor.fullName[...]
}
/// Determines, calls and returns the appropriate request handler, depending on the request's method.
/// Returns nil for methods not handled by this service.
internal func handle(
method name: Substring,
context: CallHandlerContext
) -> GRPCServerHandlerProtocol? {
switch name {
case "Logging":
return BidirectionalStreamingServerHandler(
context: context,
requestDeserializer: ProtobufDeserializer<Org_Apache_Beam_Model_FnExecution_V1_LogEntry.List>(),
responseSerializer: ProtobufSerializer<Org_Apache_Beam_Model_FnExecution_V1_LogControl>(),
interceptors: self.interceptors?.makeLoggingInterceptors() ?? [],
observerFactory: self.logging(context:)
)
default:
return nil
}
}
}
/// Stable
///
/// To implement a server, implement an object which conforms to this protocol.
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
internal protocol Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingAsyncProvider: CallHandlerProvider, Sendable {
static var serviceDescriptor: GRPCServiceDescriptor { get }
var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingServerInterceptorFactoryProtocol? { get }
/// Allows for the SDK to emit log entries which the runner can
/// associate with the active job.
func logging(
requestStream: GRPCAsyncRequestStream<Org_Apache_Beam_Model_FnExecution_V1_LogEntry.List>,
responseStream: GRPCAsyncResponseStreamWriter<Org_Apache_Beam_Model_FnExecution_V1_LogControl>,
context: GRPCAsyncServerCallContext
) async throws
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingAsyncProvider {
internal static var serviceDescriptor: GRPCServiceDescriptor {
return Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingServerMetadata.serviceDescriptor
}
internal var serviceName: Substring {
return Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingServerMetadata.serviceDescriptor.fullName[...]
}
internal var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingServerInterceptorFactoryProtocol? {
return nil
}
internal func handle(
method name: Substring,
context: CallHandlerContext
) -> GRPCServerHandlerProtocol? {
switch name {
case "Logging":
return GRPCAsyncServerHandler(
context: context,
requestDeserializer: ProtobufDeserializer<Org_Apache_Beam_Model_FnExecution_V1_LogEntry.List>(),
responseSerializer: ProtobufSerializer<Org_Apache_Beam_Model_FnExecution_V1_LogControl>(),
interceptors: self.interceptors?.makeLoggingInterceptors() ?? [],
wrapping: { try await self.logging(requestStream: $0, responseStream: $1, context: $2) }
)
default:
return nil
}
}
}
internal protocol Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingServerInterceptorFactoryProtocol: Sendable {
/// - Returns: Interceptors to use when handling 'logging'.
/// Defaults to calling `self.makeInterceptors()`.
func makeLoggingInterceptors() -> [ServerInterceptor<Org_Apache_Beam_Model_FnExecution_V1_LogEntry.List, Org_Apache_Beam_Model_FnExecution_V1_LogControl>]
}
internal enum Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingServerMetadata {
internal static let serviceDescriptor = GRPCServiceDescriptor(
name: "BeamFnLogging",
fullName: "org.apache.beam.model.fn_execution.v1.BeamFnLogging",
methods: [
Org_Apache_Beam_Model_FnExecution_V1_BeamFnLoggingServerMetadata.Methods.logging,
]
)
internal enum Methods {
internal static let logging = GRPCMethodDescriptor(
name: "Logging",
path: "/org.apache.beam.model.fn_execution.v1.BeamFnLogging/Logging",
type: GRPCCallType.bidirectionalStreaming
)
}
}
/// To build a server, implement a class that conforms to this protocol.
internal protocol Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolProvider: CallHandlerProvider {
var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolServerInterceptorFactoryProtocol? { get }
/// Start the SDK worker with the given ID.
func startWorker(request: Org_Apache_Beam_Model_FnExecution_V1_StartWorkerRequest, context: StatusOnlyCallContext) -> EventLoopFuture<Org_Apache_Beam_Model_FnExecution_V1_StartWorkerResponse>
/// Stop the SDK worker.
func stopWorker(request: Org_Apache_Beam_Model_FnExecution_V1_StopWorkerRequest, context: StatusOnlyCallContext) -> EventLoopFuture<Org_Apache_Beam_Model_FnExecution_V1_StopWorkerResponse>
}
extension Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolProvider {
internal var serviceName: Substring {
return Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolServerMetadata.serviceDescriptor.fullName[...]
}
/// Determines, calls and returns the appropriate request handler, depending on the request's method.
/// Returns nil for methods not handled by this service.
internal func handle(
method name: Substring,
context: CallHandlerContext
) -> GRPCServerHandlerProtocol? {
switch name {
case "StartWorker":
return UnaryServerHandler(
context: context,
requestDeserializer: ProtobufDeserializer<Org_Apache_Beam_Model_FnExecution_V1_StartWorkerRequest>(),
responseSerializer: ProtobufSerializer<Org_Apache_Beam_Model_FnExecution_V1_StartWorkerResponse>(),
interceptors: self.interceptors?.makeStartWorkerInterceptors() ?? [],
userFunction: self.startWorker(request:context:)
)
case "StopWorker":
return UnaryServerHandler(
context: context,
requestDeserializer: ProtobufDeserializer<Org_Apache_Beam_Model_FnExecution_V1_StopWorkerRequest>(),
responseSerializer: ProtobufSerializer<Org_Apache_Beam_Model_FnExecution_V1_StopWorkerResponse>(),
interceptors: self.interceptors?.makeStopWorkerInterceptors() ?? [],
userFunction: self.stopWorker(request:context:)
)
default:
return nil
}
}
}
/// To implement a server, implement an object which conforms to this protocol.
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
internal protocol Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolAsyncProvider: CallHandlerProvider, Sendable {
static var serviceDescriptor: GRPCServiceDescriptor { get }
var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolServerInterceptorFactoryProtocol? { get }
/// Start the SDK worker with the given ID.
func startWorker(
request: Org_Apache_Beam_Model_FnExecution_V1_StartWorkerRequest,
context: GRPCAsyncServerCallContext
) async throws -> Org_Apache_Beam_Model_FnExecution_V1_StartWorkerResponse
/// Stop the SDK worker.
func stopWorker(
request: Org_Apache_Beam_Model_FnExecution_V1_StopWorkerRequest,
context: GRPCAsyncServerCallContext
) async throws -> Org_Apache_Beam_Model_FnExecution_V1_StopWorkerResponse
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolAsyncProvider {
internal static var serviceDescriptor: GRPCServiceDescriptor {
return Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolServerMetadata.serviceDescriptor
}
internal var serviceName: Substring {
return Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolServerMetadata.serviceDescriptor.fullName[...]
}
internal var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolServerInterceptorFactoryProtocol? {
return nil
}
internal func handle(
method name: Substring,
context: CallHandlerContext
) -> GRPCServerHandlerProtocol? {
switch name {
case "StartWorker":
return GRPCAsyncServerHandler(
context: context,
requestDeserializer: ProtobufDeserializer<Org_Apache_Beam_Model_FnExecution_V1_StartWorkerRequest>(),
responseSerializer: ProtobufSerializer<Org_Apache_Beam_Model_FnExecution_V1_StartWorkerResponse>(),
interceptors: self.interceptors?.makeStartWorkerInterceptors() ?? [],
wrapping: { try await self.startWorker(request: $0, context: $1) }
)
case "StopWorker":
return GRPCAsyncServerHandler(
context: context,
requestDeserializer: ProtobufDeserializer<Org_Apache_Beam_Model_FnExecution_V1_StopWorkerRequest>(),
responseSerializer: ProtobufSerializer<Org_Apache_Beam_Model_FnExecution_V1_StopWorkerResponse>(),
interceptors: self.interceptors?.makeStopWorkerInterceptors() ?? [],
wrapping: { try await self.stopWorker(request: $0, context: $1) }
)
default:
return nil
}
}
}
internal protocol Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolServerInterceptorFactoryProtocol: Sendable {
/// - Returns: Interceptors to use when handling 'startWorker'.
/// Defaults to calling `self.makeInterceptors()`.
func makeStartWorkerInterceptors() -> [ServerInterceptor<Org_Apache_Beam_Model_FnExecution_V1_StartWorkerRequest, Org_Apache_Beam_Model_FnExecution_V1_StartWorkerResponse>]
/// - Returns: Interceptors to use when handling 'stopWorker'.
/// Defaults to calling `self.makeInterceptors()`.
func makeStopWorkerInterceptors() -> [ServerInterceptor<Org_Apache_Beam_Model_FnExecution_V1_StopWorkerRequest, Org_Apache_Beam_Model_FnExecution_V1_StopWorkerResponse>]
}
internal enum Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolServerMetadata {
internal static let serviceDescriptor = GRPCServiceDescriptor(
name: "BeamFnExternalWorkerPool",
fullName: "org.apache.beam.model.fn_execution.v1.BeamFnExternalWorkerPool",
methods: [
Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolServerMetadata.Methods.startWorker,
Org_Apache_Beam_Model_FnExecution_V1_BeamFnExternalWorkerPoolServerMetadata.Methods.stopWorker,
]
)
internal enum Methods {
internal static let startWorker = GRPCMethodDescriptor(
name: "StartWorker",
path: "/org.apache.beam.model.fn_execution.v1.BeamFnExternalWorkerPool/StartWorker",
type: GRPCCallType.unary
)
internal static let stopWorker = GRPCMethodDescriptor(
name: "StopWorker",
path: "/org.apache.beam.model.fn_execution.v1.BeamFnExternalWorkerPool/StopWorker",
type: GRPCCallType.unary
)
}
}
/// API for SDKs to report debug-related statuses to runner during pipeline execution.
///
/// To build a server, implement a class that conforms to this protocol.
internal protocol Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusProvider: CallHandlerProvider {
var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusServerInterceptorFactoryProtocol? { get }
func workerStatus(context: StreamingResponseCallContext<Org_Apache_Beam_Model_FnExecution_V1_WorkerStatusRequest>) -> EventLoopFuture<(StreamEvent<Org_Apache_Beam_Model_FnExecution_V1_WorkerStatusResponse>) -> Void>
}
extension Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusProvider {
internal var serviceName: Substring {
return Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusServerMetadata.serviceDescriptor.fullName[...]
}
/// Determines, calls and returns the appropriate request handler, depending on the request's method.
/// Returns nil for methods not handled by this service.
internal func handle(
method name: Substring,
context: CallHandlerContext
) -> GRPCServerHandlerProtocol? {
switch name {
case "WorkerStatus":
return BidirectionalStreamingServerHandler(
context: context,
requestDeserializer: ProtobufDeserializer<Org_Apache_Beam_Model_FnExecution_V1_WorkerStatusResponse>(),
responseSerializer: ProtobufSerializer<Org_Apache_Beam_Model_FnExecution_V1_WorkerStatusRequest>(),
interceptors: self.interceptors?.makeWorkerStatusInterceptors() ?? [],
observerFactory: self.workerStatus(context:)
)
default:
return nil
}
}
}
/// API for SDKs to report debug-related statuses to runner during pipeline execution.
///
/// To implement a server, implement an object which conforms to this protocol.
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
internal protocol Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusAsyncProvider: CallHandlerProvider, Sendable {
static var serviceDescriptor: GRPCServiceDescriptor { get }
var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusServerInterceptorFactoryProtocol? { get }
func workerStatus(
requestStream: GRPCAsyncRequestStream<Org_Apache_Beam_Model_FnExecution_V1_WorkerStatusResponse>,
responseStream: GRPCAsyncResponseStreamWriter<Org_Apache_Beam_Model_FnExecution_V1_WorkerStatusRequest>,
context: GRPCAsyncServerCallContext
) async throws
}
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusAsyncProvider {
internal static var serviceDescriptor: GRPCServiceDescriptor {
return Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusServerMetadata.serviceDescriptor
}
internal var serviceName: Substring {
return Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusServerMetadata.serviceDescriptor.fullName[...]
}
internal var interceptors: Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusServerInterceptorFactoryProtocol? {
return nil
}
internal func handle(
method name: Substring,
context: CallHandlerContext
) -> GRPCServerHandlerProtocol? {
switch name {
case "WorkerStatus":
return GRPCAsyncServerHandler(
context: context,
requestDeserializer: ProtobufDeserializer<Org_Apache_Beam_Model_FnExecution_V1_WorkerStatusResponse>(),
responseSerializer: ProtobufSerializer<Org_Apache_Beam_Model_FnExecution_V1_WorkerStatusRequest>(),
interceptors: self.interceptors?.makeWorkerStatusInterceptors() ?? [],
wrapping: { try await self.workerStatus(requestStream: $0, responseStream: $1, context: $2) }
)
default:
return nil
}
}
}
internal protocol Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusServerInterceptorFactoryProtocol: Sendable {
/// - Returns: Interceptors to use when handling 'workerStatus'.
/// Defaults to calling `self.makeInterceptors()`.
func makeWorkerStatusInterceptors() -> [ServerInterceptor<Org_Apache_Beam_Model_FnExecution_V1_WorkerStatusResponse, Org_Apache_Beam_Model_FnExecution_V1_WorkerStatusRequest>]
}
internal enum Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusServerMetadata {
internal static let serviceDescriptor = GRPCServiceDescriptor(
name: "BeamFnWorkerStatus",
fullName: "org.apache.beam.model.fn_execution.v1.BeamFnWorkerStatus",
methods: [
Org_Apache_Beam_Model_FnExecution_V1_BeamFnWorkerStatusServerMetadata.Methods.workerStatus,
]
)
internal enum Methods {
internal static let workerStatus = GRPCMethodDescriptor(
name: "WorkerStatus",
path: "/org.apache.beam.model.fn_execution.v1.BeamFnWorkerStatus/WorkerStatus",
type: GRPCCallType.bidirectionalStreaming
)
}
}