code: public void foreachPartition(final Action1<PartitionState> action) {
      int len = partitionStates.length();
      for (int i = 0; i < len; i++) {
        PartitionState ps = partitionStates.get(i);
        if (ps == null) {
          continue;
        }
        action.call(ps);
      }
    }
docs: Provides an iterator over all partitions, calling the callback for each one.
  
  @param action the action to be called with the state for every partition.