private static AbstractCanaryServiceIntegration getServiceIntegrationByClass(Canary canary, Class<? extends AbstractCanaryServiceIntegration> serviceIntegrationClass) { return canary.getServiceIntegrations() .stream() .filter(s -> serviceIntegrationClass.isAssignableFrom(s.getClass())) .findFirst() .orElseThrow(() -> new IllegalArgumentException("Canary service integration of type " + serviceIntegrationClass.getSimpleName() + " not found.")); } }
public static AbstractCanaryServiceIntegration getServiceIntegrationByClass(Canary canary, Class<? extends AbstractCanaryServiceIntegration> serviceIntegrationClass) { return canary.getServiceIntegrations() .stream() .filter(s -> serviceIntegrationClass.isAssignableFrom(s.getClass())) .findFirst() .orElseThrow(() -> new IllegalArgumentException("Canary service integration of type " + serviceIntegrationClass.getSimpleName() + " not found.")); }
private static AbstractCanaryServiceIntegration getServiceIntegrationByClass(Canary canary, Class<? extends AbstractCanaryServiceIntegration> serviceIntegrationClass) { return canary.getServiceIntegrations() .stream() .filter(s -> serviceIntegrationClass.isAssignableFrom(s.getClass())) .findFirst() .orElseThrow(() -> new IllegalArgumentException("Canary service integration of type " + serviceIntegrationClass.getSimpleName() + " not found.")); } }
public static AbstractCanaryServiceIntegration getServiceIntegrationByClass(Canary canary, Class<? extends AbstractCanaryServiceIntegration> serviceIntegrationClass) { return canary.getServiceIntegrations() .stream() .filter(s -> serviceIntegrationClass.isAssignableFrom(s.getClass())) .findFirst() .orElseThrow(() -> new IllegalArgumentException("Canary service integration of type " + serviceIntegrationClass.getSimpleName() + " not found.")); }
private AbstractCanaryServiceIntegration getServiceIntegration(String deploymentName, String serviceIntegrationName) { Canary canary = canaryService.getCanary(deploymentName); return canary.getServiceIntegrations() .stream() .filter(s -> s.getName().equals(serviceIntegrationName)) .findFirst() .orElseThrow(() -> new IllegalArgumentException("Canary service integration " + serviceIntegrationName + " not found.")); }
private AbstractCanaryServiceIntegration getServiceIntegration(String deploymentName, String serviceIntegrationName) { Canary canary = canaryService.getCanary(deploymentName); return canary.getServiceIntegrations() .stream() .filter(s -> s.getName().equals(serviceIntegrationName)) .findFirst() .orElseThrow(() -> new IllegalArgumentException("Canary service integration " + serviceIntegrationName + " not found.")); }
public static AbstractCanaryServiceIntegration getServiceIntegrationByName(Canary canary, String currentDeployment, String serviceIntegrationName, boolean noValidate) { if (canary == null) { canary = new OperationHandler<Canary>() .setFailureMesssage("Failed to get canary.") .setOperation(Daemon.getCanary(currentDeployment, !noValidate)) .get(); } return canary.getServiceIntegrations() .stream() .filter(s -> s.getName().equals(serviceIntegrationName.toLowerCase())) .findFirst() .orElseThrow(() -> new IllegalArgumentException("Canary service integration " + serviceIntegrationName + " not found.")); } }
public static AbstractCanaryServiceIntegration getServiceIntegrationByName(Canary canary, String currentDeployment, String serviceIntegrationName, boolean noValidate) { if (canary == null) { canary = new OperationHandler<Canary>() .setFailureMesssage("Failed to get canary.") .setOperation(Daemon.getCanary(currentDeployment, !noValidate)) .get(); } return canary.getServiceIntegrations() .stream() .filter(s -> s.getName().equals(serviceIntegrationName.toLowerCase())) .findFirst() .orElseThrow(() -> new IllegalArgumentException("Canary service integration " + serviceIntegrationName + " not found.")); } }
Set<String> accounts = new HashSet<>(); for (AbstractCanaryServiceIntegration svc : n.getServiceIntegrations()) { for (AbstractCanaryAccount account : (List<AbstractCanaryAccount>)svc.getAccounts()) { if (accounts.contains(account.getName())) { for (AbstractCanaryServiceIntegration s : n.getServiceIntegrations()) { if (s instanceof GoogleCanaryServiceIntegration) { GoogleCanaryServiceIntegration googleCanaryServiceIntegration = (GoogleCanaryServiceIntegration)s;
KayentaConfig(Canary canary) { for (AbstractCanaryServiceIntegration svc : canary.getServiceIntegrations()) { if (svc instanceof GoogleCanaryServiceIntegration) { GoogleCanaryServiceIntegration googleSvc = (GoogleCanaryServiceIntegration)svc; google = new GoogleConfig(googleSvc); stackdriver = new StackdriverConfig(googleSvc); gcs = new GcsConfig(googleSvc); } else if (svc instanceof PrometheusCanaryServiceIntegration) { PrometheusCanaryServiceIntegration prometheusSvc = (PrometheusCanaryServiceIntegration)svc; prometheus = new PrometheusConfig(prometheusSvc); } else if (svc instanceof DatadogCanaryServiceIntegration) { DatadogCanaryServiceIntegration datadogSvc = (DatadogCanaryServiceIntegration)svc; datadog = new DatadogConfig(datadogSvc); } else if (svc instanceof AwsCanaryServiceIntegration) { AwsCanaryServiceIntegration awsSvc = (AwsCanaryServiceIntegration)svc; aws = new AwsConfig(awsSvc); s3 = new S3Config(awsSvc); } else if (svc instanceof SignalfxCanaryServiceIntegration) { SignalfxCanaryServiceIntegration signalfxSvc = (SignalfxCanaryServiceIntegration)svc; signalfx = new SignalFxConfig(signalfxSvc); } } }
KayentaConfig(Canary canary) { for (AbstractCanaryServiceIntegration svc : canary.getServiceIntegrations()) { if (svc instanceof GoogleCanaryServiceIntegration) { GoogleCanaryServiceIntegration googleSvc = (GoogleCanaryServiceIntegration)svc; google = new GoogleConfig(googleSvc); stackdriver = new StackdriverConfig(googleSvc); gcs = new GcsConfig(googleSvc); } else if (svc instanceof PrometheusCanaryServiceIntegration) { PrometheusCanaryServiceIntegration prometheusSvc = (PrometheusCanaryServiceIntegration)svc; prometheus = new PrometheusConfig(prometheusSvc); } else if (svc instanceof DatadogCanaryServiceIntegration) { DatadogCanaryServiceIntegration datadogSvc = (DatadogCanaryServiceIntegration)svc; datadog = new DatadogConfig(datadogSvc); } else if (svc instanceof AwsCanaryServiceIntegration) { AwsCanaryServiceIntegration awsSvc = (AwsCanaryServiceIntegration)svc; aws = new AwsConfig(awsSvc); s3 = new S3Config(awsSvc); } else if (svc instanceof SignalfxCanaryServiceIntegration) { SignalfxCanaryServiceIntegration signalfxSvc = (SignalfxCanaryServiceIntegration)svc; signalfx = new SignalFxConfig(signalfxSvc); } } }
Set<String> accounts = new HashSet<>(); for (AbstractCanaryServiceIntegration svc : n.getServiceIntegrations()) { for (AbstractCanaryAccount account : (List<AbstractCanaryAccount>)svc.getAccounts()) { if (accounts.contains(account.getName())) { for (AbstractCanaryServiceIntegration s : n.getServiceIntegrations()) { if (s instanceof GoogleCanaryServiceIntegration) { GoogleCanaryServiceIntegration googleCanaryServiceIntegration = (GoogleCanaryServiceIntegration)s;