当前位置: 首页>>代码示例>>Java>>正文


Java Inject类代码示例

本文整理汇总了Java中org.elasticsearch.common.inject.Inject的典型用法代码示例。如果您正苦于以下问题:Java Inject类的具体用法?Java Inject怎么用?Java Inject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Inject类属于org.elasticsearch.common.inject包,在下文中一共展示了Inject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: PathHierarchyTokenizerFactory

import org.elasticsearch.common.inject.Inject; //导入依赖的package包/类
@Inject
public PathHierarchyTokenizerFactory(Index index, IndexSettingsService indexSettingsService, @Assisted String name, @Assisted Settings settings) {
    super(index, indexSettingsService.getSettings(), name, settings);
    bufferSize = settings.getAsInt("buffer_size", 1024);
    String delimiter = settings.get("delimiter");
    if (delimiter == null) {
        this.delimiter = PathHierarchyTokenizer.DEFAULT_DELIMITER;
    } else if (delimiter.length() > 1) {
        throw new IllegalArgumentException("delimiter can only be a one char value");
    } else {
        this.delimiter = delimiter.charAt(0);
    }

    String replacement = settings.get("replacement");
    if (replacement == null) {
        this.replacement = this.delimiter;
    } else if (replacement.length() > 1) {
        throw new IllegalArgumentException("replacement can only be a one char value");
    } else {
        this.replacement = replacement.charAt(0);
    }
    this.skip = settings.getAsInt("skip", PathHierarchyTokenizer.DEFAULT_SKIP);
    this.reverse = settings.getAsBoolean("reverse", false);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:25,代码来源:PathHierarchyTokenizerFactory.java

示例2: StatsTables

import org.elasticsearch.common.inject.Inject; //导入依赖的package包/类
@Inject
public StatsTables(Settings settings, NodeSettingsService nodeSettingsService) {
    int operationsLogSize = CrateSettings.STATS_OPERATIONS_LOG_SIZE.extract(settings);
    int jobsLogSize = CrateSettings.STATS_JOBS_LOG_SIZE.extract(settings);
    boolean isEnabled = CrateSettings.STATS_ENABLED.extract(settings);

    if (isEnabled) {
        setJobsLog(jobsLogSize);
        setOperationsLog(operationsLogSize);
    } else {
        setJobsLog(0);
        setOperationsLog(0);
    }

    lastOperationsLogSize = operationsLogSize;
    lastJobsLogSize = jobsLogSize;
    lastIsEnabled = isEnabled;

    nodeSettingsService.addListener(listener);
    jobsLogIterableGetter = new JobsLogIterableGetter();
    jobsIterableGetter = new JobsIterableGetter();
    operationsIterableGetter = new OperationsIterableGetter();
    operationsLogIterableGetter = new OperationsLogIterableGetter();
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:25,代码来源:StatsTables.java

示例3: TransportFetchNodeAction

import org.elasticsearch.common.inject.Inject; //导入依赖的package包/类
@Inject
public TransportFetchNodeAction(TransportService transportService,
                                Transports transports,
                                ThreadPool threadPool,
                                StatsTables statsTables,
                                CircuitBreakerService breakerService,
                                JobContextService jobContextService,
                                NodeFetchOperation nodeFetchOperation) {
    this.transports = transports;
    this.statsTables = statsTables;
    this.nodeFetchOperation = nodeFetchOperation;
    this.circuitBreaker = breakerService.getBreaker(CrateCircuitBreakerService.QUERY);
    this.jobContextService = jobContextService;
    this.threadPool = threadPool;

    transportService.registerRequestHandler(TRANSPORT_ACTION,
            NodeFetchRequest.class,
            EXECUTOR_NAME,
            new NodeActionRequestHandler<NodeFetchRequest, NodeFetchResponse>(this) { });
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:21,代码来源:TransportFetchNodeAction.java

示例4: PatternAnalyzerProvider

import org.elasticsearch.common.inject.Inject; //导入依赖的package包/类
@Inject
public PatternAnalyzerProvider(Index index, IndexSettingsService indexSettingsService, Environment env, @Assisted String name, @Assisted Settings settings) {
    super(index, indexSettingsService.getSettings(), name, settings);

    Version esVersion = Version.indexCreated(indexSettingsService.getSettings());
    final CharArraySet defaultStopwords;
    if (esVersion.onOrAfter(Version.V_1_0_0_RC1)) {
        defaultStopwords = CharArraySet.EMPTY_SET;
    } else {
        defaultStopwords = StopAnalyzer.ENGLISH_STOP_WORDS_SET;
    }
    boolean lowercase = settings.getAsBoolean("lowercase", true);
    CharArraySet stopWords = Analysis.parseStopWords(env, settings, defaultStopwords);

    String sPattern = settings.get("pattern", "\\W+" /*PatternAnalyzer.NON_WORD_PATTERN*/);
    if (sPattern == null) {
        throw new IllegalArgumentException("Analyzer [" + name + "] of type pattern must have a `pattern` set");
    }
    Pattern pattern = Regex.compile(sPattern, settings.get("flags"));

    analyzer = new PatternAnalyzer(pattern, lowercase, stopWords);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:23,代码来源:PatternAnalyzerProvider.java

示例5: KeepWordFilterFactory

import org.elasticsearch.common.inject.Inject; //导入依赖的package包/类
@Inject
public KeepWordFilterFactory(Index index, IndexSettingsService indexSettingsService,
                             Environment env, @Assisted String name, @Assisted Settings settings) {
    super(index, indexSettingsService.getSettings(), name, settings);

    final String[] arrayKeepWords = settings.getAsArray(KEEP_WORDS_KEY, null);
    final String keepWordsPath = settings.get(KEEP_WORDS_PATH_KEY, null);
    if ((arrayKeepWords == null && keepWordsPath == null) || (arrayKeepWords != null && keepWordsPath != null)) {
        // we don't allow both or none
        throw new IllegalArgumentException("keep requires either `" + KEEP_WORDS_KEY + "` or `"
                + KEEP_WORDS_PATH_KEY + "` to be configured");
    }
    if (version.onOrAfter(Version.LUCENE_4_4) && settings.get(ENABLE_POS_INC_KEY) != null) {
        throw new IllegalArgumentException(ENABLE_POS_INC_KEY + " is not supported anymore. Please fix your analysis chain or use"
                + " an older compatibility version (<=4.3) but beware that it might cause highlighting bugs.");
    }
    enablePositionIncrements = version.onOrAfter(Version.LUCENE_4_4) ? true : settings.getAsBoolean(ENABLE_POS_INC_KEY, true);

    this.keepWords = Analysis.getWordSet(env, settings, KEEP_WORDS_KEY);

}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:22,代码来源:KeepWordFilterFactory.java

示例6: ShadowIndexShard

import org.elasticsearch.common.inject.Inject; //导入依赖的package包/类
@Inject
public ShadowIndexShard(ShardId shardId, IndexSettingsService indexSettingsService,
                        IndicesLifecycle indicesLifecycle, Store store, StoreRecoveryService storeRecoveryService,
                        ThreadPool threadPool, MapperService mapperService,
                        IndexQueryParserService queryParserService, IndexCache indexCache,
                        IndexAliasesService indexAliasesService, IndicesQueryCache indicesQueryCache,
                        ShardPercolateService shardPercolateService, CodecService codecService,
                        ShardTermVectorsService termVectorsService, IndexFieldDataService indexFieldDataService,
                        IndexService indexService, @Nullable IndicesWarmer warmer,
                        SnapshotDeletionPolicy deletionPolicy, SimilarityService similarityService,
                        EngineFactory factory, ClusterService clusterService,
                        ShardPath path, BigArrays bigArrays, IndexSearcherWrappingService wrappingService,
                        IndexingMemoryController indexingMemoryController, SearchService shardSearchService) throws IOException {
    super(shardId, indexSettingsService, indicesLifecycle, store, storeRecoveryService,
          threadPool, mapperService, queryParserService, indexCache, indexAliasesService,
          indicesQueryCache, shardPercolateService, codecService,
          termVectorsService, indexFieldDataService, indexService,
          warmer, deletionPolicy, similarityService,
          factory, clusterService, path, bigArrays, wrappingService, indexingMemoryController, shardSearchService);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:21,代码来源:ShadowIndexShard.java

示例7: HunspellTokenFilterFactory

import org.elasticsearch.common.inject.Inject; //导入依赖的package包/类
@Inject
public HunspellTokenFilterFactory(Index index, IndexSettingsService indexSettingsService, @Assisted String name, @Assisted Settings settings, HunspellService hunspellService)  {
    super(index, indexSettingsService.getSettings(), name, settings);

    String locale = settings.get("locale", settings.get("language", settings.get("lang", null)));
    if (locale == null) {
        throw new IllegalArgumentException("missing [locale | language | lang] configuration for hunspell token filter");
    }

    dictionary = hunspellService.getDictionary(locale);
    if (dictionary == null) {
        throw new IllegalArgumentException(String.format(Locale.ROOT, "Unknown hunspell dictionary for locale [%s]", locale));
    }

    dedup = settings.getAsBoolean("dedup", true);
    longestOnly = settings.getAsBoolean("longest_only", false);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:18,代码来源:HunspellTokenFilterFactory.java

示例8: StandardHtmlStripAnalyzerProvider

import org.elasticsearch.common.inject.Inject; //导入依赖的package包/类
@Inject
public StandardHtmlStripAnalyzerProvider(Index index, IndexSettingsService indexSettingsService, Environment env,  @Assisted String name, @Assisted Settings settings) {
    super(index, indexSettingsService.getSettings(), name, settings);
    this.esVersion = Version.indexCreated(indexSettingsService.getSettings());
    final CharArraySet defaultStopwords;
    if (esVersion.onOrAfter(Version.V_1_0_0_RC1)) {
        defaultStopwords = CharArraySet.EMPTY_SET;
    } else {
        defaultStopwords = StopAnalyzer.ENGLISH_STOP_WORDS_SET;
    }
    CharArraySet stopWords = Analysis.parseStopWords(env, settings, defaultStopwords);
    analyzer = new StandardHtmlStripAnalyzer(stopWords);
    analyzer.setVersion(version);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:15,代码来源:StandardHtmlStripAnalyzerProvider.java

示例9: TransportLivenessAction

import org.elasticsearch.common.inject.Inject; //导入依赖的package包/类
@Inject
public TransportLivenessAction(ClusterName clusterName,
                               ClusterService clusterService, TransportService transportService) {
    this.clusterService = clusterService;
    this.clusterName = clusterName;
    transportService.registerRequestHandler(NAME, LivenessRequest.class, ThreadPool.Names.SAME, this);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:8,代码来源:TransportLivenessAction.java

示例10: TransportVerifyRepositoryAction

import org.elasticsearch.common.inject.Inject; //导入依赖的package包/类
@Inject
public TransportVerifyRepositoryAction(Settings settings, TransportService transportService, ClusterService clusterService,
                                       RepositoriesService repositoriesService, ThreadPool threadPool, ActionFilters actionFilters,
                                       IndexNameExpressionResolver indexNameExpressionResolver) {
    super(settings, VerifyRepositoryAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver, VerifyRepositoryRequest::new);
    this.repositoriesService = repositoriesService;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:8,代码来源:TransportVerifyRepositoryAction.java

示例11: NorwegianAnalyzerProvider

import org.elasticsearch.common.inject.Inject; //导入依赖的package包/类
@Inject
public NorwegianAnalyzerProvider(Index index, IndexSettingsService indexSettingsService, Environment env, @Assisted String name, @Assisted Settings settings) {
    super(index, indexSettingsService.getSettings(), name, settings);
    analyzer = new NorwegianAnalyzer(Analysis.parseStopWords(env, settings, NorwegianAnalyzer.getDefaultStopSet()),
                                     Analysis.parseStemExclusion(settings, CharArraySet.EMPTY_SET));
    analyzer.setVersion(version);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:8,代码来源:NorwegianAnalyzerProvider.java

示例12: ActionFilters

import org.elasticsearch.common.inject.Inject; //导入依赖的package包/类
@Inject
public ActionFilters(Set<ActionFilter> actionFilters) {
    this.filters = actionFilters.toArray(new ActionFilter[actionFilters.size()]);
    Arrays.sort(filters, new Comparator<ActionFilter>() {
        @Override
        public int compare(ActionFilter o1, ActionFilter o2) {
            return Integer.compare(o1.order(), o2.order());
        }
    });
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:11,代码来源:ActionFilters.java

示例13: DLBasedIndexShard

import org.elasticsearch.common.inject.Inject; //导入依赖的package包/类
@Inject
public DLBasedIndexShard(ShardId shardId,
        IndexSettingsService indexSettingsService,
        IndicesLifecycle indicesLifecycle, Store store,
        StoreRecoveryService storeRecoveryService, ThreadPool threadPool,
        MapperService mapperService,
        IndexQueryParserService queryParserService, IndexCache indexCache,
        IndexAliasesService indexAliasesService,
        IndicesQueryCache indicesQueryCache,
        ShardPercolateService shardPercolateService,
        CodecService codecService,
        ShardTermVectorsService termVectorsService,
        IndexFieldDataService indexFieldDataService,
        IndexService indexService, IndicesWarmer warmer,
        SnapshotDeletionPolicy deletionPolicy,
        SimilarityService similarityService, EngineFactory factory,
        ClusterService clusterService, ShardPath path, BigArrays bigArrays,
        IndexSearcherWrappingService wrappingService,
        IndexingMemoryController indexingMemoryController,
        TransportGetOrChangePrimaryShardLeaseAction checkLeaseAction,
        TransportIndexShardStatsAction indexShardStatsAction,
        SearchService shardSearchService) {
    super(shardId, indexSettingsService, indicesLifecycle, store,
            storeRecoveryService, threadPool, mapperService, queryParserService,
            indexCache, indexAliasesService, indicesQueryCache,
            shardPercolateService, codecService, termVectorsService,
            indexFieldDataService, indexService, warmer, deletionPolicy,
            similarityService, factory, clusterService, path, bigArrays,
            wrappingService, indexingMemoryController, shardSearchService);
    this.localNodeId = clusterService.state().nodes().localNodeId();
    this.checkLeaseAction = checkLeaseAction;
    this.indexShardStatsAction = indexShardStatsAction;
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:34,代码来源:DLBasedIndexShard.java

示例14: PluginSettings

import org.elasticsearch.common.inject.Inject; //导入依赖的package包/类
@Inject
public PluginSettings(org.elasticsearch.common.settings.Settings settings,
                      org.duniter.elasticsearch.user.PluginSettings delegate) {
    super(settings);
    this.delegate = delegate;

    // Add i18n bundle name
    delegate.addI18nBundleName(getI18nBundleName());

}
 
开发者ID:duniter-gchange,项目名称:gchange-pod,代码行数:11,代码来源:PluginSettings.java

示例15: SyncedFlushService

import org.elasticsearch.common.inject.Inject; //导入依赖的package包/类
@Inject
public SyncedFlushService(Settings settings, IndicesService indicesService, ClusterService clusterService, TransportService transportService, IndexNameExpressionResolver indexNameExpressionResolver) {
    super(settings);
    this.indicesService = indicesService;
    this.clusterService = clusterService;
    this.transportService = transportService;
    this.indexNameExpressionResolver = indexNameExpressionResolver;
    transportService.registerRequestHandler(PRE_SYNCED_FLUSH_ACTION_NAME, PreShardSyncedFlushRequest::new, ThreadPool.Names.FLUSH, new PreSyncedFlushTransportHandler());
    transportService.registerRequestHandler(SYNCED_FLUSH_ACTION_NAME, ShardSyncedFlushRequest::new, ThreadPool.Names.FLUSH, new SyncedFlushTransportHandler());
    transportService.registerRequestHandler(IN_FLIGHT_OPS_ACTION_NAME, InFlightOpsRequest::new, ThreadPool.Names.SAME, new InFlightOpCountTransportHandler());
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:12,代码来源:SyncedFlushService.java


注:本文中的org.elasticsearch.common.inject.Inject类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。