@Test public void testRdsConfigsWhenHivePresentedShouldReturnWithHiveConfigs() { Set<RDSConfig> rdsConfigs = underTest .prepareRdsConfigs( mockRequestedCluster(mockRds(HIVE), mockRds(RANGER)), mockDatalakeResources(mockRds(HIVE, true))); Assert.assertEquals(2, rdsConfigs.size()); Assert.assertTrue(get(rdsConfigs, HIVE).getStatus().equals(ResourceStatus.DEFAULT)); }
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; }
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; } }
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; }  }
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; }  Set<RDSConfig> prepareRdsConfigs(Cluster requestedCluster, DatalakeResources datalakeResources); FileSystem prepareFilesytem(Cluster requestedCluster, DatalakeResources datalakeResources); }
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; }  Set<RDSConfig> prepareRdsConfigs(Cluster requestedCluster, DatalakeResources datalakeResources); FileSystem prepareFilesytem(Cluster requestedCluster, DatalakeResources datalakeResources);  }