Check if all task of a service are correctly distributed in all datacenters of the cluster

@param serviceList all task deployed in the cluster separated by a semicolumn.
@throws Exception
168286
@Given("^services '(.*?)' are splitted correctly in datacenters$")
    public void checkServicesDistributionMultiDataCenter(String serviceList) throws Exception {
        commonspec.executeCommand("dcos node --json >> aux.txt", 0, null);
        commonspec.executeCommand("cat aux.txt", 0, null);
        checkDataCentersDistribution(serviceList.split(","), obtainsDataCenters(commonspec.getRemoteSSHConnection().getResult()).split(";"));
        commonspec.executeCommand("rm -rf aux.txt", 0, null);

    }
488289
protected void checkThatStreamingServiceIsEnabled(String spaceId, String taskName) {
        // Verify that streaming is enabled
        Map<String, String> spaceProperties = s3Provider.getSpaceProperties(spaceId);
        if (!spaceProperties.containsKey(HLS_STREAMING_HOST_PROP)) {
            throw new UnsupportedTaskException(
                taskName,
                "The " + taskName + " task can only be used after a space " +
                "has been configured to enable HLS streaming. Use " +
                StorageTaskConstants.ENABLE_HLS_TASK_NAME +
                " to enable HLS streaming on this space.");
        }
    }
341169
public ServiceFuture<List<ClusterInner>> listAsync(final ServiceCallback<List<ClusterInner>> serviceCallback) {
        return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback);
    }
999249
private boolean isServiceSupportedInRegion(String serviceName) {
        return partition.getServices().get(serviceName) != null
                && partition.getServices().get(serviceName).getEndpoints()
                .containsKey(region);
    }
731145
func (_m *APIClient) ServiceList(ctx context.Context, options types.ServiceListOptions) ([]swarm.Service, error) {
	ret := _m.Called(ctx, options)

	var r0 []swarm.Service
	if rf, ok := ret.Get(0).(func(context.Context, types.ServiceListOptions) []swarm.Service); ok {
		r0 = rf(ctx, options)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).([]swarm.Service)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(context.Context, types.ServiceListOptions) error); ok {
		r1 = rf(ctx, options)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
455837
public static List<ModelServiceInstance> filter(ServiceInstanceQuery query, List<ModelServiceInstance> list) {

        List<ModelServiceInstance> instances = new ArrayList<ModelServiceInstance>();
        for (ModelServiceInstance instance : list) {
            boolean passed = true;
            for (QueryCriterion criterion : query.getCriteria()) {
                if (criterion.isMatch(instance.getMetadata()) == false) {
                    passed = false;
                    break;
                }
            }
            if (passed) {
                instances.add(instance);
            }
        }
        return instances;

    }
816845
public void setPipelineDescriptionList(java.util.Collection<PipelineDescription> pipelineDescriptionList) {
        if (pipelineDescriptionList == null) {
            this.pipelineDescriptionList = null;
            return;
        }

        this.pipelineDescriptionList = new com.amazonaws.internal.SdkInternalList<PipelineDescription>(pipelineDescriptionList);
    }
411411
@Override
	public void started(ServiceBroker broker) throws Exception {
		super.started(broker);

		// Set components
		ServiceBrokerConfig cfg = broker.getConfig();
		this.transporter = cfg.getTransporter();
		this.monitor = cfg.getMonitor();
		
		// Set local nodeID
		this.localNodeID = broker.getNodeID();
	}
307905
public function setServiceList($serviceList = [])
    {
        if (!$serviceList) return;

        foreach ($serviceList as $key => $closure) {
            $this->set($key, $closure);
        }
    }
1260211
public void preparePartitions(Map config, int totalTasks, int taskIndex, SpoutOutputCollector collector) throws Exception {
    this.collector = collector;
    if(stateStore == null) {
      String zkEndpointAddress = eventHubConfig.getZkConnectionString();
      if (zkEndpointAddress == null || zkEndpointAddress.length() == 0) {
        //use storm's zookeeper servers if not specified.
        @SuppressWarnings("unchecked")
        List<String> zkServers = (List<String>) config.get(Config.STORM_ZOOKEEPER_SERVERS);
        Integer zkPort = ((Number) config.get(Config.STORM_ZOOKEEPER_PORT)).intValue();
        StringBuilder sb = new StringBuilder();
        for (String zk : zkServers) {
          if (sb.length() > 0) {
            sb.append(',');
          }
          sb.append(zk+":"+zkPort);
        }
        zkEndpointAddress = sb.toString();
      }
      stateStore = new ZookeeperStateStore(zkEndpointAddress,
          (Integer)config.get(Config.STORM_ZOOKEEPER_RETRY_TIMES),
          (Integer)config.get(Config.STORM_ZOOKEEPER_RETRY_INTERVAL));
    }
    stateStore.open();

    partitionCoordinator = new StaticPartitionCoordinator(
        eventHubConfig, taskIndex, totalTasks, stateStore, pmFactory, recvFactory);

    for (IPartitionManager partitionManager : 
      partitionCoordinator.getMyPartitionManagers()) {
      partitionManager.open();
    }
  }
612476
public void setClientPropertiesList(java.util.Collection<ClientPropertiesResult> clientPropertiesList) {
        if (clientPropertiesList == null) {
            this.clientPropertiesList = null;
            return;
        }

        this.clientPropertiesList = new com.amazonaws.internal.SdkInternalList<ClientPropertiesResult>(clientPropertiesList);
    }
59303
func (m *MockCommonAPIClient) ServiceList(ctx context.Context, options types.ServiceListOptions) ([]swarm.Service, error) {
	ret := m.ctrl.Call(m, "ServiceList", ctx, options)
	ret0, _ := ret[0].([]swarm.Service)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
1350133
func (s *ServerRPC) ServiceList(ctx context.Context, req *types.ServiceListRequest) (*types.ServiceListResponse, error) {
	services, err := s.daemon.GetServices(req.PodID)
	if err != nil {
		return nil, err
	}

	return &types.ServiceListResponse{
		Services: services,
	}, nil
}
1009748
public boolean checkService(String serviceName, String methodName) {
        Invoker invoker = invokerMap.get(serviceName);
        return invoker instanceof ProviderProxyInvoker && getMethod(serviceName, methodName) != null;
    }
26519
@Then("^service '(.+?)' status in cluster '(.+?)' is '(suspended|running|deploying)'( in less than '(\\d+?)' seconds checking every '(\\d+?)' seconds)?")
    public void serviceStatusCheck(String service, String cluster, String status, String foo, Integer totalWait, Integer interval) throws Exception {
        String response;
        Integer i = 0;
        boolean matched;

        response = commonspec.retrieveServiceStatus(service, cluster);

        if (foo != null) {
            matched = status.matches(response);
            while (!matched && i < totalWait) {
                this.commonspec.getLogger().info("Service status not found yet after " + i + " seconds");
                i = i + interval;
                response = commonspec.retrieveServiceStatus(service, cluster);
                matched = status.matches(response);
            }
        }

        assertThat(status).as("Expected status: " + status + " doesn't match obtained one: " + response).matches(response);

    }
645119
@Synchronized
    public void start() throws Exception {

        /*Start the ZK*/
        if (isInProcZK) {
            zkUrl = "localhost:" + zkPort;
            startLocalZK();
        } else {
            URI zkUri = new URI("temp://" + zkUrl);
            zkHost = zkUri.getHost();
            zkPort = zkUri.getPort();
        }

        if (isInProcHDFS) {
            startLocalHDFS();
            hdfsUrl = String.format("hdfs://localhost:%d/", localHdfs.getNameNodePort());
        }

        cleanUpZK();

        if (isInProcController) {
            startLocalControllers();
        }

        if (isInProcSegmentStore) {
            nodeServiceStarter = new ServiceStarter[segmentStoreCount];
            startLocalSegmentStores();
        }

    }
596546
private boolean inExcludedHostsList(TaskTrackerStatus status) {
    Set<String> excludeList = hostsReader.getExcludedHosts();
    return excludeList.contains(status.getHost());
  }