Ruby/TopLevelDupeInfoPropagation.nuixscript/BatchingBulkAnnotater.rb
# Checks various annotations buckets and flushes those (by applying their annotation) which
# have a pending item count greater than or equal to the threshold specified by @max_pending
Checks various annotations buckets and flushes those (by applying their annotation) which
have a pending item count greater than or equal to the threshold specified by @max_pending
Checks various annotations buckets and flushes those ( by applying their annotation ) which have a pending item count greater than or equal to the threshold specified by @max_pending
def flush
		@pending_tagging.each do |tag,pending_items|
			if pending_items.size >= @max_pending
				log("Applying tag '#{tag}' to #{pending_items.size} items")
				$utilities.getBulkAnnotater.addTag(tag,pending_items)
				@pending_tagging[tag] = []
			end
		end
		@pending_custom_metadata.each do |field_name,value_grouped|
			value_grouped.each do |value,pending_items|
				if pending_items.size >= @max_pending
					log("Applying field '#{field_name}' to #{pending_items.size} items")
					$utilities.getBulkAnnotater.putCustomMetadata(field_name,value,pending_items,nil)
					@pending_custom_metadata[field_name][value] = []
				end	
			end
		end
	end
def flush @pending_tagging . each do | tag , pending_items | if pending_items . size >= @max_pending log ( "Applying tag '#{tag}' to #{pending_items.size} items" ) $utilities . getBulkAnnotater . addTag ( tag , pending_items ) @pending_tagging [ tag ] = [ ] end end @pending_custom_metadata . each do | field_name , value_grouped | value_grouped . each do | value , pending_items | if pending_items . size >= @max_pending log ( "Applying field '#{field_name}' to #{pending_items.size} items" ) $utilities . getBulkAnnotater . putCustomMetadata ( field_name , value , pending_items , nil ) @pending_custom_metadata [ field_name ] [ value ] = [ ] end end end end
Checks various annotations buckets and flushes those (by applying their annotation) which
have a pending item count greater than or equal to the threshold specified by @max_pending
Checks various annotations buckets and flushes those ( by applying their annotation ) which have a pending item count greater than or equal to the threshold specified by @max_pending