code: protected <T> CompletableFuture<T> invoke(String streamSegmentName, Function<SegmentContainer, CompletableFuture<T>> toInvoke,
                                                String methodName, Object... logArgs) {
          long traceId = LoggerHelpers.traceEnter(log, methodName, logArgs);
          SegmentContainer container;
          try {
              int containerId = this.segmentToContainerMapper.getContainerId(streamSegmentName);
              container = this.segmentContainerRegistry.getContainer(containerId);
          } catch (ContainerNotFoundException ex) {
              return Futures.failedFuture(ex);
          }
  
          CompletableFuture<T> resultFuture = toInvoke.apply(container);
          if (log.isTraceEnabled()) {
              resultFuture.thenAccept(r -> LoggerHelpers.traceLeave(log, methodName, traceId, r));
          }
  
          return resultFuture;
      }
docs: Executes the given Function on the SegmentContainer that the given Segment maps to.
  
  @param streamSegmentName The name of the StreamSegment to fetch the Container for.
  @param toInvoke          A Function that will be invoked on the Container.
  @param methodName        The name of the calling method (for logging purposes).
  @param logArgs           (Optional) A vararg array of items to be logged.
  @param <T>               Resulting type.
  @return Either the result of toInvoke or a CompletableFuture completed exceptionally with a ContainerNotFoundException
  in case the SegmentContainer that the Segment maps to does not exist in this StreamSegmentService.