@Override public String call(PrimaryStorageClusterRefVO arg) { return arg.getClusterUuid(); } });
@Override public String call(PrimaryStorageClusterRefVO arg) { return arg.getClusterUuid(); } });
Map<String, Set<String>> clusterPs = new HashMap<>(); for (PrimaryStorageClusterRefVO ref : refs) { Set<String> pss = clusterPs.get(ref.getClusterUuid()); if (pss == null) { pss = new HashSet<>(); clusterPs.put(ref.getClusterUuid(), pss);
private void handle(PrimaryStorageRemoveCachedImageMsg msg) { if (self.getAttachedClusterRefs().isEmpty()) { PrimaryStorageRemoveCachedImageReply reply = new PrimaryStorageRemoveCachedImageReply(); reply.setError(operr("primary storage[uuid:%s] doesn't attach to any cluster", self.getUuid())); bus.reply(msg, reply); return; } PrimaryStorageClusterRefVO ref = self.getAttachedClusterRefs().iterator().next(); ClusterVO cluster = dbf.findByUuid(ref.getClusterUuid(), ClusterVO.class); getBackend(HypervisorType.valueOf(cluster.getHypervisorType())).deleteImageCache(msg.getInventory()); }
public static PrimaryStorageClusterRefInventory valueOf(PrimaryStorageClusterRefVO vo) { PrimaryStorageClusterRefInventory inv = new PrimaryStorageClusterRefInventory(); inv.setClusterUuid(vo.getClusterUuid()); inv.setId(vo.getId()); inv.setLastOpDate(vo.getLastOpDate()); inv.setCreateDate(vo.getCreateDate()); return inv; }
.anyMatch(ref -> ref.getClusterUuid().equals(d.getInventory().getClusterUuid()))) { return false;
protected PrimaryStorageInventory(PrimaryStorageVO vo) { setZoneUuid(vo.getZoneUuid()); setCreateDate(vo.getCreateDate()); setDescription(vo.getDescription()); setLastOpDate(vo.getLastOpDate()); setName(vo.getName()); setState(vo.getState().toString()); setType(vo.getType()); setUrl(vo.getUrl()); setUuid(vo.getUuid()); setMountPath(vo.getMountPath()); setStatus(vo.getStatus().toString()); attachedClusterUuids = new ArrayList<String>(vo.getAttachedClusterRefs().size()); for (PrimaryStorageClusterRefVO ref : vo.getAttachedClusterRefs()) { attachedClusterUuids.add(ref.getClusterUuid()); } if (vo.getCapacity() != null) { setTotalCapacity(vo.getCapacity().getTotalCapacity()); setAvailableCapacity(vo.getCapacity().getAvailableCapacity()); setTotalPhysicalCapacity(vo.getCapacity().getTotalPhysicalCapacity()); setAvailablePhysicalCapacity(vo.getCapacity().getAvailablePhysicalCapacity()); setSystemUsedCapacity(vo.getCapacity().getSystemUsedCapacity()); } }