當前位置: 首頁>>代碼示例>>Java>>正文


Java IndicesStore類代碼示例

本文整理匯總了Java中org.elasticsearch.indices.store.IndicesStore的典型用法代碼示例。如果您正苦於以下問題:Java IndicesStore類的具體用法?Java IndicesStore怎麽用?Java IndicesStore使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


IndicesStore類屬於org.elasticsearch.indices.store包,在下文中一共展示了IndicesStore類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: nodeSettings

import org.elasticsearch.indices.store.IndicesStore; //導入依賴的package包/類
/**
 * This method is used to obtain settings for the <tt>Nth</tt> node in the cluster.
 * Nodes in this cluster are associated with an ordinal number such that nodes can
 * be started with specific configurations. This method might be called multiple
 * times with the same ordinal and is expected to return the same value for each invocation.
 * In other words subclasses must ensure this method is idempotent.
 */
protected Settings nodeSettings(int nodeOrdinal) {
    Settings.Builder builder = Settings.builder()
        .put(NodeEnvironment.MAX_LOCAL_STORAGE_NODES_SETTING.getKey(), Integer.MAX_VALUE)
        // Default the watermarks to absurdly low to prevent the tests
        // from failing on nodes without enough disk space
        .put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_LOW_DISK_WATERMARK_SETTING.getKey(), "1b")
        .put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_HIGH_DISK_WATERMARK_SETTING.getKey(), "1b")
        .put(ScriptService.SCRIPT_MAX_COMPILATIONS_PER_MINUTE.getKey(), 1000)
        .put("script.stored", "true")
        .put("script.inline", "true")
        // by default we never cache below 10k docs in a segment,
        // bypass this limit so that caching gets some testing in
        // integration tests that usually create few documents
        .put(IndicesQueryCache.INDICES_QUERIES_CACHE_ALL_SEGMENTS_SETTING.getKey(), nodeOrdinal % 2 == 0)
        // wait short time for other active shards before actually deleting, default 30s not needed in tests
        .put(IndicesStore.INDICES_STORE_DELETE_SHARD_TIMEOUT.getKey(), new TimeValue(1, TimeUnit.SECONDS));
    return builder.build();
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:26,代碼來源:ESIntegTestCase.java

示例2: configure

import org.elasticsearch.indices.store.IndicesStore; //導入依賴的package包/類
@Override
protected void configure() {
    bindQueryParsersExtension();
    bindHunspellExtension();
    bindMapperExtension();

    bind(IndicesLifecycle.class).to(InternalIndicesLifecycle.class).asEagerSingleton();
    bind(IndicesService.class).asEagerSingleton();
    bind(RecoverySettings.class).asEagerSingleton();
    bind(RecoveryTarget.class).asEagerSingleton();
    bind(RecoverySource.class).asEagerSingleton();
    bind(IndicesStore.class).asEagerSingleton();
    bind(IndicesClusterStateService.class).asEagerSingleton();
    bind(IndexingMemoryController.class).asEagerSingleton();
    bind(SyncedFlushService.class).asEagerSingleton();
    bind(IndicesQueryCache.class).asEagerSingleton();
    bind(IndicesRequestCache.class).asEagerSingleton();
    bind(IndicesFieldDataCache.class).asEagerSingleton();
    bind(TransportNodesListShardStoreMetaData.class).asEagerSingleton();
    bind(IndicesTTLService.class).asEagerSingleton();
    bind(IndicesWarmer.class).asEagerSingleton();
    bind(UpdateHelper.class).asEagerSingleton();
    bind(MetaDataIndexUpgradeService.class).asEagerSingleton();
    bind(IndicesFieldDataCacheListener.class).asEagerSingleton();
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:26,代碼來源:IndicesModule.java

示例3: IndexStore

import org.elasticsearch.indices.store.IndicesStore; //導入依賴的package包/類
@Inject
public IndexStore(Index index, IndexSettingsService settingsService, IndicesStore indicesStore) {
    super(index, settingsService.getSettings());
    Settings indexSettings = settingsService.getSettings();
    this.indicesStore = indicesStore;

    this.rateLimitingType = indexSettings.get(INDEX_STORE_THROTTLE_TYPE, "none");
    if (rateLimitingType.equalsIgnoreCase("node")) {
        nodeRateLimiting = true;
    } else {
        nodeRateLimiting = false;
        rateLimiting.setType(rateLimitingType);
    }
    this.rateLimitingThrottle = indexSettings.getAsBytesSize(INDEX_STORE_THROTTLE_MAX_BYTES_PER_SEC, new ByteSizeValue(0));
    rateLimiting.setMaxRate(rateLimitingThrottle);

    logger.debug("using index.store.throttle.type [{}], with index.store.throttle.max_bytes_per_sec [{}]", rateLimitingType, rateLimitingThrottle);
    this.settingsService = settingsService;
    this.settingsService.addListener(applySettings);
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:21,代碼來源:IndexStore.java

示例4: configure

import org.elasticsearch.indices.store.IndicesStore; //導入依賴的package包/類
@Override
protected void configure() {
    bind(IndicesStore.class).asEagerSingleton();
    bind(IndicesClusterStateService.class).asEagerSingleton();
    bind(SyncedFlushService.class).asEagerSingleton();
    bind(TransportNodesListShardStoreMetaData.class).asEagerSingleton();
    bind(GlobalCheckpointSyncAction.class).asEagerSingleton();
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:9,代碼來源:IndicesModule.java

示例5: registerBuiltinClusterSettings

import org.elasticsearch.indices.store.IndicesStore; //導入依賴的package包/類
private void registerBuiltinClusterSettings() {
    registerClusterDynamicSetting(AwarenessAllocationDecider.CLUSTER_ROUTING_ALLOCATION_AWARENESS_ATTRIBUTES, Validator.EMPTY);
    registerClusterDynamicSetting(AwarenessAllocationDecider.CLUSTER_ROUTING_ALLOCATION_AWARENESS_FORCE_GROUP + "*", Validator.EMPTY);
    registerClusterDynamicSetting(BalancedShardsAllocator.SETTING_INDEX_BALANCE_FACTOR, Validator.FLOAT);
    registerClusterDynamicSetting(BalancedShardsAllocator.SETTING_SHARD_BALANCE_FACTOR, Validator.FLOAT);
    registerClusterDynamicSetting(BalancedShardsAllocator.SETTING_THRESHOLD, Validator.NON_NEGATIVE_FLOAT);
    registerClusterDynamicSetting(ClusterRebalanceAllocationDecider.CLUSTER_ROUTING_ALLOCATION_ALLOW_REBALANCE, ClusterRebalanceAllocationDecider.ALLOCATION_ALLOW_REBALANCE_VALIDATOR);
    registerClusterDynamicSetting(ConcurrentRebalanceAllocationDecider.CLUSTER_ROUTING_ALLOCATION_CLUSTER_CONCURRENT_REBALANCE, Validator.INTEGER);
    registerClusterDynamicSetting(EnableAllocationDecider.CLUSTER_ROUTING_ALLOCATION_ENABLE, Validator.EMPTY);
    registerClusterDynamicSetting(EnableAllocationDecider.CLUSTER_ROUTING_REBALANCE_ENABLE, Validator.EMPTY);
    registerClusterDynamicSetting(DisableAllocationDecider.CLUSTER_ROUTING_ALLOCATION_DISABLE_NEW_ALLOCATION, Validator.EMPTY);
    registerClusterDynamicSetting(DisableAllocationDecider.CLUSTER_ROUTING_ALLOCATION_DISABLE_ALLOCATION, Validator.EMPTY);
    registerClusterDynamicSetting(DisableAllocationDecider.CLUSTER_ROUTING_ALLOCATION_DISABLE_REPLICA_ALLOCATION, Validator.EMPTY);
    registerClusterDynamicSetting(DiscoverySettings.NO_MASTER_BLOCK, Validator.EMPTY);
    registerClusterDynamicSetting(FilterAllocationDecider.CLUSTER_ROUTING_INCLUDE_GROUP + "*", Validator.EMPTY);
    registerClusterDynamicSetting(FilterAllocationDecider.CLUSTER_ROUTING_EXCLUDE_GROUP + "*", Validator.EMPTY);
    registerClusterDynamicSetting(FilterAllocationDecider.CLUSTER_ROUTING_REQUIRE_GROUP + "*", Validator.EMPTY);
    registerClusterDynamicSetting(IndicesStore.INDICES_STORE_THROTTLE_TYPE, Validator.EMPTY);
    registerClusterDynamicSetting(IndicesStore.INDICES_STORE_THROTTLE_MAX_BYTES_PER_SEC, Validator.BYTES_SIZE);
    registerClusterDynamicSetting(IndicesTTLService.INDICES_TTL_INTERVAL, Validator.TIME);
    registerClusterDynamicSetting(MappingUpdatedAction.INDICES_MAPPING_DYNAMIC_TIMEOUT, Validator.TIME);
    registerClusterDynamicSetting(MetaData.SETTING_READ_ONLY, Validator.EMPTY);
    registerClusterDynamicSetting(RecoverySettings.INDICES_RECOVERY_FILE_CHUNK_SIZE, Validator.POSITIVE_BYTES_SIZE);
    registerClusterDynamicSetting(RecoverySettings.INDICES_RECOVERY_TRANSLOG_OPS, Validator.INTEGER);
    registerClusterDynamicSetting(RecoverySettings.INDICES_RECOVERY_TRANSLOG_SIZE, Validator.BYTES_SIZE);
    registerClusterDynamicSetting(RecoverySettings.INDICES_RECOVERY_COMPRESS, Validator.EMPTY);
    registerClusterDynamicSetting(RecoverySettings.INDICES_RECOVERY_CONCURRENT_STREAMS, Validator.POSITIVE_INTEGER);
    registerClusterDynamicSetting(RecoverySettings.INDICES_RECOVERY_CONCURRENT_SMALL_FILE_STREAMS, Validator.POSITIVE_INTEGER);
    registerClusterDynamicSetting(RecoverySettings.INDICES_RECOVERY_MAX_BYTES_PER_SEC, Validator.BYTES_SIZE);
    registerClusterDynamicSetting(RecoverySettings.INDICES_RECOVERY_RETRY_DELAY_STATE_SYNC, Validator.TIME_NON_NEGATIVE);
    registerClusterDynamicSetting(RecoverySettings.INDICES_RECOVERY_RETRY_DELAY_NETWORK, Validator.TIME_NON_NEGATIVE);
    registerClusterDynamicSetting(RecoverySettings.INDICES_RECOVERY_ACTIVITY_TIMEOUT, Validator.TIME_NON_NEGATIVE);
    registerClusterDynamicSetting(RecoverySettings.INDICES_RECOVERY_INTERNAL_ACTION_TIMEOUT, Validator.TIME_NON_NEGATIVE);
    registerClusterDynamicSetting(RecoverySettings.INDICES_RECOVERY_INTERNAL_LONG_ACTION_TIMEOUT, Validator.TIME_NON_NEGATIVE);
    registerClusterDynamicSetting(RecoverySettings.INDICES_RECOVERY_MAX_SIZE_PER_SEC, Validator.BYTES_SIZE);
    registerClusterDynamicSetting(ThreadPool.THREADPOOL_GROUP + "*", ThreadPool.THREAD_POOL_TYPE_SETTINGS_VALIDATOR);
    registerClusterDynamicSetting(ThrottlingAllocationDecider.CLUSTER_ROUTING_ALLOCATION_NODE_INITIAL_PRIMARIES_RECOVERIES, Validator.INTEGER);
    registerClusterDynamicSetting(ThrottlingAllocationDecider.CLUSTER_ROUTING_ALLOCATION_NODE_CONCURRENT_RECOVERIES, Validator.INTEGER);
    registerClusterDynamicSetting(DiskThresholdDecider.CLUSTER_ROUTING_ALLOCATION_LOW_DISK_WATERMARK, Validator.EMPTY);
    registerClusterDynamicSetting(DiskThresholdDecider.CLUSTER_ROUTING_ALLOCATION_HIGH_DISK_WATERMARK, Validator.EMPTY);
    registerClusterDynamicSetting(DiskThresholdDecider.CLUSTER_ROUTING_ALLOCATION_DISK_THRESHOLD_ENABLED, Validator.BOOLEAN);
    registerClusterDynamicSetting(DiskThresholdDecider.CLUSTER_ROUTING_ALLOCATION_INCLUDE_RELOCATIONS, Validator.BOOLEAN);
    registerClusterDynamicSetting(DiskThresholdDecider.CLUSTER_ROUTING_ALLOCATION_REROUTE_INTERVAL, Validator.TIME_NON_NEGATIVE);
    registerClusterDynamicSetting(InternalClusterInfoService.INTERNAL_CLUSTER_INFO_UPDATE_INTERVAL, Validator.TIME_NON_NEGATIVE);
    registerClusterDynamicSetting(InternalClusterInfoService.INTERNAL_CLUSTER_INFO_TIMEOUT, Validator.TIME_NON_NEGATIVE);
    registerClusterDynamicSetting(SnapshotInProgressAllocationDecider.CLUSTER_ROUTING_ALLOCATION_SNAPSHOT_RELOCATION_ENABLED, Validator.EMPTY);
    registerClusterDynamicSetting(DestructiveOperations.REQUIRES_NAME, Validator.EMPTY);
    registerClusterDynamicSetting(DiscoverySettings.PUBLISH_TIMEOUT, Validator.TIME_NON_NEGATIVE);
    registerClusterDynamicSetting(DiscoverySettings.PUBLISH_DIFF_ENABLE, Validator.BOOLEAN);
    registerClusterDynamicSetting(HierarchyCircuitBreakerService.TOTAL_CIRCUIT_BREAKER_LIMIT_SETTING, Validator.MEMORY_SIZE);
    registerClusterDynamicSetting(HierarchyCircuitBreakerService.FIELDDATA_CIRCUIT_BREAKER_LIMIT_SETTING, Validator.MEMORY_SIZE);
    registerClusterDynamicSetting(HierarchyCircuitBreakerService.FIELDDATA_CIRCUIT_BREAKER_OVERHEAD_SETTING, Validator.NON_NEGATIVE_DOUBLE);
    registerClusterDynamicSetting(HierarchyCircuitBreakerService.REQUEST_CIRCUIT_BREAKER_LIMIT_SETTING, Validator.MEMORY_SIZE);
    registerClusterDynamicSetting(HierarchyCircuitBreakerService.REQUEST_CIRCUIT_BREAKER_OVERHEAD_SETTING, Validator.NON_NEGATIVE_DOUBLE);
    registerClusterDynamicSetting(InternalClusterService.SETTING_CLUSTER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD, Validator.TIME_NON_NEGATIVE);
    registerClusterDynamicSetting(SearchService.DEFAULT_SEARCH_TIMEOUT, Validator.TIMEOUT);
    registerClusterDynamicSetting(ElectMasterService.DISCOVERY_ZEN_MINIMUM_MASTER_NODES, ElectMasterService.DISCOVERY_ZEN_MINIMUM_MASTER_NODES_VALIDATOR);
    registerClusterDynamicSetting(TransportService.SETTING_TRACE_LOG_INCLUDE, Validator.EMPTY);
    registerClusterDynamicSetting(TransportService.SETTING_TRACE_LOG_INCLUDE + ".*", Validator.EMPTY);
    registerClusterDynamicSetting(TransportService.SETTING_TRACE_LOG_EXCLUDE, Validator.EMPTY);
    registerClusterDynamicSetting(TransportService.SETTING_TRACE_LOG_EXCLUDE + ".*", Validator.EMPTY);
    registerClusterDynamicSetting(TransportCloseIndexAction.SETTING_CLUSTER_INDICES_CLOSE_ENABLE, Validator.BOOLEAN);
    registerClusterDynamicSetting(ShardsLimitAllocationDecider.CLUSTER_TOTAL_SHARDS_PER_NODE, Validator.INTEGER);
    registerClusterDynamicSetting(AuditService.AUDIT_LOG_THRESHOLD, Validator.TIME);
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:66,代碼來源:ClusterModule.java

示例6: setRandomSettings

import org.elasticsearch.indices.store.IndicesStore; //導入依賴的package包/類
private static ImmutableSettings.Builder setRandomSettings(final Random random, final ImmutableSettings.Builder builder) {
    setRandomMerge(random, builder);
    setRandomTranslogSettings(random, builder);
    setRandomNormsLoading(random, builder);
    setRandomScriptingSettings(random, builder);
    if (random.nextBoolean()) {
        if (random.nextInt(10) == 0) { // do something crazy slow here
            builder.put(IndicesStore.INDICES_STORE_THROTTLE_MAX_BYTES_PER_SEC,
                    new ByteSizeValue(RandomInts.randomIntBetween(random, 1, 10), ByteSizeUnit.MB));
        } else {
            builder.put(IndicesStore.INDICES_STORE_THROTTLE_MAX_BYTES_PER_SEC,
                    new ByteSizeValue(RandomInts.randomIntBetween(random, 10, 200), ByteSizeUnit.MB));
        }
    }
    if (random.nextBoolean()) {
        builder.put(IndicesStore.INDICES_STORE_THROTTLE_TYPE, RandomPicks.randomFrom(random, StoreRateLimiting.Type.values()));
    }

    if (random.nextBoolean()) {
        builder.put(StoreModule.DISTIBUTOR_KEY, random.nextBoolean() ? StoreModule.LEAST_USED_DISTRIBUTOR
                : StoreModule.RANDOM_WEIGHT_DISTRIBUTOR);
    }

    if (random.nextBoolean()) {
        if (random.nextInt(10) == 0) { // do something crazy slow here
            builder.put(RecoverySettings.INDICES_RECOVERY_MAX_BYTES_PER_SEC,
                    new ByteSizeValue(RandomInts.randomIntBetween(random, 1, 10), ByteSizeUnit.MB));
        } else {
            builder.put(RecoverySettings.INDICES_RECOVERY_MAX_BYTES_PER_SEC,
                    new ByteSizeValue(RandomInts.randomIntBetween(random, 10, 200), ByteSizeUnit.MB));
        }
    }

    if (random.nextBoolean()) {
        builder.put(RecoverySettings.INDICES_RECOVERY_COMPRESS, random.nextBoolean());
    }

    if (random.nextBoolean()) {
        builder.put(FsTranslog.INDEX_TRANSLOG_FS_TYPE, RandomPicks.randomFrom(random, FsTranslogFile.Type.values()).name());
    }

    if (random.nextBoolean()) {
        builder.put(IndicesQueryCache.INDEX_CACHE_QUERY_ENABLED, random.nextBoolean());
    }

    if (random.nextBoolean()) {
        builder.put(IndicesQueryCache.INDICES_CACHE_QUERY_CONCURRENCY_LEVEL, RandomInts.randomIntBetween(random, 1, 32));
        builder.put(IndicesFieldDataCache.FIELDDATA_CACHE_CONCURRENCY_LEVEL, RandomInts.randomIntBetween(random, 1, 32));
        builder.put(IndicesFilterCache.INDICES_CACHE_FILTER_CONCURRENCY_LEVEL, RandomInts.randomIntBetween(random, 1, 32));
    }
    if (globalCompatibilityVersion().before(Version.V_1_3_2)) {
        // if we test against nodes before 1.3.2 we disable all the compression due to a known bug
        // see #7210
        builder.put(RecoverySettings.INDICES_RECOVERY_COMPRESS, false);
    }
    return builder;
}
 
開發者ID:salyh,項目名稱:elasticsearch-sample-plugin-audit,代碼行數:58,代碼來源:ElasticsearchIntegrationTest.java


注:本文中的org.elasticsearch.indices.store.IndicesStore類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。