public MetricStores getMetricStores(String deploymentName) { NodeFilter filter = new NodeFilter().setDeployment(deploymentName).setMetricStores(); List<MetricStores> matching = lookupService.getMatchingNodesOfType(filter, MetricStores.class); switch (matching.size()) { case 0: MetricStores metricStores = new MetricStores(); setMetricStores(deploymentName, metricStores); return metricStores; case 1: return matching.get(0); default: throw new RuntimeException("It shouldn't be possible to have multiple metricStores nodes. This is a bug."); } }
public MetricStores getMetricStores(String deploymentName) { NodeFilter filter = new NodeFilter().setDeployment(deploymentName).setMetricStores(); List<MetricStores> matching = lookupService.getMatchingNodesOfType(filter, MetricStores.class); switch (matching.size()) { case 0: MetricStores metricStores = new MetricStores(); setMetricStores(deploymentName, metricStores); return metricStores; case 1: return matching.get(0); default: throw new RuntimeException("It shouldn't be possible to have multiple metricStores nodes. This is a bug."); } }
public ProblemSet validateMetricStores(String deploymentName) { NodeFilter filter = new NodeFilter().setDeployment(deploymentName).setMetricStores(); return validateService.validateMatchingFilter(filter); }
public ProblemSet validateMetricStores(String deploymentName) { NodeFilter filter = new NodeFilter().setDeployment(deploymentName).setMetricStores(); return validateService.validateMatchingFilter(filter); }
public ProblemSet validateMetricStore(String deploymentName, String metricStoreType) { NodeFilter filter = new NodeFilter().setDeployment(deploymentName).setMetricStores().setMetricStore(metricStoreType); return validateService.validateMatchingFilter(filter); } }
public ProblemSet validateMetricStore(String deploymentName, String metricStoreType) { NodeFilter filter = new NodeFilter().setDeployment(deploymentName).setMetricStores().setMetricStore(metricStoreType); return validateService.validateMatchingFilter(filter); } }
public MetricStore getMetricStore(String deploymentName, String metricStoreType) { NodeFilter filter = new NodeFilter().setDeployment(deploymentName).setMetricStores().setMetricStore(metricStoreType); List<MetricStore> matching = lookupService.getMatchingNodesOfType(filter, MetricStore.class); try { switch (matching.size()) { case 0: MetricStore metricStores = MetricStores.translateMetricStoreType(metricStoreType).newInstance(); setMetricStore(deploymentName, metricStores); return metricStores; case 1: return matching.get(0); default: throw new RuntimeException("It shouldn't be possible to have multiple metricStore nodes of the same type. This is a bug."); } } catch (InstantiationException | IllegalAccessException e) { throw new HalException(new ConfigProblemBuilder(Severity.FATAL, "Can't create an empty metric store node " + "for metricStore type \"" + metricStoreType + "\"").build() ); } }
public MetricStore getMetricStore(String deploymentName, String metricStoreType) { NodeFilter filter = new NodeFilter().setDeployment(deploymentName).setMetricStores().setMetricStore(metricStoreType); List<MetricStore> matching = lookupService.getMatchingNodesOfType(filter, MetricStore.class); try { switch (matching.size()) { case 0: MetricStore metricStores = MetricStores.translateMetricStoreType(metricStoreType).newInstance(); setMetricStore(deploymentName, metricStores); return metricStores; case 1: return matching.get(0); default: throw new RuntimeException("It shouldn't be possible to have multiple metricStore nodes of the same type. This is a bug."); } } catch (InstantiationException | IllegalAccessException e) { throw new HalException(new ConfigProblemBuilder(Severity.FATAL, "Can't create an empty metric store node " + "for metricStore type \"" + metricStoreType + "\"").build() ); } }