code: public static DataSource createDataSource(final File yamlFile) throws SQLException, IOException {
          YamlRootMasterSlaveConfiguration config = YamlEngine.unmarshal(yamlFile, YamlRootMasterSlaveConfiguration.class);
          return MasterSlaveDataSourceFactory.createDataSource(config.getDataSources(), new MasterSlaveRuleConfigurationYamlSwapper().swap(config.getMasterSlaveRule()), config.getProps());
      }
docs: Create master-slave data source.
  
  @param yamlFile YAML file for master-slave rule configuration with data sources
  @return master-slave data source
  @throws SQLException SQL exception
  @throws IOException IO exception