Skip to content

Commit

Permalink
Refactor ShadowDataSourceMappingsFinderFactory
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu committed Nov 3, 2024
1 parent d9c9ccc commit dcf8d8c
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,7 @@ public final class ShadowSQLRouter implements DecorateSQLRouter<ShadowRule> {
@Override
public void decorateRouteContext(final RouteContext routeContext, final QueryContext queryContext, final ShardingSphereDatabase database,
final ShadowRule rule, final ConfigurationProperties props) {
route(routeContext, rule, ShadowDataSourceMappingsFinderFactory.newInstance(queryContext));
}

private void route(final RouteContext routeContext, final ShadowRule rule, final ShadowDataSourceMappingsFinder finder) {
final ShadowDataSourceMappingsFinder finder = ShadowDataSourceMappingsFinderFactory.newInstance(queryContext);
Collection<RouteUnit> toBeRemovedRouteUnit = new LinkedList<>();
Collection<RouteUnit> toBeAddedRouteUnit = new LinkedList<>();
Map<String, String> shadowDataSourceMappings = finder.find(rule);
Expand Down

0 comments on commit dcf8d8c

Please sign in to comment.