Interface PojoMassEntityLoader<I>

  • Type Parameters:
    I - The type of entity identifiers.
    All Superinterfaces:

    public interface PojoMassEntityLoader<I>
    extends AutoCloseable
    A loader for mass loading of entities, used in particular during mass indexing.

    Compared to PojoSelectionEntityLoader, this loader:

    • Receives batches of identifiers from a PojoMassIdentifierLoader
    • Is expected to load a very large number of entities in multiple small batches.
    • Pushes loaded entities to a sink.
    • Sets up its own context (session, transactions, ...), instead of potentially relying on a pre-existing context.
    • Is free to discard the entities after the sink is done processing them.
    • Method Detail

      • load

        void load​(List<I> identifiers)
           throws InterruptedException
        Loads the entities corresponding to the given identifiers and adds them to the given sink, blocking the current thread while doing so.

        Calls to the sink must be performed synchronously (before this method returns).

        Entities must be passed to the sink using a single call to PojoMassEntitySink.accept(List).

        Entities passed to the sink do not need to be the same order as identifiers.

        identifiers - A list of identifiers of entities to load.
        InterruptedException - If the thread was interrupted while performing I/O operations. This will lead to aborting mass indexing completely.