Class LeaderAutoConfiguration

java.lang.Object
com.netflix.genie.web.spring.autoconfigure.tasks.leader.LeaderAutoConfiguration

Beans for Leadership of a Genie cluster.
Since:
3.1.0
  • Constructor Details

    • LeaderAutoConfiguration

      public LeaderAutoConfiguration()
  • Method Details

    • leaderTasksCoordinator

      @Bean @ConditionalOnMissingBean(LeaderTasksCoordinator.class) public LeaderTasksCoordinator leaderTasksCoordinator(@Qualifier("genieTaskScheduler") org.springframework.scheduling.TaskScheduler taskScheduler, Set<LeaderTask> tasks)
      Create the LeadershipTasksCoordination bean used to start and stop all leadership related tasks based on whether leadership is granted or revoked.
      Parameters:
      taskScheduler - The task scheduler to use for scheduling leadership tasks
      tasks - The leadership tasks to schedule
      Returns:
      The leader coordinator
    • databaseCleanupTask

      @Bean @ConditionalOnProperty(value="genie.tasks.database-cleanup.enabled", havingValue="true") @ConditionalOnMissingBean(DatabaseCleanupTask.class) public DatabaseCleanupTask databaseCleanupTask(DatabaseCleanupProperties cleanupProperties, org.springframework.core.env.Environment environment, DataServices dataServices, io.micrometer.core.instrument.MeterRegistry registry)
      Create a DatabaseCleanupTask if one is required.
      Parameters:
      cleanupProperties - The properties to use to configure this task
      environment - The application Environment to pull properties from
      dataServices - The DataServices encapsulation instance to use
      registry - The metrics registry
      Returns:
      The DatabaseCleanupTask instance to use if the conditions match
    • userMetricsTask

      @Bean @ConditionalOnProperty(value="genie.tasks.user-metrics.enabled", havingValue="true") @ConditionalOnMissingBean(UserMetricsTask.class) public UserMetricsTask userMetricsTask(io.micrometer.core.instrument.MeterRegistry registry, DataServices dataServices, UserMetricsProperties userMetricsProperties)
      If required get a UserMetricsTask instance for use.
      Parameters:
      registry - The metrics registry
      dataServices - The DataServices instance to use
      userMetricsProperties - The properties
      Returns:
      The UserMetricsTask instance
    • agentJobCleanupTask

      @Bean @ConditionalOnProperty(value="genie.tasks.agent-cleanup.enabled", havingValue="true") @ConditionalOnMissingBean(AgentJobCleanupTask.class) public AgentJobCleanupTask agentJobCleanupTask(DataServices dataServices, AgentCleanupProperties agentCleanupProperties, io.micrometer.core.instrument.MeterRegistry registry, AgentRoutingService agentRoutingService)
      If required, get a AgentJobCleanupTask instance for use.
      Parameters:
      dataServices - The DataServices encapsulation instance to use
      agentCleanupProperties - the agent cleanup properties
      registry - the metrics registry
      agentRoutingService - the agent routing service
      Returns:
      a AgentJobCleanupTask
    • archiveStatusCleanupTask

      @Bean @ConditionalOnProperty(value="genie.tasks.archive-status-cleanup.enabled", havingValue="true") @ConditionalOnMissingBean(ArchiveStatusCleanupTask.class) public ArchiveStatusCleanupTask archiveStatusCleanupTask(DataServices dataServices, AgentRoutingService agentRoutingService, ArchiveStatusCleanupProperties archiveStatusCleanupProperties, io.micrometer.core.instrument.MeterRegistry registry)
      If required, get a ArchiveStatusCleanupTask instance for use.
      Parameters:
      dataServices - The DataServices encapsulation instance to use
      agentRoutingService - the agent routing service
      archiveStatusCleanupProperties - the archive status cleanup properties
      registry - the metrics registry
      Returns:
      a AgentJobCleanupTask
    • curatorClusterLeaderService

      @Bean @ConditionalOnBean(org.springframework.integration.zookeeper.leader.LeaderInitiator.class) @ConditionalOnMissingBean(ClusterLeaderService.class) public ClusterLeaderService curatorClusterLeaderService(org.springframework.integration.zookeeper.leader.LeaderInitiator leaderInitiator)
      Create a ClusterLeaderService based on Zookeeper/Curator if LeaderInitiator is available and the bean does not already exist.
      Parameters:
      leaderInitiator - the Spring Zookeeper/Curator based leader election component
      Returns:
      a ClusterLeaderService
    • localLeader

      @Bean @ConditionalOnMissingBean({org.springframework.integration.zookeeper.leader.LeaderInitiator.class,LocalLeader.class}) public LocalLeader localLeader(GenieEventBus genieEventBus, LeadershipProperties leadershipProperties)
      If Zookeeper isn't available and this node is forced to be the leader create the local leader bean which will fire appropriate events.
      Parameters:
      genieEventBus - The genie event bus implementation to use
      leadershipProperties - Properties related to static leadership configuration for the Genie cluster
      Returns:
      The local leader bean
    • localClusterLeaderService

      @Bean @ConditionalOnBean(LocalLeader.class) @ConditionalOnMissingBean(ClusterLeaderService.class) public ClusterLeaderService localClusterLeaderService(LocalLeader localLeader)
      Create a ClusterLeaderService based on static configuration if LocalLeader is available and the bean does not already exist.
      Parameters:
      localLeader - the configuration-based leader election component
      Returns:
      a ClusterLeaderService
    • leaderElectionActuator

      @Bean @ConditionalOnBean(ClusterLeaderService.class) @ConditionalOnMissingBean(LeaderElectionActuator.class) public LeaderElectionActuator leaderElectionActuator(ClusterLeaderService clusterLeaderService)
      Create a LeaderElectionActuator bean if one is not already defined and if ClusterLeaderService is available. This bean is an endpoint that gets registered in Spring Actuator.
      Parameters:
      clusterLeaderService - the cluster leader service
      Returns:
      a LeaderElectionActuator