This commit is contained in:
chenlw 2016-12-02 21:38:01 +08:00
parent c00360a92e
commit 86436a12b8
8 changed files with 47 additions and 14 deletions

View File

@ -116,6 +116,12 @@ PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN"
ORDER BY data_details.id
</select>
<select id="countByDataPath" resultType="java.lang.Integer" parameterType="com.platform.entities.DataInfoEntity">
SELECT count(id)
FROM data_info
where data_path=#{dataPath} and remove='0'
</select>
<!-- 获取数据符合筛选条件的全部记录信息 -->
<select id="findById" resultMap="getEntityByText" parameterType="java.lang.Integer">
SELECT
@ -215,6 +221,9 @@ PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN"
<if test="endMonth != null and endMonth != ''">
end_month,
</if>
<if test="dataBaseType != null and dataBaseType != ''">
data_base_type,
</if>
</trim>
)
VALUES(
@ -279,6 +288,9 @@ PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN"
<if test="endMonth != null and endMonth != ''">
#{endMonth},
</if>
<if test="dataBaseType != null and dataBaseType != ''">
#{dataBaseType},
</if>
</trim>
)
</insert>

View File

@ -113,7 +113,7 @@ PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN"
a.is_budget_exec budgetExecManage,a.is_budget_quota budgetQuotaManage,a.is_collection collection,a.is_department_budget departmentBudgetManage,a.total_budget_account totalBudgetAccount,
a.final_account_manage finalAccountManage,a.report_form_manage reportFormManage,a.non_tax_revenue_manage nonTaxManage,a.wage_system wageSystem,
a.analysis_of_financial_economic_prosperity analysisOfFinancialEconomicProsperity,a.government_debt governmentDebtManage,d.data_version dataVersion,d.collection_time collectingTime,l.is_update collUpdate,
d.checkout_indicate execResult,d.checkout_pay payResult,d.checkout_flag checkoutFlag,d.checkout_indicate_last execResultLast,d.checkout_pay_last payResultLast
d.checkout_indicate execResult,d.checkout_pay payResult,d.checkout_flag checkoutFlag,d.checkout_indicate_last execResultLast,d.checkout_pay_last payResultLast,d.mark mark
</sql>
<!-- 获取数据符合筛选条件的全部记录信息 -->
@ -196,7 +196,7 @@ PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN"
SELECT
<include refid="find_city_Column_List" />
FROM standard_data_details a left join collection_data_description l on a.area_code=l.regionalism_code AND a.sys_code=l.sys_code
left join data_info d on a.area_code=d.regionalism_code AND a.sys_code=d.system_code AND d.remove='0'
left join data_details d on a.area_code=d.regionalism_code AND a.sys_code=d.system_code
<where>
a.is_collection='是' AND a.city_name=#{cityName}
</where>

View File

@ -28,6 +28,8 @@ public interface DataInfoDao {
List<DataInfoEntity> findByParam(DataInfoEntity data)throws Exception;
int countByDataPath(DataInfoEntity data)throws Exception;
int removes(List<Integer> list)throws Exception;
int save(DataInfoEntity data) throws Exception;

View File

@ -136,11 +136,16 @@ public class SetVolume {
*/
public int deleteVolume(String volumeName) throws Exception{
int reslut = 0;
this.stopVolume(volumeName);
try {
Thread.sleep(500);
} catch (Exception e) {
log.info(e);
}
log.info("delete volume " + volumeName);
Map<String, Object> map = new HashMap<String, Object>();
map.put("volumeName", volumeName);
//请求web
this.stopVolume(volumeName);
String rest = ht.sendPost("gfs/deleteVolume", map);
if (null == rest || "".equals(rest)) {
log.error(" --- gluster is disconnect ! \n");

View File

@ -159,7 +159,7 @@ public class MoveDataServiceImpl implements IMoveDataService {
}
if (path.length() == 0) {
dataMove.setDstVolumePath("nopath");
dataMove.setDstVolumePath("noIP");
dataMove.setDstVolumeIp("noIP");
}else {
dataMove.setDstVolumePath(path);
dataMove.setDstVolumeIp(ip);

View File

@ -71,9 +71,9 @@ public class OracleExtractServiceImpl implements IOracleExtractService {
}
for (OracleConnectorParams collectOracle : datainfos) {
String replicasName = collectOracle.getName();
DataInfoEntity data = new DataInfoEntity();
try{
if(null != collectOracle.getDataId() && !"".equals(collectOracle.getDataId())){
DataInfoEntity data = new DataInfoEntity();
data.setId(Integer.valueOf(collectOracle.getDataId()));
data.setExtractStatus(1);
dataInfoDao.updateExtract(data);
@ -109,6 +109,8 @@ public class OracleExtractServiceImpl implements IOracleExtractService {
log.error(Custom4exception.OracleSQL_Except, e);
}
finally{
data.setExtractStatus(2);
dataInfoDao.updateExtract(data);
//sql日志记录时间
FileOperateHelper.fileWrite(Configs.EXTRACT_LOG_LOCALTION
+ collectOracle.getName()+".log", "\r\n 汇总结束 \r\n"+ DateForm.date2StringBysecond(new Date()) +"\r\n");
@ -161,9 +163,9 @@ public class OracleExtractServiceImpl implements IOracleExtractService {
}
for (OracleConnectorParams collectOracle : datainfos) {
String replicasName = collectOracle.getName();
DataInfoEntity data = new DataInfoEntity();
try{
if(null != collectOracle.getDataId() && !"".equals(collectOracle.getDataId())){
DataInfoEntity data = new DataInfoEntity();
data.setId(Integer.valueOf(collectOracle.getDataId()));
//设置为 标准表 抽取中
data.setCheckoutFlag(Constant.CHECKOUTFLAG_SIX);
@ -245,6 +247,9 @@ public class OracleExtractServiceImpl implements IOracleExtractService {
log.error(Custom4exception.OracleSQL_Except, e);
}
finally{
data.setCheckoutFlag(Constant.CHECKOUTFLAG_SEVEN);
data.setStandardExtractStatus("2");
dataInfoDao.update(data);
//sql日志记录时间
FileOperateHelper.fileWrite(Configs.EXTRACT_STANDARD_LOG_LOCALTION
+ collectOracle.getName()+".log", "\r\n 抽取标准表结束 \r\n"+ DateForm.date2StringBysecond(new Date()) +"\r\n");

View File

@ -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());
if (!volMap.keySet().contains(volInSql.getPath())) {
volumeDao.save(volInSql);
}
isContinue = false;
}
// 修改 brick

View File

@ -127,6 +127,7 @@ public class ThreadMoveData{
long timelong = nowTime - DateForm.string2DateBysecond(moveE.getLastTime()).getTime();
if (timelong > 1000*60*20) {
try {
moveE.setCompleteStatus("3");
dataInfoMoveTmpDao.update(moveE);
} catch (Exception e) {
log.error(e);
@ -142,14 +143,13 @@ public class ThreadMoveData{
}else if(taskOne.getStatus() < 0){
//失败
moveE.setCompleteStatus("3");
}
try {
dataInfoMoveTmpDao.update(moveE);
} catch (Exception e) {
log.error(e);
}
}
}
}
//待迁移 status = 0准备迁移则开始迁移