code: public CompletableFuture<UpdateStreamStatus.Status> updateStream(String scope, String stream, StreamConfiguration newConfig,
                                                                       OperationContext contextOpt) {
          final OperationContext context = contextOpt == null ? streamMetadataStore.createContext(scope, stream) : contextOpt;
          final long requestId = requestTracker.getRequestIdFor("updateStream", scope, stream);
  
          // 1. get configuration
          return streamMetadataStore.getConfigurationRecord(scope, stream, context, executor)
                  .thenCompose(configProperty -> {
                      // 2. post event to start update workflow
                      if (!configProperty.getObject().isUpdating()) {
                          return addIndexAndSubmitTask(new UpdateStreamEvent(scope, stream, requestId), 
                                  // 3. update new configuration in the store with updating flag = true
                                  // if attempt to update fails, we bail out with no harm done
                                  () -> streamMetadataStore.startUpdateConfiguration(scope, stream, newConfig,
                                          context, executor))
                                  // 4. wait for update to complete
                                  .thenCompose(x -> checkDone(() -> isUpdated(scope, stream, newConfig, context))
                                          .thenApply(y -> UpdateStreamStatus.Status.SUCCESS));
                      } else {
                          log.warn(requestId, "Another update in progress for {}/{}",
                                  scope, stream);
                          return CompletableFuture.completedFuture(UpdateStreamStatus.Status.FAILURE);
                      }
                  })
                  .exceptionally(ex -> {
                      log.warn(requestId, "Exception thrown in trying to update stream configuration {}",
                              ex.getMessage());
                      return handleUpdateStreamError(ex, requestId);
                  });
      }
docs: Update stream's configuration.
  
  @param scope      scope.
  @param stream     stream name.
  @param newConfig     modified stream configuration.
  @param contextOpt optional context
  @return update status.