rename image_transfer disk_id to volume_id

This commit is contained in:
Abhisar Sinha 2026-04-13 00:31:08 +05:30 committed by Abhisar Sinha
parent 1d20ecc677
commit 9af2c941ae
5 changed files with 18 additions and 18 deletions

View File

@ -45,7 +45,7 @@ public interface ImageTransfer extends ControlledEntity, InternalIdentity {
Long getBackupId();
long getDiskId();
long getVolumeId();
long getHostId();

View File

@ -45,8 +45,8 @@ public class ImageTransferVO implements ImageTransfer {
@Column(name = "backup_id")
private Long backupId;
@Column(name = "disk_id")
private long diskId;
@Column(name = "volume_id")
private long volumeId;
@Column(name = "host_id")
private long hostId;
@ -102,9 +102,9 @@ public class ImageTransferVO implements ImageTransfer {
public ImageTransferVO() {
}
private ImageTransferVO(String uuid, long diskId, long hostId, Phase phase, Direction direction, Long accountId, Long domainId, Long dataCenterId) {
private ImageTransferVO(String uuid, long volumeId, long hostId, Phase phase, Direction direction, Long accountId, Long domainId, Long dataCenterId) {
this.uuid = uuid;
this.diskId = diskId;
this.volumeId = volumeId;
this.hostId = hostId;
this.phase = phase;
this.direction = direction;
@ -114,15 +114,15 @@ public class ImageTransferVO implements ImageTransfer {
this.created = new Date();
}
public ImageTransferVO(String uuid, Long backupId, long diskId, long hostId, String socket, Phase phase, Direction direction, Long accountId, Long domainId, Long dataCenterId) {
this(uuid, diskId, hostId, phase, direction, accountId, domainId, dataCenterId);
public ImageTransferVO(String uuid, Long backupId, long volumeId, long hostId, String socket, Phase phase, Direction direction, Long accountId, Long domainId, Long dataCenterId) {
this(uuid, volumeId, hostId, phase, direction, accountId, domainId, dataCenterId);
this.backupId = backupId;
this.socket = socket;
this.backend = Backend.nbd;
}
public ImageTransferVO(String uuid, long diskId, long hostId, String file, Phase phase, Direction direction, Long accountId, Long domainId, Long dataCenterId) {
this(uuid, diskId, hostId, phase, direction, accountId, domainId, dataCenterId);
public ImageTransferVO(String uuid, long volumeId, long hostId, String file, Phase phase, Direction direction, Long accountId, Long domainId, Long dataCenterId) {
this(uuid, volumeId, hostId, phase, direction, accountId, domainId, dataCenterId);
this.file = file;
this.backend = Backend.file;
}
@ -147,12 +147,12 @@ public class ImageTransferVO implements ImageTransfer {
}
@Override
public long getDiskId() {
return diskId;
public long getVolumeId() {
return volumeId;
}
public void setDiskId(long diskId) {
this.diskId = diskId;
public void setVolumeId(long volumeId) {
this.volumeId = volumeId;
}
@Override

View File

@ -54,11 +54,11 @@ public class ImageTransferDaoImpl extends GenericDaoBase<ImageTransferVO, Long>
uuidSearch.done();
volumeSearch = createSearchBuilder();
volumeSearch.and("volumeId", volumeSearch.entity().getDiskId(), SearchCriteria.Op.EQ);
volumeSearch.and("volumeId", volumeSearch.entity().getVolumeId(), SearchCriteria.Op.EQ);
volumeSearch.done();
volumeUnfinishedSearch = createSearchBuilder();
volumeUnfinishedSearch.and("volumeId", volumeUnfinishedSearch.entity().getDiskId(), SearchCriteria.Op.EQ);
volumeUnfinishedSearch.and("volumeId", volumeUnfinishedSearch.entity().getVolumeId(), SearchCriteria.Op.EQ);
volumeUnfinishedSearch.and("phase", volumeUnfinishedSearch.entity().getPhase(), SearchCriteria.Op.NEQ);
volumeUnfinishedSearch.done();

View File

@ -64,7 +64,7 @@ public class ImageTransferVOToImageTransferConverter {
}
}
if (volumeResolver != null) {
VolumeJoinVO volumeVo = volumeResolver.apply(vo.getDiskId());
VolumeJoinVO volumeVo = volumeResolver.apply(vo.getVolumeId());
if (volumeVo != null) {
imageTransfer.setDisk(Ref.of(basePath + DisksRouteHandler.BASE_ROUTE + "/" + volumeVo.getUuid(), volumeVo.getUuid()));
imageTransfer.setImage(Ref.of(null, volumeVo.getUuid()));

View File

@ -871,7 +871,7 @@ public class KVMBackupExportServiceImpl extends ManagerBase implements KVMBackup
Backup backup = backupDao.findByIdIncludingRemoved(backupId);
response.setBackupId(backup.getUuid());
}
Long volumeId = imageTransferVO.getDiskId();
Long volumeId = imageTransferVO.getVolumeId();
Volume volume = volumeDao.findByIdIncludingRemoved(volumeId);
response.setDiskId(volume.getUuid());
response.setTransferUrl(imageTransferVO.getTransferUrl());
@ -970,7 +970,7 @@ public class KVMBackupExportServiceImpl extends ManagerBase implements KVMBackup
Map<String, Long> volumeSizes = new HashMap<>();
for (ImageTransferVO transfer : hostTransfers) {
VolumeVO volume = volumeDao.findById(transfer.getDiskId());
VolumeVO volume = volumeDao.findById(transfer.getVolumeId());
if (volume == null) {
logger.warn("Volume not found for image transfer: {}", transfer.getUuid());
imageTransferDao.remove(transfer.getId()); // ToDo: confirm if this enough?