Skip to content

Commit

Permalink
feat(multi): Support for channel pool configuration (#22919)
Browse files Browse the repository at this point in the history
  • Loading branch information
gcf-owl-bot[bot] authored Sep 9, 2023
1 parent f047943 commit df3216a
Show file tree
Hide file tree
Showing 244 changed files with 14,989 additions and 134 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Gem::Specification.new do |gem|

gem.required_ruby_version = ">= 2.6"

gem.add_dependency "gapic-common", ">= 0.19.1", "< 2.a"
gem.add_dependency "gapic-common", ">= 0.20.0", "< 2.a"
gem.add_dependency "google-cloud-errors", "~> 1.0"

gem.add_development_dependency "google-style", "~> 1.26.3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ def initialize
credentials: credentials,
endpoint: @config.endpoint,
channel_args: @config.channel_args,
interceptors: @config.interceptors
interceptors: @config.interceptors,
channel_pool_config: @config.channel_pool
)
end

Expand Down Expand Up @@ -958,6 +959,14 @@ def rpcs
end
end

##
# Configuration for the channel pool
# @return [::Gapic::ServiceStub::ChannelPool::Configuration]
#
def channel_pool
@channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
end

##
# Configuration RPC class for the DataFusion API.
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ def initialize
credentials: credentials,
endpoint: @config.endpoint,
channel_args: @config.channel_args,
interceptors: @config.interceptors
interceptors: @config.interceptors,
channel_pool_config: @config.channel_pool
)

# Used by an LRO wrapper for some methods of this service
Expand Down Expand Up @@ -701,6 +702,14 @@ def rpcs
end
end

##
# Configuration for the channel pool
# @return [::Gapic::ServiceStub::ChannelPool::Configuration]
#
def channel_pool
@channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
end

##
# Configuration RPC class for the Operations API.
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,26 @@ def initialize
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DataFusion::V1::Version>]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
#
# @example Basic example
# require "google/cloud/data_fusion/v1"
#
# # Create a client object. The client can be reused for multiple calls.
# client = Google::Cloud::DataFusion::V1::DataFusion::Rest::Client.new
#
# # Create a request. To set request fields, pass in keyword arguments.
# request = Google::Cloud::DataFusion::V1::ListAvailableVersionsRequest.new
#
# # Call the list_available_versions method.
# result = client.list_available_versions request
#
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
# # over elements, and API calls will be issued to fetch pages as needed.
# result.each do |item|
# # Each element is of type ::Google::Cloud::DataFusion::V1::Version.
# p item
# end
#
def list_available_versions request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?

Expand Down Expand Up @@ -265,6 +285,26 @@ def list_available_versions request, options = nil
# @return [::Google::Cloud::DataFusion::V1::ListInstancesResponse]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
#
# @example Basic example
# require "google/cloud/data_fusion/v1"
#
# # Create a client object. The client can be reused for multiple calls.
# client = Google::Cloud::DataFusion::V1::DataFusion::Rest::Client.new
#
# # Create a request. To set request fields, pass in keyword arguments.
# request = Google::Cloud::DataFusion::V1::ListInstancesRequest.new
#
# # Call the list_instances method.
# result = client.list_instances request
#
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
# # over elements, and API calls will be issued to fetch pages as needed.
# result.each do |item|
# # Each element is of type ::Google::Cloud::DataFusion::V1::Instance.
# p item
# end
#
def list_instances request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?

Expand Down Expand Up @@ -328,6 +368,22 @@ def list_instances request, options = nil
# @return [::Google::Cloud::DataFusion::V1::Instance]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
#
# @example Basic example
# require "google/cloud/data_fusion/v1"
#
# # Create a client object. The client can be reused for multiple calls.
# client = Google::Cloud::DataFusion::V1::DataFusion::Rest::Client.new
#
# # Create a request. To set request fields, pass in keyword arguments.
# request = Google::Cloud::DataFusion::V1::GetInstanceRequest.new
#
# # Call the get_instance method.
# result = client.get_instance request
#
# # The returned object is of type Google::Cloud::DataFusion::V1::Instance.
# p result
#
def get_instance request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?

Expand Down Expand Up @@ -395,6 +451,29 @@ def get_instance request, options = nil
# @return [::Gapic::Operation]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
#
# @example Basic example
# require "google/cloud/data_fusion/v1"
#
# # Create a client object. The client can be reused for multiple calls.
# client = Google::Cloud::DataFusion::V1::DataFusion::Rest::Client.new
#
# # Create a request. To set request fields, pass in keyword arguments.
# request = Google::Cloud::DataFusion::V1::CreateInstanceRequest.new
#
# # Call the create_instance method.
# result = client.create_instance request
#
# # The returned object is of type Gapic::Operation. You can use it to
# # check the status of an operation, cancel it, or wait for results.
# # Here is how to wait for a response.
# result.wait_until_done! timeout: 60
# if result.response?
# p result.response
# else
# puts "No response received."
# end
#
def create_instance request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?

Expand Down Expand Up @@ -459,6 +538,29 @@ def create_instance request, options = nil
# @return [::Gapic::Operation]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
#
# @example Basic example
# require "google/cloud/data_fusion/v1"
#
# # Create a client object. The client can be reused for multiple calls.
# client = Google::Cloud::DataFusion::V1::DataFusion::Rest::Client.new
#
# # Create a request. To set request fields, pass in keyword arguments.
# request = Google::Cloud::DataFusion::V1::DeleteInstanceRequest.new
#
# # Call the delete_instance method.
# result = client.delete_instance request
#
# # The returned object is of type Gapic::Operation. You can use it to
# # check the status of an operation, cancel it, or wait for results.
# # Here is how to wait for a response.
# result.wait_until_done! timeout: 60
# if result.response?
# p result.response
# else
# puts "No response received."
# end
#
def delete_instance request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?

Expand Down Expand Up @@ -531,6 +633,29 @@ def delete_instance request, options = nil
# @return [::Gapic::Operation]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
#
# @example Basic example
# require "google/cloud/data_fusion/v1"
#
# # Create a client object. The client can be reused for multiple calls.
# client = Google::Cloud::DataFusion::V1::DataFusion::Rest::Client.new
#
# # Create a request. To set request fields, pass in keyword arguments.
# request = Google::Cloud::DataFusion::V1::UpdateInstanceRequest.new
#
# # Call the update_instance method.
# result = client.update_instance request
#
# # The returned object is of type Gapic::Operation. You can use it to
# # check the status of an operation, cancel it, or wait for results.
# # Here is how to wait for a response.
# result.wait_until_done! timeout: 60
# if result.response?
# p result.response
# else
# puts "No response received."
# end
#
def update_instance request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?

Expand Down Expand Up @@ -596,6 +721,29 @@ def update_instance request, options = nil
# @return [::Gapic::Operation]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
#
# @example Basic example
# require "google/cloud/data_fusion/v1"
#
# # Create a client object. The client can be reused for multiple calls.
# client = Google::Cloud::DataFusion::V1::DataFusion::Rest::Client.new
#
# # Create a request. To set request fields, pass in keyword arguments.
# request = Google::Cloud::DataFusion::V1::RestartInstanceRequest.new
#
# # Call the restart_instance method.
# result = client.restart_instance request
#
# # The returned object is of type Gapic::Operation. You can use it to
# # check the status of an operation, cancel it, or wait for results.
# # Here is how to wait for a response.
# result.wait_until_done! timeout: 60
# if result.response?
# p result.response
# else
# puts "No response received."
# end
#
def restart_instance request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,26 @@ def initialize
# @return [::Gapic::Operation]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
#
# @example Basic example
# require "google/longrunning"
#
# # Create a client object. The client can be reused for multiple calls.
# client = Google::Longrunning::Operations::Rest::Client.new
#
# # Create a request. To set request fields, pass in keyword arguments.
# request = Google::Longrunning::ListOperationsRequest.new
#
# # Call the list_operations method.
# result = client.list_operations request
#
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
# # over elements, and API calls will be issued to fetch pages as needed.
# result.each do |item|
# # Each element is of type ::Google::Longrunning::Operation.
# p item
# end
#
def list_operations request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?

Expand Down Expand Up @@ -201,6 +221,29 @@ def list_operations request, options = nil
# @return [::Gapic::Operation]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
#
# @example Basic example
# require "google/longrunning"
#
# # Create a client object. The client can be reused for multiple calls.
# client = Google::Longrunning::Operations::Rest::Client.new
#
# # Create a request. To set request fields, pass in keyword arguments.
# request = Google::Longrunning::GetOperationRequest.new
#
# # Call the get_operation method.
# result = client.get_operation request
#
# # The returned object is of type Gapic::Operation. You can use it to
# # check the status of an operation, cancel it, or wait for results.
# # Here is how to wait for a response.
# result.wait_until_done! timeout: 60
# if result.response?
# p result.response
# else
# puts "No response received."
# end
#
def get_operation request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?

Expand Down Expand Up @@ -267,6 +310,22 @@ def get_operation request, options = nil
# @return [::Google::Protobuf::Empty]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
#
# @example Basic example
# require "google/longrunning"
#
# # Create a client object. The client can be reused for multiple calls.
# client = Google::Longrunning::Operations::Rest::Client.new
#
# # Create a request. To set request fields, pass in keyword arguments.
# request = Google::Longrunning::DeleteOperationRequest.new
#
# # Call the delete_operation method.
# result = client.delete_operation request
#
# # The returned object is of type Google::Protobuf::Empty.
# p result
#
def delete_operation request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?

Expand Down Expand Up @@ -338,6 +397,22 @@ def delete_operation request, options = nil
# @return [::Google::Protobuf::Empty]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
#
# @example Basic example
# require "google/longrunning"
#
# # Create a client object. The client can be reused for multiple calls.
# client = Google::Longrunning::Operations::Rest::Client.new
#
# # Create a request. To set request fields, pass in keyword arguments.
# request = Google::Longrunning::CancelOperationRequest.new
#
# # Call the cancel_operation method.
# result = client.cancel_operation request
#
# # The returned object is of type Google::Protobuf::Empty.
# p result
#
def cancel_operation request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Gem::Specification.new do |gem|

gem.required_ruby_version = ">= 2.6"

gem.add_dependency "gapic-common", ">= 0.19.1", "< 2.a"
gem.add_dependency "gapic-common", ">= 0.20.0", "< 2.a"
gem.add_dependency "google-cloud-errors", "~> 1.0"

gem.add_development_dependency "google-style", "~> 1.26.3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,8 @@ def initialize
credentials: credentials,
endpoint: @config.endpoint,
channel_args: @config.channel_args,
interceptors: @config.interceptors
interceptors: @config.interceptors,
channel_pool_config: @config.channel_pool
)
end

Expand Down Expand Up @@ -3685,6 +3686,14 @@ def rpcs
end
end

##
# Configuration for the channel pool
# @return [::Gapic::ServiceStub::ChannelPool::Configuration]
#
def channel_pool
@channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
end

##
# Configuration RPC class for the DataLabelingService API.
#
Expand Down
Loading

0 comments on commit df3216a

Please sign in to comment.