synchronized void free(SystemStreamPartition ssp) {
    boolean success = availableSsps.computeIfAbsent(ssp.getStream(), p -> new HashSet<>()).add(ssp);
    Validate.isTrue(success, String.format("Ssp %s is already in free pool.", ssp));

    LOG.info("Number of unassigned partitions for system-stream {} is {}.", ssp.getSystemStream(),
        availableSsps.get(ssp.getStream()).size());
  }
SSPAllocator is responsible for assigning Samza SystemStreamPartitions (SSPs). It provides two APIs:
<ul>
  <li> allocate: Given a stream, returns free ssp.
  <li> free: Adds ssp back to the free pool.
</ul>
A free (unallocated) ssp is returned for every allocate request and when there is no available ssp to allocate,
the allocator throws NoAvailablePartitionException. Allocator could run out of free ssps as a result of dynamic
shard splits.
samza-aws/src/main/java/org/apache/samza/system/kinesis/consumer/SSPAllocator.java