Skip to content

Commit

Permalink
reverse
Browse files Browse the repository at this point in the history
  • Loading branch information
tristaZero committed Oct 15, 2018
1 parent 07dd8f6 commit 18ebf50
Showing 1 changed file with 2 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

package io.shardingsphere.orchestration.internal.rule;

import com.google.common.base.Predicate;
import com.google.common.collect.Iterators;
import com.google.common.eventbus.Subscribe;
import io.shardingsphere.api.config.MasterSlaveRuleConfiguration;
import io.shardingsphere.core.rule.MasterSlaveRule;
Expand Down Expand Up @@ -61,20 +59,7 @@ public Collection<String> getSlaveDataSourceNames() {
*/
@Subscribe
public void renew(final DisabledStateEventBusEvent disabledStateEventBusEvent) {
if (disabledStateEventBusEvent.getDisabledDataSourceNames().isEmpty()) {
disabledDataSourceNames.clear();
} else {
disabledDataSourceNames.addAll(disabledStateEventBusEvent.getDisabledDataSourceNames());
}
}

private boolean isToRenew(final Collection<String> disabledDataSourceNames) {
return Iterators.contains(disabledDataSourceNames.iterator(), new Predicate<String>() {

@Override
public boolean apply(final String input) {
return OrchestrationMasterSlaveRule.super.getSlaveDataSourceNames().contains(input);
}
});
disabledDataSourceNames.clear();
disabledDataSourceNames.addAll(disabledStateEventBusEvent.getDisabledDataSourceNames());
}
}

0 comments on commit 18ebf50

Please sign in to comment.