Search in sources :

Example 71 with Settings

use of org.elasticsearch.common.settings.Settings in project elasticsearch by elastic.

the class ActionModule method initRestHandlers.

public void initRestHandlers(Supplier<DiscoveryNodes> nodesInCluster) {
    List<AbstractCatAction> catActions = new ArrayList<>();
    Consumer<RestHandler> registerHandler = a -> {
        if (a instanceof AbstractCatAction) {
            catActions.add((AbstractCatAction) a);
        }
    };
    registerHandler.accept(new RestMainAction(settings, restController));
    registerHandler.accept(new RestNodesInfoAction(settings, restController, settingsFilter));
    registerHandler.accept(new RestNodesStatsAction(settings, restController));
    registerHandler.accept(new RestNodesHotThreadsAction(settings, restController));
    registerHandler.accept(new RestClusterAllocationExplainAction(settings, restController));
    registerHandler.accept(new RestClusterStatsAction(settings, restController));
    registerHandler.accept(new RestClusterStateAction(settings, restController, settingsFilter));
    registerHandler.accept(new RestClusterHealthAction(settings, restController));
    registerHandler.accept(new RestClusterUpdateSettingsAction(settings, restController));
    registerHandler.accept(new RestClusterGetSettingsAction(settings, restController, clusterSettings, settingsFilter));
    registerHandler.accept(new RestClusterRerouteAction(settings, restController, settingsFilter));
    registerHandler.accept(new RestClusterSearchShardsAction(settings, restController));
    registerHandler.accept(new RestPendingClusterTasksAction(settings, restController));
    registerHandler.accept(new RestPutRepositoryAction(settings, restController));
    registerHandler.accept(new RestGetRepositoriesAction(settings, restController, settingsFilter));
    registerHandler.accept(new RestDeleteRepositoryAction(settings, restController));
    registerHandler.accept(new RestVerifyRepositoryAction(settings, restController));
    registerHandler.accept(new RestGetSnapshotsAction(settings, restController));
    registerHandler.accept(new RestCreateSnapshotAction(settings, restController));
    registerHandler.accept(new RestRestoreSnapshotAction(settings, restController));
    registerHandler.accept(new RestDeleteSnapshotAction(settings, restController));
    registerHandler.accept(new RestSnapshotsStatusAction(settings, restController));
    registerHandler.accept(new RestTypesExistsAction(settings, restController));
    registerHandler.accept(new RestGetIndicesAction(settings, restController, indexScopedSettings, settingsFilter));
    registerHandler.accept(new RestIndicesStatsAction(settings, restController));
    registerHandler.accept(new RestIndicesSegmentsAction(settings, restController));
    registerHandler.accept(new RestIndicesShardStoresAction(settings, restController));
    registerHandler.accept(new RestGetAliasesAction(settings, restController));
    registerHandler.accept(new RestIndexDeleteAliasesAction(settings, restController));
    registerHandler.accept(new RestIndexPutAliasAction(settings, restController));
    registerHandler.accept(new RestIndicesAliasesAction(settings, restController));
    registerHandler.accept(new RestCreateIndexAction(settings, restController));
    registerHandler.accept(new RestShrinkIndexAction(settings, restController));
    registerHandler.accept(new RestRolloverIndexAction(settings, restController));
    registerHandler.accept(new RestDeleteIndexAction(settings, restController));
    registerHandler.accept(new RestCloseIndexAction(settings, restController));
    registerHandler.accept(new RestOpenIndexAction(settings, restController));
    registerHandler.accept(new RestUpdateSettingsAction(settings, restController));
    registerHandler.accept(new RestGetSettingsAction(settings, restController, indexScopedSettings, settingsFilter));
    registerHandler.accept(new RestAnalyzeAction(settings, restController));
    registerHandler.accept(new RestGetIndexTemplateAction(settings, restController));
    registerHandler.accept(new RestPutIndexTemplateAction(settings, restController));
    registerHandler.accept(new RestDeleteIndexTemplateAction(settings, restController));
    registerHandler.accept(new RestPutMappingAction(settings, restController));
    registerHandler.accept(new RestGetMappingAction(settings, restController));
    registerHandler.accept(new RestGetFieldMappingAction(settings, restController));
    registerHandler.accept(new RestRefreshAction(settings, restController));
    registerHandler.accept(new RestFlushAction(settings, restController));
    registerHandler.accept(new RestSyncedFlushAction(settings, restController));
    registerHandler.accept(new RestForceMergeAction(settings, restController));
    registerHandler.accept(new RestUpgradeAction(settings, restController));
    registerHandler.accept(new RestClearIndicesCacheAction(settings, restController));
    registerHandler.accept(new RestIndexAction(settings, restController));
    registerHandler.accept(new RestGetAction(settings, restController));
    registerHandler.accept(new RestGetSourceAction(settings, restController));
    registerHandler.accept(new RestMultiGetAction(settings, restController));
    registerHandler.accept(new RestDeleteAction(settings, restController));
    registerHandler.accept(new org.elasticsearch.rest.action.document.RestCountAction(settings, restController));
    registerHandler.accept(new RestTermVectorsAction(settings, restController));
    registerHandler.accept(new RestMultiTermVectorsAction(settings, restController));
    registerHandler.accept(new RestBulkAction(settings, restController));
    registerHandler.accept(new RestUpdateAction(settings, restController));
    registerHandler.accept(new RestSearchAction(settings, restController));
    registerHandler.accept(new RestSearchScrollAction(settings, restController));
    registerHandler.accept(new RestClearScrollAction(settings, restController));
    registerHandler.accept(new RestMultiSearchAction(settings, restController));
    registerHandler.accept(new RestValidateQueryAction(settings, restController));
    registerHandler.accept(new RestExplainAction(settings, restController));
    registerHandler.accept(new RestRecoveryAction(settings, restController));
    // Scripts API
    registerHandler.accept(new RestGetStoredScriptAction(settings, restController));
    registerHandler.accept(new RestPutStoredScriptAction(settings, restController));
    registerHandler.accept(new RestDeleteStoredScriptAction(settings, restController));
    registerHandler.accept(new RestFieldStatsAction(settings, restController));
    // Tasks API
    registerHandler.accept(new RestListTasksAction(settings, restController, nodesInCluster));
    registerHandler.accept(new RestGetTaskAction(settings, restController));
    registerHandler.accept(new RestCancelTasksAction(settings, restController, nodesInCluster));
    // Ingest API
    registerHandler.accept(new RestPutPipelineAction(settings, restController));
    registerHandler.accept(new RestGetPipelineAction(settings, restController));
    registerHandler.accept(new RestDeletePipelineAction(settings, restController));
    registerHandler.accept(new RestSimulatePipelineAction(settings, restController));
    // CAT API
    registerHandler.accept(new RestAllocationAction(settings, restController));
    registerHandler.accept(new RestShardsAction(settings, restController));
    registerHandler.accept(new RestMasterAction(settings, restController));
    registerHandler.accept(new RestNodesAction(settings, restController));
    registerHandler.accept(new RestTasksAction(settings, restController, nodesInCluster));
    registerHandler.accept(new RestIndicesAction(settings, restController, indexNameExpressionResolver));
    registerHandler.accept(new RestSegmentsAction(settings, restController));
    // Fully qualified to prevent interference with rest.action.count.RestCountAction
    registerHandler.accept(new org.elasticsearch.rest.action.cat.RestCountAction(settings, restController));
    // Fully qualified to prevent interference with rest.action.indices.RestRecoveryAction
    registerHandler.accept(new org.elasticsearch.rest.action.cat.RestRecoveryAction(settings, restController));
    registerHandler.accept(new RestHealthAction(settings, restController));
    registerHandler.accept(new org.elasticsearch.rest.action.cat.RestPendingClusterTasksAction(settings, restController));
    registerHandler.accept(new RestAliasAction(settings, restController));
    registerHandler.accept(new RestThreadPoolAction(settings, restController));
    registerHandler.accept(new RestPluginsAction(settings, restController));
    registerHandler.accept(new RestFielddataAction(settings, restController));
    registerHandler.accept(new RestNodeAttrsAction(settings, restController));
    registerHandler.accept(new RestRepositoriesAction(settings, restController));
    registerHandler.accept(new RestSnapshotAction(settings, restController));
    registerHandler.accept(new RestTemplatesAction(settings, restController));
    for (ActionPlugin plugin : actionPlugins) {
        for (RestHandler handler : plugin.getRestHandlers(settings, restController, clusterSettings, indexScopedSettings, settingsFilter, indexNameExpressionResolver, nodesInCluster)) {
            registerHandler.accept(handler);
        }
    }
    registerHandler.accept(new RestCatAction(settings, restController, catActions));
}
Also used : RestClusterSearchShardsAction(org.elasticsearch.rest.action.admin.cluster.RestClusterSearchShardsAction) RestTasksAction(org.elasticsearch.rest.action.cat.RestTasksAction) Collections.unmodifiableList(java.util.Collections.unmodifiableList) CreateSnapshotAction(org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotAction) ListTasksAction(org.elasticsearch.action.admin.cluster.node.tasks.list.ListTasksAction) TransportTermVectorsAction(org.elasticsearch.action.termvectors.TransportTermVectorsAction) TransportSearchAction(org.elasticsearch.action.search.TransportSearchAction) TransportVerifyRepositoryAction(org.elasticsearch.action.admin.cluster.repositories.verify.TransportVerifyRepositoryAction) UpgradeAction(org.elasticsearch.action.admin.indices.upgrade.post.UpgradeAction) TransportCreateSnapshotAction(org.elasticsearch.action.admin.cluster.snapshots.create.TransportCreateSnapshotAction) TransportUpdateSettingsAction(org.elasticsearch.action.admin.indices.settings.put.TransportUpdateSettingsAction) RestPutPipelineAction(org.elasticsearch.rest.action.ingest.RestPutPipelineAction) DeletePipelineTransportAction(org.elasticsearch.action.ingest.DeletePipelineTransportAction) RestPluginsAction(org.elasticsearch.rest.action.cat.RestPluginsAction) TransportFieldStatsAction(org.elasticsearch.action.fieldstats.TransportFieldStatsAction) RestOpenIndexAction(org.elasticsearch.rest.action.admin.indices.RestOpenIndexAction) TransportGetTaskAction(org.elasticsearch.action.admin.cluster.node.tasks.get.TransportGetTaskAction) GetMappingsAction(org.elasticsearch.action.admin.indices.mapping.get.GetMappingsAction) Map(java.util.Map) PutStoredScriptAction(org.elasticsearch.action.admin.cluster.storedscripts.PutStoredScriptAction) MultiGetAction(org.elasticsearch.action.get.MultiGetAction) TransportClearIndicesCacheAction(org.elasticsearch.action.admin.indices.cache.clear.TransportClearIndicesCacheAction) TransportListTasksAction(org.elasticsearch.action.admin.cluster.node.tasks.list.TransportListTasksAction) NodesStatsAction(org.elasticsearch.action.admin.cluster.node.stats.NodesStatsAction) TransportAnalyzeAction(org.elasticsearch.action.admin.indices.analyze.TransportAnalyzeAction) TransportNodesInfoAction(org.elasticsearch.action.admin.cluster.node.info.TransportNodesInfoAction) TransportUpgradeSettingsAction(org.elasticsearch.action.admin.indices.upgrade.post.TransportUpgradeSettingsAction) ActionFilters(org.elasticsearch.action.support.ActionFilters) GetStoredScriptAction(org.elasticsearch.action.admin.cluster.storedscripts.GetStoredScriptAction) AbstractModule(org.elasticsearch.common.inject.AbstractModule) RestGetAliasesAction(org.elasticsearch.rest.action.admin.indices.RestGetAliasesAction) NamedRegistry(org.elasticsearch.common.NamedRegistry) Logger(org.apache.logging.log4j.Logger) RestBulkAction(org.elasticsearch.rest.action.document.RestBulkAction) RestDeleteAction(org.elasticsearch.rest.action.document.RestDeleteAction) TransportUpdateAction(org.elasticsearch.action.update.TransportUpdateAction) RestIndicesAction(org.elasticsearch.rest.action.cat.RestIndicesAction) TransportShrinkAction(org.elasticsearch.action.admin.indices.shrink.TransportShrinkAction) RestSimulatePipelineAction(org.elasticsearch.rest.action.ingest.RestSimulatePipelineAction) TransportMainAction(org.elasticsearch.action.main.TransportMainAction) TransportNodesStatsAction(org.elasticsearch.action.admin.cluster.node.stats.TransportNodesStatsAction) TransportGetRepositoriesAction(org.elasticsearch.action.admin.cluster.repositories.get.TransportGetRepositoriesAction) TransportUpgradeAction(org.elasticsearch.action.admin.indices.upgrade.post.TransportUpgradeAction) RestTypesExistsAction(org.elasticsearch.rest.action.admin.indices.RestTypesExistsAction) RestSearchAction(org.elasticsearch.rest.action.search.RestSearchAction) RestValidateQueryAction(org.elasticsearch.rest.action.admin.indices.RestValidateQueryAction) TransportShardBulkAction(org.elasticsearch.action.bulk.TransportShardBulkAction) MultiSearchAction(org.elasticsearch.action.search.MultiSearchAction) TransportShardMultiTermsVectorAction(org.elasticsearch.action.termvectors.TransportShardMultiTermsVectorAction) RestSyncedFlushAction(org.elasticsearch.rest.action.admin.indices.RestSyncedFlushAction) DeleteRepositoryAction(org.elasticsearch.action.admin.cluster.repositories.delete.DeleteRepositoryAction) Supplier(java.util.function.Supplier) GetTaskAction(org.elasticsearch.action.admin.cluster.node.tasks.get.GetTaskAction) TransportRolloverAction(org.elasticsearch.action.admin.indices.rollover.TransportRolloverAction) TransportGetIndexTemplatesAction(org.elasticsearch.action.admin.indices.template.get.TransportGetIndexTemplatesAction) RestClearScrollAction(org.elasticsearch.rest.action.search.RestClearScrollAction) RestDeletePipelineAction(org.elasticsearch.rest.action.ingest.RestDeletePipelineAction) TransportDeleteSnapshotAction(org.elasticsearch.action.admin.cluster.snapshots.delete.TransportDeleteSnapshotAction) RestClusterRerouteAction(org.elasticsearch.rest.action.admin.cluster.RestClusterRerouteAction) RestUpdateSettingsAction(org.elasticsearch.rest.action.admin.indices.RestUpdateSettingsAction) GetFieldMappingsAction(org.elasticsearch.action.admin.indices.mapping.get.GetFieldMappingsAction) RestGetMappingAction(org.elasticsearch.rest.action.admin.indices.RestGetMappingAction) IndicesStatsAction(org.elasticsearch.action.admin.indices.stats.IndicesStatsAction) RestSegmentsAction(org.elasticsearch.rest.action.cat.RestSegmentsAction) DiscoveryNodes(org.elasticsearch.cluster.node.DiscoveryNodes) RestRestoreSnapshotAction(org.elasticsearch.rest.action.admin.cluster.RestRestoreSnapshotAction) TransportGetStoredScriptAction(org.elasticsearch.action.admin.cluster.storedscripts.TransportGetStoredScriptAction) TransportPutStoredScriptAction(org.elasticsearch.action.admin.cluster.storedscripts.TransportPutStoredScriptAction) RestNodesInfoAction(org.elasticsearch.rest.action.admin.cluster.RestNodesInfoAction) ShrinkAction(org.elasticsearch.action.admin.indices.shrink.ShrinkAction) IndexAction(org.elasticsearch.action.index.IndexAction) MainAction(org.elasticsearch.action.main.MainAction) RestSnapshotAction(org.elasticsearch.rest.action.cat.RestSnapshotAction) ESLoggerFactory(org.elasticsearch.common.logging.ESLoggerFactory) PutPipelineAction(org.elasticsearch.action.ingest.PutPipelineAction) UpdateAction(org.elasticsearch.action.update.UpdateAction) RestNodesStatsAction(org.elasticsearch.rest.action.admin.cluster.RestNodesStatsAction) RestNodesAction(org.elasticsearch.rest.action.cat.RestNodesAction) ForceMergeAction(org.elasticsearch.action.admin.indices.forcemerge.ForceMergeAction) ExplainAction(org.elasticsearch.action.explain.ExplainAction) CloseIndexAction(org.elasticsearch.action.admin.indices.close.CloseIndexAction) RestGetSourceAction(org.elasticsearch.rest.action.document.RestGetSourceAction) AnalyzeAction(org.elasticsearch.action.admin.indices.analyze.AnalyzeAction) RestForceMergeAction(org.elasticsearch.rest.action.admin.indices.RestForceMergeAction) AbstractCatAction(org.elasticsearch.rest.action.cat.AbstractCatAction) TransportBulkAction(org.elasticsearch.action.bulk.TransportBulkAction) NodesInfoAction(org.elasticsearch.action.admin.cluster.node.info.NodesInfoAction) TransportGetFieldMappingsIndexAction(org.elasticsearch.action.admin.indices.mapping.get.TransportGetFieldMappingsIndexAction) TransportRefreshAction(org.elasticsearch.action.admin.indices.refresh.TransportRefreshAction) MultiTermVectorsAction(org.elasticsearch.action.termvectors.MultiTermVectorsAction) RestClusterHealthAction(org.elasticsearch.rest.action.admin.cluster.RestClusterHealthAction) AutoCreateIndex(org.elasticsearch.action.support.AutoCreateIndex) TransportUpgradeStatusAction(org.elasticsearch.action.admin.indices.upgrade.get.TransportUpgradeStatusAction) TransportMultiGetAction(org.elasticsearch.action.get.TransportMultiGetAction) Settings(org.elasticsearch.common.settings.Settings) ThreadPool(org.elasticsearch.threadpool.ThreadPool) PutMappingAction(org.elasticsearch.action.admin.indices.mapping.put.PutMappingAction) GetAction(org.elasticsearch.action.get.GetAction) TransportGetAliasesAction(org.elasticsearch.action.admin.indices.alias.get.TransportGetAliasesAction) TransportRecoveryAction(org.elasticsearch.action.admin.indices.recovery.TransportRecoveryAction) RestClusterStateAction(org.elasticsearch.rest.action.admin.cluster.RestClusterStateAction) TransportTypesExistsAction(org.elasticsearch.action.admin.indices.exists.types.TransportTypesExistsAction) ActionFilter(org.elasticsearch.action.support.ActionFilter) RestPutRepositoryAction(org.elasticsearch.rest.action.admin.cluster.RestPutRepositoryAction) ClusterRerouteAction(org.elasticsearch.action.admin.cluster.reroute.ClusterRerouteAction) TermVectorsAction(org.elasticsearch.action.termvectors.TermVectorsAction) Collectors(java.util.stream.Collectors) RestIndicesShardStoresAction(org.elasticsearch.rest.action.admin.indices.RestIndicesShardStoresAction) RestAliasAction(org.elasticsearch.rest.action.cat.RestAliasAction) RestAnalyzeAction(org.elasticsearch.rest.action.admin.indices.RestAnalyzeAction) TransportCreateIndexAction(org.elasticsearch.action.admin.indices.create.TransportCreateIndexAction) TransportForceMergeAction(org.elasticsearch.action.admin.indices.forcemerge.TransportForceMergeAction) CreateIndexAction(org.elasticsearch.action.admin.indices.create.CreateIndexAction) ClearIndicesCacheAction(org.elasticsearch.action.admin.indices.cache.clear.ClearIndicesCacheAction) RolloverAction(org.elasticsearch.action.admin.indices.rollover.RolloverAction) RestGetFieldMappingAction(org.elasticsearch.rest.action.admin.indices.RestGetFieldMappingAction) GetSettingsAction(org.elasticsearch.action.admin.indices.settings.get.GetSettingsAction) RestIndexPutAliasAction(org.elasticsearch.rest.action.admin.indices.RestIndexPutAliasAction) RestTemplatesAction(org.elasticsearch.rest.action.cat.RestTemplatesAction) UpdateSettingsAction(org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsAction) TransportPutIndexTemplateAction(org.elasticsearch.action.admin.indices.template.put.TransportPutIndexTemplateAction) RestGetSettingsAction(org.elasticsearch.rest.action.admin.indices.RestGetSettingsAction) TransportIndicesShardStoresAction(org.elasticsearch.action.admin.indices.shards.TransportIndicesShardStoresAction) PutPipelineTransportAction(org.elasticsearch.action.ingest.PutPipelineTransportAction) RefreshAction(org.elasticsearch.action.admin.indices.refresh.RefreshAction) RestSearchScrollAction(org.elasticsearch.rest.action.search.RestSearchScrollAction) TransportRestoreSnapshotAction(org.elasticsearch.action.admin.cluster.snapshots.restore.TransportRestoreSnapshotAction) RestRefreshAction(org.elasticsearch.rest.action.admin.indices.RestRefreshAction) NodeClient(org.elasticsearch.client.node.NodeClient) TransportIndicesSegmentsAction(org.elasticsearch.action.admin.indices.segments.TransportIndicesSegmentsAction) RestExplainAction(org.elasticsearch.rest.action.search.RestExplainAction) TransportFlushAction(org.elasticsearch.action.admin.indices.flush.TransportFlushAction) RestCatAction(org.elasticsearch.rest.action.cat.RestCatAction) RestIndicesSegmentsAction(org.elasticsearch.rest.action.admin.indices.RestIndicesSegmentsAction) DeleteSnapshotAction(org.elasticsearch.action.admin.cluster.snapshots.delete.DeleteSnapshotAction) RestMultiSearchAction(org.elasticsearch.rest.action.search.RestMultiSearchAction) TransportDeleteAction(org.elasticsearch.action.delete.TransportDeleteAction) RestGetSnapshotsAction(org.elasticsearch.rest.action.admin.cluster.RestGetSnapshotsAction) RestPutIndexTemplateAction(org.elasticsearch.rest.action.admin.indices.RestPutIndexTemplateAction) RestClearIndicesCacheAction(org.elasticsearch.rest.action.admin.indices.RestClearIndicesCacheAction) RestIndicesStatsAction(org.elasticsearch.rest.action.admin.indices.RestIndicesStatsAction) ClusterAllocationExplainAction(org.elasticsearch.action.admin.cluster.allocation.ClusterAllocationExplainAction) GetIndexTemplatesAction(org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesAction) IndexScopedSettings(org.elasticsearch.common.settings.IndexScopedSettings) Consumer(java.util.function.Consumer) RestHealthAction(org.elasticsearch.rest.action.cat.RestHealthAction) ClusterSettings(org.elasticsearch.common.settings.ClusterSettings) RestShardsAction(org.elasticsearch.rest.action.cat.RestShardsAction) RestGetIndexTemplateAction(org.elasticsearch.rest.action.admin.indices.RestGetIndexTemplateAction) RestAllocationAction(org.elasticsearch.rest.action.cat.RestAllocationAction) TransportCancelTasksAction(org.elasticsearch.action.admin.cluster.node.tasks.cancel.TransportCancelTasksAction) FlushAction(org.elasticsearch.action.admin.indices.flush.FlushAction) RestCancelTasksAction(org.elasticsearch.rest.action.admin.cluster.RestCancelTasksAction) IndexNameExpressionResolver(org.elasticsearch.cluster.metadata.IndexNameExpressionResolver) ClusterUpdateSettingsAction(org.elasticsearch.action.admin.cluster.settings.ClusterUpdateSettingsAction) IndicesExistsAction(org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsAction) TransportGetMappingsAction(org.elasticsearch.action.admin.indices.mapping.get.TransportGetMappingsAction) ValidateQueryAction(org.elasticsearch.action.admin.indices.validate.query.ValidateQueryAction) TransportExplainAction(org.elasticsearch.action.explain.TransportExplainAction) TransportGetAction(org.elasticsearch.action.get.TransportGetAction) UnaryOperator(java.util.function.UnaryOperator) DestructiveOperations(org.elasticsearch.action.support.DestructiveOperations) RestRepositoriesAction(org.elasticsearch.rest.action.cat.RestRepositoriesAction) UpgradeStatusAction(org.elasticsearch.action.admin.indices.upgrade.get.UpgradeStatusAction) TypesExistsAction(org.elasticsearch.action.admin.indices.exists.types.TypesExistsAction) RestClusterGetSettingsAction(org.elasticsearch.rest.action.admin.cluster.RestClusterGetSettingsAction) TransportAction(org.elasticsearch.action.support.TransportAction) DeleteIndexAction(org.elasticsearch.action.admin.indices.delete.DeleteIndexAction) BulkAction(org.elasticsearch.action.bulk.BulkAction) TransportPendingClusterTasksAction(org.elasticsearch.action.admin.cluster.tasks.TransportPendingClusterTasksAction) TransportIndicesAliasesAction(org.elasticsearch.action.admin.indices.alias.TransportIndicesAliasesAction) TransportIndexAction(org.elasticsearch.action.index.TransportIndexAction) RestRolloverIndexAction(org.elasticsearch.rest.action.admin.indices.RestRolloverIndexAction) TransportMultiSearchAction(org.elasticsearch.action.search.TransportMultiSearchAction) ClusterSearchShardsAction(org.elasticsearch.action.admin.cluster.shards.ClusterSearchShardsAction) RestDeleteIndexAction(org.elasticsearch.rest.action.admin.indices.RestDeleteIndexAction) RestPutStoredScriptAction(org.elasticsearch.rest.action.admin.cluster.RestPutStoredScriptAction) TransportCloseIndexAction(org.elasticsearch.action.admin.indices.close.TransportCloseIndexAction) TransportGetSettingsAction(org.elasticsearch.action.admin.indices.settings.get.TransportGetSettingsAction) TransportGetIndexAction(org.elasticsearch.action.admin.indices.get.TransportGetIndexAction) Set(java.util.Set) RestController(org.elasticsearch.rest.RestController) RestTermVectorsAction(org.elasticsearch.rest.action.document.RestTermVectorsAction) TransportIndicesStatsAction(org.elasticsearch.action.admin.indices.stats.TransportIndicesStatsAction) RestGetStoredScriptAction(org.elasticsearch.rest.action.admin.cluster.RestGetStoredScriptAction) RestMultiTermVectorsAction(org.elasticsearch.rest.action.document.RestMultiTermVectorsAction) RestDeleteStoredScriptAction(org.elasticsearch.rest.action.admin.cluster.RestDeleteStoredScriptAction) RestVerifyRepositoryAction(org.elasticsearch.rest.action.admin.cluster.RestVerifyRepositoryAction) TransportSyncedFlushAction(org.elasticsearch.action.admin.indices.flush.TransportSyncedFlushAction) IndicesShardStoresAction(org.elasticsearch.action.admin.indices.shards.IndicesShardStoresAction) RestFielddataAction(org.elasticsearch.rest.action.cat.RestFielddataAction) PutIndexTemplateAction(org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateAction) RestGetTaskAction(org.elasticsearch.rest.action.admin.cluster.RestGetTaskAction) ClusterStatsAction(org.elasticsearch.action.admin.cluster.stats.ClusterStatsAction) TransportOpenIndexAction(org.elasticsearch.action.admin.indices.open.TransportOpenIndexAction) CircuitBreakerService(org.elasticsearch.indices.breaker.CircuitBreakerService) ArrayList(java.util.ArrayList) RestMultiGetAction(org.elasticsearch.rest.action.document.RestMultiGetAction) TransportClusterSearchShardsAction(org.elasticsearch.action.admin.cluster.shards.TransportClusterSearchShardsAction) RestClusterStatsAction(org.elasticsearch.rest.action.admin.cluster.RestClusterStatsAction) RestPutMappingAction(org.elasticsearch.rest.action.admin.indices.RestPutMappingAction) GetPipelineTransportAction(org.elasticsearch.action.ingest.GetPipelineTransportAction) RestRecoveryAction(org.elasticsearch.rest.action.admin.indices.RestRecoveryAction) RestPendingClusterTasksAction(org.elasticsearch.rest.action.admin.cluster.RestPendingClusterTasksAction) UpgradeSettingsAction(org.elasticsearch.action.admin.indices.upgrade.post.UpgradeSettingsAction) CancelTasksAction(org.elasticsearch.action.admin.cluster.node.tasks.cancel.CancelTasksAction) RestDeleteIndexTemplateAction(org.elasticsearch.rest.action.admin.indices.RestDeleteIndexTemplateAction) GetAliasesAction(org.elasticsearch.action.admin.indices.alias.get.GetAliasesAction) TransportClearScrollAction(org.elasticsearch.action.search.TransportClearScrollAction) IndicesAliasesAction(org.elasticsearch.action.admin.indices.alias.IndicesAliasesAction) GetRepositoriesAction(org.elasticsearch.action.admin.cluster.repositories.get.GetRepositoriesAction) TransportClusterAllocationExplainAction(org.elasticsearch.action.admin.cluster.allocation.TransportClusterAllocationExplainAction) RestGetPipelineAction(org.elasticsearch.rest.action.ingest.RestGetPipelineAction) NodesHotThreadsAction(org.elasticsearch.action.admin.cluster.node.hotthreads.NodesHotThreadsAction) RestCloseIndexAction(org.elasticsearch.rest.action.admin.indices.RestCloseIndexAction) RestClusterAllocationExplainAction(org.elasticsearch.rest.action.admin.cluster.RestClusterAllocationExplainAction) GetPipelineAction(org.elasticsearch.action.ingest.GetPipelineAction) RestCreateSnapshotAction(org.elasticsearch.rest.action.admin.cluster.RestCreateSnapshotAction) RestUpgradeAction(org.elasticsearch.rest.action.admin.indices.RestUpgradeAction) TransportNodesHotThreadsAction(org.elasticsearch.action.admin.cluster.node.hotthreads.TransportNodesHotThreadsAction) RestFieldStatsAction(org.elasticsearch.rest.action.RestFieldStatsAction) RestMasterAction(org.elasticsearch.rest.action.cat.RestMasterAction) TransportLivenessAction(org.elasticsearch.action.admin.cluster.node.liveness.TransportLivenessAction) RestDeleteSnapshotAction(org.elasticsearch.rest.action.admin.cluster.RestDeleteSnapshotAction) TransportDeleteRepositoryAction(org.elasticsearch.action.admin.cluster.repositories.delete.TransportDeleteRepositoryAction) RestIndexDeleteAliasesAction(org.elasticsearch.rest.action.admin.indices.RestIndexDeleteAliasesAction) TransportMultiTermVectorsAction(org.elasticsearch.action.termvectors.TransportMultiTermVectorsAction) TransportSnapshotsStatusAction(org.elasticsearch.action.admin.cluster.snapshots.status.TransportSnapshotsStatusAction) TransportDeleteStoredScriptAction(org.elasticsearch.action.admin.cluster.storedscripts.TransportDeleteStoredScriptAction) RestClusterUpdateSettingsAction(org.elasticsearch.rest.action.admin.cluster.RestClusterUpdateSettingsAction) DeleteStoredScriptAction(org.elasticsearch.action.admin.cluster.storedscripts.DeleteStoredScriptAction) RestGetAction(org.elasticsearch.rest.action.document.RestGetAction) Multibinder(org.elasticsearch.common.inject.multibindings.Multibinder) SimulatePipelineTransportAction(org.elasticsearch.action.ingest.SimulatePipelineTransportAction) RestIndicesAliasesAction(org.elasticsearch.rest.action.admin.indices.RestIndicesAliasesAction) TransportSearchScrollAction(org.elasticsearch.action.search.TransportSearchScrollAction) TransportValidateQueryAction(org.elasticsearch.action.admin.indices.validate.query.TransportValidateQueryAction) RestNodesHotThreadsAction(org.elasticsearch.rest.action.admin.cluster.RestNodesHotThreadsAction) IndicesSegmentsAction(org.elasticsearch.action.admin.indices.segments.IndicesSegmentsAction) DeleteIndexTemplateAction(org.elasticsearch.action.admin.indices.template.delete.DeleteIndexTemplateAction) SimulatePipelineAction(org.elasticsearch.action.ingest.SimulatePipelineAction) SyncedFlushAction(org.elasticsearch.action.admin.indices.flush.SyncedFlushAction) GetSnapshotsAction(org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsAction) RestUpdateAction(org.elasticsearch.rest.action.document.RestUpdateAction) PutRepositoryAction(org.elasticsearch.action.admin.cluster.repositories.put.PutRepositoryAction) RestShrinkIndexAction(org.elasticsearch.rest.action.admin.indices.RestShrinkIndexAction) RecoveryAction(org.elasticsearch.action.admin.indices.recovery.RecoveryAction) RestMainAction(org.elasticsearch.rest.action.RestMainAction) FieldStatsAction(org.elasticsearch.action.fieldstats.FieldStatsAction) GetIndexAction(org.elasticsearch.action.admin.indices.get.GetIndexAction) TransportDeleteIndexAction(org.elasticsearch.action.admin.indices.delete.TransportDeleteIndexAction) RestThreadPoolAction(org.elasticsearch.rest.action.cat.RestThreadPoolAction) OpenIndexAction(org.elasticsearch.action.admin.indices.open.OpenIndexAction) RestSnapshotsStatusAction(org.elasticsearch.rest.action.admin.cluster.RestSnapshotsStatusAction) RestDeleteRepositoryAction(org.elasticsearch.rest.action.admin.cluster.RestDeleteRepositoryAction) List(java.util.List) TransportShardMultiGetAction(org.elasticsearch.action.get.TransportShardMultiGetAction) ClearScrollAction(org.elasticsearch.action.search.ClearScrollAction) TransportClusterStatsAction(org.elasticsearch.action.admin.cluster.stats.TransportClusterStatsAction) VerifyRepositoryAction(org.elasticsearch.action.admin.cluster.repositories.verify.VerifyRepositoryAction) RestGetIndicesAction(org.elasticsearch.rest.action.admin.indices.RestGetIndicesAction) ClusterStateAction(org.elasticsearch.action.admin.cluster.state.ClusterStateAction) RestIndexAction(org.elasticsearch.rest.action.document.RestIndexAction) TransportClusterHealthAction(org.elasticsearch.action.admin.cluster.health.TransportClusterHealthAction) RestoreSnapshotAction(org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotAction) PendingClusterTasksAction(org.elasticsearch.action.admin.cluster.tasks.PendingClusterTasksAction) TransportIndicesExistsAction(org.elasticsearch.action.admin.indices.exists.indices.TransportIndicesExistsAction) SnapshotsStatusAction(org.elasticsearch.action.admin.cluster.snapshots.status.SnapshotsStatusAction) RestFlushAction(org.elasticsearch.rest.action.admin.indices.RestFlushAction) RestCreateIndexAction(org.elasticsearch.rest.action.admin.indices.RestCreateIndexAction) TransportClusterRerouteAction(org.elasticsearch.action.admin.cluster.reroute.TransportClusterRerouteAction) TransportClusterStateAction(org.elasticsearch.action.admin.cluster.state.TransportClusterStateAction) TransportDeleteIndexTemplateAction(org.elasticsearch.action.admin.indices.template.delete.TransportDeleteIndexTemplateAction) RestListTasksAction(org.elasticsearch.rest.action.admin.cluster.RestListTasksAction) RestHandler(org.elasticsearch.rest.RestHandler) MapBinder(org.elasticsearch.common.inject.multibindings.MapBinder) RestNodeAttrsAction(org.elasticsearch.rest.action.cat.RestNodeAttrsAction) RestGetRepositoriesAction(org.elasticsearch.rest.action.admin.cluster.RestGetRepositoriesAction) SearchAction(org.elasticsearch.action.search.SearchAction) ClusterHealthAction(org.elasticsearch.action.admin.cluster.health.ClusterHealthAction) TransportPutMappingAction(org.elasticsearch.action.admin.indices.mapping.put.TransportPutMappingAction) SettingsFilter(org.elasticsearch.common.settings.SettingsFilter) ActionPlugin(org.elasticsearch.plugins.ActionPlugin) TransportPutRepositoryAction(org.elasticsearch.action.admin.cluster.repositories.put.TransportPutRepositoryAction) SearchScrollAction(org.elasticsearch.action.search.SearchScrollAction) TransportClusterUpdateSettingsAction(org.elasticsearch.action.admin.cluster.settings.TransportClusterUpdateSettingsAction) DeleteAction(org.elasticsearch.action.delete.DeleteAction) TransportGetFieldMappingsAction(org.elasticsearch.action.admin.indices.mapping.get.TransportGetFieldMappingsAction) AliasesExistAction(org.elasticsearch.action.admin.indices.alias.exists.AliasesExistAction) ActionHandler(org.elasticsearch.plugins.ActionPlugin.ActionHandler) DeletePipelineAction(org.elasticsearch.action.ingest.DeletePipelineAction) TransportAliasesExistAction(org.elasticsearch.action.admin.indices.alias.exists.TransportAliasesExistAction) Collections.unmodifiableMap(java.util.Collections.unmodifiableMap) TransportGetSnapshotsAction(org.elasticsearch.action.admin.cluster.snapshots.get.TransportGetSnapshotsAction) AbstractCatAction(org.elasticsearch.rest.action.cat.AbstractCatAction) RestIndicesAliasesAction(org.elasticsearch.rest.action.admin.indices.RestIndicesAliasesAction) RestGetMappingAction(org.elasticsearch.rest.action.admin.indices.RestGetMappingAction) ArrayList(java.util.ArrayList) RestExplainAction(org.elasticsearch.rest.action.search.RestExplainAction) ActionPlugin(org.elasticsearch.plugins.ActionPlugin) RestDeletePipelineAction(org.elasticsearch.rest.action.ingest.RestDeletePipelineAction) RestTasksAction(org.elasticsearch.rest.action.cat.RestTasksAction) RestGetPipelineAction(org.elasticsearch.rest.action.ingest.RestGetPipelineAction) RestGetStoredScriptAction(org.elasticsearch.rest.action.admin.cluster.RestGetStoredScriptAction) RestUpdateAction(org.elasticsearch.rest.action.document.RestUpdateAction) RestVerifyRepositoryAction(org.elasticsearch.rest.action.admin.cluster.RestVerifyRepositoryAction) RestMultiSearchAction(org.elasticsearch.rest.action.search.RestMultiSearchAction) RestMasterAction(org.elasticsearch.rest.action.cat.RestMasterAction) RestClearIndicesCacheAction(org.elasticsearch.rest.action.admin.indices.RestClearIndicesCacheAction) RestAllocationAction(org.elasticsearch.rest.action.cat.RestAllocationAction) RestCatAction(org.elasticsearch.rest.action.cat.RestCatAction) RestIndexPutAliasAction(org.elasticsearch.rest.action.admin.indices.RestIndexPutAliasAction) RestPutIndexTemplateAction(org.elasticsearch.rest.action.admin.indices.RestPutIndexTemplateAction) RestClearScrollAction(org.elasticsearch.rest.action.search.RestClearScrollAction) RestHandler(org.elasticsearch.rest.RestHandler) RestRestoreSnapshotAction(org.elasticsearch.rest.action.admin.cluster.RestRestoreSnapshotAction) RestPutPipelineAction(org.elasticsearch.rest.action.ingest.RestPutPipelineAction) RestPutMappingAction(org.elasticsearch.rest.action.admin.indices.RestPutMappingAction) RestRolloverIndexAction(org.elasticsearch.rest.action.admin.indices.RestRolloverIndexAction) RestSearchScrollAction(org.elasticsearch.rest.action.search.RestSearchScrollAction) RestPendingClusterTasksAction(org.elasticsearch.rest.action.admin.cluster.RestPendingClusterTasksAction) RestPutRepositoryAction(org.elasticsearch.rest.action.admin.cluster.RestPutRepositoryAction) RestDeleteIndexTemplateAction(org.elasticsearch.rest.action.admin.indices.RestDeleteIndexTemplateAction) RestDeleteRepositoryAction(org.elasticsearch.rest.action.admin.cluster.RestDeleteRepositoryAction) RestOpenIndexAction(org.elasticsearch.rest.action.admin.indices.RestOpenIndexAction) RestSimulatePipelineAction(org.elasticsearch.rest.action.ingest.RestSimulatePipelineAction) RestGetAction(org.elasticsearch.rest.action.document.RestGetAction) RestIndicesAction(org.elasticsearch.rest.action.cat.RestIndicesAction) RestCancelTasksAction(org.elasticsearch.rest.action.admin.cluster.RestCancelTasksAction) RestAnalyzeAction(org.elasticsearch.rest.action.admin.indices.RestAnalyzeAction) RestSyncedFlushAction(org.elasticsearch.rest.action.admin.indices.RestSyncedFlushAction) RestCreateSnapshotAction(org.elasticsearch.rest.action.admin.cluster.RestCreateSnapshotAction) RestGetTaskAction(org.elasticsearch.rest.action.admin.cluster.RestGetTaskAction) RestFieldStatsAction(org.elasticsearch.rest.action.RestFieldStatsAction) RestMainAction(org.elasticsearch.rest.action.RestMainAction) RestDeleteSnapshotAction(org.elasticsearch.rest.action.admin.cluster.RestDeleteSnapshotAction) RestClusterHealthAction(org.elasticsearch.rest.action.admin.cluster.RestClusterHealthAction) RestRefreshAction(org.elasticsearch.rest.action.admin.indices.RestRefreshAction) RestClusterGetSettingsAction(org.elasticsearch.rest.action.admin.cluster.RestClusterGetSettingsAction) RestSnapshotsStatusAction(org.elasticsearch.rest.action.admin.cluster.RestSnapshotsStatusAction) RestNodesInfoAction(org.elasticsearch.rest.action.admin.cluster.RestNodesInfoAction) RestGetIndexTemplateAction(org.elasticsearch.rest.action.admin.indices.RestGetIndexTemplateAction) RestAliasAction(org.elasticsearch.rest.action.cat.RestAliasAction) RestClusterRerouteAction(org.elasticsearch.rest.action.admin.cluster.RestClusterRerouteAction) RestTemplatesAction(org.elasticsearch.rest.action.cat.RestTemplatesAction) RestSearchAction(org.elasticsearch.rest.action.search.RestSearchAction) RestNodesAction(org.elasticsearch.rest.action.cat.RestNodesAction) RestGetIndicesAction(org.elasticsearch.rest.action.admin.indices.RestGetIndicesAction) RestThreadPoolAction(org.elasticsearch.rest.action.cat.RestThreadPoolAction) RestHealthAction(org.elasticsearch.rest.action.cat.RestHealthAction) RestFielddataAction(org.elasticsearch.rest.action.cat.RestFielddataAction) RestUpgradeAction(org.elasticsearch.rest.action.admin.indices.RestUpgradeAction) RestSegmentsAction(org.elasticsearch.rest.action.cat.RestSegmentsAction) RestClusterUpdateSettingsAction(org.elasticsearch.rest.action.admin.cluster.RestClusterUpdateSettingsAction) RestGetSnapshotsAction(org.elasticsearch.rest.action.admin.cluster.RestGetSnapshotsAction) RestGetFieldMappingAction(org.elasticsearch.rest.action.admin.indices.RestGetFieldMappingAction) RestGetSourceAction(org.elasticsearch.rest.action.document.RestGetSourceAction) RestNodesHotThreadsAction(org.elasticsearch.rest.action.admin.cluster.RestNodesHotThreadsAction) RestDeleteStoredScriptAction(org.elasticsearch.rest.action.admin.cluster.RestDeleteStoredScriptAction) RestClusterStateAction(org.elasticsearch.rest.action.admin.cluster.RestClusterStateAction) RestShrinkIndexAction(org.elasticsearch.rest.action.admin.indices.RestShrinkIndexAction) RestClusterSearchShardsAction(org.elasticsearch.rest.action.admin.cluster.RestClusterSearchShardsAction) RestPluginsAction(org.elasticsearch.rest.action.cat.RestPluginsAction) RestGetAliasesAction(org.elasticsearch.rest.action.admin.indices.RestGetAliasesAction) RestMultiGetAction(org.elasticsearch.rest.action.document.RestMultiGetAction) RestClusterStatsAction(org.elasticsearch.rest.action.admin.cluster.RestClusterStatsAction) RestTypesExistsAction(org.elasticsearch.rest.action.admin.indices.RestTypesExistsAction) RestCreateIndexAction(org.elasticsearch.rest.action.admin.indices.RestCreateIndexAction) RestSnapshotAction(org.elasticsearch.rest.action.cat.RestSnapshotAction) RestRepositoriesAction(org.elasticsearch.rest.action.cat.RestRepositoriesAction) RestIndicesSegmentsAction(org.elasticsearch.rest.action.admin.indices.RestIndicesSegmentsAction) RestMultiTermVectorsAction(org.elasticsearch.rest.action.document.RestMultiTermVectorsAction) RestClusterAllocationExplainAction(org.elasticsearch.rest.action.admin.cluster.RestClusterAllocationExplainAction) RestIndexDeleteAliasesAction(org.elasticsearch.rest.action.admin.indices.RestIndexDeleteAliasesAction) RestBulkAction(org.elasticsearch.rest.action.document.RestBulkAction) RestIndicesShardStoresAction(org.elasticsearch.rest.action.admin.indices.RestIndicesShardStoresAction) RestCloseIndexAction(org.elasticsearch.rest.action.admin.indices.RestCloseIndexAction) RestGetRepositoriesAction(org.elasticsearch.rest.action.admin.cluster.RestGetRepositoriesAction) RestListTasksAction(org.elasticsearch.rest.action.admin.cluster.RestListTasksAction) RestValidateQueryAction(org.elasticsearch.rest.action.admin.indices.RestValidateQueryAction) RestIndicesStatsAction(org.elasticsearch.rest.action.admin.indices.RestIndicesStatsAction) RestForceMergeAction(org.elasticsearch.rest.action.admin.indices.RestForceMergeAction) RestUpdateSettingsAction(org.elasticsearch.rest.action.admin.indices.RestUpdateSettingsAction) RestPutStoredScriptAction(org.elasticsearch.rest.action.admin.cluster.RestPutStoredScriptAction) RestDeleteIndexAction(org.elasticsearch.rest.action.admin.indices.RestDeleteIndexAction) RestIndexAction(org.elasticsearch.rest.action.document.RestIndexAction) RestRecoveryAction(org.elasticsearch.rest.action.admin.indices.RestRecoveryAction) RestShardsAction(org.elasticsearch.rest.action.cat.RestShardsAction) RestNodesStatsAction(org.elasticsearch.rest.action.admin.cluster.RestNodesStatsAction) RestFlushAction(org.elasticsearch.rest.action.admin.indices.RestFlushAction) RestTermVectorsAction(org.elasticsearch.rest.action.document.RestTermVectorsAction) RestNodeAttrsAction(org.elasticsearch.rest.action.cat.RestNodeAttrsAction) RestGetSettingsAction(org.elasticsearch.rest.action.admin.indices.RestGetSettingsAction) RestDeleteAction(org.elasticsearch.rest.action.document.RestDeleteAction)

Example 72 with Settings

use of org.elasticsearch.common.settings.Settings in project elasticsearch by elastic.

the class TransportAnalyzeAction method getCharFilterFactories.

private static CharFilterFactory[] getCharFilterFactories(AnalyzeRequest request, IndexSettings indexSettings, AnalysisRegistry analysisRegistry, Environment environment, CharFilterFactory[] charFilterFactories) throws IOException {
    if (request.charFilters() != null && request.charFilters().size() > 0) {
        charFilterFactories = new CharFilterFactory[request.charFilters().size()];
        for (int i = 0; i < request.charFilters().size(); i++) {
            final AnalyzeRequest.NameOrDefinition charFilter = request.charFilters().get(i);
            // parse anonymous settings
            if (charFilter.definition != null) {
                Settings settings = getAnonymousSettings(charFilter.definition);
                String charFilterTypeName = settings.get("type");
                if (charFilterTypeName == null) {
                    throw new IllegalArgumentException("Missing [type] setting for anonymous char filter: " + charFilter.definition);
                }
                AnalysisModule.AnalysisProvider<CharFilterFactory> charFilterFactoryFactory = analysisRegistry.getCharFilterProvider(charFilterTypeName);
                if (charFilterFactoryFactory == null) {
                    throw new IllegalArgumentException("failed to find global char filter under [" + charFilterTypeName + "]");
                }
                // Need to set anonymous "name" of char_filter
                charFilterFactories[i] = charFilterFactoryFactory.get(getNaIndexSettings(settings), environment, "_anonymous_charfilter_[" + i + "]", settings);
            } else {
                AnalysisModule.AnalysisProvider<CharFilterFactory> charFilterFactoryFactory;
                if (indexSettings == null) {
                    charFilterFactoryFactory = analysisRegistry.getCharFilterProvider(charFilter.name);
                    if (charFilterFactoryFactory == null) {
                        throw new IllegalArgumentException("failed to find global char filter under [" + charFilter.name + "]");
                    }
                    charFilterFactories[i] = charFilterFactoryFactory.get(environment, charFilter.name);
                } else {
                    charFilterFactoryFactory = analysisRegistry.getCharFilterProvider(charFilter.name, indexSettings);
                    if (charFilterFactoryFactory == null) {
                        throw new IllegalArgumentException("failed to find char filter under [" + charFilter.name + "]");
                    }
                    charFilterFactories[i] = charFilterFactoryFactory.get(indexSettings, environment, charFilter.name, AnalysisRegistry.getSettingsFromIndexSettings(indexSettings, AnalysisRegistry.INDEX_ANALYSIS_CHAR_FILTER + "." + charFilter.name));
                }
            }
            if (charFilterFactories[i] == null) {
                throw new IllegalArgumentException("failed to find char filter under [" + charFilter.name + "]");
            }
        }
    }
    return charFilterFactories;
}
Also used : CharFilterFactory(org.elasticsearch.index.analysis.CharFilterFactory) AnalysisModule(org.elasticsearch.indices.analysis.AnalysisModule) Settings(org.elasticsearch.common.settings.Settings) IndexSettings(org.elasticsearch.index.IndexSettings)

Example 73 with Settings

use of org.elasticsearch.common.settings.Settings in project elasticsearch by elastic.

the class GetIndexResponse method writeTo.

@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeStringArray(indices);
    out.writeVInt(mappings.size());
    for (ObjectObjectCursor<String, ImmutableOpenMap<String, MappingMetaData>> indexEntry : mappings) {
        out.writeString(indexEntry.key);
        out.writeVInt(indexEntry.value.size());
        for (ObjectObjectCursor<String, MappingMetaData> mappingEntry : indexEntry.value) {
            out.writeString(mappingEntry.key);
            mappingEntry.value.writeTo(out);
        }
    }
    out.writeVInt(aliases.size());
    for (ObjectObjectCursor<String, List<AliasMetaData>> indexEntry : aliases) {
        out.writeString(indexEntry.key);
        out.writeVInt(indexEntry.value.size());
        for (AliasMetaData aliasEntry : indexEntry.value) {
            aliasEntry.writeTo(out);
        }
    }
    out.writeVInt(settings.size());
    for (ObjectObjectCursor<String, Settings> indexEntry : settings) {
        out.writeString(indexEntry.key);
        Settings.writeSettingsToStream(indexEntry.value, out);
    }
}
Also used : AliasMetaData(org.elasticsearch.cluster.metadata.AliasMetaData) List(java.util.List) ArrayList(java.util.ArrayList) ImmutableOpenMap(org.elasticsearch.common.collect.ImmutableOpenMap) MappingMetaData(org.elasticsearch.cluster.metadata.MappingMetaData) Settings(org.elasticsearch.common.settings.Settings)

Example 74 with Settings

use of org.elasticsearch.common.settings.Settings in project elasticsearch by elastic.

the class GetIndexResponse method readFrom.

@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    this.indices = in.readStringArray();
    int mappingsSize = in.readVInt();
    ImmutableOpenMap.Builder<String, ImmutableOpenMap<String, MappingMetaData>> mappingsMapBuilder = ImmutableOpenMap.builder();
    for (int i = 0; i < mappingsSize; i++) {
        String key = in.readString();
        int valueSize = in.readVInt();
        ImmutableOpenMap.Builder<String, MappingMetaData> mappingEntryBuilder = ImmutableOpenMap.builder();
        for (int j = 0; j < valueSize; j++) {
            mappingEntryBuilder.put(in.readString(), new MappingMetaData(in));
        }
        mappingsMapBuilder.put(key, mappingEntryBuilder.build());
    }
    mappings = mappingsMapBuilder.build();
    int aliasesSize = in.readVInt();
    ImmutableOpenMap.Builder<String, List<AliasMetaData>> aliasesMapBuilder = ImmutableOpenMap.builder();
    for (int i = 0; i < aliasesSize; i++) {
        String key = in.readString();
        int valueSize = in.readVInt();
        List<AliasMetaData> aliasEntryBuilder = new ArrayList<>();
        for (int j = 0; j < valueSize; j++) {
            aliasEntryBuilder.add(new AliasMetaData(in));
        }
        aliasesMapBuilder.put(key, Collections.unmodifiableList(aliasEntryBuilder));
    }
    aliases = aliasesMapBuilder.build();
    int settingsSize = in.readVInt();
    ImmutableOpenMap.Builder<String, Settings> settingsMapBuilder = ImmutableOpenMap.builder();
    for (int i = 0; i < settingsSize; i++) {
        String key = in.readString();
        settingsMapBuilder.put(key, Settings.readSettingsFromStream(in));
    }
    settings = settingsMapBuilder.build();
}
Also used : ArrayList(java.util.ArrayList) ImmutableOpenMap(org.elasticsearch.common.collect.ImmutableOpenMap) MappingMetaData(org.elasticsearch.cluster.metadata.MappingMetaData) AliasMetaData(org.elasticsearch.cluster.metadata.AliasMetaData) List(java.util.List) ArrayList(java.util.ArrayList) Settings(org.elasticsearch.common.settings.Settings)

Example 75 with Settings

use of org.elasticsearch.common.settings.Settings in project elasticsearch by elastic.

the class TransportGetIndexAction method doMasterOperation.

@Override
protected void doMasterOperation(final GetIndexRequest request, String[] concreteIndices, final ClusterState state, final ActionListener<GetIndexResponse> listener) {
    ImmutableOpenMap<String, ImmutableOpenMap<String, MappingMetaData>> mappingsResult = ImmutableOpenMap.of();
    ImmutableOpenMap<String, List<AliasMetaData>> aliasesResult = ImmutableOpenMap.of();
    ImmutableOpenMap<String, Settings> settings = ImmutableOpenMap.of();
    Feature[] features = request.features();
    boolean doneAliases = false;
    boolean doneMappings = false;
    boolean doneSettings = false;
    for (Feature feature : features) {
        switch(feature) {
            case MAPPINGS:
                if (!doneMappings) {
                    mappingsResult = state.metaData().findMappings(concreteIndices, request.types());
                    doneMappings = true;
                }
                break;
            case ALIASES:
                if (!doneAliases) {
                    aliasesResult = state.metaData().findAliases(Strings.EMPTY_ARRAY, concreteIndices);
                    doneAliases = true;
                }
                break;
            case SETTINGS:
                if (!doneSettings) {
                    ImmutableOpenMap.Builder<String, Settings> settingsMapBuilder = ImmutableOpenMap.builder();
                    for (String index : concreteIndices) {
                        Settings indexSettings = state.metaData().index(index).getSettings();
                        if (request.humanReadable()) {
                            indexSettings = IndexMetaData.addHumanReadableSettings(indexSettings);
                        }
                        settingsMapBuilder.put(index, indexSettings);
                    }
                    settings = settingsMapBuilder.build();
                    doneSettings = true;
                }
                break;
            default:
                throw new IllegalStateException("feature [" + feature + "] is not valid");
        }
    }
    listener.onResponse(new GetIndexResponse(concreteIndices, mappingsResult, aliasesResult, settings));
}
Also used : ImmutableOpenMap(org.elasticsearch.common.collect.ImmutableOpenMap) Feature(org.elasticsearch.action.admin.indices.get.GetIndexRequest.Feature) List(java.util.List) Settings(org.elasticsearch.common.settings.Settings)

Aggregations

Settings (org.elasticsearch.common.settings.Settings)874 IndexSettings (org.elasticsearch.index.IndexSettings)112 Path (java.nio.file.Path)91 IOException (java.io.IOException)83 ClusterState (org.elasticsearch.cluster.ClusterState)76 IndexMetaData (org.elasticsearch.cluster.metadata.IndexMetaData)72 ClusterSettings (org.elasticsearch.common.settings.ClusterSettings)68 HashMap (java.util.HashMap)66 ArrayList (java.util.ArrayList)65 Version (org.elasticsearch.Version)63 Environment (org.elasticsearch.env.Environment)63 DiscoveryNode (org.elasticsearch.cluster.node.DiscoveryNode)61 Test (org.junit.Test)60 Map (java.util.Map)55 Index (org.elasticsearch.index.Index)55 Matchers.containsString (org.hamcrest.Matchers.containsString)54 List (java.util.List)45 ThreadPool (org.elasticsearch.threadpool.ThreadPool)41 XContentBuilder (org.elasticsearch.common.xcontent.XContentBuilder)37 MetaData (org.elasticsearch.cluster.metadata.MetaData)36