Search in sources :

Example 1 with ShadowEsServerConfig

use of com.pamirs.pradar.internal.config.ShadowEsServerConfig in project LinkAgent by shulieTech.

the class ShadowEsClientHolder method createShadowTransportClient.

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

Example 2 with ShadowEsServerConfig

use of com.pamirs.pradar.internal.config.ShadowEsServerConfig 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

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