static boolean disableDataSource(SQLMetadataConnector connector,
      final MetadataStorageTablesConfig metadataStorageTablesConfig,
      final String dataSource) {
    try {
      if (!getAllDataSourceNames(connector, metadataStorageTablesConfig).contains(dataSource)) {
        LOG.warn("Cannot delete data source {}, does not exist", dataSource);
        return false;
      }

      connector.getDBI().withHandle((HandleCallback<Void>) handle -> {
        disableDataSourceWithHandle(handle, metadataStorageTablesConfig, dataSource);
        return null;
      });

    } catch (Exception e) {
      LOG.error(String.format("Error removing dataSource %s", dataSource), e);
      return false;
    }
    return true;
  }
@param connector                   SQL connector to metadata
@param metadataStorageTablesConfig Tables configuration
@param dataSource                  Name of data source
@return true if the data source was successfully disabled false otherwise
druid-handler/src/java/org/apache/hadoop/hive/druid/DruidStorageHandlerUtils.java