Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/src/main/java/com/cloud/storage/Snapshot.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ enum LocationType {

boolean isRecursive();

short getsnapshotType();
short getSnapshotType();

LocationType getLocationType(); // This type is in reference to the location where the snapshot resides (ex. primary storage, archive on secondary storage, etc.)
}
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ public void loadDetails(HostVO host) {

@Override
public void loadHostTags(HostVO host) {
List<String> hostTags = _hostTagsDao.gethostTags(host.getId());
List<String> hostTags = _hostTagsDao.getHostTags(host.getId());
host.setHostTags(hostTags);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public interface HostTagsDao extends GenericDao<HostTagVO, Long> {

void persist(long hostId, List<String> hostTags);

List<String> gethostTags(long hostId);
List<String> getHostTags(long hostId);

List<String> getDistinctImplicitHostTags(List<Long> hostIds, String[] implicitHostTags);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public HostTagsDaoImpl() {
}

@Override
public List<String> gethostTags(long hostId) {
public List<String> getHostTags(long hostId) {
SearchCriteria<HostTagVO> sc = HostSearch.create();
sc.setParameters("hostId", hostId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public long getSnapshotId() {
}

@Override
public short getsnapshotType() {
public short getSnapshotType() {
return snapshotType;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,12 @@ protected void init() {

VolumeIdTypeSearch = createSearchBuilder();
VolumeIdTypeSearch.and("volumeId", VolumeIdTypeSearch.entity().getVolumeId(), SearchCriteria.Op.EQ);
VolumeIdTypeSearch.and("type", VolumeIdTypeSearch.entity().getsnapshotType(), SearchCriteria.Op.EQ);
VolumeIdTypeSearch.and("type", VolumeIdTypeSearch.entity().getSnapshotType(), SearchCriteria.Op.EQ);
VolumeIdTypeSearch.done();

VolumeIdTypeNotDestroyedSearch = createSearchBuilder();
VolumeIdTypeNotDestroyedSearch.and("volumeId", VolumeIdTypeNotDestroyedSearch.entity().getVolumeId(), SearchCriteria.Op.EQ);
VolumeIdTypeNotDestroyedSearch.and("type", VolumeIdTypeNotDestroyedSearch.entity().getsnapshotType(), SearchCriteria.Op.EQ);
VolumeIdTypeNotDestroyedSearch.and("type", VolumeIdTypeNotDestroyedSearch.entity().getSnapshotType(), SearchCriteria.Op.EQ);
VolumeIdTypeNotDestroyedSearch.and("status", VolumeIdTypeNotDestroyedSearch.entity().getState(), SearchCriteria.Op.NEQ);
VolumeIdTypeNotDestroyedSearch.done();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ public boolean isRecursive() {
}

@Override
public short getsnapshotType() {
return snapshot.getsnapshotType();
public short getSnapshotType() {
return snapshot.getSnapshotType();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public boolean isRecursive() {
}

@Override
public short getsnapshotType() {
public short getSnapshotType() {
// TODO Auto-generated method stub
return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3750,7 +3750,7 @@ protected void updateServiceOfferingHostTagsIfNotNull(String hostTags, ServiceOf
if (CollectionUtils.isNotEmpty(hosts)) {
List<String> listOfHostTags = Arrays.asList(hostTags.split(","));
for (HostVO host : hosts) {
List<String> tagsOnHost = hostTagDao.gethostTags(host.getId());
List<String> tagsOnHost = hostTagDao.getHostTags(host.getId());
if (CollectionUtils.isEmpty(tagsOnHost) || !tagsOnHost.containsAll(listOfHostTags)) {
throw new InvalidParameterValueException(String.format("There are active VMs using offering [%s], and the hosts [%s] don't have the new tags", offering.getId(), hosts));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2160,7 +2160,7 @@ protected HostVO createHostVO(final StartupCommand[] cmds, final ServerResource
final List<String> implicitHostTags = ssCmd.getHostTags();
if (!implicitHostTags.isEmpty()) {
if (hostTags == null) {
hostTags = _hostTagsDao.gethostTags(host.getId());
hostTags = _hostTagsDao.getHostTags(host.getId());
}
if (hostTags != null) {
implicitHostTags.removeAll(hostTags);
Expand Down Expand Up @@ -3172,7 +3172,7 @@ public Long getGuestOSCategoryId(final long hostId) {

@Override
public String getHostTags(final long hostId) {
final List<String> hostTags = _hostTagsDao.gethostTags(hostId);
final List<String> hostTags = _hostTagsDao.getHostTags(hostId);
if (hostTags == null) {
return null;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -612,14 +612,14 @@ private Pair<Boolean, String> performCapacityChecksBeforeHostInMaintenance(Host
if (CollectionUtils.isEmpty(vmsRunning)) {
return new Pair<>(true, "OK");
}
List<String> hostTags = hostTagsDao.gethostTags(host.getId());
List<String> hostTags = hostTagsDao.getHostTags(host.getId());

int sucessfullyCheckedVmMigrations = 0;
for (VMInstanceVO runningVM : vmsRunning) {
boolean canMigrateVm = false;
ServiceOfferingVO serviceOffering = serviceOfferingDao.findById(runningVM.getServiceOfferingId());
for (Host hostInCluster : hostsInCluster) {
if (!checkHostTags(hostTags, hostTagsDao.gethostTags(hostInCluster.getId()), serviceOffering.getHostTag())) {
if (!checkHostTags(hostTags, hostTagsDao.getHostTags(hostInCluster.getId()), serviceOffering.getHostTag())) {
s_logger.debug(String.format("Host tags mismatch between %s and %s Skipping it from the capacity check", host, hostInCluster));
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -672,8 +672,8 @@ public Pair<List<? extends Snapshot>, Integer> listSnapshots(ListSnapshotsCmd cm
sb.and("name", sb.entity().getName(), SearchCriteria.Op.LIKE);
sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ);
sb.and("idIN", sb.entity().getId(), SearchCriteria.Op.IN);
sb.and("snapshotTypeEQ", sb.entity().getsnapshotType(), SearchCriteria.Op.IN);
sb.and("snapshotTypeNEQ", sb.entity().getsnapshotType(), SearchCriteria.Op.NEQ);
sb.and("snapshotTypeEQ", sb.entity().getSnapshotType(), SearchCriteria.Op.IN);
sb.and("snapshotTypeNEQ", sb.entity().getSnapshotType(), SearchCriteria.Op.NEQ);
sb.and("dataCenterId", sb.entity().getDataCenterId(), SearchCriteria.Op.EQ);

if (tags != null && !tags.isEmpty()) {
Expand Down