public ControllerResult<Errors> replaceCommittedObject(long objectId, int attributes) {
        S3Object object = this.objectsMetadata.get(objectId);
        if (object == null) {
            return ControllerResult.of(Collections.emptyList(), Errors.OBJECT_NOT_EXIST);
        }
        // verify the state
        if (object.getS3ObjectState() != S3ObjectState.COMMITTED) {
            return ControllerResult.of(Collections.emptyList(), Errors.OBJECT_NOT_COMMITED);
        }
        AutoMQVersion version = this.version.get();
        S3ObjectRecord record = new S3ObjectRecord()
            .setObjectId(objectId)
            .setObjectSize(object.getObjectSize())
            .setObjectState(S3ObjectState.COMMITTED.toByte());
        record.setTimestamp(object.getObjectSize());
        record.setAttributes(attributes);
        return ControllerResult.of(List.of(
            new ApiMessageAndVersion(record, version.objectRecordVersion())), Errors.NONE);
    }
The objectId of the next object to be prepared. (start from 0)
metadata/src/main/java/org/apache/kafka/controller/stream/S3ObjectControlManager.java