Examples of IndexManager


Examples of org.hibernate.search.indexes.spi.IndexManager

    if ( StringHelper.isEmpty( indexManagerImplementationName ) ) {
      return createDefaultIndexManager();
    }
    else {
      String implName = indexManagerImplementationName.trim();
      IndexManager im = fromAlias( implName );
      if ( im == null ) {
        implName = aliasToFQN( implName );
        im = ClassLoaderHelper.instanceFromName( IndexManager.class, implName,
            IndexManagerHolder.class, "index manager" );
      }
      log.indexManagerAliasResolved( indexManagerImplementationName, im.getClass() );
      return im;
    }
  }
View Full Code Here

Examples of org.hibernate.search.indexes.spi.IndexManager

  private static class AddSelectionDelegate implements StreamingOperationSelectionDelegate {

    @Override
    public final void performStreamOperation(LuceneWork work,
        IndexShardingStrategy shardingStrategy, IndexingMonitor monitor, boolean forceAsync) {
      IndexManager indexManager = shardingStrategy.getIndexManagerForAddition(
          work.getEntityClass(),
          work.getId(),
          work.getIdInString(),
          work.getDocument()
      );
      indexManager.performStreamOperation( work, monitor, forceAsync );
    }
View Full Code Here

Examples of org.hibernate.search.indexes.spi.IndexManager

    IndexManager[] providers = new IndexManager[nbrOfProviders];
    for ( int index = 0; index < nbrOfProviders; index++ ) {
      String providerName = nbrOfProviders > 1 ?
          directoryProviderName + "." + index :
          directoryProviderName;
      IndexManager indexManager = indexManagersRegistry.get( providerName );
      if ( indexManager == null ) {
        indexManager = createIndexManager( providerName, indexProps[index], context, cfg );
        indexManagersRegistry.put( providerName, indexManager );
      }
      indexManager.addContainedEntity( mappedClass );
      providers[index] = indexManager;
    }

    //define sharding strategy for this entity:
    IndexShardingStrategy shardingStrategy;
View Full Code Here

Examples of org.hibernate.search.indexes.spi.IndexManager

    manager.setSimilarity( newSimilarity );
  }

  private IndexManager createIndexManager(String indexName, Properties indexProps, WorkerBuildContext context, SearchConfiguration cfg) {
    String indexManagerImplementationName = indexProps.getProperty( Environment.INDEX_MANAGER_IMPL_NAME );
    final IndexManager manager;
    if ( StringHelper.isEmpty( indexManagerImplementationName ) ) {
      manager = cfg.getIndexManagerFactory().createDefaultIndexManager();
    }
    else {
      manager = cfg.getIndexManagerFactory().createIndexManagerByName( indexManagerImplementationName );
    }
    try {
      manager.initialize( indexName, indexProps, context );
      return manager;
    }
    catch (Exception e) {
      throw log.unableToInitializeIndexManager( indexName, e );
    }
View Full Code Here

Examples of org.hibernate.search.indexes.spi.IndexManager

  private static class AddSelectionDelegate implements ContextAwareSelectionDelegate {

    @Override
    public final void performOperation(LuceneWork work, IndexShardingStrategy shardingStrategy,
        WorkQueuePerIndexSplitter context) {
      IndexManager indexManager = shardingStrategy.getIndexManagerForAddition(
          work.getEntityClass(),
          work.getId(),
          work.getIdInString(),
          work.getDocument()
      );
View Full Code Here

Examples of org.hibernate.search.indexes.spi.IndexManager

      return;
    }
    final ObjectMessage objectMessage = (ObjectMessage) message;
    final String indexName;
    final List<LuceneWork> queue;
    final IndexManager indexManager;
    SearchFactoryImplementor factory = getSearchFactory().unwrap( SearchFactoryImplementor.class );
    try {
      indexName = objectMessage.getStringProperty( Environment.INDEX_NAME_JMS_PROPERTY );
      indexManager = factory.getIndexManagerHolder().getIndexManager( indexName );
      if ( indexManager == null ) {
        log.messageReceivedForUndefinedIndex( indexName );
        return;
      }
      queue = indexManager.getSerializer().toLuceneWorks( (byte[]) objectMessage.getObject() );
      indexManager.performOperations( queue, null );
    }
    catch (JMSException e) {
      log.unableToRetrieveObjectFromMessage( message.getClass(), e );
      return;
    }
View Full Code Here

Examples of org.hibernate.search.indexes.spi.IndexManager

  private static class AddSelectionDelegate implements StreamingOperationSelectionDelegate {

    public final void performStreamOperation(LuceneWork work,
        IndexShardingStrategy shardingStrategy, IndexingMonitor monitor, boolean forceAsync) {
      IndexManager indexManager = shardingStrategy.getIndexManagerForAddition(
          work.getEntityClass(),
          work.getId(),
          work.getIdInString(),
          work.getDocument()
      );
      indexManager.performStreamOperation( work, monitor, forceAsync );
    }
View Full Code Here

Examples of org.hibernate.search.indexes.spi.IndexManager

  private static class AddSelectionDelegate implements ContextAwareSelectionDelegate {

    @Override
    public final void performOperation(LuceneWork work, IndexShardingStrategy shardingStrategy,
        WorkQueuePerIndexSplitter context) {
      IndexManager indexManager = shardingStrategy.getIndexManagerForAddition(
          work.getEntityClass(),
          work.getId(),
          work.getIdInString(),
          work.getDocument()
      );
View Full Code Here

Examples of org.hibernate.search.indexes.spi.IndexManager

  @SuppressWarnings("unchecked")
  @Override
  public void receive(Message message) {
    final List<LuceneWork> queue;
    final String indexName;
    final IndexManager indexManager;
    try {
      BackendMessage decoded = (BackendMessage) message.getObject();
      indexName = decoded.indexName;
      indexManager = searchFactory.getAllIndexesManager().getIndexManager( indexName );
      if ( indexManager != null ) {
        queue = indexManager.getSerializer().toLuceneWorks( decoded.queue );
      }
      else {
        log.messageReceivedForUndefinedIndex( indexName );
        return;
      }
View Full Code Here

Examples of org.hibernate.search.indexes.spi.IndexManager

    }
  }

  private void perform(String indexName, List<LuceneWork> queue) {
    IndexManagerHolder allIndexesManager = searchFactory.getAllIndexesManager();
    IndexManager indexManager = allIndexesManager.getIndexManager( indexName );
    indexManager.performOperations( queue, null );
  }
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.