code: @Override
      public void setupAppend(SetupAppend setupAppend) {
          String newSegment = setupAppend.getSegment();
          UUID writer = setupAppend.getWriterId();
          log.info("Setting up appends for writer: {} on segment: {}", writer, newSegment);
          if (this.tokenVerifier != null && !tokenVerifier.verifyToken(newSegment,
                  setupAppend.getDelegationToken(), AuthHandler.Permissions.READ_UPDATE)) {
              log.warn("Delegation token verification failed");
              handleException(setupAppend.getWriterId(), setupAppend.getRequestId(), newSegment,
                      "Update Segment Attribute", new AuthenticationException("Token verification failed"));
              return;
          }
  
          // Get the last Event Number for this writer from the Store. This operation (cache=true) will automatically put
          // the value in the Store's cache so it's faster to access later.
          store.getAttributes(newSegment, Collections.singleton(writer), true, TIMEOUT)
                  .whenComplete((attributes, u) -> {
                      try {
                          if (u != null) {
                              handleException(writer, setupAppend.getRequestId(), newSegment, "setting up append", u);
                          } else {
                              long eventNumber = attributes.getOrDefault(writer, Attributes.NULL_ATTRIBUTE_VALUE);
                              synchronized (lock) {
                                  latestEventNumbers.putIfAbsent(Pair.of(newSegment, writer), eventNumber);
                              }
                              connection.send(new AppendSetup(setupAppend.getRequestId(), newSegment, writer, eventNumber));
                          }
                      } catch (Throwable e) {
                          handleException(writer, setupAppend.getRequestId(), newSegment, "handling setupAppend result", e);
                      }
                  });
      }
docs: Setup an append so that subsequent append calls can occur.
  This requires validating that the segment exists.
  The reply: AppendSetup indicates that appends may proceed and contains the eventNumber which they should proceed
  from (in the event that this is a reconnect from a producer we have seen before)