public String getActualDataSourceName ( final String actualTableName ) { Optional < TableRule > tableRule = findTableRuleByActualTable ( actualTableName ) ; if ( tableRule . isPresent ( ) ) { return tableRule . get ( ) . getActualDatasourceNames ( ) . iterator ( ) . next ( ) ; } if ( ! Strings . isNullOrEmpty ( shardingDataSourceNames . getDefaultDataSourceName ( ) ) ) { return shardingDataSourceNames . getDefaultDataSourceName ( ) ; } throw new ShardingException ( "Cannot found actual data source name of '%s' in sharding rule." , actualTableName ) ; }
Get actual data source name .