diff --git a/README.md b/README.md index 89511c9..80b9648 100644 --- a/README.md +++ b/README.md @@ -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 : diff --git a/bin/bloblib-0.0.4.jar b/bin/bloblib-1.0.0.jar similarity index 90% rename from bin/bloblib-0.0.4.jar rename to bin/bloblib-1.0.0.jar index e094c6d..9d3d7d0 100644 Binary files a/bin/bloblib-0.0.4.jar and b/bin/bloblib-1.0.0.jar differ diff --git a/dependency-reduced-pom.xml b/dependency-reduced-pom.xml index bf70a3c..c9a5e44 100644 --- a/dependency-reduced-pom.xml +++ b/dependency-reduced-pom.xml @@ -4,7 +4,7 @@ com.wesley bloblib A blob operation library built on top of azure blob service - 0.0.3 + 1.0.0 http://maven.apache.org src diff --git a/pom.xml b/pom.xml index 27bc217..5d1163a 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.wesley bloblib - 0.0.4 + 1.0.0 A blob operation library built on top of azure blob service jar http://maven.apache.org diff --git a/src/main/java/com/wesley/bloblib/ParallelDownloader.java b/src/main/java/com/wesley/bloblib/ParallelDownloader.java index dd452c6..12078e1 100644 --- a/src/main/java/com/wesley/bloblib/ParallelDownloader.java +++ b/src/main/java/com/wesley/bloblib/ParallelDownloader.java @@ -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 */ @@ -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(); } @@ -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; } diff --git a/src/main/java/com/wesley/bloblib/ParallelUploader.java b/src/main/java/com/wesley/bloblib/ParallelUploader.java index 9008707..cb79022 100644 --- a/src/main/java/com/wesley/bloblib/ParallelUploader.java +++ b/src/main/java/com/wesley/bloblib/ParallelUploader.java @@ -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 */ @@ -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(); } @@ -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; }