private static Multimap<CopyEntity.DatasetAndPartition, WorkUnitState> groupByFileSet(
      Collection<? extends WorkUnitState> states) {
    Multimap<CopyEntity.DatasetAndPartition, WorkUnitState> datasetRoots = ArrayListMultimap.create();

    for (WorkUnitState workUnitState : states) {
      CopyEntity file = CopySource.deserializeCopyEntity(workUnitState);
      CopyEntity.DatasetAndPartition datasetAndPartition = file.getDatasetAndPartition(
          CopyableDatasetMetadata.deserialize(workUnitState.getProp(CopySource.SERIALIZED_COPYABLE_DATASET)));

      datasetRoots.put(datasetAndPartition, workUnitState);
    }
    return datasetRoots;
  }
private static Multimap < CopyEntity . DatasetAndPartition , WorkUnitState > groupByFileSet ( Collection < ? extends WorkUnitState > states ) { Multimap < CopyEntity . DatasetAndPartition , WorkUnitState > datasetRoots = ArrayListMultimap . create ( ) ; for ( WorkUnitState workUnitState : states ) { CopyEntity file = CopySource . deserializeCopyEntity ( workUnitState ) ; CopyEntity . DatasetAndPartition datasetAndPartition = file . getDatasetAndPartition ( CopyableDatasetMetadata . deserialize ( workUnitState . getProp ( CopySource . SERIALIZED_COPYABLE_DATASET ) ) ) ; datasetRoots . put ( datasetAndPartition , workUnitState ) ; } return datasetRoots ; }
Create a {@link Multimap} that maps a {@link CopyableDataset} to all {@link WorkUnitState}s that belong to this
{@link CopyableDataset}. This mapping is used to set WorkingState of all {@link WorkUnitState}s to
{@link WorkUnitState.WorkingState#COMMITTED} after a {@link CopyableDataset} is successfully published.