Examples of MaskedProperty


Examples of org.hibernate.search.util.configuration.impl.MaskedProperty

   * hibernate.search.indexname.n has priority over hibernate.search.indexname which has priority over hibernate.search.default
   * If the Index is not sharded, a single Properties is returned
   * If the index is sharded, the Properties index matches the shard index
   */
  private static Properties[] getDirectoryProperties(SearchConfiguration cfg, String directoryProviderName) {
    Properties rootCfg = new MaskedProperty( cfg.getProperties(), "hibernate.search" );
    Properties globalProperties = new MaskedProperty( rootCfg, "default" );
    Properties directoryLocalProperties = new MaskedProperty( rootCfg, directoryProviderName, globalProperties );
    final String shardsCountValue = directoryLocalProperties.getProperty( NBR_OF_SHARDS );
    if ( shardsCountValue == null ) {
      // no shards: finished.
      return new Properties[] { directoryLocalProperties };
    }
    else {
      // count shards
      int shardsCount = ConfigurationParseHelper.parseInt(
          shardsCountValue, shardsCountValue + " is not a number"
      );
      // create shard-specific Props
      Properties[] shardLocalProperties = new Properties[shardsCount];
      for ( int i = 0; i < shardsCount; i++ ) {
        shardLocalProperties[i] = new MaskedProperty(
            directoryLocalProperties, Integer.toString( i ), directoryLocalProperties
        );
      }
      return shardLocalProperties;
    }
View Full Code Here

Examples of org.hibernate.search.util.configuration.impl.MaskedProperty

      return Executors.QUEUE_MAX_LENGTH;
    }
  }

  public static OptimizerStrategy getOptimizerStrategy(IndexManager callback, Properties indexProps) {
    MaskedProperty optimizerCfg = new MaskedProperty(indexProps, "optimizer" );
    String customImplementation = optimizerCfg.getProperty( "implementation" );
    if ( customImplementation != null && (! "default".equalsIgnoreCase( customImplementation ) ) ) {
      return ClassLoaderHelper.instanceFromName( OptimizerStrategy.class, customImplementation, callback.getClass(), "Optimizer Strategy" );
    }
    else {
      boolean incremental = optimizerCfg.containsKey( "operation_limit.max" )
        || optimizerCfg.containsKey( "transaction_limit.max" );
      OptimizerStrategy optimizerStrategy;
      if ( incremental ) {
        optimizerStrategy = new IncrementalOptimizerStrategy();
        optimizerStrategy.initialize( callback, optimizerCfg );
      }
View Full Code Here

Examples of org.hibernate.search.util.configuration.impl.MaskedProperty

   * @param directoryBasedIndexManager
   * @param cfg
   * @return
   */
  public static DirectoryBasedReaderProvider createDirectoryBasedReaderProvider(DirectoryBasedIndexManager indexManager, Properties cfg) {
    Properties props = new MaskedProperty( cfg, Environment.READER_PREFIX );
    String impl = props.getProperty( "strategy" );
    DirectoryBasedReaderProvider readerProvider;
    if ( StringHelper.isEmpty( impl ) ) {
      readerProvider = new SharingBufferReaderProvider();
    }
    else if ( "not-shared".equalsIgnoreCase( impl ) ) {
View Full Code Here

Examples of org.hibernate.search.util.configuration.impl.MaskedProperty

  public static final String PROP_GROUP = "indexwriter";

  private final ParameterSet indexParameters;

  public LuceneIndexingParameters(Properties sourceProps) {
    Properties indexingParameters = new MaskedProperty( sourceProps, PROP_GROUP );
    indexParameters = new ParameterSet( indexingParameters );
  }
View Full Code Here

Examples of org.hibernate.search.util.configuration.impl.MaskedProperty

  public static final String PROP_GROUP = "indexwriter";

  private final ParameterSet indexParameters;

  public LuceneIndexingParameters(Properties sourceProps) {
    Properties indexingParameters = new MaskedProperty( sourceProps, PROP_GROUP );
    indexParameters = new ParameterSet( indexingParameters );
  }
View Full Code Here

Examples of org.hibernate.search.util.configuration.impl.MaskedProperty

   * @param directoryBasedIndexManager
   * @param cfg
   * @return
   */
  public static DirectoryBasedReaderProvider createDirectoryBasedReaderProvider(DirectoryBasedIndexManager indexManager, Properties cfg) {
    Properties props = new MaskedProperty( cfg, Environment.READER_PREFIX );
    String impl = props.getProperty( "strategy" );
    DirectoryBasedReaderProvider readerProvider;
    if ( StringHelper.isEmpty( impl ) ) {
      readerProvider = new SharingBufferReaderProvider();
    }
    else if ( "not-shared".equalsIgnoreCase( impl ) ) {
View Full Code Here

Examples of org.hibernate.search.util.configuration.impl.MaskedProperty

          IndexShardingStrategy.class,
          shardingStrategyName, DirectoryProviderFactory.class, "IndexShardingStrategy"
      );
    }
    shardingStrategy.initialize(
        new MaskedProperty( indexProps[0], SHARDING_STRATEGY ), providers
    );
   
    //define the Similarity implementation:
    // warning: it can also be set by an annotation at class level
    final String similarityClassName = indexProps[0].getProperty( Environment.SIMILARITY_CLASS_PER_INDEX );
View Full Code Here

Examples of org.hibernate.search.util.configuration.impl.MaskedProperty

   * hibernate.search.indexname.n has priority over hibernate.search.indexname which has priority over hibernate.search.default
   * If the Index is not sharded, a single Properties is returned
   * If the index is sharded, the Properties index matches the shard index
   */
  private static Properties[] getDirectoryProperties(SearchConfiguration cfg, String directoryProviderName) {
    Properties rootCfg = new MaskedProperty( cfg.getProperties(), "hibernate.search" );
    Properties globalProperties = new MaskedProperty( rootCfg, "default" );
    Properties directoryLocalProperties = new MaskedProperty( rootCfg, directoryProviderName, globalProperties );
    final String shardsCountValue = directoryLocalProperties.getProperty( NBR_OF_SHARDS );
    if ( shardsCountValue == null ) {
      // no shards: finished.
      return new Properties[] { directoryLocalProperties };
    }
    else {
      // count shards
      int shardsCount = ConfigurationParseHelper.parseInt(
          shardsCountValue, shardsCountValue + " is not a number"
      );
      // create shard-specific Props
      Properties[] shardLocalProperties = new Properties[shardsCount];
      for ( int i = 0; i < shardsCount; i++ ) {
        shardLocalProperties[i] = new MaskedProperty(
            directoryLocalProperties, Integer.toString( i ), directoryLocalProperties
        );
      }
      return shardLocalProperties;
    }
View Full Code Here

Examples of org.hibernate.search.util.configuration.impl.MaskedProperty

  }

  public static OptimizerStrategy getOptimizerStrategy(IndexManager callback,
      Properties indexProperties,
      WorkerBuildContext buildContext) {
    MaskedProperty maskedProperty = new MaskedProperty( indexProperties, "optimizer" );
    String optimizerImplClassName = maskedProperty.getProperty( "implementation" );
    if ( optimizerImplClassName != null && ( !"default".equalsIgnoreCase( optimizerImplClassName ) ) ) {
      ServiceManager serviceManager = buildContext.getServiceManager();
      return ClassLoaderHelper.instanceFromName(
          OptimizerStrategy.class,
          optimizerImplClassName,
          "Optimizer Strategy",
          serviceManager
      );
    }
    else {
      boolean incremental = maskedProperty.containsKey( "operation_limit.max" )
          || maskedProperty.containsKey( "transaction_limit.max" );
      OptimizerStrategy optimizerStrategy;
      if ( incremental ) {
        optimizerStrategy = new IncrementalOptimizerStrategy();
        optimizerStrategy.initialize( callback, maskedProperty );
      }
View Full Code Here

Examples of org.hibernate.search.util.configuration.impl.MaskedProperty

  }

  public static DirectoryBasedReaderProvider createDirectoryBasedReaderProvider(DirectoryBasedIndexManager indexManager,
      Properties properties,
      WorkerBuildContext buildContext) {
    Properties maskedProperties = new MaskedProperty( properties, Environment.READER_PREFIX );
    String readerProviderImplName = maskedProperties.getProperty( "strategy" );
    DirectoryBasedReaderProvider readerProvider;
    if ( StringHelper.isEmpty( readerProviderImplName ) ) {
      readerProvider = new SharingBufferReaderProvider();
    }
    else if ( "not-shared".equalsIgnoreCase( readerProviderImplName ) ) {
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.