Search in sources :

Example 1 with IsolationServerListFilter

use of io.servicecomb.loadbalance.filter.IsolationServerListFilter in project java-chassis by ServiceComb.

the class LoadbalanceHandler method setIsolationFilter.

protected void setIsolationFilter(LoadBalancer lb, Invocation invocation) {
    final String filterName = IsolationServerListFilter.class.getName();
    boolean isIsolationOpen = Configuration.INSTANCE.isIsolationFilterOpen(invocation.getMicroserviceName());
    if (!isIsolationOpen) {
        lb.removeFilter(filterName);
        return;
    }
    if (lb.containsFilter(filterName)) {
        return;
    }
    IsolationServerListFilter isolationListFilter = new IsolationServerListFilter();
    isolationListFilter.setMicroserviceName(invocation.getMicroserviceName());
    isolationListFilter.setLoadBalancerStats(lb.getLoadBalancerStats());
    lb.putFilter(filterName, isolationListFilter);
}
Also used : IsolationServerListFilter(io.servicecomb.loadbalance.filter.IsolationServerListFilter)

Aggregations

IsolationServerListFilter (io.servicecomb.loadbalance.filter.IsolationServerListFilter)1