Skip to content

Commit d4c9627

Browse files
committed
chore: upgrade version name(1.6.8->1.6.9) code(59->60)
1 parent cba5dcf commit d4c9627

6 files changed

Lines changed: 73 additions & 8 deletions

File tree

CHANGELOG-ZH.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,49 @@
22

33
> [ Change log in english](https://github.com/lingochamp/FileDownloader/blob/master/CHANGELOG.md)
44
5+
## Version 1.6.9
6+
7+
_2017_12_16_
8+
9+
#### 修复
10+
11+
- 修复(serial-queue): 修复在`FileDownloadSerialQueue`遇到的死锁。 closes #858
12+
- 修复: 不再在非单元测试环境使用`j-unit`,避免在一些小米手机上发生`no-static-method-found`的问题。 closes #867
13+
- 修复: 修复每次重试减少两次重试机会的问题。 closes #838
14+
- 修复: 修复在`pending`的时候暂停任务,而后获取到该任务都是`pending`的状态的问题。 closes #855
15+
16+
#### 性能与提高
17+
18+
- 提高实用性: 开放`SqliteDatabaseImpl``RemitDatabase``NoDatabaseImpl`,便于上层覆盖他们。
19+
- 提高实用性: 支持从更高的版本降级到该版本。
20+
- 提高实用性: 当上层没有主动添加`User-Agent`的时候,内部添加默认的`User-Agent`。 closes #848
21+
- 提高性能: 修改所有的线程池中线程的存活时间(从5s修改为15s),避免在高频下载中,各池子频繁的释放与创建线程
22+
- 提高性能: 使用`RemitDatabase`作为默认的数据库,在很多小任务很快的结束下载(2s内),其数据库操作将会变得十分冗余,而这部分的数据库操作将被取消
23+
24+
#### RemitDatabase
25+
26+
FileDownloader中大多数数据库长尾问题,是由于有很多很小的任务同时执行:
27+
28+
- 由于很小的任务每次启动、等待、连接、下载进度、结束都会促发入库
29+
- 一旦任务很小网速很快的时候,一个小任务实际下载耗时可能在1-2s完成
30+
- 因此整个引擎不得不为该1-2s完成的任务完成一连串的数据库入库、更新到从数据库删除的操作
31+
- 也就是说单个类似的任务在1-2s内促发了至少5次数据库操作,期间包含入库与最后的删除
32+
- 一个任务还好,当这样的任务数上升到几百个的层面,这样高频持续的数据库操作,就很容易暴露各种数据库问题(包含文件系统问题)
33+
- 而现有体系在上层推任务大量任务到下载服务的时候, 会高频持续的3个并行对这些任务做入库处理,在这个点上数据库问题也容易发生(包含文件系统问题)
34+
35+
---
36+
37+
而相比之下写入数据库是为了断点续传,这个短期的频繁数据库操作,实质的作用甚微,早期的提供外接接口来控制下载进度间的入库频率显然无法覆盖该问题。
38+
39+
---
40+
41+
因此,还是为FileDownloader推出新的`RemitDatabase`用于解决该问题,除去期间的多线程安全问题的处理,核心思想如下:
42+
![][RemitDatabase-png]
43+
44+
- 如果某一个任务的整体数据更新与结束在2s(该值可定制)内,则不再有数据库操作,全程只存内存
45+
- 如果某一个任务的数据更新与结束操过2s,则分为两部分,2s前只存内存,2s开始同时存内存与数据库
46+
- 如果某一个任务最终的结束是暂停或错误,则在最后的状态更新中,同时存内存与数据库
47+
548
## Version 1.6.8
649

750
_2017-10-13_

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,27 @@
22

33
> [中文迭代日志](https://github.com/lingochamp/FileDownloader/blob/master/CHANGELOG-ZH.md)
44
5+
## Version 1.6.9
6+
7+
_2017_12_16_
8+
9+
#### Fix
10+
11+
- Fix(serial-queue): fix deadlock on `FileDownloadSerialQueue`. closes #858
12+
- Fix: do not use j-unit on library non-unit-test env to fix the `no-static-method-found` issue on some mi-phones. closes #867
13+
- Fix: fix decrease two times of retry-chance each time of retry. closes #838
14+
- Fix: fix get status is pending when a task has been paused on pending status. closes #855
15+
16+
#### Enhancement
17+
18+
- Improve Practicability: public `SqliteDatabaseImpl``RemitDatabase``NoDatabaseImpl`, so you can overwrite them
19+
- Improve Practicability: support downgrade version from newer version
20+
- Improve Practicability: add the default `User-Agent` if upper layer does not add. closes #848
21+
- Improve Performance: change the keepalive second(5s to 15s) for each executor, since when downloading multiple tasks thread release and recreate too frequently
22+
- Improve Performance: using `RemitDatabase` instead of `DefaultFiledownloadDatabase` to avoid some small task start and finished on the very short time but consume too much time on sync status to database what is useless
23+
24+
![][RemitDatabase-png]
25+
526
## Version 1.6.8
627

728
_2017-10-13_
@@ -816,5 +837,6 @@ _2015-12-22_
816837

817838
- initial release
818839

840+
[RemitDatabase-png]: https://github.com/lingochamp/FileDownloader/raw/master/art/remit-database.gif
819841
[FileDownloadConnection-java-link]: https://github.com/lingochamp/FileDownloader/blob/master/library/src/main/java/com/liulishuo/filedownloader/connection/FileDownloadConnection.java
820842
[FileDownloadUrlConnection-java-link]: https://github.com/lingochamp/FileDownloader/blob/master/library/src/main/java/com/liulishuo/filedownloader/connection/FileDownloadUrlConnection.java

README-zh.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Android 文件下载引擎,稳定、高效、灵活、简单易用
5959
在项目中引用:
6060

6161
```groovy
62-
compile 'com.liulishuo.filedownloader:library:1.6.8'
62+
compile 'com.liulishuo.filedownloader:library:1.6.9'
6363
```
6464

6565
> 如果是eclipse引入jar包参考: [这里](https://github.com/lingochamp/FileDownloader/issues/212#issuecomment-232240415)
@@ -253,7 +253,7 @@ if (parallel) {
253253

254254
| 方法名 | 需实现接口 | 已有组件 | 默认组件 | 说明
255255
| --- | --- | --- | --- | ---
256-
| database | FileDownloadDatabase | DefaultDatabaseImpl、NoDatabaseImpl | DefaultDatabaseImpl | 传入定制化数据库组件,用于存储用于断点续传的数据
256+
| database | FileDownloadDatabase | RemitDatabase、SqliteDatabaseImpl、NoDatabaseImpl | RemitDatabase | 传入定制化数据库组件,用于存储用于断点续传的数据
257257
| connection | FileDownloadConnection | FileDownloadUrlConnection | FileDownloadUrlConnection | 传入定制化的网络连接组件,用于下载时建立网络连接
258258
| outputStreamCreator | FileDownloadOutputStream | FileDownloadRandomAccessFile | FileDownloadRandomAccessFile | 传入输出流组件,用于下载时写文件使用
259259
| maxNetworkThreadCount | - | - | 3 | 传入创建下载引擎时,指定可用的下载线程个数

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ FileDownloader is installed by adding the following dependency to your `build.gr
2626

2727
```groovy
2828
dependencies {
29-
compile 'com.liulishuo.filedownloader:library:1.6.8'
29+
compile 'com.liulishuo.filedownloader:library:1.6.9'
3030
}
3131
```
3232

@@ -38,7 +38,7 @@ From now on, FileDownloader support following components to be customized by you
3838
| --- | --- | ---
3939
| Connection | [FileDownloadConnection][FileDownloadConnection-java-link] | [FileDownloadUrlConnection][FileDownloadUrlConnection-java-link]
4040
| OutputStream | [FileDownloadOutputStream][FileDownloadOutputStream-java-link] | [FileDownloadRandomAccessFile][FileDownloadRandomAccessFile-java-link]
41-
| Database | [FileDownloadDatabase][FileDownloadDatabase-java-link] | [DefaultDatabaseImpl][DefaultDatabaseImpl-java-link]
41+
| Database | [FileDownloadDatabase][FileDownloadDatabase-java-link] | [RemitDatabase][RemitDatabase-java-link]
4242
| ConnectionCountAdapter | [ConnectionCountAdapter][ConnectionCountAdapter-java-link] | [DefaultConnectionCountAdapter][DefaultConnectionCountAdapter-java-link]
4343
| IdGenerator | [IdGenerator][IdGenerator-java-link] | [DefaultIdGenerator][DefaultIdGenerator-java-link]
4444

@@ -99,8 +99,8 @@ limitations under the License.
9999
[build_status_link]: https://travis-ci.org/lingochamp/FileDownloader
100100
[FileDownloadConnection-java-link]: https://github.com/lingochamp/FileDownloader/blob/master/library/src/main/java/com/liulishuo/filedownloader/connection/FileDownloadConnection.java
101101
[FileDownloadUrlConnection-java-link]: https://github.com/lingochamp/FileDownloader/blob/master/library/src/main/java/com/liulishuo/filedownloader/connection/FileDownloadUrlConnection.java
102-
[FileDownloadDatabase-java-link]: https://github.com/lingochamp/FileDownloader/blob/master/library/src/main/java/com/liulishuo/filedownloader/services/FileDownloadDatabase.java
103-
[DefaultDatabaseImpl-java-link]: https://github.com/lingochamp/FileDownloader/blob/master/library/src/main/java/com/liulishuo/filedownloader/services/DefaultDatabaseImpl.java
102+
[FileDownloadDatabase-java-link]: https://github.com/lingochamp/FileDownloader/blob/master/library/src/main/java/com/liulishuo/filedownloader/database/RemitDatabase.java
103+
[RemitDatabase-java-link]: https://github.com/lingochamp/FileDownloader/blob/master/library/src/main/java/com/liulishuo/filedownloader/database/RemitDatabase.java
104104
[FileDownloadOutputStream-java-link]: https://github.com/lingochamp/FileDownloader/blob/master/library/src/main/java/com/liulishuo/filedownloader/stream/FileDownloadOutputStream.java
105105
[FileDownloadRandomAccessFile-java-link]: https://github.com/lingochamp/FileDownloader/blob/master/library/src/main/java/com/liulishuo/filedownloader/stream/FileDownloadRandomAccessFile.java
106106
[ConnectionCountAdapter-java-link]: https://github.com/lingochamp/FileDownloader/blob/master/library/src/main/java/com/liulishuo/filedownloader/util/FileDownloadHelper.java#L100

art/remit-database.png

37.5 KB
Loading

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
VERSION_NAME=1.6.8
2-
VERSION_CODE=59
1+
VERSION_NAME=1.6.9
2+
VERSION_CODE=60
33
BUILD_TOOLS_VERSION=26.0.2
44
COMPILE_SDK_VERSION=26
55

0 commit comments

Comments
 (0)