Package org.hibernate.search.backend

Examples of org.hibernate.search.backend.PurgeAllLuceneWork


  public static List<LuceneWork> buildWorks() throws Exception {
    List<LuceneWork> works = new ArrayList<LuceneWork>();
    works.add( OptimizeLuceneWork.INSTANCE );
    works.add( OptimizeLuceneWork.INSTANCE );
    works.add( new OptimizeLuceneWork( RemoteEntity.class ) ); //class won't be send over
    works.add( new PurgeAllLuceneWork( RemoteEntity.class ) );
    works.add( new PurgeAllLuceneWork( RemoteEntity.class ) );
    works.add( new DeleteLuceneWork( 123l, "123", RemoteEntity.class ) );
    works.add( new DeleteLuceneWork( "Sissi", "Sissi", RemoteEntity.class ) );
    works.add(
        new DeleteLuceneWork(
            new URL( "http://emmanuelbernard.com" ),
View Full Code Here


     * @param luceneQueue work will be appended to this list
     */
    public void enqueueLuceneWork(List<LuceneWork> luceneQueue) {
      final Set<Entry<Serializable, PerEntityWork<T>>> entityInstances = entityById.entrySet();
      if ( purgeAll ) {
        luceneQueue.add( new PurgeAllLuceneWork( entityClass ) );
      }
      for ( Entry<Serializable, PerEntityWork<T>> entry : entityInstances ) {
        Serializable indexingId = entry.getKey();
        PerEntityWork<T> perEntityWork = entry.getValue();
        perEntityWork.enqueueLuceneWork( entityClass, indexingId, documentBuilder, luceneQueue );
View Full Code Here

     */
    public void enqueueLuceneWork(List<LuceneWork> luceneQueue) {
      final Set<Entry<Serializable, PerEntityWork<T>>> entityInstances = entityById.entrySet();
      ConversionContext conversionContext = new ContextualExceptionBridgeHelper();
      if ( purgeAll ) {
        luceneQueue.add( new PurgeAllLuceneWork( entityClass ) );
      }
      for ( Entry<Serializable, PerEntityWork<T>> entry : entityInstances ) {
        Serializable indexingId = entry.getKey();
        PerEntityWork<T> perEntityWork = entry.getValue();
        perEntityWork.enqueueLuceneWork( entityClass, indexingId, documentBuilder, luceneQueue, conversionContext );
View Full Code Here

    if ( this.purgeAtStart ) {
      //purgeAll for affected entities
      Set<Class<?>> targetedClasses = searchFactoryImplementor.getIndexedTypesPolymorphic( rootEntities );
      for ( Class<?> clazz : targetedClasses ) {
        //needs do be in-sync work to make sure we wait for the end of it.
        backend.doWorkInSync( new PurgeAllLuceneWork( clazz ) );
      }
      if ( this.optimizeAfterPurge ) {
        optimize( targetedClasses );
      }
    }
View Full Code Here

    else if ( workType == WorkType.DELETE || workType == WorkType.PURGE ) {
      String idInString = idBridge.objectToString( id );
      queue.add( new DeleteLuceneWork( id, idInString, entityClass ) );
    }
    else if ( workType == WorkType.PURGE_ALL ) {
      queue.add( new PurgeAllLuceneWork( entityClass ) );
    }
    else if ( workType == WorkType.UPDATE || workType == WorkType.COLLECTION ) {
      String idInString = idBridge.objectToString( id );
      queue.add( new DeleteLuceneWork( id, idInString, entityClass ) );
      queue.add( createAddWork( entityClass, entity, id, idInString, false ) );
View Full Code Here

    else if ( workType == WorkType.DELETE || workType == WorkType.PURGE ) {
      String idInString = idBridge.objectToString( id );
      queue.add( new DeleteLuceneWork( id, idInString, entityClass ) );
    }
    else if ( workType == WorkType.PURGE_ALL ) {
      queue.add( new PurgeAllLuceneWork( entityClass ) );
    }
    else if ( workType == WorkType.UPDATE || workType == WorkType.COLLECTION ) {
      String idInString = idBridge.objectToString( id );
      queue.add( new DeleteLuceneWork( id, idInString, entityClass ) );
      queue.add( createAddWork( entityClass, entity, id, idInString, false ) );
View Full Code Here

     */
    public void enqueueLuceneWork(List<LuceneWork> luceneQueue) {
      final Set<Entry<Serializable, PerEntityWork<T>>> entityInstances = entityById.entrySet();
      ConversionContext conversionContext = new ContextualExceptionBridgeHelper();
      if ( purgeAll ) {
        luceneQueue.add( new PurgeAllLuceneWork( entityClass ) );
      }
      for ( Entry<Serializable, PerEntityWork<T>> entry : entityInstances ) {
        Serializable indexingId = entry.getKey();
        PerEntityWork<T> perEntityWork = entry.getValue();
        perEntityWork.enqueueLuceneWork( entityClass, indexingId, documentBuilder, luceneQueue, conversionContext );
View Full Code Here

    if ( this.purgeAtStart ) {
      //purgeAll for affected entities
      Set<Class<?>> targetedClasses = searchFactoryImplementor.getIndexedTypesPolymorphic( rootEntities );
      for ( Class<?> clazz : targetedClasses ) {
        //needs do be in-sync work to make sure we wait for the end of it.
        backend.doWorkInSync( new PurgeAllLuceneWork( clazz ) );
      }
      if ( this.optimizeAfterPurge ) {
        optimize( targetedClasses );
      }
    }
View Full Code Here

    else if ( workType == WorkType.DELETE || workType == WorkType.PURGE ) {
      String idInString = idBridge.objectToString( id );
      queue.add( new DeleteLuceneWork( id, idInString, entityClass ) );
    }
    else if ( workType == WorkType.PURGE_ALL ) {
      queue.add( new PurgeAllLuceneWork( entityClass ) );
    }
    else if ( workType == WorkType.UPDATE || workType == WorkType.COLLECTION ) {
      String idInString = idBridge.objectToString( id );
      queue.add( new DeleteLuceneWork( id, idInString, entityClass ) );
      queue.add( createAddWork( entityClass, entity, id, idInString, false ) );
View Full Code Here

    else if ( workType == WorkType.DELETE || workType == WorkType.PURGE ) {
      String idInString = idBridge.objectToString( id );
      queue.add( new DeleteLuceneWork( id, idInString, entityClass ) );
    }
    else if ( workType == WorkType.PURGE_ALL ) {
      queue.add( new PurgeAllLuceneWork( entityClass ) );
    }
    else if ( workType == WorkType.UPDATE || workType == WorkType.COLLECTION ) {
      String idInString = idBridge.objectToString( id );
      queue.add( new DeleteLuceneWork( id, idInString, entityClass ) );
      queue.add( createAddWork( entityClass, entity, id, idInString, false ) );
View Full Code Here

TOP

Related Classes of org.hibernate.search.backend.PurgeAllLuceneWork

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.