use of com.sequenceiq.common.api.cloudstorage.query.ConfigQueryEntry in project cloudbreak by hortonworks.
the class CmCloudStorageConfigDetailsTest method testWhenHiveMetasoreRangerAdminZeppelinRMIsPresentedAndNotAttachedThenShouldReturnWithBothConfigs.
@Test
public void testWhenHiveMetasoreRangerAdminZeppelinRMIsPresentedAndNotAttachedThenShouldReturnWithBothConfigs() {
prepareBlueprintProcessorFactoryMock(HIVE_METASTORE, RANGER_ADMIN, RESOURCEMANAGER, ZEPPELIN_SERVER, NAMENODE);
FileSystemConfigQueryObject fileSystemConfigQueryObject = FileSystemConfigQueryObject.Builder.builder().withStorageName(STORAGE_NAME).withClusterName(CLUSTER_NAME).withBlueprintText(BLUEPRINT_TEXT).withAttachedCluster(false).withFileSystemType(FileSystemType.S3.name()).build();
Set<ConfigQueryEntry> bigCluster = underTest.queryParameters(fileSystemConfigQueryObject);
Assert.assertEquals(6L, bigCluster.size());
Set<ConfigQueryEntry> rangerAdmins = serviceEntry(bigCluster, RANGER_ADMIN);
Set<ConfigQueryEntry> yarnSite = serviceEntry(bigCluster, RESOURCEMANAGER);
Set<ConfigQueryEntry> zeppelin = serviceEntry(bigCluster, ZEPPELIN_SERVER);
Set<ConfigQueryEntry> hive = serviceEntry(bigCluster, HIVE_METASTORE);
Assert.assertEquals(1, rangerAdmins.size());
Assert.assertTrue(rangerAdmins.stream().anyMatch(cqe -> cqe.getDefaultPath().equals("hwx-remote/ranger/audit")));
Assert.assertEquals(1, yarnSite.size());
Assert.assertTrue(yarnSite.stream().anyMatch(cqe -> cqe.getDefaultPath().equals("hwx-remote/bigCluster/oplogs/yarn-app-logs")));
Assert.assertEquals(1, zeppelin.size());
Assert.assertTrue(zeppelin.stream().anyMatch(cqe -> cqe.getDefaultPath().equals("hwx-remote/bigCluster/zeppelin/notebook")));
Assert.assertEquals(3, hive.size());
Assert.assertTrue(hive.stream().anyMatch(cqe -> cqe.getDefaultPath().equals("hwx-remote/warehouse/tablespace/managed/hive")));
Assert.assertTrue(hive.stream().anyMatch(cqe -> cqe.getDefaultPath().equals("hwx-remote/warehouse/tablespace/external/hive")));
}
use of com.sequenceiq.common.api.cloudstorage.query.ConfigQueryEntry in project cloudbreak by hortonworks.
the class CmCloudStorageConfigDetailsTest method testWhenAttachedClusterAndHiveMetastorePresentedThenShouldReturnWithNothing.
@Test
public void testWhenAttachedClusterAndHiveMetastorePresentedThenShouldReturnWithNothing() {
prepareBlueprintProcessorFactoryMock(HIVE_METASTORE, NAMENODE);
FileSystemConfigQueryObject fileSystemConfigQueryObject = FileSystemConfigQueryObject.Builder.builder().withStorageName(STORAGE_NAME).withClusterName(CLUSTER_NAME).withBlueprintText(BLUEPRINT_TEXT).withAttachedCluster(true).withFileSystemType(FileSystemType.S3.name()).build();
Set<ConfigQueryEntry> bigCluster = underTest.queryParameters(fileSystemConfigQueryObject);
Assert.assertEquals(0L, bigCluster.size());
}
use of com.sequenceiq.common.api.cloudstorage.query.ConfigQueryEntry in project cloudbreak by hortonworks.
the class CmCloudStorageConfigDetailsTest method testWhenNotAttachedClusterAndOnlyHiveMetastoreIsPresentedThenShouldReturnWithOnlyHiveMetastoreConfigs.
@Test
public void testWhenNotAttachedClusterAndOnlyHiveMetastoreIsPresentedThenShouldReturnWithOnlyHiveMetastoreConfigs() {
prepareBlueprintProcessorFactoryMock(HIVE_METASTORE, NAMENODE);
FileSystemConfigQueryObject fileSystemConfigQueryObject = FileSystemConfigQueryObject.Builder.builder().withStorageName(STORAGE_NAME).withClusterName(CLUSTER_NAME).withBlueprintText(BLUEPRINT_TEXT).withAttachedCluster(false).withFileSystemType(FileSystemType.S3.name()).build();
Set<ConfigQueryEntry> bigCluster = underTest.queryParameters(fileSystemConfigQueryObject);
Assert.assertEquals(3L, bigCluster.size());
Set<ConfigQueryEntry> hive = serviceEntry(bigCluster, HIVE_METASTORE);
Assert.assertEquals(3, hive.size());
Assert.assertTrue(hive.stream().map(ConfigQueryEntry::getDefaultPath).anyMatch("hwx-remote/warehouse/tablespace/managed/hive"::equals));
Assert.assertTrue(hive.stream().map(ConfigQueryEntry::getDefaultPath).anyMatch("hwx-remote/warehouse/tablespace/external/hive"::equals));
Assert.assertTrue(hive.stream().map(ConfigQueryEntry::getDefaultPath).anyMatch("hwx-remote/warehouse/tablespace/external/hive"::equals));
}
use of com.sequenceiq.common.api.cloudstorage.query.ConfigQueryEntry in project cloudbreak by hortonworks.
the class CmCloudStorageConfigDetailsTest method testBasePathWhenNoHDFSServicesWithAttachedCluster.
@Test
public void testBasePathWhenNoHDFSServicesWithAttachedCluster() {
prepareBlueprintProcessorFactoryMock();
FileSystemConfigQueryObject fileSystemConfigQueryObject = FileSystemConfigQueryObject.Builder.builder().withStorageName(STORAGE_NAME).withClusterName(CLUSTER_NAME).withBlueprintText(BLUEPRINT_TEXT).withAttachedCluster(true).withFileSystemType(FileSystemType.S3.name()).build();
Set<ConfigQueryEntry> bigCluster = underTest.queryParameters(fileSystemConfigQueryObject);
Assert.assertEquals(1L, bigCluster.size());
Set<ConfigQueryEntry> defaultFS = missingServiceEntry(bigCluster, NAMENODE);
Assert.assertEquals(1, defaultFS.size());
Assert.assertTrue(defaultFS.stream().map(ConfigQueryEntry::getDefaultPath).anyMatch("hwx-remote/bigCluster"::equals));
Assert.assertTrue(defaultFS.stream().map(ConfigQueryEntry::getPropertyName).anyMatch("core_defaultfs"::equals));
}
use of com.sequenceiq.common.api.cloudstorage.query.ConfigQueryEntry in project cloudbreak by hortonworks.
the class CmCloudStorageConfigDetailsTest method testProfilerServicesWithAttachedCluster.
@Test
public void testProfilerServicesWithAttachedCluster() {
prepareBlueprintProcessorFactoryMock(DATA_DISCOVERY_SERVICE_AGENT, PROFILER_ADMIN_AGENT, PROFILER_METRICS_AGENT, PROFILER_SCHEDULER_AGENT, NAMENODE);
FileSystemConfigQueryObject fileSystemConfigQueryObject = FileSystemConfigQueryObject.Builder.builder().withStorageName(STORAGE_NAME).withClusterName(CLUSTER_NAME).withBlueprintText(BLUEPRINT_TEXT).withAttachedCluster(true).withFileSystemType(FileSystemType.S3.name()).build();
Set<ConfigQueryEntry> bigCluster = underTest.queryParameters(fileSystemConfigQueryObject);
Assert.assertEquals(1L, bigCluster.size());
Set<ConfigQueryEntry> dataDiscoveryService = serviceEntry(bigCluster, DATA_DISCOVERY_SERVICE_AGENT);
Set<ConfigQueryEntry> profilerAdmin = serviceEntry(bigCluster, PROFILER_ADMIN_AGENT);
Set<ConfigQueryEntry> profilerMetrics = serviceEntry(bigCluster, PROFILER_METRICS_AGENT);
Set<ConfigQueryEntry> profilerScheduler = serviceEntry(bigCluster, PROFILER_SCHEDULER_AGENT);
Assert.assertEquals(1, dataDiscoveryService.size());
Assert.assertTrue(dataDiscoveryService.stream().map(ConfigQueryEntry::getDefaultPath).anyMatch("hwx-remote/dpprofiler"::equals));
Assert.assertTrue(dataDiscoveryService.stream().map(ConfigQueryEntry::getPropertyName).anyMatch("file_system_uri"::equals));
Assert.assertEquals(1, profilerAdmin.size());
Assert.assertTrue(profilerAdmin.stream().map(ConfigQueryEntry::getDefaultPath).anyMatch("hwx-remote/dpprofiler"::equals));
Assert.assertTrue(profilerAdmin.stream().map(ConfigQueryEntry::getPropertyName).anyMatch("file_system_uri"::equals));
Assert.assertEquals(1, profilerMetrics.size());
Assert.assertTrue(profilerMetrics.stream().map(ConfigQueryEntry::getDefaultPath).anyMatch("hwx-remote/dpprofiler"::equals));
Assert.assertTrue(profilerMetrics.stream().map(ConfigQueryEntry::getPropertyName).anyMatch("file_system_uri"::equals));
Assert.assertEquals(1, profilerScheduler.size());
Assert.assertTrue(profilerScheduler.stream().map(ConfigQueryEntry::getDefaultPath).anyMatch("hwx-remote/dpprofiler"::equals));
Assert.assertTrue(profilerScheduler.stream().map(ConfigQueryEntry::getPropertyName).anyMatch("file_system_uri"::equals));
}
Aggregations