AdvancedDcMetaService implements DcMetaService { @Override public DcMeta getDcMeta(String dcName) { return getDcMeta(dcName, consoleConfig.getOwnClusterType()); }  @PostConstruct void initService(); @Override DcMeta getDcMeta(String dcName); @Override DcMeta getDcMeta(String dcName, Set<String> allowTypes); AdvancedDcMetaService setScheduled(ScheduledExecutorService scheduled); AdvancedDcMetaService setExecutors(ExecutorService executors); AdvancedDcMetaService setFactory(RetryCommandFactory factory);  }
@Test public void testGetDcMeta() { long start = System.currentTimeMillis(); DcMeta dcMeta = service.getDcMeta("jq"); long end = System.currentTimeMillis(); logger.info("[durationMilli] {}", end - start); logger.info("[]{}", dcMeta); }
@Test public void testGetDcMeta2() { long start = System.currentTimeMillis(); for(int i = 0; i < 100; i++) { dcMetaService.getDcMeta(dcNames[(1&i)]); } long end = System.currentTimeMillis(); logger.info("[durationMilli] {}", (end - start)/100); }
@Test public void testClusterOrgInfo() { List<ClusterTbl> clusterTbls = clusterService.findAllClustersWithOrgInfo(); logger.info("{}", clusterTbls.size()); ClusterTbl clusterTbl = clusterTbls.get(0); clusterTbl.setClusterOrgId(3); clusterService.update(clusterTbl); logger.info("{}", clusterService.find(clusterTbl.getId())); DcMeta dcMeta = service.getDcMeta("jq"); List<ClusterMeta> clusters = Lists.newArrayList(dcMeta.getClusters().values()); logger.info("{}", clusters.get(0)); Assert.assertNotNull(clusters.get(0).getOrgId()); Assert.assertTrue(3 == clusters.get(0).getOrgId()); }
@Ignore @Test public void testHangForever() { dcMetaService.getDcMeta("jq"); }