public void replay(S3ObjectRecord record) {
        S3Object object = S3Object.of(record);
        objectsMetadata.put(record.objectId(), object);
        long objectId = object.getObjectId();
        if (object.getS3ObjectState() == S3ObjectState.PREPARED) {
            preparedObjects0.put(objectId, object.getTimestamp());
            preparedObjectsTimeouts.put(objectId, newPreparedObjectTimeout(objectId, object.getTimestamp()));
        } else {
            removePreparedObject(objectId);
            if (object.getS3ObjectState() == S3ObjectState.MARK_DESTROYED) {
                markDestroyedObjects0.add(object.getObjectId());
                ObjectAttributes attributes = ObjectAttributes.from(object.getAttributes());
                if (attributes.type() == Type.Composite && !attributes.deepDelete()) {
                    // It means the composite object is compacted by another composite object.
                    // So decrease size here to make the s3 size metrics more precise.
                    s3ObjectSize.set(s3ObjectSize.get() - record.objectSize());
                }
            } else {
                // object committed
                s3ObjectSize.set(s3ObjectSize.get() + record.objectSize());
            }
        }
    }
The objectId of the next object to be prepared. (start from 0)
metadata/src/main/java/org/apache/kafka/controller/stream/S3ObjectControlManager.java