Skip to content

Commit dfbbf05

Browse files
config(lcm): Allow configure increase parallel processing for each step on LCM Rollout Brick
1 parent 51d6340 commit dfbbf05

File tree

8 files changed

+38
-8
lines changed

8 files changed

+38
-8
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.7.99
1+
3.7.100

lib/gooddata/lcm/actions/synchronize_cas.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ class SynchronizeComputedAttributes < BaseAction
4141

4242
description 'Sync failed list'
4343
param :sync_failed_list, instance_of(Type::HashType), required: false
44+
45+
description 'Number Of Threads'
46+
param :number_of_threads_synchronize_cas, instance_of(Type::StringType), required: false, default: '10'
4447
end
4548

4649
class << self
@@ -57,14 +60,16 @@ def call(params)
5760
client = params.gdc_gd_client
5861
collect_synced_status = collect_synced_status(params)
5962
failed_projects = ThreadSafe::Array.new
63+
number_of_threads = Integer(params.number_of_threads_synchronize_cas || '10')
64+
GoodData.logger.info "Number of threads using synchronize computed attributes #{number_of_threads}" if params.number_of_threads_synchronize_cas
6065

6166
params.synchronize.each do |info|
6267
from = info.from
6368
to_projects = info.to
6469

6570
params.gdc_logger.info "Synchronize Computed Attributes from project pid: #{from}"
6671

67-
to_projects.peach do |entry|
72+
to_projects.peach(number_of_threads) do |entry|
6873
ca_scripts = entry[:ca_scripts]
6974
next unless ca_scripts
7075

lib/gooddata/lcm/actions/synchronize_etls_in_segment.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ class SynchronizeETLsInSegment < BaseAction
5353

5454
description 'Sync failed list'
5555
param :sync_failed_list, instance_of(Type::HashType), required: false
56+
57+
description 'Number Of Threads'
58+
param :number_of_threads_synchronize_etls, instance_of(Type::StringType), required: false, default: '10'
5659
end
5760

5861
# will be updated later based on the way etl synchronization
@@ -73,6 +76,8 @@ def call(params)
7376

7477
schedule_additional_params = params.schedule_additional_params || params.additional_params
7578
schedule_additional_hidden_params = params.schedule_additional_hidden_params || params.additional_hidden_params
79+
number_of_threads = Integer(params.number_of_threads_synchronize_etls || '10')
80+
GoodData.logger.info "Number of threads using synchronize ETL processes #{number_of_threads}" if params.number_of_threads_synchronize_etls
7681

7782
synchronize_segments = params.synchronize.group_by do |info|
7883
info[:segment_id]
@@ -132,7 +137,7 @@ def call(params)
132137
next if delete_extra_process_schedule && from_project_etl_names.nil?
133138

134139
to_projects = info.to
135-
to_projects.peach do |entry|
140+
to_projects.peach(number_of_threads) do |entry|
136141
pid = entry[:pid]
137142
next if collect_synced_status && sync_failed_project(pid, params)
138143

lib/gooddata/lcm/actions/synchronize_kd_dashboard_permission.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ class SynchronizeKDDashboardPermissions < BaseAction
4040

4141
description 'Sync failed list'
4242
param :sync_failed_list, instance_of(Type::HashType), required: false
43+
44+
description 'Number Of Threads'
45+
param :number_of_threads_synchronize_kd_dashboard_permissions, instance_of(Type::StringType), required: false, default: '10'
4346
end
4447

4548
class << self
@@ -49,6 +52,8 @@ def call(params)
4952
failed_projects = ThreadSafe::Array.new
5053

5154
disable_kd_dashboard_permission = GoodData::Helpers.to_boolean(params.disable_kd_dashboard_permission)
55+
number_of_threads = Integer(params.number_of_threads_synchronize_kd_dashboard_permissions || '10')
56+
GoodData.logger.info "Number of threads using synchronize KD dashboard permissions #{number_of_threads}" if params.number_of_threads_synchronize_kd_dashboard_permissions
5257

5358
# rubocop:disable Style/UnlessElse
5459
unless disable_kd_dashboard_permission
@@ -69,7 +74,7 @@ def call(params)
6974
from_dashboards = from_project.analytical_dashboards
7075

7176
params.gdc_logger.info "Transferring #{dashboard_type} Dashboard permission, from project: '#{from_project.title}', PID: '#{from_project.pid}' for dashboard(s): #{from_dashboards.map { |d| "#{d.title.inspect}" }.join(', ')}" # rubocop:disable Metrics/LineLength
72-
to_projects_info.peach do |item|
77+
to_projects_info.peach(number_of_threads) do |item|
7378
to_project_pid = item[:pid]
7479
next if sync_failed_project(to_project_pid, params)
7580

lib/gooddata/lcm/actions/synchronize_ldm.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def sync_segment_ldm(params, segment_info)
9595
include_deprecated = params.include_deprecated.to_b
9696
update_preference = params[:update_preference]
9797
number_of_threads = Integer(params.number_of_threads_synchronize_ldm || '10')
98-
GoodData.logger.info "Number of threads using synchronize logical data model #{number_of_threads}"
98+
GoodData.logger.info "Number of threads using synchronize logical data model #{number_of_threads}" if params.number_of_threads_synchronize_ldm
9999

100100
exist_fallback_to_hard_sync_config = !update_preference.nil? && !update_preference[:fallback_to_hard_sync].nil?
101101
include_maql_fallback_hard_sync = exist_fallback_to_hard_sync_config && Helpers.to_bool('fallback_to_hard_sync', update_preference[:fallback_to_hard_sync])

lib/gooddata/lcm/actions/synchronize_ldm_layout.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ class SynchronizeLdmLayout < BaseAction
3333

3434
description 'Sync failed list'
3535
param :sync_failed_list, instance_of(Type::HashType), required: false
36+
37+
description 'Number Of Threads'
38+
param :number_of_threads_synchronize_ldm_layout, instance_of(Type::StringType), required: false, default: '10'
3639
end
3740

3841
RESULT_HEADER = %i[from to status]
@@ -45,6 +48,8 @@ def call(params)
4548
development_client = params.development_client
4649
gdc_logger = params.gdc_logger
4750
collect_synced_status = collect_synced_status(params)
51+
number_of_threads = Integer(params.number_of_threads_synchronize_ldm_layout || '10')
52+
GoodData.logger.info "Number of threads using synchronize ldm layout #{number_of_threads}" if params.number_of_threads_synchronize_ldm_layout
4853
failed_projects = ThreadSafe::Array.new
4954

5055
params.synchronize.peach do |info|
@@ -64,7 +69,7 @@ def call(params)
6469
if from_ldm_layout&.dig('ldmLayout', 'layout').nil? || from_ldm_layout['ldmLayout']['layout'].empty?
6570
gdc_logger.info "Project: '#{from_title}', PID: '#{from_pid}' has no ldm layout, skip synchronizing ldm layout."
6671
else
67-
to_projects.peach do |to|
72+
to_projects.peach(number_of_threads) do |to|
6873
pid = to[:pid]
6974
to_project = client.projects(pid)
7075
unless to_project

lib/gooddata/lcm/actions/synchronize_pp_dashboard_permission.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,18 @@ class SynchronizePPDashboardPermissions < BaseAction
4242

4343
description 'Sync failed list'
4444
param :sync_failed_list, instance_of(Type::HashType), required: false
45+
46+
description 'Number Of Threads'
47+
param :number_of_threads_synchronize_pp_dashboard_permissions, instance_of(Type::StringType), required: false, default: '10'
4548
end
4649

4750
class << self
4851
def call(params)
4952
results = []
5053
disable_pp_dashboard_permission = GoodData::Helpers.to_boolean(params.disable_pp_dashboard_permission)
5154
collect_synced_status = collect_synced_status(params)
55+
number_of_threads = Integer(params.number_of_threads_synchronize_pp_dashboard_permissions || '10')
56+
GoodData.logger.info "Number of threads using synchronize pixel perfect dashboard permissions #{number_of_threads}" if params.number_of_threads_synchronize_pp_dashboard_permissions
5257
failed_projects = ThreadSafe::Array.new
5358

5459
if disable_pp_dashboard_permission
@@ -72,7 +77,7 @@ def call(params)
7277
source_dashboards = from.dashboards
7378

7479
params.gdc_logger.info "Transferring Pixel Perfect Dashboard permission, from project: '#{from.title}', PID: '#{from.pid}' for dashboard(s): #{source_dashboards.map { |d| "#{d.title.inspect}" }.join(', ')}" # rubocop:disable Metrics/LineLength
75-
to_projects.peach do |entry|
80+
to_projects.peach(number_of_threads) do |entry|
7681
pid = entry[:pid]
7782
next if sync_failed_project(pid, params)
7883

lib/gooddata/lcm/actions/synchronize_user_groups.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ class SynchronizeUserGroups < BaseAction
3636

3737
description 'Sync failed list'
3838
param :sync_failed_list, instance_of(Type::HashType), required: false
39+
40+
description 'Number Of Threads'
41+
param :number_of_threads_synchronize_user_groups, instance_of(Type::StringType), required: false, default: '10'
3942
end
4043

4144
class << self
@@ -46,6 +49,8 @@ def call(params)
4649

4750
client = params.gdc_gd_client
4851
development_client = params.development_client
52+
number_of_threads = Integer(params.number_of_threads_synchronize_user_groups || '10')
53+
GoodData.logger.info "Number of threads using synchronize user groups #{number_of_threads}" if params.number_of_threads_synchronize_user_groups
4954

5055
params.synchronize.peach do |info|
5156
from_project = info.from
@@ -57,7 +62,7 @@ def call(params)
5762
next
5863
end
5964

60-
to_projects.peach do |entry|
65+
to_projects.peach(number_of_threads) do |entry|
6166
pid = entry[:pid]
6267
next if sync_failed_project(pid, params)
6368

0 commit comments

Comments
 (0)