use of com.ctrip.platform.dal.dao.datasource.log.SqlContext in project dal by ctripcorp.
the class ClusterDataSource method createSqlContext.
@Override
protected SqlContext createSqlContext() {
SqlContext context = id.createSqlContext();
if (context instanceof ClusterDbSqlContext) {
((ClusterDbSqlContext) context).populateShard(getShardIndex());
((ClusterDbSqlContext) context).populateRole(DatabaseRole.MASTER);
}
return context;
}
Aggregations