|
|
|
@ -38,6 +38,13 @@ public class VolumeServiceImpl implements IVolumeService {
|
|
|
|
|
public int save(VolumeDataEntity entity) throws Exception {
|
|
|
|
|
int rest = 1;
|
|
|
|
|
//createVolume("lili_test1", 0, "distributed", bricksToCreate, "/home/lili_test1_point")
|
|
|
|
|
List<VolumeInitEntity> vols = volumeDao.findAll();
|
|
|
|
|
Map<String, Object> volMap = new HashMap<String, Object>();
|
|
|
|
|
if (null!= vols) {
|
|
|
|
|
for (VolumeInitEntity volumeInitEntity : vols) {
|
|
|
|
|
volMap.put(volumeInitEntity.getPath(), null);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
List<VolumeDataEntity> result = gfsService.getAllVolumes();
|
|
|
|
|
List<VolumeDataEntity> addVolumes = new ArrayList<VolumeDataEntity>();
|
|
|
|
|
VolumeDataEntity volumeTmp = null;
|
|
|
|
@ -81,7 +88,7 @@ public class VolumeServiceImpl implements IVolumeService {
|
|
|
|
|
//创建volume
|
|
|
|
|
if (bristr.size() > 0) {
|
|
|
|
|
//TODO 换成 web 请求
|
|
|
|
|
int createreslt = setVolume.createVolume(add.getName(), 0, "distributed", bristr, add.getPath());
|
|
|
|
|
int createreslt = setVolume.createVolume(add.getName(), 0, "Distribute", bristr, add.getPath());
|
|
|
|
|
if (createreslt != 1) {
|
|
|
|
|
rest = createreslt;
|
|
|
|
|
}
|
|
|
|
@ -90,7 +97,9 @@ public class VolumeServiceImpl implements IVolumeService {
|
|
|
|
|
VolumeInitEntity volInSql = new VolumeInitEntity();
|
|
|
|
|
volInSql.setName(add.getName());
|
|
|
|
|
volInSql.setPath(add.getPath());
|
|
|
|
|
volumeDao.save(volInSql);
|
|
|
|
|
if (!volMap.keySet().contains(volInSql.getPath())) {
|
|
|
|
|
volumeDao.save(volInSql);
|
|
|
|
|
}
|
|
|
|
|
isContinue = false;
|
|
|
|
|
}
|
|
|
|
|
// 修改 brick
|
|
|
|
|