Examples of WorkQueue


Examples of org.hibernate.search.backend.WorkQueue

  public void add(Work work, WorkQueue workQueue) {
    //don't check for builder it's done in prepareWork
    //FIXME WorkType.COLLECTION does not play well with batchSize
    workQueue.add( work );
    if ( batchSize > 0 && workQueue.size() >= batchSize ) {
      WorkQueue subQueue = workQueue.splitQueue();
      prepareWorks( subQueue );
      performWorks( subQueue );
    }
  }
View Full Code Here

Examples of org.hibernate.search.backend.WorkQueue

    else {
      // this is a workaround: isTransactionInProgress should return "true"
      // for correct configurations.
      log.warn( "It appears changes are being pushed to the index out of a transaction. " +
          "Register the IndexWorkFlushEventListener listener on flush to correctly manage Collections!" );
      WorkQueue queue = new WorkQueue( 2 ); //one work can be split
      queueingProcessor.add( work, queue );
      queueingProcessor.prepareWorks( queue );
      queueingProcessor.performWorks( queue );
    }
  }
View Full Code Here

Examples of org.hibernate.search.backend.WorkQueue

      if (queuePerTransaction != null) queuePerTransaction.removeValue( this );
    }
  }

  public void flushWorks() {
    WorkQueue subQueue = queue.splitQueue();
    queueingProcessor.prepareWorks( subQueue );
    queueingProcessor.performWorks( subQueue );
  }
View Full Code Here

Examples of org.hibernate.search.backend.WorkQueue

  public void add(Work work, WorkQueue workQueue) {
    //don't check for builder it's done in prepareWork
    //FIXME WorkType.COLLECTION does not play well with batchSize
    workQueue.add( work );
    if ( batchSize > 0 && workQueue.size() >= batchSize ) {
      WorkQueue subQueue = workQueue.splitQueue();
      prepareWorks( subQueue );
      performWorks( subQueue );
    }
  }
View Full Code Here

Examples of org.hibernate.search.backend.WorkQueue

    else {
      // this is a workaround: isTransactionInProgress should return "true"
      // for correct configurations.
      log.warn( "It appears changes are being pushed to the index out of a transaction. " +
          "Register the IndexWorkFlushEventListener listener on flush to correctly manage Collections!" );
      WorkQueue queue = new WorkQueue( 2 ); //one work can be split
      queueingProcessor.add( work, queue );
      queueingProcessor.prepareWorks( queue );
      queueingProcessor.performWorks( queue );
    }
  }
View Full Code Here

Examples of org.hibernate.search.backend.WorkQueue

  public void add(Work work, WorkQueue workQueue) {
    //don't check for builder it's done in prepareWork
    //FIXME WorkType.COLLECTION does not play well with batchSize
    workQueue.add( work );
    if ( batchSize > 0 && workQueue.size() >= batchSize ) {
      WorkQueue subQueue = workQueue.splitQueue();
      prepareWorks( subQueue );
      performWorks( subQueue );
    }
  }
View Full Code Here

Examples of org.hibernate.search.backend.WorkQueue

        synchronizationPerTransaction.put( transaction, txSync );
      }
      txSync.add( work );
    }
    else {
      WorkQueue queue = new WorkQueue( 2 ); //one work can be split
      queueingProcessor.add( work, queue );
      queueingProcessor.prepareWorks( queue );
      queueingProcessor.performWorks( queue );
    }
  }
View Full Code Here

Examples of org.hibernate.search.backend.WorkQueue

      if (queuePerTransaction != null) queuePerTransaction.removeValue( this );
    }
  }

  public void flushWorks() {
    WorkQueue subQueue = queue.splitQueue();
    queueingProcessor.prepareWorks( subQueue );
    queueingProcessor.performWorks( subQueue );
  }
View Full Code Here

Examples of org.hibernate.search.backend.WorkQueue

  public void add(Work work, WorkQueue workQueue) {
    //don't check for builder it's done in prepareWork
    //FIXME WorkType.COLLECTION does not play well with batchSize
    workQueue.add( work );
    if ( batchSize > 0 && workQueue.size() >= batchSize ) {
      WorkQueue subQueue = workQueue.splitQueue();
      prepareWorks( subQueue );
      performWorks( subQueue );
    }
  }
View Full Code Here

Examples of org.hibernate.search.backend.WorkQueue

    if ( event.getSession().isTransactionInProgress() ) {
      Transaction transaction = event.getSession().getTransaction();
      PostTransactionWorkQueueSynchronization sync = (PostTransactionWorkQueueSynchronization)
          queuePerTransaction.get( transaction );
      if ( sync == null || sync.isConsumed() ) {
        WorkQueue workQueue = new BatchLuceneWorkQueue( documentBuilders, lockableDirectoryProviders );
        sync = new PostTransactionWorkQueueSynchronization( workQueue, queuePerTransaction );
        transaction.registerSynchronization( sync );
        queuePerTransaction.put(transaction, sync);
      }
      sync.add( work );
    }
    else {
      WorkQueue workQueue = new BatchLuceneWorkQueue( documentBuilders, lockableDirectoryProviders );
      PostTransactionWorkQueueSynchronization sync = new PostTransactionWorkQueueSynchronization( workQueue );
      sync.add( work );
      sync.afterCompletion( Status.STATUS_COMMITTED );
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.