Gets all the topologies which needs scheduling.
344262
public List<TopologyDetails> needsSchedulingTopologies(Topologies topologies) {
        List<TopologyDetails> ret = new ArrayList<>();
        for (TopologyDetails topology : topologies.getTopologies()) {
            if (needsScheduling(topology)) {
                ret.add(topology);
            }
        }

        return ret;
    }
737220
public Collection<ExecutorDetails> getUnassignedExecutors(TopologyDetails topology) {
        if (topology == null) {
            return new ArrayList<>(0);
        }

        Collection<ExecutorDetails> ret = new HashSet<>(topology.getExecutors());

        SchedulerAssignment assignment = this.getAssignmentById(topology.getId());
        if (assignment != null) {
            Set<ExecutorDetails> assignedExecutors = assignment.getExecutors();
            ret.removeAll(assignedExecutors);
        }

        return ret;
    }
427397
def get_resources(cls):
        """"""
        exts = []
        parent = dict(member_name="agent",
                      collection_name="agents")
        controller = resource.Resource(HostingDeviceSchedulerController(),
                                       cb_faults.FAULT_MAP)
        exts.append(extensions.ResourceExtension(CFG_AGENT_HOSTING_DEVICES,
                                                 controller, parent))
        parent = dict(member_name=ciscohostingdevicemanager.DEVICE,
                      collection_name=ciscohostingdevicemanager.DEVICES)
        controller = resource.Resource(
            CfgAgentsHandlingHostingDeviceController(), cb_faults.FAULT_MAP)
        exts.append(extensions.ResourceExtension(HOSTING_DEVICE_CFG_AGENTS,
                                                 controller, parent,
                                                 PATH_PREFIX))
        return exts
444288
public function getAll()
    {
        $requests = [
            'schedule' => $this->buildGetRequest(self::ZF_SCHEDULE_URI, [], $this->headers, true),
            'cet' => $this->buildGetRequest(self::ZF_CET_URI, [], $this->headers, true),
            'exam' => $this->buildGetRequest(self::ZF_EXAM_URI, [], $this->headers, true),
        ];
        // Wait on all of the requests to complete. Throws a ConnectException
        // if any of the requests fail
        $results = Promise\unwrap($requests);

        // Wait for the requests to complete, even if some of them fail
        // $results = Promise\settle($requests)->wait();

        //Parser the data we need.
        $schedule = $this->parserSchedule($results['schedule']->getBody());
        $cet = $this->parserCommonTable($results['cet']->getBody());
        $exam = $this->parserCommonTable($results['exam']->getBody());

        return compact('schedule', 'cet', 'exam');
    }
267243
public java.util.List<ScheduledInstancesNetworkInterface> getNetworkInterfaces() {
        if (networkInterfaces == null) {
            networkInterfaces = new com.amazonaws.internal.SdkInternalList<ScheduledInstancesNetworkInterface>();
        }
        return networkInterfaces;
    }
1305343
public function getTopology() {
		$descriptor      = new Descriptor('APC', self::TOPOLOGY_BACKEND);
		$memoryFormatter = new Memory();
				
		$info = apc_sma_info(true);
		
		$limit  = $info['seg_size'] * $info['num_seg'];
		$used   = $limit - $info['avail_mem'];
		$filled = $used / $limit * 100;
		
		$descriptor->id     = $this->getTopologyId();
		$descriptor->used   = $memoryFormatter->format($used);
		$descriptor->limit  = $memoryFormatter->format($limit);
		$descriptor->filled = round($filled, 2) . '%';
		
		return $descriptor;
	}
866047
def scheduling_blocks():
    """"""
    sbi_list = SchedulingBlockInstanceList()
    return dict(active=sbi_list.active,
                completed=sbi_list.completed,
                aborted=sbi_list.aborted)
1066997
void scheduleHeronWorkers(PackingPlan topologyPacking) throws ContainerAllocationException {
    this.componentRamMap = topologyPacking.getComponentRamDistribution();
    scheduleHeronWorkers(topologyPacking.getContainers());
  }
626704
def GetRandomLocationsNearStops(schedule):
  """"""
  locations = []
  for s in schedule.GetStopList():
    locations.append(AddNoiseToLatLng(s.stop_lat, s.stop_lon))
  return locations
138212
public List<Map<String,String>> getMapsForTopology(SamzaTopology topology) throws Exception {

		List<Map<String,String>> maps = new ArrayList<Map<String,String>>();

		// File to write serialized objects
		String filename = topology.getTopologyName() + ".dat";
		Path dirPath = FileSystems.getDefault().getPath("dat");
		Path filePath= FileSystems.getDefault().getPath(dirPath.toString(), filename);
		String dstPath = filePath.toString();
		String resPath;
		String filesystem;
		if (this.isLocalMode) {
			filesystem = SystemsUtils.LOCAL_FS;
			File dir = dirPath.toFile();
			if (!dir.exists()) 
				FileUtils.forceMkdir(dir);
		}
		else {
			filesystem = SystemsUtils.HDFS;
		}

		// Correct system name for streams
		this.setSystemNameForStreams(topology.getStreams());
		
		// Add all PIs to a collection (map)
		Map<String,Object> piMap = new HashMap<String,Object>();
		Set<EntranceProcessingItem> entranceProcessingItems = topology.getEntranceProcessingItems();
		Set<IProcessingItem> processingItems = topology.getNonEntranceProcessingItems();
		for(EntranceProcessingItem epi:entranceProcessingItems) {
			SamzaEntranceProcessingItem sepi = (SamzaEntranceProcessingItem) epi;
			piMap.put(sepi.getName(), sepi);
		}
		for(IProcessingItem pi:processingItems) {
			SamzaProcessingItem spi = (SamzaProcessingItem) pi;
			piMap.put(spi.getName(), spi);
		}

		// Serialize all PIs
		boolean serialized = false;
		if (this.isLocalMode) {
			serialized = SystemsUtils.serializeObjectToLocalFileSystem(piMap, dstPath);
			resPath = dstPath;
		}
		else {
			resPath = SystemsUtils.serializeObjectToHDFS(piMap, dstPath);
			serialized = resPath != null;
		}

		if (!serialized) {
			throw new Exception("Fail serialize map of PIs to file");
		}

		// MapConfig for all PIs
		for(EntranceProcessingItem epi:entranceProcessingItems) {
			SamzaEntranceProcessingItem sepi = (SamzaEntranceProcessingItem) epi;
			maps.add(this.getMapForEntrancePI(sepi, resPath, filesystem));
		}
		for(IProcessingItem pi:processingItems) {
			SamzaProcessingItem spi = (SamzaProcessingItem) pi;
			maps.add(this.getMapForPI(spi, resPath, filesystem));
		}

		return maps;
	}
1223057
private Set<AllocationID> computeAllPriorAllocationIdsIfRequiredByScheduling() {
		// This is a temporary optimization to avoid computing all previous allocations if not required
		// This can go away when we progress with the implementation of the Scheduler.
		if (slotProvider instanceof Scheduler && ((Scheduler) slotProvider).requiresPreviousExecutionGraphAllocations()) {
			return computeAllPriorAllocationIds();
		} else {
			return Collections.emptySet();
		}
	}
829510
def _get_schedule(self,
                      include_opts=True,
                      include_pillar=True,
                      remove_hidden=False):
        '''
        
        '''
        schedule = {}
        if include_pillar:
            pillar_schedule = self.opts.get('pillar', {}).get('schedule', {})
            if not isinstance(pillar_schedule, dict):
                raise ValueError('Schedule must be of type dict.')
            schedule.update(pillar_schedule)
        if include_opts:
            opts_schedule = self.opts.get('schedule', {})
            if not isinstance(opts_schedule, dict):
                raise ValueError('Schedule must be of type dict.')
            schedule.update(opts_schedule)

        if remove_hidden:
            _schedule = copy.deepcopy(schedule)
            for job in _schedule:
                if isinstance(_schedule[job], dict):
                    for item in _schedule[job]:
                        if item.startswith('_'):
                            del schedule[job][item]
        return schedule
101288
public java.util.List<ClusterAssociatedToSchedule> getAssociatedClusters() {
        if (associatedClusters == null) {
            associatedClusters = new com.amazonaws.internal.SdkInternalList<ClusterAssociatedToSchedule>();
        }
        return associatedClusters;
    }
92006
@Exported
    public Set<Node> getNodes() {
        Set<Node> nodes = this.nodes;
        if(nodes!=null) return nodes;

        Set<Node> r = new HashSet<>();
        Jenkins h = Jenkins.getInstance();
        if(this.matches(h))
            r.add(h);
        for (Node n : h.getNodes()) {
            if(this.matches(n))
                r.add(n);
        }
        return this.nodes = Collections.unmodifiableSet(r);
    }
410250
private static Set<Integer> getPartitionIdsForHosts(AbstractTopology topology, Set<Integer> hostIds) {
        Set<Integer> partitionIds = new HashSet<>();
        for (int hostId : hostIds) {
            partitionIds.addAll(topology.getPartitionIdList(hostId));
        }
        return partitionIds;
    }
639542
public java.util.List<ScheduledInstanceAvailability> getScheduledInstanceAvailabilitySet() {
        if (scheduledInstanceAvailabilitySet == null) {
            scheduledInstanceAvailabilitySet = new com.amazonaws.internal.SdkInternalList<ScheduledInstanceAvailability>();
        }
        return scheduledInstanceAvailabilitySet;
    }
827110
private HashSet<String> getComponents(Nimbus.Client client, String topology) throws Exception {
        HashSet<String> components = new HashSet<String>();
        ClusterSummary clusterSummary = client.getClusterInfo();
        TopologySummary topologySummary = null;
        for (TopologySummary ts : clusterSummary.get_topologies()) {
            if (topology.equals(ts.get_name())) {
                topologySummary = ts;
                break;
            }
        }
        if (topologySummary == null) {
            throw new IllegalArgumentException("topology: " + topology + " not found");
        } else {
            String id = topologySummary.get_id();
            // GetInfoOptions getInfoOpts = new GetInfoOptions();
            // getInfoOpts.set_num_err_choice(NumErrorsChoice.NONE);
            // TopologyInfo info = client.getTopologyInfoWithOpts(id, getInfoOpts);
            // for (ExecutorSummary es: info.get_executors()) {
            // components.add(es.get_component_id());
            // }
        }
        return components;
    }