修改volume删除失败bug

web_backend_develope
chenlw 9 years ago
parent 4ab1c353c5
commit 0c7fbfe478

@ -52,7 +52,7 @@ public class VolumeController extends BaseController{
@ResponseBody
public String volumeDelete(HttpServletRequest res, HttpServletResponse req,
@RequestBody VolumeEntity entity) throws Exception {
Configs.CONSOLE_LOGGER.error("/oracle/delete");
Configs.CONSOLE_LOGGER.error("/volume/delete");
int rest = volumeService.delete(entity);
if (rest == 1) {
req.setStatus(200);

@ -25,10 +25,10 @@ import java.util.List;
public class VolumeEntity {
/** volume总大小 */
private double allSize;
private Double allSize;
/** volume已使用大小 */
private double usedSize;
private Double usedSize;
/** volume名称 */
private String name;
@ -37,7 +37,7 @@ public class VolumeEntity {
private String path;
/** * exist正常返回状态Started,Stopped,Created */
private boolean status;
private Boolean status;
private String type;
@ -50,28 +50,28 @@ public class VolumeEntity {
/**
* @return the allSize
*/
public double getAllSize() {
public Double getAllSize() {
return allSize;
}
/**
* @param allSize the allSize to set
*/
public void setAllSize(double allSize) {
public void setAllSize(Double allSize) {
this.allSize = allSize;
}
/**
* @return the usedSize
*/
public double getUsedSize() {
public Double getUsedSize() {
return usedSize;
}
/**
* @param usedSize the usedSize to set
*/
public void setUsedSize(double usedSize) {
public void setUsedSize(Double usedSize) {
this.usedSize = usedSize;
}
@ -107,14 +107,14 @@ public class VolumeEntity {
/**
* @return the status
*/
public boolean isStatus() {
public Boolean isStatus() {
return status;
}
/**
* @param status the status to set
*/
public void setStatus(boolean status) {
public void setStatus(Boolean status) {
this.status = status;
}

@ -1,23 +1,124 @@
package com.platform.entities;
import java.util.ArrayList;
import java.util.List;
public class VolumeForm {
//
// List<VolumeEntity> volumes;
//
// /**
// * @return the volumes
// */
// public List<VolumeEntity> getVolumes() {
// return volumes;
// }
//
// /**
// * @param volumes the volumes to set
// */
// public void setVolumes(List<VolumeEntity> volumes) {
// this.volumes = volumes;
// }
/** volume名称 */
private String name;
List<VolumeEntity> volumes;
/** 挂载点 */
private String path;
/** * exist正常返回状态Started,Stopped,Created */
private boolean status;
private String type;
/** volume树形目录 */
private List<FolderNode> folder = new ArrayList<FolderNode>();
/** volume的 块 */
private List<Brick> brick = new ArrayList<Brick>();
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}
/**
* @return the path
*/
public String getPath() {
return path;
}
/**
* @param path the path to set
*/
public void setPath(String path) {
this.path = path;
}
/**
* @return the status
*/
public boolean isStatus() {
return status;
}
/**
* @param status the status to set
*/
public void setStatus(boolean status) {
this.status = status;
}
/**
* @return the type
*/
public String getType() {
return type;
}
/**
* @param type the type to set
*/
public void setType(String type) {
this.type = type;
}
/**
* @return the folder
*/
public List<FolderNode> getFolder() {
return folder;
}
/**
* @param folder the folder to set
*/
public void setFolder(List<FolderNode> folder) {
this.folder = folder;
}
/**
* @return the volumes
* @return the brick
*/
public List<VolumeEntity> getVolumes() {
return volumes;
public List<Brick> getBrick() {
return brick;
}
/**
* @param volumes the volumes to set
* @param brick the brick to set
*/
public void setVolumes(List<VolumeEntity> volumes) {
this.volumes = volumes;
public void setBrick(List<Brick> brick) {
this.brick = brick;
}
}

@ -128,8 +128,8 @@ public class GfsServiceImpl implements IGfsService {
if (null != path && path.size() > 0) {
volume.setPath(path.get(0));
}
volume.setAllSize(volumeInfo.getVolumeAvailableSize(volumeName));
volume.setUsedSize(volumeInfo.getVolumeUseSize(volumeName));
volume.setAllSize((double) volumeInfo.getVolumeAvailableSize(volumeName));
volume.setUsedSize((double) volumeInfo.getVolumeUseSize(volumeName));
// volume.setBrick(brick);
if (null != volume.getPath()) {
List<FolderNode> list = new ArrayList<FolderNode>();

@ -94,9 +94,9 @@ public class ThreadVolume extends Thread {
if (null == volume.getPath()) {
volume.setPath("");
}
volume.setAllSize(volumeInfo
volume.setAllSize((double) (volumeInfo
.getVolumeAvailableSize(volumeName)
+ volumeInfo.getVolumeUseSize(volumeName));
+ volumeInfo.getVolumeUseSize(volumeName)));
// 状态Started,Stopped,Created
String status = volumeInfo.getVolumeStatus(volumeName);
if ("Started".equals(status)) {
@ -104,7 +104,7 @@ public class ThreadVolume extends Thread {
} else {
volume.setStatus(false);
}
volume.setUsedSize(volumeInfo.getVolumeUseSize(volumeName));
volume.setUsedSize((double) volumeInfo.getVolumeUseSize(volumeName));
volume.setType(volumeInfo.getVolumeType(volumeName));
// TODO 查询brick--
// 返回 ip:path

Loading…
Cancel
Save