Package org.hibernate.search.indexes.spi

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


  @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

    }
  }

  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

    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 = createDirectoryManager( providerName, indexProps[index], context );
        indexManagersRegistry.put( providerName, indexManager );
      }
      indexManager.addContainedEntity( mappedClass );
      providers[index] = indexManager;
    }

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

    manager.setSimilarity( newSimilarity );
  }

  private IndexManager createDirectoryManager(String indexName, Properties indexProps, WorkerBuildContext context) {
    String indexManagerName = indexProps.getProperty( Environment.INDEX_MANAGER_IMPL_NAME, DEFAULT_INDEX_MANAGER_NAME);
    final IndexManager manager;
    if ( StringHelper.isEmpty( indexManagerName ) ) {
      manager = new DirectoryBasedIndexManager();
    }
    else {
      String longName = defaultIndexManagerClasses.get( indexManagerName );
      if ( longName == null ) {
        longName = indexManagerName;
      }
      manager = ClassLoaderHelper.instanceFromName( IndexManager.class, longName,
            IndexManagerHolder.class, "index manager" );
    }
    try {
      manager.initialize( indexName, indexProps, context );
      return manager;
    } catch (Exception e) {
      throw log.unableToInitializeIndexManager( indexName, e );
    }
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  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

    }
  }

  private void perform(String indexName, List<LuceneWork> queue) {
    IndexManagerHolder allIndexesManager = searchFactory.getAllIndexesManager();
    IndexManager indexManager = allIndexesManager.getIndexManager( indexName );
    indexManager.performOperations( queue );
  }
View Full Code Here

 
  private static class AddSelectionDelegate implements StreamingOperationSelectionDelegate {

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

  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

    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 = createDirectoryManager(
          providerName, indexProps[index],
          reflectionManager.toClass( entity ),
          context
            );
        indexManagersRegistry.put( providerName, indexManager );
      }
      indexManager.addContainedEntity( mappedClass );
      providers[index] = indexManager;
    }
   
    //define sharding strategy for this entity:
    IndexShardingStrategy shardingStrategy;
View Full Code Here

TOP

Related Classes of org.hibernate.search.indexes.spi.IndexManager

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.