private void validateReservedMetadataChunkId() throws RouterException {
      if (!options.isChunkUpload() && Objects.nonNull(passedInBlobProperties.getReservedMetadataBlobId())) {
        reservedMetadataIdMetrics.reservedMetadataPassedInForNonChunkedUploadCount.inc();
        throw new RouterException("Only chunked uploads can have reserved metadata blob id passed in.",
            RouterErrorCode.InvalidOrMismatchedStitchBlobReservedMetadataChunkId);
      }
      if (options.isChunkUpload() && passedInBlobProperties.getReservedMetadataBlobId() == null) {
        reservedMetadataIdMetrics.noReservedMetadataForChunkedUploadCount.inc();
        throw new RouterException("No reserved metadata passed in for chunked upload",
            RouterErrorCode.InvalidOrMismatchedStitchBlobReservedMetadataChunkId);
      }
    }
Validate the reserved metadata chunk id is passed in correctly where it needs to be specified.
@throws RouterException in case of any errors.
ambry-router/src/main/java/com/github/ambry/router/PutOperation.java