Load all lineage information from {@link State}s of a dataset

@param states All states which belong to the same dataset
@return A collection of {@link LineageEventBuilder}s put in the state
326474
public static Collection<LineageEventBuilder> load(Collection<? extends State> states) {
    Preconditions.checkArgument(states != null && !states.isEmpty());
    Set<LineageEventBuilder> allEvents = Sets.newHashSet();
    for (State state : states) {
      Map<String, Set<LineageEventBuilder>> branchedEvents = load(state);
      branchedEvents.values().forEach(allEvents::addAll);
    }
    return allEvents;
  }
635178
public PropertiesLoaderBuilder loadAllPropertiesFromSpring() {
        for (PropertySource<?> propertySource : env.getPropertySources()) {
            if (propertySource instanceof MapPropertySource) {
                MapPropertySource mapPropSource = (MapPropertySource) propertySource;
                for (String propName : mapPropSource.getPropertyNames()) {
                    if (!props.containsKey(propName)) {
                        props.put(propName, env.getProperty(propName));
                    }
                }
            }
        }
        return this;
    }
116521
public static Map<String, State> getDatasetSpecificProps(Iterable<String> datasets, State state) {
    if (!Strings.isNullOrEmpty(state.getProp(DATASET_SPECIFIC_PROPS))
        || !Strings.isNullOrEmpty(state.getProp(KAFKA_TOPIC_SPECIFIC_STATE))) {
      Map<String, State> datasetSpecificConfigMap = Maps.newHashMap();

      JsonArray array = !Strings.isNullOrEmpty(state.getProp(DATASET_SPECIFIC_PROPS))
          ? state.getPropAsJsonArray(DATASET_SPECIFIC_PROPS) : state.getPropAsJsonArray(KAFKA_TOPIC_SPECIFIC_STATE);

      // Iterate over the entire JsonArray specified by the config key
      for (JsonElement datasetElement : array) {

        // Check that each entry in the JsonArray is a JsonObject
        Preconditions.checkArgument(datasetElement.isJsonObject(),
            "The value for property " + DATASET_SPECIFIC_PROPS + " is malformed");
        JsonObject object = datasetElement.getAsJsonObject();

        // Only process JsonObjects that have a dataset identifier
        if (object.has(DATASET)) {
          JsonElement datasetNameElement = object.get(DATASET);
          Preconditions.checkArgument(datasetNameElement.isJsonPrimitive(), "The value for property "
              + DATASET_SPECIFIC_PROPS + " is malformed, the " + DATASET + " field must be a string");

          // Iterate through each dataset that matches the value of the JsonObjects DATASET field
          for (String dataset : Iterables.filter(datasets, new DatasetPredicate(datasetNameElement.getAsString()))) {

            // If an entry already exists for a dataset, add it to the current state, else create a new state
            if (datasetSpecificConfigMap.containsKey(dataset)) {
              datasetSpecificConfigMap.get(dataset).addAll(StateUtils.jsonObjectToState(object, DATASET));
            } else {
              datasetSpecificConfigMap.put(dataset, StateUtils.jsonObjectToState(object, DATASET));
            }
          }
        } else {
          LOG.warn("Skipping JsonElement " + datasetElement + " as it is does not contain a field with key " + DATASET);
        }
      }
      return datasetSpecificConfigMap;
    }
    return Maps.newHashMap();
  }
1307396
public Set<Integer> getTransitions(int state, I input) { // TODO: replace by primitive specialization
        return getTransitions(state, getSymbolIndex(input));
    }
365379
public Collection<QProfileDto> selectDescendants(DbSession dbSession, Collection<QProfileDto> profiles) {
    if (profiles.isEmpty()) {
      return emptyList();
    }
    Collection<QProfileDto> children = selectChildren(dbSession, profiles);
    List<QProfileDto> descendants = new ArrayList<>(children);
    descendants.addAll(selectDescendants(dbSession, children));
    return descendants;
  }
175644
private function loadStateIdentifiers(): array
    {
        if ($this->stateIdentifiers === null) {
            $this->stateIdentifiers = $this->repository->sudo(
                static function (Repository $repository): array {
                    $stateIdentifiers = [];

                    $stateGroups = $repository->getObjectStateService()->loadObjectStateGroups();
                    foreach ($stateGroups as $stateGroup) {
                        $stateIdentifiers[$stateGroup->identifier] = [];

                        $states = $repository->getObjectStateService()->loadObjectStates($stateGroup);
                        foreach ($states as $state) {
                            $stateIdentifiers[$stateGroup->identifier][] = $state->identifier;
                        }
                    }

                    return $stateIdentifiers;
                }
            );
        }

        return $this->stateIdentifiers;
    }
552070
def _load_states(self):
        '''
        
        '''
        if self.states_loader == 'thorium':
            self.states = salt.loader.thorium(self.opts, self.functions, {})  # TODO: Add runners, proxy?
        else:
            self.states = salt.loader.states(self.opts, self.functions, self.utils,
                                             self.serializers, context=self.state_con, proxy=self.proxy)
1056770
public static String getFullEventName(State state) {
    return Joiner.on('.').join(LineageEventBuilder.LIENAGE_EVENT_NAMESPACE, state.getProp(getKey(NAME_KEY)));
  }
677635
public void setEvents(java.util.Collection<HistoryEvent> events) {
        if (events == null) {
            this.events = null;
            return;
        }

        this.events = new java.util.ArrayList<HistoryEvent>(events);
    }
66620
public void setActionStates(java.util.Collection<ActionState> actionStates) {
        if (actionStates == null) {
            this.actionStates = null;
            return;
        }

        this.actionStates = new java.util.ArrayList<ActionState>(actionStates);
    }
1207346
private List<String> loadKeyList() {
        Set<String> keySet = new HashSet<String>();
        for (EDBObjectEntry entry : startState.values()) {
            keySet.add(entry.getKey());
        }
        for (EDBObjectEntry entry : endState.values()) {
            keySet.add(entry.getKey());
        }
        return new ArrayList<String>(keySet);
    }
182019
@Override
    public Iterable<Object> loadAllKeys() {
        if (isMapLoader()) {
            Iterable<Object> allKeys;
            try {
                allKeys = mapLoader.loadAllKeys();
            } catch (AbstractMethodError e) {
                // Invoke reflectively to preserve backwards binary compatibility. Removable in v4.x
                allKeys = ReflectionHelper.invokeMethod(mapLoader, "loadAllKeys");
            }
            return allKeys;
        }
        return null;
    }
334913
def _load_child_state_models(self, load_meta_data):
        
        self.states = {}
        # Create model for each child class
        child_states = self.state.states
        for child_state in child_states.values():
            # Create hierarchy
            model_class = get_state_model_class_for_state(child_state)
            if model_class is not None:
                self._add_model(self.states, child_state, model_class, child_state.state_id, load_meta_data)
            else:
                logger.error("Unknown state type '{type:s}'. Cannot create model.".format(type=type(child_state)))
797654
def load_states():
    '''
    
    '''
    states = {}

    # the loader expects to find pillar & grain data
    __opts__['grains'] = salt.loader.grains(__opts__)
    __opts__['pillar'] = __pillar__
    lazy_utils = salt.loader.utils(__opts__)
    lazy_funcs = salt.loader.minion_mods(__opts__, utils=lazy_utils)
    lazy_serializers = salt.loader.serializers(__opts__)
    lazy_states = salt.loader.states(__opts__,
            lazy_funcs,
            lazy_utils,
            lazy_serializers)

    # TODO: some way to lazily do this? This requires loading *all* state modules
    for key, func in six.iteritems(lazy_states):
        if '.' not in key:
            continue
        mod_name, func_name = key.split('.', 1)
        if mod_name not in states:
            states[mod_name] = {}
        states[mod_name][func_name] = func

    __context__['pyobjects_states'] = states
282234
@Override
    public StateIdsBuilder append(final String stateToken, final StateRange range) {
        return doAppend(Collections.singletonList(new StateId(stateToken, range)));
    }
333011
public Collection<String> getOutDatedCache(Map<String, Long> states) {
		return updatedCacheManager.getOutDatedCache(states);
	}
847170
private void downloadDataForAllStateHandles(
		Map<StateHandleID, StreamStateHandle> stateHandleMap,
		Path restoreInstancePath,
		CloseableRegistry closeableRegistry) throws Exception {

		try {
			List<Runnable> runnables = createDownloadRunnables(stateHandleMap, restoreInstancePath, closeableRegistry);
			List<CompletableFuture<Void>> futures = new ArrayList<>(runnables.size());
			for (Runnable runnable : runnables) {
				futures.add(CompletableFuture.runAsync(runnable, executorService));
			}
			FutureUtils.waitForAll(futures).get();
		} catch (ExecutionException e) {
			Throwable throwable = ExceptionUtils.stripExecutionException(e);
			throwable = ExceptionUtils.stripException(throwable, RuntimeException.class);
			if (throwable instanceof IOException) {
				throw (IOException) throwable;
			} else {
				throw new FlinkRuntimeException("Failed to download data for state handles.", e);
			}
		}
	}