class RemoteDataContextWorkaroundService {

    public Set<RDSConfig> prepareRdsConfigs(Cluster requestedCluster, DatalakeResources datalakeResources) {
        Set<RDSConfig> rdsConfigsWithoutHive = requestedCluster.getRdsConfigs();
        Set<RDSConfig> hiveDbfromSdx = datalakeResources.getRdsConfigs()
                .stream()
                .filter(this::isActiveHiveMetastoreDatabase)
                .collect(toSet());
        if (isHivePresentedInSdx(hiveDbfromSdx)) {
            rdsConfigsWithoutHive = requestedCluster.getRdsConfigs()
                    .stream()
                    .filter(rdsConfig -> !isHiveMetastoreDatabase(rdsConfig))
                    .collect(toSet());
        }
        rdsConfigsWithoutHive.addAll(hiveDbfromSdx);
        return rdsConfigsWithoutHive;
    }

}