diff --git a/src/main/java/com/nis/util/Constants.java b/src/main/java/com/nis/util/Constants.java index b0164593a..9f36804fd 100644 --- a/src/main/java/com/nis/util/Constants.java +++ b/src/main/java/com/nis/util/Constants.java @@ -734,4 +734,6 @@ public final class Constants { public static final Integer MAAT_JSON_SEND_SIZE=Configurations.getIntProperty("maat_json_send_size", 1000); public static final Integer MULITY_THREAD_SIZE=Configurations.getIntProperty("mulity_thread_size", 5); public static final Integer SAVE_AND_DEL_THREAD_SIZE=Configurations.getIntProperty("save_and_del_thread_size", 5); + public static final Integer MAX_ALLOWED_PACKET=Configurations.getIntProperty("max_allowed_packet", 1048576); + } diff --git a/src/main/java/com/nis/util/excel/thread/SaveAsnIpThread.java b/src/main/java/com/nis/util/excel/thread/SaveAsnIpThread.java index 26eb8f879..3ee0d719d 100644 --- a/src/main/java/com/nis/util/excel/thread/SaveAsnIpThread.java +++ b/src/main/java/com/nis/util/excel/thread/SaveAsnIpThread.java @@ -175,10 +175,10 @@ public class SaveAsnIpThread implements Callable{ long start=System.currentTimeMillis(); int len=0; List tempList=Lists.newArrayList(); - Varibles maxPacket=asnIpCfgDao.getVaribles("max_allowed_packet"); +// Varibles maxPacket=asnIpCfgDao.getVaribles("max_allowed_packet"); for(AsnIpCfg asnIpCfg:entitys) { int tempLen=asnIpCfg.toString().getBytes(Charset.forName("UTF-8")).length; - if((len+tempLen), AsnIpCfg> { // } @Transactional(readOnly=false,rollbackFor=RuntimeException.class) public void save(List entitys) { - logger.warn("Start to save IP"); + logger.warn("Start to save IP,size:"+entitys.size()); long start=System.currentTimeMillis(); int len=0; List tempList=Lists.newArrayList(); - Varibles maxPacket=asnIpCfgDao.getVaribles("max_allowed_packet"); +// Varibles maxPacket=asnIpCfgDao.getVaribles("max_allowed_packet"); for(AsnIpCfg asnIpCfg:entitys) { int tempLen=asnIpCfg.toString().getBytes(Charset.forName("UTF-8")).length; - if((len+tempLen), AsnIpCfg> { } } if(tempList.size()>0) { - logger.warn("save ip size:"+tempList.size()); +// logger.warn("save ip size:"+tempList.size()); asnIpCfgDao.insertBatch(tempList); tempList.clear(); } @@ -121,7 +121,7 @@ public class AsnIpCfgService extends CrudService, AsnIpCfg> { List configGroupInfoS=Lists.newArrayList(); Date createTime=new Date(); int len=0,len1=0; - Varibles maxPacket=asnIpCfgDao.getVaribles("max_allowed_packet"); +// Varibles maxPacket=asnIpCfgDao.getVaribles("max_allowed_packet"); for(Entry e:asnNoMap.entrySet()) { PolicyGroupInfo info=new PolicyGroupInfo(); info.setAsnNo(e.getKey()); @@ -133,7 +133,7 @@ public class AsnIpCfgService extends CrudService, AsnIpCfg> { info.setCreatorId(UserUtils.getUser().getId()); info.setCreateTime(createTime); int tempLen=info.toString().getBytes(Charset.forName("UTF-8")).length; - if((len+tempLen), AsnIpCfg> { group.setGroupType(info.getGroupType()); group.setAsnId(info.getAsnNo()); int tempLen1=group.toString().getBytes(Charset.forName("UTF-8")).length; - if((len1+tempLen1), AsnIpCfg> { public void saveAsnIpBatch(List cfgs){ //需要通过新增域接口新增的ip集合 List toAddRegionAsnIpCfgs=Lists.newArrayList(); - long start=System.currentTimeMillis(); for(AsnIpCfg cfg:cfgs) { if(Constants.VALID_YES==cfg.getIsValid().intValue()) { toAddRegionAsnIpCfgs.add(cfg); } } - long end=System.currentTimeMillis(); this.save(cfgs); // splitAndSend(toAddRegionAsnIpCfgs,Constants.VALID_YES); if(toAddRegionAsnIpCfgs.size()>0) { @@ -249,6 +247,8 @@ public class AsnIpCfgService extends CrudService, AsnIpCfg> { } cfgs.clear(); toAddRegionAsnIpCfgs.clear(); + cfgs=null; + toAddRegionAsnIpCfgs=null; } /** * 分割IP region分次下发 diff --git a/src/main/java/com/nis/web/service/configuration/AppCfgService.java b/src/main/java/com/nis/web/service/configuration/AppCfgService.java index ba38f9af2..606544ed2 100644 --- a/src/main/java/com/nis/web/service/configuration/AppCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/AppCfgService.java @@ -352,7 +352,7 @@ public class AppCfgService extends BaseService { specificServiceCfgDao.update(specificServiceCfg); } Integer compileId = configGroupInfo.getCompileId(); - Varibles maxPacket=asnIpCfgDao.getVaribles("max_allowed_packet"); +// Varibles maxPacket=asnIpCfgDao.getVaribles("max_allowed_packet"); List tempList=Lists.newArrayList(); int len=0; for(BaseIpCfg cfg:cfgs) { @@ -360,7 +360,7 @@ public class AppCfgService extends BaseService { BeanUtils.copyProperties(cfg, entity); entity.setCompileId(compileId); int tempLen=entity.toString().getBytes(Charset.forName("UTF-8")).length; - if((len+tempLen)