/** * Get a {@link List} of previous {@link WorkUnitState}s. The list is lazily materialized upon invocation of the * method by the {@link org.apache.gobblin.source.Source}. Subsequent calls to this method will return the previously * materialized map. */ public List<WorkUnitState> getPreviousWorkUnitStates() { if (this.workUnitAndDatasetStateFunctional != null) { materializeWorkUnitAndDatasetStates(null); } return this.previousWorkUnitStates; }
/** * * @return a {@link Map} from dataset URNs (as being specified by {@link ConfigurationKeys#DATASET_URN_KEY} * to the {@link SourceState} with the dataset URNs. The map is materialized upon invocation of the method * by the source. Subsequent calls to this method will return the previously materialized map. * <p> * {@link SourceState}s that do not have {@link ConfigurationKeys#DATASET_URN_KEY} set will be added * to the dataset state belonging to {@link ConfigurationKeys#DEFAULT_DATASET_URN}. * </p> * * @return a {@link Map} from dataset URNs to the {@link SourceState} with the dataset URNs */ public Map<String, SourceState> getPreviousDatasetStatesByUrns() { if (this.workUnitAndDatasetStateFunctional != null) { materializeWorkUnitAndDatasetStates(null); } return this.previousDatasetStatesByUrns; }
/** * Get a {@link Map} from dataset URNs (as being specified by {@link ConfigurationKeys#DATASET_URN_KEY} * to the {@link WorkUnitState} with the dataset URNs. * * <p> * {@link WorkUnitState}s that do not have {@link ConfigurationKeys#DATASET_URN_KEY} set will be added * to the dataset state belonging to {@link ConfigurationKeys#DEFAULT_DATASET_URN}. * </p> * * @return a {@link Map} from dataset URNs to the {@link WorkUnitState} with the dataset URNs */ public Map<String, Iterable<WorkUnitState>> getPreviousWorkUnitStatesByDatasetUrns() { Map<String, Iterable<WorkUnitState>> previousWorkUnitStatesByDatasetUrns = Maps.newHashMap(); if (this.workUnitAndDatasetStateFunctional != null) { materializeWorkUnitAndDatasetStates(null); } for (WorkUnitState workUnitState : this.previousWorkUnitStates) { String datasetUrn = workUnitState.getProp(ConfigurationKeys.DATASET_URN_KEY, ConfigurationKeys.DEFAULT_DATASET_URN); if (!previousWorkUnitStatesByDatasetUrns.containsKey(datasetUrn)) { previousWorkUnitStatesByDatasetUrns.put(datasetUrn, Lists.newArrayList()); } ((List<WorkUnitState>) previousWorkUnitStatesByDatasetUrns.get(datasetUrn)).add(workUnitState); } return ImmutableMap.copyOf(previousWorkUnitStatesByDatasetUrns); }
/** * Get a {@link List} of previous {@link WorkUnitState}s. The list is lazily materialized upon invocation of the * method by the {@link org.apache.gobblin.source.Source}. Subsequent calls to this method will return the previously * materialized map. */ public List<WorkUnitState> getPreviousWorkUnitStates() { if (this.workUnitAndDatasetStateFunctional != null) { materializeWorkUnitAndDatasetStates(null); } return this.previousWorkUnitStates; }
/** * * @return a {@link Map} from dataset URNs (as being specified by {@link ConfigurationKeys#DATASET_URN_KEY} * to the {@link SourceState} with the dataset URNs. The map is materialized upon invocation of the method * by the source. Subsequent calls to this method will return the previously materialized map. * <p> * {@link SourceState}s that do not have {@link ConfigurationKeys#DATASET_URN_KEY} set will be added * to the dataset state belonging to {@link ConfigurationKeys#DEFAULT_DATASET_URN}. * </p> * * @return a {@link Map} from dataset URNs to the {@link SourceState} with the dataset URNs */ public Map<String, SourceState> getPreviousDatasetStatesByUrns() { if (this.workUnitAndDatasetStateFunctional != null) { materializeWorkUnitAndDatasetStates(null); } return this.previousDatasetStatesByUrns; }
/** * Get a {@link Map} from dataset URNs (as being specified by {@link ConfigurationKeys#DATASET_URN_KEY} * to the {@link WorkUnitState} with the dataset URNs. * * <p> * {@link WorkUnitState}s that do not have {@link ConfigurationKeys#DATASET_URN_KEY} set will be added * to the dataset state belonging to {@link ConfigurationKeys#DEFAULT_DATASET_URN}. * </p> * * @return a {@link Map} from dataset URNs to the {@link WorkUnitState} with the dataset URNs */ public Map<String, Iterable<WorkUnitState>> getPreviousWorkUnitStatesByDatasetUrns() { Map<String, Iterable<WorkUnitState>> previousWorkUnitStatesByDatasetUrns = Maps.newHashMap(); if (this.workUnitAndDatasetStateFunctional != null) { materializeWorkUnitAndDatasetStates(null); } for (WorkUnitState workUnitState : this.previousWorkUnitStates) { String datasetUrn = workUnitState.getProp(ConfigurationKeys.DATASET_URN_KEY, ConfigurationKeys.DEFAULT_DATASET_URN); if (!previousWorkUnitStatesByDatasetUrns.containsKey(datasetUrn)) { previousWorkUnitStatesByDatasetUrns.put(datasetUrn, Lists.newArrayList()); } ((List<WorkUnitState>) previousWorkUnitStatesByDatasetUrns.get(datasetUrn)).add(workUnitState); } return ImmutableMap.copyOf(previousWorkUnitStatesByDatasetUrns); }