org.hibernate.search.batchindexing.impl

## Class IdentifierProducer

- java.lang.Object
- - org.hibernate.search.batchindexing.impl.IdentifierProducer

- All Implemented Interfaces:
    StatelessSessionAwareRunnable

      public class IdentifierProducer
      extends Object
      implements StatelessSessionAwareRunnable

  This Runnable is going to feed the indexing queue with the identifiers of all the entities going to be indexed. This step in the indexing process is not parallel (should be done by one thread per type) so that a single transaction is used to define the group of entities to be indexed. Produced identifiers are put in the destination queue grouped in List instances: the reason for this is to load them in batches in the next step and reduce contention on the queue.
  Author:
    Sanne Grinovero

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `IdentifierProducer(ProducerConsumerQueue<List<Serializable>> fromIdentifierListToEntities, SessionFactory sessionFactory, int objectLoadingBatchSize, IndexedTypeIdentifier indexedType, MassIndexerProgressMonitor monitor, long objectsLimit, ErrorHandler errorHandler, int idFetchSize, String tenantId)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `run(StatelessSession upperSession)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### IdentifierProducer

          public IdentifierProducer(ProducerConsumerQueue<List<Serializable>> fromIdentifierListToEntities,
                                    SessionFactory sessionFactory,
                                    int objectLoadingBatchSize,
                                    IndexedTypeIdentifier indexedType,
                                    MassIndexerProgressMonitor monitor,
                                    long objectsLimit,
                                    ErrorHandler errorHandler,
                                    int idFetchSize,
                                    String tenantId)

      Parameters:
        `fromIdentifierListToEntities` - the target queue where the produced identifiers are sent to
        `sessionFactory` - the Hibernate SessionFactory to use to load entities
        `objectLoadingBatchSize` - affects mostly the next consumer: IdentifierConsumerEntityProducer
        `indexedType` - the entity type to be loaded
        `monitor` - to monitor indexing progress
        `objectsLimit` - if not zero
        `errorHandler` - how to handle unexpected errors
        `idFetchSize` - the fetch size
        `tenantId` - the tenant identifier

  - ### Method Detail

    - #### run

          public void run(StatelessSession upperSession)
                   throws Exception

      Specified by:
        `run` in interface `StatelessSessionAwareRunnable`
      Throws:
        `Exception`

Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved