Interface LoaderExecutor

  • All Superinterfaces:
    AutoCloseable

    public interface LoaderExecutor
    extends AutoCloseable
    Executes provided Loader objects to load data into Fluo. close() should be called when finished.
    Since:
    1.0.0
    • Method Detail

      • execute

        void execute​(Loader loader)
        Queues Loader task implemented by users for execution. The load Task may not have completed when the method returns. If the queue is full, this method will block.

        If a previous execution of loader has thrown an exception, then this call may throw an exception. To avoid this odd behavior use submit(Loader) instead which relays exceptions through the returned future.

      • execute

        void execute​(String identity,
                     Loader loader)
        Same as execute(Loader), but allows specifying an identity. The identity is used in metrics and trace logging. When an identity is not supplied, the class name is used. In the case of lambdas the class name may not be the same in different processes.
        Since:
        1.1.0
      • submit

        <T extends LoaderCompletableFuture<T> submit​(T loader)
        Same as execute(Loader) except it returns a future that completes upon successful commit and if an exception is thrown in the loader, it will be relayed through the future. The result of the future is the Loader that was successfully executed. If storing any information in the loader object, keep in mind that loaders may execute multiple times in the case of commit collisions. If a loader executes multiple times, it may see different data on subsequent executions.
        Since:
        2.0.0