Skip to content
This repository has been archived by the owner on Aug 20, 2021. It is now read-only.

2.0.0

Compare
Choose a tag to compare
@venusdrogon venusdrogon released this 13 Sep 05:03
· 24 commits to master since this release

feilong-core 2.0.0,让 Java 开发更简便的工具包

本次升级共有 3 处变更, 具体参见 2.0.0 milestone

2.0.0 文档地址: http://feilong-core.mydoc.io/

单元测试数 增加至 2192 个, 单元测试覆盖率 增加至 91% ,javadoc 比率 83%

[Feature] 🆕

  • #801 新建 ThreadUtil.execute(List<T>, int, PartitionPerHandler<T>)

给定一个待解析的 list,设定每个线程执行多少条 eachSize,使用自定义的 partitionRunnableBuilder,自动构造多条线程并运行.

主要是用来简化 **execute(List, int, PartitionRunnableBuilder) **调用

重构:

对于以下代码:

 ThreadUtil.execute(list, 5, new PartitionRunnableBuilder<String>(){
 
     @Override
     public Runnable build(final List<String> perBatchList,PartitionThreadEntity partitionThreadEntity,Map<String, ?> paramsMap){
 
         return new Runnable(){
 
             @Override
             public void run(){
                 map.putAll(handle(perBatchList, noList));
             }
         };
     }
 });

可以重构成:

 ThreadUtil.execute(list, 5, new PartitionPerHandler<String>(){
 
     @Override
     public void handle(List<String> perBatchList,PartitionThreadEntity partitionThreadEntity,Map<String, ?> paramsMap){
         map.putAll(CopyrightTest.this.handle(perBatchList, noList));
     }
 });

上述事例,可以从 14 行代码, 精简到 7 行代码

  • #794 新增 PartitionPerHandler ,让多线程调用更简单
  • #803 新建 ThreadUtil.execute(List<T>, PartitionThreadConfig, Map<String, ?>, PartitionPerHandler<T>)
  • #802 新建 ThreadUtil.execute(List<T>, int, Map<String, ?>, PartitionPerHandler<T>)

[Update]

  • #800 新建 com.feilong.core.lang.thread 包, 将thread 相关类 移动进来 remove 不兼容
  • #799 AbstractPartitionThreadExecutor actualExcute name change to actualExecute rename 不兼容 坏味道
  • #798 PartitionThreadExecutor 方法名字从 excute 改成 execute rename 不兼容 坏味道
  • #797 PropertyValueObtainer.getDataUseSpring(Object, String) log trace 单词写错了 rename 不兼容 坏味道

[版本升级]

  • none

[Remove]

  • none

[Fix Bug] 🐛

  • none

[Javadoc]

  • #793 完善 ThreadUtil.sleep(long) 注释
  • #792 完善 ThreadUtil.execute(Runnable, int) 注释

[Junit Test]

  • none