|
|
|
|
|
/**
|
|
|
* 文件名 : ShowGlusterfsController.java
|
|
|
* 版权 : <版权/公司名>
|
|
|
* 描述 : <描述>
|
|
|
* @author liliy
|
|
|
* 版本 : <版本>
|
|
|
* 修改时间: 2016年9月8日
|
|
|
* 修改内容: <修改内容>
|
|
|
*/
|
|
|
package com.platform.controller;
|
|
|
|
|
|
<<<<<<< HEAD
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
import org.apache.log4j.Logger;
|
|
|
=======
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
>>>>>>> 355b6e47a4fa8d058029ec939fe4fefdaa751275
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
|
import com.platform.glusterfs.ClusterInfo;
|
|
|
<<<<<<< HEAD
|
|
|
import com.platform.glusterfs.VolumeInfo;
|
|
|
|
|
|
/**
|
|
|
* 显示集群信息
|
|
|
=======
|
|
|
|
|
|
/**
|
|
|
* <一句话功能简述>
|
|
|
>>>>>>> 355b6e47a4fa8d058029ec939fe4fefdaa751275
|
|
|
* <功能详细描述>
|
|
|
* @author liliy
|
|
|
* @version [版本号,2016年9月8日]
|
|
|
* @see [相关类/方法]
|
|
|
* @since [产品/模块版本]
|
|
|
*/
|
|
|
@Controller
|
|
|
public class ShowGlusterfsController {
|
|
|
<<<<<<< HEAD
|
|
|
public static Logger log = Logger.getLogger(ShowGlusterfsController.class);
|
|
|
/**
|
|
|
* 显示集群节点以及状态
|
|
|
=======
|
|
|
/**
|
|
|
* <一句话功能简述>
|
|
|
>>>>>>> 355b6e47a4fa8d058029ec939fe4fefdaa751275
|
|
|
* <功能详细描述>
|
|
|
* @return
|
|
|
* @see [类、类#方法、类#成员]
|
|
|
*/
|
|
|
@RequestMapping("/showPeerStatus")
|
|
|
public Map<String,String> showPeerStatus(){
|
|
|
Map<String, String> peer_status=new ClusterInfo().showClusterInfo();
|
|
|
return peer_status;
|
|
|
}
|
|
|
|
|
|
<<<<<<< HEAD
|
|
|
/**
|
|
|
* <一句话功能简述>
|
|
|
* <功能详细描述>
|
|
|
* @return
|
|
|
* @see [类、类#方法、类#成员]
|
|
|
*/
|
|
|
@RequestMapping("/showVolumeStatus")
|
|
|
public Map<String,String> showVolumeStatus(){
|
|
|
VolumeInfo volumeInfo=new VolumeInfo();
|
|
|
Map<String, String> volume_status=new HashMap<String, String>();
|
|
|
List<String> volumes=volumeInfo.showAllVolumeName();
|
|
|
if(volumes==null){
|
|
|
log.error("showAllVolumeName is error!");
|
|
|
return null;
|
|
|
}
|
|
|
for(String vol:volumes){
|
|
|
String status=volumeInfo.getVolumeStatus(vol);
|
|
|
if(status==null){
|
|
|
log.error("getVolumeStatus is error!");
|
|
|
return null;
|
|
|
}
|
|
|
volume_status.put(vol, status);
|
|
|
}
|
|
|
return volume_status;
|
|
|
}
|
|
|
|
|
|
|
|
|
=======
|
|
|
>>>>>>> 355b6e47a4fa8d058029ec939fe4fefdaa751275
|
|
|
|
|
|
}
|