Search in sources :

Example 1 with TransportClientDefinition

use of com.pamirs.attach.plugin.es.shadowserver.rest.definition.TransportClientDefinition 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)

Aggregations

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