mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
removed some references to name
This commit is contained in:
parent
88c0126878
commit
6936a666fd
@ -163,6 +163,11 @@ public interface VirtualMachine extends RunningOn, ControlledEntity, StateObject
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The name of the vm instance used by the cloud stack to uniquely
|
||||
* reference this VM. You can build names that starts with this name and it
|
||||
* guarantees uniqueness for things related to the VM.
|
||||
*/
|
||||
public String getInstanceName();
|
||||
|
||||
/**
|
||||
@ -171,7 +176,9 @@ public interface VirtualMachine extends RunningOn, ControlledEntity, StateObject
|
||||
public long getId();
|
||||
|
||||
/**
|
||||
* @return the name of the virtual machine.
|
||||
* @return the host name of the virtual machine. If the user did not
|
||||
* specify the host name when creating the virtual machine then it is
|
||||
* the name generated by cloud stack.
|
||||
*/
|
||||
public String getName();
|
||||
|
||||
@ -220,6 +227,7 @@ public interface VirtualMachine extends RunningOn, ControlledEntity, StateObject
|
||||
* @return id of the host it was assigned last time.
|
||||
*/
|
||||
public Long getLastHostId();
|
||||
@Override
|
||||
public Long getHostId();
|
||||
|
||||
public void setLastHostId(Long lastHostId);
|
||||
|
||||
@ -31,7 +31,6 @@ public class CheckPointManagerImpl implements CheckPointManager, Manager, Cluste
|
||||
private static final Logger s_logger = Logger.getLogger(CheckPointManagerImpl.class);
|
||||
|
||||
private static final int ACQUIRE_GLOBAL_LOCK_TIMEOUT_FOR_COOPERATION = 3; // 3 seconds
|
||||
private static final int GC_INTERVAL = 10000; // 10 seconds
|
||||
private int _cleanupRetryInterval;
|
||||
|
||||
private String _name;
|
||||
@ -44,8 +43,6 @@ public class CheckPointManagerImpl implements CheckPointManager, Manager, Cluste
|
||||
|
||||
long _msId;
|
||||
|
||||
private final ScheduledExecutorService _heartbeatScheduler = Executors.newScheduledThreadPool(1, new NamedThreadFactory("TaskMgr-Heartbeat"));
|
||||
|
||||
private final ScheduledExecutorService _cleanupScheduler = Executors.newScheduledThreadPool(1, new NamedThreadFactory("Task-Cleanup"));
|
||||
|
||||
protected CheckPointManagerImpl() {
|
||||
@ -119,14 +116,6 @@ public class CheckPointManagerImpl implements CheckPointManager, Manager, Cluste
|
||||
|
||||
@Override
|
||||
public boolean start() {
|
||||
// try {
|
||||
// List<TaskVO> l = _maidDao.listLeftoversByMsid(_clusterMgr.getManagementNodeId());
|
||||
// cleanupLeftovers(l);
|
||||
// } catch (Throwable e) {
|
||||
// s_logger.error("Unexpected exception " + e.getMessage(), e);
|
||||
// }
|
||||
//
|
||||
// _heartbeatScheduler.scheduleAtFixedRate(getGCTask(), GC_INTERVAL, GC_INTERVAL, TimeUnit.MILLISECONDS);
|
||||
_cleanupScheduler.schedule(new CleanupTask(), _cleanupRetryInterval > 0 ? _cleanupRetryInterval : 600, TimeUnit.SECONDS);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -20,7 +20,6 @@ package com.cloud.vm.dao;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.cloud.uservm.UserVm;
|
||||
import com.cloud.utils.db.GenericDao;
|
||||
import com.cloud.vm.UserVmVO;
|
||||
|
||||
@ -33,8 +32,6 @@ public interface UserVmDao extends GenericDao<UserVmVO, Long> {
|
||||
List<UserVmVO> listByLastHostId(Long hostId);
|
||||
List<UserVmVO> listUpByHostId(Long hostId);
|
||||
|
||||
UserVmVO findByName(String name);
|
||||
|
||||
/**
|
||||
* Updates display name and group for vm; enables/disables ha
|
||||
* @param id vm id.
|
||||
@ -62,7 +59,6 @@ public interface UserVmDao extends GenericDao<UserVmVO, Long> {
|
||||
|
||||
List<UserVmVO> listByNetworkId(long networkId);
|
||||
|
||||
UserVm findVmByZoneIdAndName(long zoneId, String name);
|
||||
List<UserVmVO> listByAccountIdAndHostId(long accountId, long hostId);
|
||||
|
||||
void loadDetails(UserVmVO vm);
|
||||
|
||||
@ -29,20 +29,15 @@ import javax.ejb.Local;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.capacity.CapacityVO;
|
||||
import com.cloud.host.HostVO;
|
||||
import com.cloud.uservm.UserVm;
|
||||
import com.cloud.utils.component.ComponentLocator;
|
||||
import com.cloud.utils.db.Attribute;
|
||||
import com.cloud.utils.db.Filter;
|
||||
import com.cloud.utils.db.GenericDaoBase;
|
||||
import com.cloud.utils.db.GenericSearchBuilder;
|
||||
import com.cloud.utils.db.JoinBuilder;
|
||||
import com.cloud.utils.db.SearchBuilder;
|
||||
import com.cloud.utils.db.SearchCriteria;
|
||||
import com.cloud.utils.db.Transaction;
|
||||
import com.cloud.utils.db.SearchCriteria.Func;
|
||||
import com.cloud.utils.db.SearchCriteria.Op;
|
||||
import com.cloud.utils.db.Transaction;
|
||||
import com.cloud.utils.exception.CloudRuntimeException;
|
||||
import com.cloud.vm.NicVO;
|
||||
import com.cloud.vm.UserVmVO;
|
||||
@ -59,9 +54,7 @@ public class UserVmDaoImpl extends GenericDaoBase<UserVmVO, Long> implements Use
|
||||
protected final SearchBuilder<UserVmVO> LastHostSearch;
|
||||
protected final SearchBuilder<UserVmVO> HostUpSearch;
|
||||
protected final SearchBuilder<UserVmVO> HostRunningSearch;
|
||||
protected final SearchBuilder<UserVmVO> NameSearch;
|
||||
protected final SearchBuilder<UserVmVO> StateChangeSearch;
|
||||
protected final SearchBuilder<UserVmVO> ZoneNameSearch;
|
||||
protected final SearchBuilder<UserVmVO> AccountHostSearch;
|
||||
|
||||
protected final SearchBuilder<UserVmVO> DestroySearch;
|
||||
@ -102,10 +95,6 @@ public class UserVmDaoImpl extends GenericDaoBase<UserVmVO, Long> implements Use
|
||||
HostRunningSearch.and("state", HostRunningSearch.entity().getState(), SearchCriteria.Op.EQ);
|
||||
HostRunningSearch.done();
|
||||
|
||||
NameSearch = createSearchBuilder();
|
||||
NameSearch.and("name", NameSearch.entity().getName(), SearchCriteria.Op.EQ);
|
||||
NameSearch.done();
|
||||
|
||||
AccountPodSearch = createSearchBuilder();
|
||||
AccountPodSearch.and("account", AccountPodSearch.entity().getAccountId(), SearchCriteria.Op.EQ);
|
||||
AccountPodSearch.and("pod", AccountPodSearch.entity().getPodId(), SearchCriteria.Op.EQ);
|
||||
@ -128,11 +117,6 @@ public class UserVmDaoImpl extends GenericDaoBase<UserVmVO, Long> implements Use
|
||||
DestroySearch.and("updateTime", DestroySearch.entity().getUpdateTime(), SearchCriteria.Op.LT);
|
||||
DestroySearch.done();
|
||||
|
||||
ZoneNameSearch = createSearchBuilder();
|
||||
ZoneNameSearch.and("dataCenterId", ZoneNameSearch.entity().getDataCenterId(), SearchCriteria.Op.EQ);
|
||||
ZoneNameSearch.and("name", ZoneNameSearch.entity().getName(), SearchCriteria.Op.EQ);
|
||||
ZoneNameSearch.done();
|
||||
|
||||
AccountHostSearch = createSearchBuilder();
|
||||
AccountHostSearch.and("accountId", AccountHostSearch.entity().getAccountId(), SearchCriteria.Op.EQ);
|
||||
AccountHostSearch.and("hostId", AccountHostSearch.entity().getHostId(), SearchCriteria.Op.EQ);
|
||||
@ -216,13 +200,6 @@ public class UserVmDaoImpl extends GenericDaoBase<UserVmVO, Long> implements Use
|
||||
|
||||
return listBy(sc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserVmVO findByName(String name) {
|
||||
SearchCriteria<UserVmVO> sc = NameSearch.create();
|
||||
sc.setParameters("name", name);
|
||||
return findOneIncludingRemovedBy(sc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserVmVO> listVirtualNetworkInstancesByAcctAndZone(long accountId, long dcId, long networkId) {
|
||||
@ -274,14 +251,6 @@ public class UserVmDaoImpl extends GenericDaoBase<UserVmVO, Long> implements Use
|
||||
return listBy(sc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserVm findVmByZoneIdAndName(long zoneId, String name) {
|
||||
SearchCriteria<UserVmVO> sc = ZoneNameSearch.create();
|
||||
sc.setParameters("dataCenterId", zoneId);
|
||||
sc.setParameters("name", name);
|
||||
return findOneBy(sc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserVmVO> listByAccountIdAndHostId(long accountId, long hostId) {
|
||||
SearchCriteria<UserVmVO> sc = AccountHostSearch.create();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user