Search in sources :

Example 1 with RestClientDefinition

use of com.pamirs.attach.plugin.es.shadowserver.rest.definition.RestClientDefinition in project LinkAgent by shulieTech.

the class ShadowEsClientHolder method createShadowRestClient.

private static RestClient createShadowRestClient(RestClient target) {
    List<String> nodesAddressAsString = getNodesAddressAsString(target);
    ShadowEsServerConfig shadowEsServerConfig = findMatchShadowEsServerConfig(nodesAddressAsString);
    if (shadowEsServerConfig == null) {
        throw new PressureMeasureError(String.format("影子集群未配置,业务节点:%s", StringUtils.join(nodesAddressAsString, ",")));
    }
    RestClientDefinition restClientDefinition = RestClientDefinitionStrategy.match(target);
    return restClientDefinition.solve(target, shadowEsServerConfig);
}
Also used : ShadowEsServerConfig(com.pamirs.pradar.internal.config.ShadowEsServerConfig) PressureMeasureError(com.pamirs.pradar.exception.PressureMeasureError) RestClientDefinition(com.pamirs.attach.plugin.es.shadowserver.rest.definition.RestClientDefinition)

Aggregations

RestClientDefinition (com.pamirs.attach.plugin.es.shadowserver.rest.definition.RestClientDefinition)1 PressureMeasureError (com.pamirs.pradar.exception.PressureMeasureError)1 ShadowEsServerConfig (com.pamirs.pradar.internal.config.ShadowEsServerConfig)1