private AggregateState addPartToAggregate(final FeedKey feedKey,
                                              final Path dir,
                                              final Part part,
                                              final AggregatorConfig aggregatorConfig) throws IOException {
        final AggregateState aggregateState = getOrCreateAggregateState(feedKey, aggregatorConfig);
        final long newPartCount = aggregateState.partCount + 1;
        final Path destDir = aggregateState.aggregateDir.resolve(StringIdUtil.idToString(newPartCount));
        Files.move(dir, destDir, StandardCopyOption.ATOMIC_MOVE);
        aggregateState.addPart(part);
        LOGGER.debug(() -> LogUtil.message("addPartToAggregate() - feedKey: {}, dir: {}, part: {}, " +
                                           "destDir: {}, itemCount: {}, totalBytes: {}",
                feedKey, dir, part, destDir, aggregateState.itemCount, aggregateState.totalBytes));
        return aggregateState;
    }
Add a part to the current aggregate by moving its source dir to the aggregate
output dir and incrementing the item count and total bytes for the aggregate.
<p>
MUST be called under the feedKeyLock.
</p>

@param feedKey The feed key of the aggregate to add to.
@param dir     The source dir to add.
@param part    The part details associated with the source.
@return The updated aggregate state.
@throws IOException Could be thrown when moving the source dir to the aggregate.
stroom-proxy/stroom-proxy-app/src/main/java/stroom/proxy/app/handler/PreAggregator.java