• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java UpdateSettingsResponse类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: indexConfig

import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsResponse; //导入依赖的package包/类
/**
 * 索引的相关操作
 *
 * @param indicesAdminClient
 * @param indexName
 * @throws IOException
 */
private static void indexConfig(IndicesAdminClient indicesAdminClient, String indexName) throws IOException {
    //settings 设置
    String settings = getIndexSetting();
    // PUT /my_temp_index/_settings updatesettings
    showIndexSettings(indicesAdminClient,indexName);
    UpdateSettingsResponse updateSettingsResponse = indicesAdminClient.prepareUpdateSettings(indexName).setSettings(settings).execute().actionGet();
    log.info("更新 index setting:{}", updateSettingsResponse);


    //更新索引settings之前要关闭索引
    indicesAdminClient.close(new CloseIndexRequest().indices(indexName)).actionGet();
    //配置拼音自定义分析器
    indicesAdminClient.prepareUpdateSettings(indexName).setSettings(getIndexPinYinSetting()).execute().actionGet();
    //自定义分析器
    indicesAdminClient.prepareUpdateSettings(indexName).setSettings(getIndexDemoSetting()).execute().actionGet();
    //打开索引
    indicesAdminClient.open(new OpenIndexRequest().indices(indexName)).actionGet();

    //索引别名映射
    createAliasIndex(indicesAdminClient);

    showIndexSettings(indicesAdminClient,indexName);
}
 
开发者ID:ggj2010,项目名称:javabase,代码行数:31,代码来源:CrudDemo.java


示例2: setIndexReadOnly

import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsResponse; //导入依赖的package包/类
private void setIndexReadOnly(String index, Object value) {
    HashMap<String, Object> newSettings = new HashMap<>();
    newSettings.put(IndexMetaData.SETTING_READ_ONLY, value);

    UpdateSettingsRequestBuilder settingsRequest = client().admin().indices().prepareUpdateSettings(index);
    settingsRequest.setSettings(newSettings);
    UpdateSettingsResponse settingsResponse = settingsRequest.execute().actionGet();
    assertThat(settingsResponse, notNullValue());
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:10,代码来源:SimpleBlocksIT.java


示例3: alterBlobTable

import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsResponse; //导入依赖的package包/类
/**
 * can be used to alter the number of replicas.
 *
 * @param tableName name of the blob table
 * @param indexSettings updated index settings
 */
public ListenableFuture<Void> alterBlobTable(String tableName, Settings indexSettings) {
    final SettableFuture<Void> result = SettableFuture.create();
    ActionListener<UpdateSettingsResponse> listener = ActionListeners.wrap(result, Functions.<Void>constant(null));
    transportUpdateSettingsActionProvider.get().execute(
        new UpdateSettingsRequest(indexSettings, fullIndexName(tableName)), listener);
    return result;
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:14,代码来源:BlobIndices.java


示例4: updateSettings

import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsResponse; //导入依赖的package包/类
private ListenableFuture<Long> updateSettings(TableParameter concreteTableParameter, String... indices) {
    if (concreteTableParameter.settings().getAsMap().isEmpty() || indices.length == 0) {
        return Futures.immediateFuture(null);
    }
    UpdateSettingsRequest request = new UpdateSettingsRequest(concreteTableParameter.settings(), indices);
    request.indicesOptions(IndicesOptions.lenientExpandOpen());

    SettableFuture<Long> result = SettableFuture.create();
    transportActionProvider.transportUpdateSettingsAction().execute(request,
            new SettableFutureToNullActionListener<UpdateSettingsResponse>(result));
    return result;
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:13,代码来源:AlterTableOperation.java


示例5: updateIndexSetting

import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsResponse; //导入依赖的package包/类
/**
 * updateIndexSetting
 * 
 * @param index
 * @param set
 * @return
 */
public boolean updateIndexSetting(String index, Map<String, Object> set) {

    try {
        UpdateSettingsResponse usr = client.admin().indices().prepareUpdateSettings(index).setSettings(set).get();
        return usr.isAcknowledged();
    }
    catch (Exception e) {
        return false;
    }
}
 
开发者ID:uavorg,项目名称:uavstack,代码行数:18,代码来源:ESClient.java


示例6: testPutSettings

import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsResponse; //导入依赖的package包/类
@Test
public void testPutSettings() {
    createIndex("the_index");
    String settings = "" +
            "{\n" +
            "  \"number_of_replicas\": 1\n" +
            "}" +
            "";
    UpdateSettingsResponse response = operations.putSettings(settings, "the_index").actionGet();
    Assertions.assertThat(response.isAcknowledged()).isTrue();
}
 
开发者ID:obourgain,项目名称:elasticsearch-batch,代码行数:12,代码来源:ElasticsearchBatchOperationsAsyncTest.java


示例7: updateSettings

import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsResponse; //导入依赖的package包/类
@Override
public ActionFuture<UpdateSettingsResponse> updateSettings(final UpdateSettingsRequest request) {
    return execute(UpdateSettingsAction.INSTANCE, request);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:5,代码来源:AbstractClient.java


示例8: testUpdateSettingsNoAcknowledgement

import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsResponse; //导入依赖的package包/类
public void testUpdateSettingsNoAcknowledgement() {
    createIndex("test");
    UpdateSettingsResponse updateSettingsResponse = client().admin().indices().prepareUpdateSettings("test").setTimeout("0s")
            .setSettings(Settings.builder().put("refresh_interval", 9999, TimeUnit.MILLISECONDS)).get();
    assertThat(updateSettingsResponse.isAcknowledged(), equalTo(false));
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:7,代码来源:AckIT.java


示例9: disableRefresh

import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsResponse; //导入依赖的package包/类
public ActionFuture<UpdateSettingsResponse> disableRefresh(String... indices) {
    logger.trace("Disabling refresh on {}", Arrays.asList(indices));
    return updateSettings(Collections.singletonMap("refresh_interval", "-1"), indices);
}
 
开发者ID:obourgain,项目名称:elasticsearch-batch,代码行数:5,代码来源:ElasticsearchBatchOperationsAsync.java


示例10: setRefreshInterval

import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsResponse; //导入依赖的package包/类
public ActionFuture<UpdateSettingsResponse> setRefreshInterval(String refreshInterval, String... indices) {
    logger.trace("Set refresh to {} on {}", refreshInterval, Arrays.asList(indices));
    return updateSettings(Collections.singletonMap("refresh_interval", refreshInterval), indices);
}
 
开发者ID:obourgain,项目名称:elasticsearch-batch,代码行数:5,代码来源:ElasticsearchBatchOperationsAsync.java


示例11: disableReplicas

import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsResponse; //导入依赖的package包/类
public ActionFuture<UpdateSettingsResponse> disableReplicas(String... indices) {
    logger.trace("Disabling replicas on {}", Arrays.asList(indices));
    return updateSettings(Collections.singletonMap("number_of_replicas", "0"), indices);
}
 
开发者ID:obourgain,项目名称:elasticsearch-batch,代码行数:5,代码来源:ElasticsearchBatchOperationsAsync.java


示例12: setReplicas

import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsResponse; //导入依赖的package包/类
public ActionFuture<UpdateSettingsResponse> setReplicas(int replicas, String... indices) {
    logger.trace("Set replicas to {} on {}", replicas, Arrays.asList(indices));
    return updateSettings(Collections.singletonMap("number_of_replicas", String.valueOf(replicas)), indices);
}
 
开发者ID:obourgain,项目名称:elasticsearch-batch,代码行数:5,代码来源:ElasticsearchBatchOperationsAsync.java


示例13: updateSettings

import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsResponse; //导入依赖的package包/类
public ActionFuture<UpdateSettingsResponse> updateSettings(Map<String, String> settings, String... indices) {
    logger.trace("Update settings with {} on {}", settings, Arrays.asList(indices));
    return client.admin().indices()
            .updateSettings(Requests.updateSettingsRequest(indices)
                    .settings(settings));
}
 
开发者ID:obourgain,项目名称:elasticsearch-batch,代码行数:7,代码来源:ElasticsearchBatchOperationsAsync.java


示例14: putSettings

import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsResponse; //导入依赖的package包/类
public ActionFuture<UpdateSettingsResponse> putSettings(String settingsSource, String index) {
    logger.trace("Put settings with {} on {}", settingsSource, index);
    return client.admin().indices()
            .updateSettings(Requests.updateSettingsRequest(index)
                    .settings(settingsSource));
}
 
开发者ID:obourgain,项目名称:elasticsearch-batch,代码行数:7,代码来源:ElasticsearchBatchOperationsAsync.java


示例15: updateSettings

import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsResponse; //导入依赖的package包/类
public void updateSettings(String index, String settings) throws Exception {
  UpdateSettingsRequestBuilder builder = client.admin().indices().prepareUpdateSettings(index);
  builder.setSettings(settings);
  UpdateSettingsResponse response = builder.execute().actionGet();
}
 
开发者ID:DemandCube,项目名称:NeverwinterDP-Commons,代码行数:6,代码来源:ESClient.java


示例16: updateSettings

import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsResponse; //导入依赖的package包/类
/**
 * Updates settings of one or more indices.
 *
 * @param request the update settings request
 * @return The result future
 */
ActionFuture<UpdateSettingsResponse> updateSettings(UpdateSettingsRequest request);
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:8,代码来源:IndicesAdminClient.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java EntityResolver2Wrapper类代码示例发布时间:2022-05-23
下一篇:
Java KeyType类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap