Class ActorSystemScheduledExecutorAdapter

  • All Implemented Interfaces:
    Executor, org.apache.flink.util.concurrent.ScheduledExecutor

    public final class ActorSystemScheduledExecutorAdapter
    extends Object
    implements org.apache.flink.util.concurrent.ScheduledExecutor
    Adapter to use a ActorSystem as a ScheduledExecutor. Furthermore ensures that the context class loader is set to the Flink class loader while the runnable is running.
    • Constructor Detail

      • ActorSystemScheduledExecutorAdapter

        public ActorSystemScheduledExecutorAdapter​(org.apache.pekko.actor.ActorSystem actorSystem,
                                                   ClassLoader flinkClassLoader)
    • Method Detail

      • schedule

        @Nonnull
        public ScheduledFuture<?> schedule​(@Nonnull
                                           Runnable command,
                                           long delay,
                                           @Nonnull
                                           TimeUnit unit)
        Specified by:
        schedule in interface org.apache.flink.util.concurrent.ScheduledExecutor
      • schedule

        @Nonnull
        public <V> ScheduledFuture<V> schedule​(@Nonnull
                                               Callable<V> callable,
                                               long delay,
                                               @Nonnull
                                               TimeUnit unit)
        Specified by:
        schedule in interface org.apache.flink.util.concurrent.ScheduledExecutor
      • scheduleAtFixedRate

        @Nonnull
        public ScheduledFuture<?> scheduleAtFixedRate​(@Nonnull
                                                      Runnable command,
                                                      long initialDelay,
                                                      long period,
                                                      @Nonnull
                                                      TimeUnit unit)
        Specified by:
        scheduleAtFixedRate in interface org.apache.flink.util.concurrent.ScheduledExecutor
      • scheduleWithFixedDelay

        @Nonnull
        public ScheduledFuture<?> scheduleWithFixedDelay​(@Nonnull
                                                         Runnable command,
                                                         long initialDelay,
                                                         long delay,
                                                         @Nonnull
                                                         TimeUnit unit)
        Specified by:
        scheduleWithFixedDelay in interface org.apache.flink.util.concurrent.ScheduledExecutor