use of com.ctrip.platform.dal.dao.datasource.cluster.strategy.RouteStrategy in project dal by ctripcorp.
the class MultiHostClusterPropertiesAdapterTest method setUp.
@Before
public void setUp() throws Exception {
mgrRouteStrategyConfig = new ClusterRouteStrategyConfig() {
@Override
public RouteStrategy generate() {
return doGenerate(routeStrategyName());
}
@Override
public String routeStrategyName() {
return RouteStrategyEnum.WRITE_ORDERED.name();
}
@Override
public boolean multiMaster() {
return true;
}
@Override
public CaseInsensitiveProperties routeStrategyProperties() {
return null;
}
};
obRouteStrategyConfig = new ClusterRouteStrategyConfig() {
@Override
public RouteStrategy generate() {
return doGenerate(routeStrategyName());
}
@Override
public String routeStrategyName() {
return RouteStrategyEnum.WRITE_CURRENT_ZONE_FIRST.getAlias();
}
@Override
public boolean multiMaster() {
return true;
}
@Override
public CaseInsensitiveProperties routeStrategyProperties() {
return null;
}
};
customRouteStrategyConfig = new ClusterRouteStrategyConfig() {
@Override
public RouteStrategy generate() {
return doGenerate(routeStrategyName());
}
@Override
public String routeStrategyName() {
return CUSTOM_STRATEGY;
}
@Override
public boolean multiMaster() {
return false;
}
@Override
public CaseInsensitiveProperties routeStrategyProperties() {
return null;
}
};
}
Aggregations