Search in sources :

Example 1 with ClusterGetSettingsRequest

use of org.elasticsearch.action.admin.cluster.settings.ClusterGetSettingsRequest in project pancm_project by xuwujing.

the class EsHighLevelCluster method clusterGetSetting.

/**
 * @return void
 * @Author pancm
 * @Description 设获取集群的设置情况
 * @Date 2020/1/2
 * @Param [index]
 */
public static void clusterGetSetting() throws IOException {
    ClusterGetSettingsRequest request = new ClusterGetSettingsRequest();
    ClusterGetSettingsResponse response = client.cluster().getSettings(request, RequestOptions.DEFAULT);
    Settings setting = response.getPersistentSettings();
    Settings setting2 = response.getTransientSettings();
    logger.info("setting:{}", setting);
    logger.info("setting2:{}", setting2);
}
Also used : ClusterGetSettingsResponse(org.elasticsearch.action.admin.cluster.settings.ClusterGetSettingsResponse) ClusterGetSettingsRequest(org.elasticsearch.action.admin.cluster.settings.ClusterGetSettingsRequest) RecoverySettings(org.elasticsearch.indices.recovery.RecoverySettings) Settings(org.elasticsearch.common.settings.Settings)

Example 2 with ClusterGetSettingsRequest

use of org.elasticsearch.action.admin.cluster.settings.ClusterGetSettingsRequest in project graylog2-server by Graylog2.

the class ClusterAdapterES7 method clusterAllocationDiskSettings.

@Override
public ClusterAllocationDiskSettings clusterAllocationDiskSettings() {
    final ClusterGetSettingsRequest request = new ClusterGetSettingsRequest();
    request.includeDefaults(true);
    final ClusterGetSettingsResponse response = client.execute((c, requestOptions) -> c.cluster().getSettings(request, requestOptions));
    return ClusterAllocationDiskSettingsFactory.create(Boolean.parseBoolean(response.getSetting("cluster.routing.allocation.disk.threshold_enabled")), response.getSetting("cluster.routing.allocation.disk.watermark.low"), response.getSetting("cluster.routing.allocation.disk.watermark.high"), response.getSetting("cluster.routing.allocation.disk.watermark.flood_stage"));
}
Also used : ClusterGetSettingsResponse(org.graylog.shaded.elasticsearch7.org.elasticsearch.action.admin.cluster.settings.ClusterGetSettingsResponse) ClusterGetSettingsRequest(org.graylog.shaded.elasticsearch7.org.elasticsearch.action.admin.cluster.settings.ClusterGetSettingsRequest)

Aggregations

ClusterGetSettingsRequest (org.elasticsearch.action.admin.cluster.settings.ClusterGetSettingsRequest)1 ClusterGetSettingsResponse (org.elasticsearch.action.admin.cluster.settings.ClusterGetSettingsResponse)1 Settings (org.elasticsearch.common.settings.Settings)1 RecoverySettings (org.elasticsearch.indices.recovery.RecoverySettings)1 ClusterGetSettingsRequest (org.graylog.shaded.elasticsearch7.org.elasticsearch.action.admin.cluster.settings.ClusterGetSettingsRequest)1 ClusterGetSettingsResponse (org.graylog.shaded.elasticsearch7.org.elasticsearch.action.admin.cluster.settings.ClusterGetSettingsResponse)1