Package org.hibernate.search.indexes.impl

Examples of org.hibernate.search.indexes.impl.IndexManagerHolder


      factoryState.setDocumentBuildersContainedEntities( new ConcurrentHashMap<Class<?>, DocumentBuilderContainedEntity<?>>() );
      factoryState.setFilterDefinitions( new ConcurrentHashMap<String, FilterDef>() );
      factoryState.setIndexHierarchy( new PolymorphicIndexHierarchy() );
      factoryState.setConfigurationProperties( cfg.getProperties() );
      factoryState.setServiceManager( new StandardServiceManager( cfg ) );
      factoryState.setAllIndexesManager( new IndexManagerHolder() );
      factoryState.setErrorHandler( createErrorHandler( cfg ) );
      factoryState.setInstanceInitializer( cfg.getInstanceInitializer() );
      factoryState.setTimingSource( new DefaultTimingSource() );
      factoryState.setIndexMetadataComplete( cfg.isIndexMetadataComplete() );
      factoryState.setTransactionManagerExpected( cfg.isTransactionManagerExpected() );
View Full Code Here


      }
      bindFilterDefs( mappedXClass );
      //TODO should analyzer def for classes at their same level???
    }

    IndexManagerHolder indexesFactory = factoryState.getAllIndexesManager();

    // Create all IndexManagers, configure and start them:
    for ( XClass mappedXClass : rootIndexedEntities ) {

      Class<?> mappedClass = classMappings.get( mappedXClass );
      MutableEntityIndexBinding mappedEntity = indexesFactory.buildEntityIndexBinding( mappedXClass, mappedClass, cfg, buildContext );
      //interceptor might use non indexed state
      if ( mappedEntity.getEntityIndexingInterceptor() != null ) {
        optimizationBlackListedTypes.add( mappedXClass );
      }
      // Create all DocumentBuilderIndexedEntity
View Full Code Here

      factoryState.setDocumentBuildersContainedEntities( new ConcurrentHashMap<Class<?>, DocumentBuilderContainedEntity<?>>() );
      factoryState.setFilterDefinitions( new ConcurrentHashMap<String, FilterDef>() );
      factoryState.setIndexHierarchy( new PolymorphicIndexHierarchy() );
      factoryState.setConfigurationProperties( cfg.getProperties() );
      factoryState.setServiceManager( new ServiceManager( cfg ) );
      factoryState.setAllIndexesManager( new IndexManagerHolder() );
      factoryState.setErrorHandler( createErrorHandler( cfg ) );
      factoryState.setInstanceInitializer( cfg.getInstanceInitializer() );
      factoryState.setTimingSource( new DefaultTimingSource() );
    }
  }
View Full Code Here

      }
      bindFilterDefs( mappedXClass );
      //TODO should analyzer def for classes at their same level???
    }
   
    IndexManagerHolder indexesFactory = factoryState.getAllIndexesManager();
   
    // Create all IndexManagers, configure and start them:
    for ( XClass mappedXClass : rootIndexedEntities ) {
     
      Class mappedClass = classMappings.get( mappedXClass );
      MutableEntityIndexBinding mappedEntity = indexesFactory.buildEntityIndexBinding( mappedXClass, mappedClass, cfg, buildContext );
      //interceptor might use non indexed state
        if ( mappedEntity.getEntityIndexingInterceptor() != null ) {
        optimizationBlackListedTypes.add( mappedXClass );
      }
      // Create all DocumentBuilderIndexedEntity
View Full Code Here

      log.receivedEmptyLuceneWOrksInMessage();
    }
  }

  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

      log.receivedEmptyLuceneWOrksInMessage();
    }
  }

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

      factoryState.setDocumentBuildersContainedEntities( new ConcurrentHashMap<Class<?>, DocumentBuilderContainedEntity<?>>() );
      factoryState.setFilterDefinitions( new ConcurrentHashMap<String, FilterDef>() );
      factoryState.setIndexHierarchy( new PolymorphicIndexHierarchy() );
      factoryState.setConfigurationProperties( cfg.getProperties() );
      factoryState.setServiceManager( new ServiceManager( cfg ) );
      factoryState.setAllIndexesManager( new IndexManagerHolder() );
      factoryState.setErrorHandler( createErrorHandler( cfg ) );
      factoryState.setClassHelper( cfg.getClassHelper() );
    }
  }
View Full Code Here

      }
      bindFilterDefs( mappedXClass );
      //TODO should analyzer def for classes at their same level???
    }
   
    IndexManagerHolder indexesFactory = factoryState.getAllIndexesManager();
   
    // Create all IndexManagers, configure and start them:
    for ( XClass mappedXClass : rootIndexedEntities ) {
     
      Class mappedClass = classMappings.get( mappedXClass );
      MutableEntityIndexBinding mappedEntity = indexesFactory.buildEntityIndexBinding( mappedXClass, mappedClass, cfg, buildContext, reflectionManager );
   
      // Create all DocumentBuilderIndexedEntity
      //FIXME DocumentBuilderIndexedEntity needs to be built by a helper method receiving Class<T> to infer T properly
      //XClass unfortunately is not (yet) genericized: TODO?
      final DocumentBuilderIndexedEntity<?> documentBuilder =
View Full Code Here

      SearchManager searchManager = Search.getSearchManager(cache);
      return (SearchFactoryImplementor)searchManager.getSearchFactory();
   }

   private NRTIndexManager verifyShardingOptions(SearchFactoryImplementor searchFactory, int expectedShards) {
      IndexManagerHolder allIndexesManager = searchFactory.getIndexManagerHolder();
      for (int i = 0; i < expectedShards; i++)
         Assert.assertNotNull(allIndexesManager.getIndexManager("person."+i), "person."+i+" IndexManager missing!");
      Assert.assertNull(allIndexesManager.getIndexManager("person."+expectedShards), "An IndexManager too much was created!");

      IndexManager indexManager = allIndexesManager.getIndexManager("person.0");
      Assert.assertTrue(indexManager instanceof NRTIndexManager);
      NRTIndexManager nrtIM = (NRTIndexManager)indexManager;
      return nrtIM;
   }
View Full Code Here

      checkIndexPresence(cache2);
   }

   private void checkIndexPresence(Cache cache) {
      SearchFactoryImplementor searchFactory = (SearchFactoryImplementor) Search.getSearchManager(cache).getSearchFactory();
      IndexManagerHolder indexManagerHolder = searchFactory.getIndexManagerHolder();

      assertTrue(searchFactory.getIndexedTypes().contains(getModelFactory().getUserImplClass()));
      assertNotNull(indexManagerHolder.getIndexManager(getModelFactory().getUserImplClass().getName()));

      assertTrue(searchFactory.getIndexedTypes().contains(getModelFactory().getAccountImplClass()));
      assertNotNull(indexManagerHolder.getIndexManager(getModelFactory().getAccountImplClass().getName()));

      assertTrue(searchFactory.getIndexedTypes().contains(getModelFactory().getTransactionImplClass()));
      assertNotNull(indexManagerHolder.getIndexManager(getModelFactory().getTransactionImplClass().getName()));

      assertFalse(searchFactory.getIndexedTypes().contains(getModelFactory().getAddressImplClass()));
      assertNull(indexManagerHolder.getIndexManager(getModelFactory().getAddressImplClass().getName()));
   }
View Full Code Here

TOP

Related Classes of org.hibernate.search.indexes.impl.IndexManagerHolder

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.