boolean updateProgress(Allocation allocation, long units) {
    AtomicBoolean mapUpdated = new AtomicBoolean(units != 0);

    completionMap.compute(
        allocation,
        (ignored, indexedRemainingUnits) -> {
          if (indexedRemainingUnits == null) {
            indexedRemainingUnits = new IndexedRemainingUnits(allocation);
            mapUpdated.set(true);
          }

          if (units != 0) {
            updateIndexedRemainingUnits(indexedRemainingUnits, units);
          }
          return indexedRemainingUnits;
        });
    return mapUpdated.get();
  }
Updates the progress for {@link Allocation} atomically relative to the {@code allocation}.

<p>For any {@link Allocation}, this method <em>must</em> have been called on all of its parents
beforehand.

@param allocation the {@link Allocation} to update progress for
@param units the units of progress
@return {@code true} if the map was updated
jib-core/src/main/java/com/google/cloud/tools/jib/event/progress/AllocationCompletionTracker.java