- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.cloudstack.engine.subsystem.api.storage.ZoneScope.<init>()
方法的一些代码示例,展示了ZoneScope.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZoneScope.<init>()
方法的具体详情如下:
包路径:org.apache.cloudstack.engine.subsystem.api.storage.ZoneScope
类名称:ZoneScope
方法名:<init>
暂无
代码示例来源:origin: apache/cloudstack
private Scope getZoneScope(Scope scope) {
ZoneScope zoneScope;
if (scope instanceof ClusterScope) {
ClusterScope clusterScope = (ClusterScope)scope;
zoneScope = new ZoneScope(clusterScope.getZoneId());
} else if (scope instanceof HostScope) {
HostScope hostScope = (HostScope)scope;
zoneScope = new ZoneScope(hostScope.getZoneId());
} else {
zoneScope = (ZoneScope)scope;
}
return zoneScope;
}
代码示例来源:origin: apache/cloudstack
@Override
public Scope getScope() {
return new ZoneScope(imageDataStoreVO.getDataCenterId());
}
代码示例来源:origin: apache/cloudstack
private Scope getZoneScope(Scope destScope) {
ZoneScope zoneScope = null;
if (destScope instanceof ClusterScope) {
ClusterScope clusterScope = (ClusterScope)destScope;
zoneScope = new ZoneScope(clusterScope.getZoneId());
} else if (destScope instanceof HostScope) {
HostScope hostScope = (HostScope)destScope;
zoneScope = new ZoneScope(hostScope.getZoneId());
} else {
zoneScope = (ZoneScope)destScope;
}
return zoneScope;
}
代码示例来源:origin: apache/cloudstack
@Override
public DataStore getImageStore(long zoneId) {
List<DataStore> stores = getImageStoresByScope(new ZoneScope(zoneId));
if (stores == null || stores.size() == 0) {
return null;
}
return imageDataStoreMgr.getImageStore(stores);
}
代码示例来源:origin: apache/cloudstack
@Override
public DataStore getImageCacheStore(long zoneId) {
List<DataStore> stores = getImageCacheStores(new ZoneScope(zoneId));
if (stores == null || stores.size() == 0) {
return null;
}
return imageDataStoreMgr.getImageStore(stores);
}
代码示例来源:origin: apache/cloudstack
@Override
public TemplateDataStoreVO findByTemplateZoneDownloadStatus(long templateId, Long zoneId, Status... status) {
// get all elgible image stores
List<DataStore> imgStores = _storeMgr.getImageStoresByScope(new ZoneScope(zoneId));
if (imgStores != null) {
for (DataStore store : imgStores) {
List<TemplateDataStoreVO> sRes = listByTemplateStoreDownloadStatus(templateId, store.getId(), status);
if (sRes != null && sRes.size() > 0) {
Collections.shuffle(sRes);
return sRes.get(0);
}
}
}
return null;
}
代码示例来源:origin: apache/cloudstack
@Override
public List<DataStore> getImageStoreByTemplate(long templateId, Long zoneId) {
// find all eligible image stores for this zone scope
List<DataStore> imageStores = _dataStoreMgr.getImageStoresByScope(new ZoneScope(zoneId));
if (imageStores == null || imageStores.size() == 0) {
return null;
}
List<DataStore> stores = new ArrayList<DataStore>();
for (DataStore store : imageStores) {
// check if the template is stored there
List<TemplateDataStoreVO> storeTmpl = _tmplStoreDao.listByTemplateStore(templateId, store.getId());
if (storeTmpl != null && storeTmpl.size() > 0) {
stores.add(store);
}
}
return stores;
}
代码示例来源:origin: apache/cloudstack
@Override
public TemplateDataStoreVO findByTemplateZoneReady(long templateId, Long zoneId) {
List<DataStore> imgStores = null;
imgStores = _storeMgr.getImageStoresByScope(new ZoneScope(zoneId));
if (imgStores != null) {
Collections.shuffle(imgStores);
for (DataStore store : imgStores) {
List<TemplateDataStoreVO> sRes = listByTemplateStoreStatus(templateId, store.getId(), State.Ready);
if (sRes != null && sRes.size() > 0) {
return sRes.get(0);
}
}
}
return null;
}
代码示例来源:origin: apache/cloudstack
@Override
public TemplateDataStoreVO findByTemplateZoneStagingDownloadStatus(long templateId, Long zoneId, Status... status) {
// get all elgible image stores
List<DataStore> cacheStores = _storeMgr.getImageCacheStores(new ZoneScope(zoneId));
if (cacheStores != null) {
for (DataStore store : cacheStores) {
List<TemplateDataStoreVO> sRes = listByTemplateStoreDownloadStatus(templateId, store.getId(),
status);
if (sRes != null && sRes.size() > 0) {
Collections.shuffle(sRes);
return sRes.get(0);
}
}
}
return null;
}
代码示例来源:origin: apache/cloudstack
@Override
public List<TemplateDataStoreVO> listByTemplateZoneDownloadStatus(long templateId, Long zoneId, Status... status) {
// get all elgible image stores
List<DataStore> imgStores = _storeMgr.getImageStoresByScope(new ZoneScope(zoneId));
if (imgStores != null) {
List<TemplateDataStoreVO> result = new ArrayList<TemplateDataStoreVO>();
for (DataStore store : imgStores) {
List<TemplateDataStoreVO> sRes = listByTemplateStoreDownloadStatus(templateId, store.getId(), status);
if (sRes != null && sRes.size() > 0) {
result.addAll(sRes);
}
}
return result;
}
return null;
}
代码示例来源:origin: apache/cloudstack
@Override
public TemplateDataStoreVO findByTemplateZone(long templateId, Long zoneId, DataStoreRole role) {
// get all elgible image stores
List<DataStore> imgStores = null;
if (role == DataStoreRole.Image) {
imgStores = _storeMgr.getImageStoresByScope(new ZoneScope(zoneId));
} else if (role == DataStoreRole.ImageCache) {
imgStores = _storeMgr.getImageCacheStores(new ZoneScope(zoneId));
}
if (imgStores != null) {
for (DataStore store : imgStores) {
List<TemplateDataStoreVO> sRes = listByTemplateStore(templateId, store.getId());
if (sRes != null && sRes.size() > 0) {
return sRes.get(0);
}
}
}
return null;
}
代码示例来源:origin: apache/cloudstack
@Override
public List<DataStore> listImageCacheStores(Scope scope) {
if (scope.getScopeType() != ScopeType.ZONE) {
s_logger.debug("only support zone wide image cache stores");
return null;
}
List<ImageStoreVO> stores = dataStoreDao.findImageCacheByScope(new ZoneScope(scope.getScopeId()));
List<DataStore> imageStores = new ArrayList<DataStore>();
for (ImageStoreVO store : stores) {
imageStores.add(getImageStore(store.getId()));
}
return imageStores;
}
代码示例来源:origin: apache/cloudstack
@Override
public TemplateInfo prepareIso(long isoId, long dcId, Long hostId, Long poolId) {
TemplateInfo tmplt;
boolean bypassed = false;
if (_tmplFactory.isTemplateMarkedForDirectDownload(isoId)) {
tmplt = _tmplFactory.getReadyBypassedTemplateOnPrimaryStore(isoId, poolId, hostId);
bypassed = true;
} else {
tmplt = _tmplFactory.getTemplate(isoId, DataStoreRole.Image, dcId);
}
if (tmplt == null || tmplt.getFormat() != ImageFormat.ISO) {
s_logger.warn("ISO: " + isoId + " does not exist in vm_template table");
return null;
}
if (!bypassed && tmplt.getDataStore() != null && !(tmplt.getDataStore().getTO() instanceof NfsTO)) {
// if it is s3, need to download into cache storage first
Scope destScope = new ZoneScope(dcId);
TemplateInfo cacheData = (TemplateInfo)cacheMgr.createCacheObject(tmplt, destScope);
if (cacheData == null) {
s_logger.error("Failed in copy iso from S3 to cache storage");
return null;
}
return cacheData;
} else {
return tmplt;
}
}
代码示例来源:origin: apache/cloudstack
@Override
public void handleSysTemplateDownload(HypervisorType hostHyper, Long dcId) {
Set<VMTemplateVO> toBeDownloaded = new HashSet<VMTemplateVO>();
List<DataStore> stores = _storeMgr.getImageStoresByScope(new ZoneScope(dcId));
if (stores == null || stores.isEmpty()) {
return;
代码示例来源:origin: apache/cloudstack
private void addStorageMetrics(final List<Item> metricsList, final long dcId, final String zoneName, final String zoneUuid) {
for (final StoragePoolJoinVO pool: storagePoolJoinDao.listAll()) {
if (pool == null || pool.getZoneId() != dcId) {
continue;
}
final String poolName = pool.getName();
final String poolPath = pool.getHostAddress() + ":" + pool.getPath();
long usedCapacity = 0L;
long allocatedCapacity = pool.getUsedCapacity() + pool.getReservedCapacity();
final long totalCapacity = pool.getCapacityBytes();
final StorageStats stats = ApiDBUtils.getStoragePoolStatistics(pool.getId());
if (stats != null) {
usedCapacity = stats.getByteUsed();
}
final BigDecimal poolOverProvisioningFactor = BigDecimal.valueOf(CapacityManager.StorageOverprovisioningFactor.valueIn(pool.getId()));
final String poolFactor = poolOverProvisioningFactor.toString();
metricsList.add(new ItemPool(zoneName, zoneUuid, poolName, poolPath, "primary", poolFactor, USED, usedCapacity));
metricsList.add(new ItemPool(zoneName, zoneUuid, poolName, poolPath, "primary", poolFactor, ALLOCATED, allocatedCapacity));
metricsList.add(new ItemPool(zoneName, zoneUuid, poolName, poolPath, "primary", poolFactor, UNALLOCATED, poolOverProvisioningFactor.multiply(BigDecimal.valueOf(totalCapacity)).longValue() - allocatedCapacity));
metricsList.add(new ItemPool(zoneName, zoneUuid, poolName, poolPath, "primary", poolFactor, TOTAL, totalCapacity));
}
for (final ImageStore imageStore : imageStoreDao.findByScope(new ZoneScope(dcId))) {
final StorageStats stats = ApiDBUtils.getSecondaryStorageStatistics(imageStore.getId());
metricsList.add(new ItemPool(zoneName, zoneUuid, imageStore.getName(), imageStore.getUrl(), "secondary", null, USED, stats != null ? stats.getByteUsed() : 0));
metricsList.add(new ItemPool(zoneName, zoneUuid, imageStore.getName(), imageStore.getUrl(), "secondary", null, TOTAL, stats != null ? stats.getCapacityBytes() : 0));
}
}
代码示例来源:origin: apache/cloudstack
@Override
public CapacityVO getSecondaryStorageUsedStats(Long hostId, Long zoneId) {
SearchCriteria<HostVO> sc = _hostDao.createSearchCriteria();
if (zoneId != null) {
sc.addAnd("dataCenterId", SearchCriteria.Op.EQ, zoneId);
}
List<Long> hosts = new ArrayList<Long>();
if (hostId != null) {
hosts.add(hostId);
} else {
List<DataStore> stores = _dataStoreMgr.getImageStoresByScope(new ZoneScope(zoneId));
if (stores != null) {
for (DataStore store : stores) {
hosts.add(store.getId());
}
}
}
CapacityVO capacity = new CapacityVO(hostId, zoneId, null, null, 0, 0, Capacity.CAPACITY_TYPE_SECONDARY_STORAGE);
for (Long id : hosts) {
StorageStats stats = ApiDBUtils.getSecondaryStorageStatistics(id);
if (stats == null) {
continue;
}
capacity.setUsedCapacity(stats.getByteUsed() + capacity.getUsedCapacity());
capacity.setTotalCapacity(stats.getCapacityBytes() + capacity.getTotalCapacity());
}
return capacity;
}
代码示例来源:origin: apache/cloudstack
if(!_imageStoreDao.findByScope(new ZoneScope(zoneId)).isEmpty()) {
throw new CloudRuntimeException(errorMsg + "there are Secondary storages in this zone");
代码示例来源:origin: apache/cloudstack
@Override
public Scope getScope() {
StoragePoolVO vo = dataStoreDao.findById(pdsv.getId());
if (vo.getScope() == ScopeType.CLUSTER) {
return new ClusterScope(vo.getClusterId(), vo.getPodId(), vo.getDataCenterId());
} else if (vo.getScope() == ScopeType.ZONE) {
return new ZoneScope(vo.getDataCenterId());
} else if (vo.getScope() == ScopeType.HOST) {
List<StoragePoolHostVO> poolHosts = poolHostDao.listByPoolId(vo.getId());
if (poolHosts.size() > 0) {
return new HostScope(poolHosts.get(0).getHostId(), vo.getClusterId(), vo.getDataCenterId());
}
s_logger.debug("can't find a local storage in pool host table: " + vo.getId());
}
return null;
}
代码示例来源:origin: apache/cloudstack
List<DataStore> imageStores = _storeMgr.getImageStoresByScope(new ZoneScope(agent.getDataCenterId()));
for (DataStore store : imageStores) {
_volumeSrv.handleVolumeSync(store);
代码示例来源:origin: apache/cloudstack
if (!(storTO instanceof NfsTO)) {
srcData = cacheSnapshotChain(snapshot, new ZoneScope(pool.getDataCenterId()));
CloudStack SSVM启动条件源码阅读与问题解决方法: 在CloudStack建立zone的时候,经常遇到SSVM不启动,或者根本就没有SSVM的情况,分析CloudStack
CloudStack创建主存储失败(SR已经被使用),删除SR后成功 &nb
CloudStack 环境重新部署: 最近公司项目需求,由于更
CloudStack 安装及使用过程中常见问题汇总 在做工程项
我正在开发一个cloudstack框架模型,以分析Cloudstack与我组织的产品的可行性。 我试图从cloudstack的UI中删除辅助存储,但由于错误“无法删除带有事件模板备份的图像存储!”而失
很难说出这里要问什么。这个问题模棱两可、含糊不清、不完整、过于宽泛或夸夸其谈,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开,visit the help center . 关闭10
本文整理了Java中org.jclouds.cloudstack.domain.Zone类的一些代码示例,展示了Zone类的具体用法。这些代码示例主要来源于Github/Stackoverflow/M
本文整理了Java中org.jclouds.cloudstack.features.ZoneClient类的一些代码示例,展示了ZoneClient类的具体用法。这些代码示例主要来源于Github/S
本文整理了Java中org.jclouds.cloudstack.predicates.ZonePredicates类的一些代码示例,展示了ZonePredicates类的具体用法。这些代码示例主要来
我想将 10-15 个 VMWare 主机部署到 cloudstack。这是我第一次使用任何类型的云。我正在研究安装和架构,我一直坚持使用 VMWare 主机我必须安装 VCenter 服务器,但我不
本文整理了Java中org.apache.cloudstack.api.response.ZoneResponse类的一些代码示例,展示了ZoneResponse类的具体用法。这些代码示例主要来源于G
我正在 ubuntu 上安装 cloudstack,它使用 maven 来解决它的依赖关系。运行命令 mvn -P deps 时出现以下错误 [ERROR] The build could not r
本文整理了Java中org.jclouds.cloudstack.domain.Zone.getDisplayText()方法的一些代码示例,展示了Zone.getDisplayText()的具体用法
本文整理了Java中org.jclouds.cloudstack.domain.Zone.getVLAN()方法的一些代码示例,展示了Zone.getVLAN()的具体用法。这些代码示例主要来源于Gi
本文整理了Java中org.jclouds.cloudstack.domain.Zone.builder()方法的一些代码示例,展示了Zone.builder()的具体用法。这些代码示例主要来源于Gi
本文整理了Java中org.jclouds.cloudstack.domain.Zone.()方法的一些代码示例,展示了Zone.()的具体用法。这些代码示例主要来源于Github/Stackover
本文整理了Java中org.jclouds.cloudstack.domain.Zone.getDescription()方法的一些代码示例,展示了Zone.getDescription()的具体用法
本文整理了Java中org.jclouds.cloudstack.domain.Zone.getName()方法的一些代码示例,展示了Zone.getName()的具体用法。这些代码示例主要来源于Gi
本文整理了Java中org.jclouds.cloudstack.domain.Zone.getGuestCIDRAddress()方法的一些代码示例,展示了Zone.getGuestCIDRAddr
本文整理了Java中org.jclouds.cloudstack.domain.Zone.getDomain()方法的一些代码示例,展示了Zone.getDomain()的具体用法。这些代码示例主要来
我是一名优秀的程序员,十分优秀!