<commit_before><?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
	xmlns:tx="http://www.springframework.org/schema/tx" xmlns:util="http://www.springframework.org/schema/util"
	xsi:schemaLocation="
       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
       http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
       http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
       http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">

	<!-- Turn on Spring's autoproxy using AspectJ's @Aspect annotations. -->
	<aop:aspectj-autoproxy proxy-target-class="true"/>

	<!-- This worker scans for new partitions in the glue tables defined for the stack -->
	<bean id="athenaPartitionScannerWorker" class="org.sagebionetworks.athena.workers.AthenaPartitionScannerWorker" scope="singleton" />

	<!-- Trigger for the athena partition scanner -->
	<bean id="athenaPartitionScannerTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerFactoryBean" scope="singleton">
		<property name="jobDetail">
			<bean class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
				<property name="targetObject">
					<bean class="org.sagebionetworks.workers.util.semaphore.SemaphoreGatedWorkerStack">
						<constructor-arg index="0" ref="countingSemaphore" />
						<constructor-arg index="1">
							<bean class="org.sagebionetworks.workers.util.semaphore.SemaphoreGatedWorkerStackConfiguration">
								<property name="progressingRunner" ref="athenaPartitionScannerWorker"/>
								<property name="semaphoreLockKey" value="athenaPartitionScanner" />
								<property name="semaphoreMaxLockCount" value="1" />
								<property name="semaphoreLockTimeoutSec" value="60" />
								<property name="gate">
									<bean class="org.sagebionetworks.worker.utils.StackStatusGate" />
								</property>

							</bean>
						</constructor-arg>
					</bean>
				</property>
				<property name="targetMethod" value="run" />
				<property name="concurrent" value="false" />
			</bean>
		</property>
		<property name="startDelay" value="135" />
		<!-- Once a day -->
		<property name="repeatInterval" value="86400000" />
	</bean>
	
	<!-- This worker process an SQS message that contains the query results from an Athena query executed by a step function -->
	<bean id="recurrentAthenaQueryWorker" class="org.sagebionetworks.athena.workers.RecurrentAthenaQueryWorker" scope="singleton" >
		<property name="queueName" value="#{stackConfiguration.getQueueName('RECURRENT_ATHENA_QUERIES')}" />
	</bean>
	
	<!-- Trigger for the worker that process unlinked file handles -->
	<bean id="recurrentAthenaQueryWorkerTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerFactoryBean" scope="singleton">
		<property name="jobDetail">
			<bean class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
				<property name="targetObject">
					<bean class="org.sagebionetworks.workers.util.aws.message.MessageDrivenWorkerStack">
						<constructor-arg index="0" ref="countingSemaphore" />
						<constructor-arg index="1" ref="awsSQSClient" />
						<constructor-arg index="2">
							<bean class="org.sagebionetworks.workers.util.aws.message.MessageDrivenWorkerStackConfiguration">
								<property name="runner" ref="recurrentAthenaQueryWorker" />
								<property name="semaphoreLockKey" value="recurrentAthenaQueryWorker" />
								<property name="semaphoreMaxLockCount" value="5" />
								<property name="semaphoreLockAndMessageVisibilityTimeoutSec" value="300" />
								<property name="queueName" value="#{stackConfiguration.getQueueName('RECURRENT_ATHENA_QUERIES')}"/>
								<property name="gate">
									<bean class="org.sagebionetworks.worker.utils.StackStatusGate" /><commit_msg>PLFM-6641: Switch to a single worker for Athena query processing for now<commit_after><?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
	xmlns:tx="http://www.springframework.org/schema/tx" xmlns:util="http://www.springframework.org/schema/util"
	xsi:schemaLocation="
       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
       http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
       http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
       http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">

	<!-- Turn on Spring's autoproxy using AspectJ's @Aspect annotations. -->
	<aop:aspectj-autoproxy proxy-target-class="true"/>

	<!-- This worker scans for new partitions in the glue tables defined for the stack -->
	<bean id="athenaPartitionScannerWorker" class="org.sagebionetworks.athena.workers.AthenaPartitionScannerWorker" scope="singleton" />

	<!-- Trigger for the athena partition scanner -->
	<bean id="athenaPartitionScannerTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerFactoryBean" scope="singleton">
		<property name="jobDetail">
			<bean class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
				<property name="targetObject">
					<bean class="org.sagebionetworks.workers.util.semaphore.SemaphoreGatedWorkerStack">
						<constructor-arg index="0" ref="countingSemaphore" />
						<constructor-arg index="1">
							<bean class="org.sagebionetworks.workers.util.semaphore.SemaphoreGatedWorkerStackConfiguration">
								<property name="progressingRunner" ref="athenaPartitionScannerWorker"/>
								<property name="semaphoreLockKey" value="athenaPartitionScanner" />
								<property name="semaphoreMaxLockCount" value="1" />
								<property name="semaphoreLockTimeoutSec" value="60" />
								<property name="gate">
									<bean class="org.sagebionetworks.worker.utils.StackStatusGate" />
								</property>

							</bean>
						</constructor-arg>
					</bean>
				</property>
				<property name="targetMethod" value="run" />
				<property name="concurrent" value="false" />
			</bean>
		</property>
		<property name="startDelay" value="135" />
		<!-- Once a day -->
		<property name="repeatInterval" value="86400000" />
	</bean>
	
	<!-- This worker process an SQS message that contains the query results from an Athena query executed by a step function -->
	<bean id="recurrentAthenaQueryWorker" class="org.sagebionetworks.athena.workers.RecurrentAthenaQueryWorker" scope="singleton" >
		<property name="queueName" value="#{stackConfiguration.getQueueName('RECURRENT_ATHENA_QUERIES')}" />
	</bean>
	
	<!-- Trigger for the worker that process unlinked file handles -->
	<bean id="recurrentAthenaQueryWorkerTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerFactoryBean" scope="singleton">
		<property name="jobDetail">
			<bean class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
				<property name="targetObject">
					<bean class="org.sagebionetworks.workers.util.aws.message.MessageDrivenWorkerStack">
						<constructor-arg index="0" ref="countingSemaphore" />
						<constructor-arg index="1" ref="awsSQSClient" />
						<constructor-arg index="2">
							<bean class="org.sagebionetworks.workers.util.aws.message.MessageDrivenWorkerStackConfiguration">
								<property name="runner" ref="recurrentAthenaQueryWorker" />
								<property name="semaphoreLockKey" value="recurrentAthenaQueryWorker" />
								<property name="semaphoreMaxLockCount" value="1" />
								<property name="semaphoreLockAndMessageVisibilityTimeoutSec" value="300" />
								<property name="queueName" value="#{stackConfiguration.getQueueName('RECURRENT_ATHENA_QUERIES')}"/>
								<property name="gate">
									<bean class="org.sagebionetworks.worker.utils.StackStatusGate" />
{'fraction_non_alphanumeric': 0.14308233296956469, 'fraction_numerical': 0.009457984721716987, 'mean_word_length': 4.700069108500346, 'pattern_counts': {'":': 0, '<': 113, '<?xml version=': 2, '>': 113, 'https://': 0, 'lorem ipsum': 0, 'www.': 26, 'xml': 12}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1556707', 'n_tokens_mistral': 2945, 'n_tokens_neox': 2472, 'n_words': 387}