Skip to content

Commit

Permalink
bloblib v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tony4248 committed Nov 28, 2017
1 parent 971fc9a commit fe92970
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 9 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,16 @@ Packaged the core operations of the azure blob storage as a separated library, t


## Features and Updates:

### Bump the version to v1.0.0

* Optimize performance for large content uploads and downloads
* Optimize performance for multiple files concurrently download/upload

### New features since v0.0.4 :

* upload and down with multiple threads, more faster and stable.
* Page blob is full supported.
* Page blob is fully supported.

### New features since v0.0.3 :

Expand Down
Binary file renamed bin/bloblib-0.0.4.jar → bin/bloblib-1.0.0.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>com.wesley</groupId>
<artifactId>bloblib</artifactId>
<name>A blob operation library built on top of azure blob service</name>
<version>0.0.3</version>
<version>1.0.0</version>
<url>http://maven.apache.org</url>
<build>
<sourceDirectory>src</sourceDirectory>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.wesley</groupId>
<artifactId>bloblib</artifactId>
<version>0.0.4</version>
<version>1.0.0</version>
<name>A blob operation library built on top of azure blob service</name>
<packaging>jar</packaging>
<url>http://maven.apache.org</url>
Expand Down
9 changes: 6 additions & 3 deletions src/main/java/com/wesley/bloblib/ParallelDownloader.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ public class ParallelDownloader {
/* instance of the object */
private static ParallelDownloader instance = null;
/* the number of threads */
private int defaultNumOfThreads = 8;
private int defaultNumOfThreads = 12;
/* the number of chunks */
private int defaultNumOfChunks = 4;
/* the minimum chunk size */
private int minChunkSize = 512 * 1024; // 512K
private int minChunkSize = 2 * 1024 * 1024; // 2MB
/* the downloader threads pool */
private static ThreadPuddle downloaderThreadsPool;
/* the factory of thread puddle class */
Expand Down Expand Up @@ -72,6 +74,7 @@ public synchronized static ParallelDownloader getInstance () {
private final void initTheDownLoaderThreadsPool(int numOfthreads){
threadPuddleFactory = new ThreadPuddleFactory();
threadPuddleFactory.setThreads(numOfthreads);
threadPuddleFactory.setTaskLimit(numOfthreads * 100);
threadPuddleFactory.setFifo(true);
downloaderThreadsPool = threadPuddleFactory.build();
}
Expand All @@ -80,7 +83,7 @@ private final void initTheDownLoaderThreadsPool(int numOfthreads){
private int getFinalNumOfChunks(long length){
int tmpBlockCount = (int)((float)length / (float)minChunkSize) + 1;
/* the final number of the chunks */
int numOfChunks = Math.min(defaultNumOfThreads, tmpBlockCount);
int numOfChunks = Math.min(defaultNumOfChunks, tmpBlockCount);
return numOfChunks;
}

Expand Down
9 changes: 6 additions & 3 deletions src/main/java/com/wesley/bloblib/ParallelUploader.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ public class ParallelUploader {
/* instance of the object */
private static ParallelUploader instance = null;
/* the number of threads */
private int defaultNumOfThreads = 8;
private int defaultNumOfThreads = 12;
/* the number of chunks */
private int defaultNumOfChunks = 4;
/* the minimum chunk size */
private int minChunkSize = 512 * 1024; // 512K
private int minChunkSize = 2 * 1024 * 1024; // 2MB
/* the uploader threads pool */
private static ThreadPuddle uploaderThreadsPool;
/* the factory of thread puddle class */
Expand Down Expand Up @@ -84,6 +86,7 @@ public synchronized static ParallelUploader getInstance () {
private final void initTheUploaderThreadsPool(int numOfthreads){
threadPuddleFactory = new ThreadPuddleFactory();
threadPuddleFactory.setThreads(numOfthreads);
threadPuddleFactory.setTaskLimit(numOfthreads * 100);
threadPuddleFactory.setFifo(true);
uploaderThreadsPool = threadPuddleFactory.build();
}
Expand All @@ -96,7 +99,7 @@ private final void initTheUploaderThreadsPool(int numOfthreads){
private int getFinalNumOfChunks(long length){
int tmpBlockCount = (int)((float)length / (float)minChunkSize) + 1;
/* the final number of the chunks */
int numOfChunks = Math.min(defaultNumOfThreads, tmpBlockCount);
int numOfChunks = Math.min(defaultNumOfChunks, tmpBlockCount);
return numOfChunks;
}

Expand Down

0 comments on commit fe92970

Please sign in to comment.