public static DataSourceProvider tryGetDataSourceProviderOrNull(Configuration hdpConfig) {
    final String configuredPoolingType = MetastoreConf.getVar(hdpConfig,
        MetastoreConf.ConfVars.CONNECTION_POOLING_TYPE);
    return Iterables.tryFind(FACTORIES, factory -> {
      String poolingType = factory.getPoolingType();
      return poolingType != null && poolingType.equalsIgnoreCase(configuredPoolingType);
    }).orNull();
  }
The data source providers declare if they are supported or not based on the config.
This function looks through all the data source providers and picks the first one which is
supported. If no data source provider is found, returns a null.

@param hdpConfig hadoop configuration
@return factory for the configured datanucleus.connectionPoolingType or null if no supported
        data source providers are found.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/datasource/DataSourceProviderFactory.java