Skip to content

Commit

Permalink
eliminate legacy
Browse files Browse the repository at this point in the history
  • Loading branch information
terrywbrady committed Nov 1, 2024
1 parent 6b61f7a commit ca33fd0
Show file tree
Hide file tree
Showing 15 changed files with 51 additions and 561 deletions.
6 changes: 1 addition & 5 deletions src-colladmin/actions/access_queue_action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@
class AccessQueueAction < ZookeeperListAction
def perform_action
jobs = []
if ZookeeperListAction.migration_m3?
jobs = MerrittZK::Access.list_jobs_as_json(@zk)
else
jobs = MerrittZK::LegacyAccessJob.list_jobs_as_json(@zk)
end
jobs = MerrittZK::Access.list_jobs_as_json(@zk)
jobs.each do |po|
register_item(AccQueueEntry.new(po))
end
Expand Down
1 change: 0 additions & 1 deletion src-colladmin/actions/forward_to_ingest_action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ def initialize(config, action, path, myparams, endpoint)
@endpoint = endpoint

@zk = ZK.new(get_zookeeper_conn)
ZookeeperListAction.migration_level(@zk)
end

def get_zookeeper_conn
Expand Down
30 changes: 8 additions & 22 deletions src-colladmin/actions/ingest_collection_locks_action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,9 @@ def initialize(config, action, path, myparams)
@held_counts = {}
ql = QueueList.new(@zk)
ql.jobs.each do |qe|
if ZookeeperListAction.migration_m1?
next if qe.profile.empty?
# next unless MerrittZK::Locks.check_lock_collection(@zk, qe.profile)
next if qe.qstatus != 'Held'
elsif qe.qstatus != 'Held'
next
end
next if qe.profile.empty?
# next unless MerrittZK::Locks.check_lock_collection(@zk, qe.profile)
next if qe.qstatus != 'Held'

@held_counts[qe.profile] = @held_counts.fetch(qe.profile, 0) + 1
end
Expand All @@ -39,19 +35,11 @@ def specific_profile?
end

def table_headers
if ZookeeperListAction.migration_m1?
['Profile', 'CollId', 'Name', 'Locked', 'Locks ZK', 'Held Items', 'Release']
else
['Profile', 'CollId', 'Name', 'Locked', 'Locks', 'Held Items', 'Release']
end
['Profile', 'CollId', 'Name', 'Locked', 'Locks ZK', 'Held Items', 'Release']
end

def table_types
if ZookeeperListAction.migration_m1?
['', 'colllist', '', '', 'colllockzk', 'dataint', 'collqitems-mrtzk']
else
['', 'colllist', '', '', 'colllock', 'dataint', 'collqitems-legacy']
end
['', 'colllist', '', '', 'colllockzk', 'dataint', 'collqitems-mrtzk']
end

def table_rows(_body)
Expand Down Expand Up @@ -91,13 +79,11 @@ def get_profile_names
locked: false,
name: p.get_value(:profileDescription)
}
pstat[:locked] = MerrittZK::Locks.check_lock_collection(@zk, profile) if ZookeeperListAction.migration_m1?
pstat[:locked] = MerrittZK::Locks.check_lock_collection(@zk, profile)
names[profile] = pstat
end
unless ZookeeperListAction.migration_m1?
IngestStateAction.new(@config, {}, 'state', {}).get_locked_collections.each do |k|
names.fetch(k, {})[:locked] = true
end
IngestStateAction.new(@config, {}, 'state', {}).get_locked_collections.each do |k|
names.fetch(k, {})[:locked] = true
end
rescue StandardError => e
log(e.message)
Expand Down
59 changes: 0 additions & 59 deletions src-colladmin/actions/inventory_queue_action.rb

This file was deleted.

Loading

0 comments on commit ca33fd0

Please sign in to comment.