Skip to content
This repository was archived by the owner on Jul 19, 2024. It is now read-only.

Commit 9a16e35

Browse files
author
jofriedm-msft
authored
Merge pull request #101 from jofriedm-msft/dev
Dev
2 parents 673a33d + 43a0619 commit 9a16e35

File tree

1 file changed

+9
-28
lines changed

1 file changed

+9
-28
lines changed

microsoft-azure-storage/src/com/microsoft/azure/storage/blob/BlobOutputStreamInternal.java

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,13 @@
2727
import java.util.HashSet;
2828
import java.util.Set;
2929
import java.util.UUID;
30-
import java.util.concurrent.*;
31-
import java.util.concurrent.atomic.AtomicInteger;
30+
import java.util.concurrent.Callable;
31+
import java.util.concurrent.ConcurrentHashMap;
32+
import java.util.concurrent.ExecutorCompletionService;
33+
import java.util.concurrent.Future;
34+
import java.util.concurrent.LinkedBlockingQueue;
35+
import java.util.concurrent.ThreadPoolExecutor;
36+
import java.util.concurrent.TimeUnit;
3237

3338
import com.microsoft.azure.storage.AccessCondition;
3439
import com.microsoft.azure.storage.Constants;
@@ -46,29 +51,6 @@
4651
*/
4752
final class BlobOutputStreamInternal extends BlobOutputStream {
4853

49-
private static class BlobOutputStreamThreadFactory implements ThreadFactory {
50-
private final ThreadGroup group;
51-
private final AtomicInteger threadNumber = new AtomicInteger(1);
52-
private final String namePrefix;
53-
54-
BlobOutputStreamThreadFactory() {
55-
SecurityManager s = System.getSecurityManager();
56-
group = (s != null) ? s.getThreadGroup() :
57-
Thread.currentThread().getThreadGroup();
58-
namePrefix = "azure-storage-bloboutputstream-thread-";
59-
}
60-
61-
public Thread newThread(Runnable r) {
62-
Thread t = new Thread(group, r,
63-
namePrefix + threadNumber.getAndIncrement(),
64-
0);
65-
t.setDaemon(true);
66-
if (t.getPriority() != Thread.NORM_PRIORITY)
67-
t.setPriority(Thread.NORM_PRIORITY);
68-
return t;
69-
}
70-
}
71-
7254
/**
7355
* Holds the {@link AccessCondition} object that represents the access conditions for the blob.
7456
*/
@@ -189,10 +171,9 @@ private BlobOutputStreamInternal(final CloudBlob parentBlob, final AccessConditi
189171
this.threadExecutor = new ThreadPoolExecutor(
190172
this.options.getConcurrentRequestCount(),
191173
this.options.getConcurrentRequestCount(),
192-
10,
174+
10,
193175
TimeUnit.SECONDS,
194-
new LinkedBlockingQueue<Runnable>(),
195-
new BlobOutputStreamThreadFactory());
176+
new LinkedBlockingQueue<Runnable>());
196177
this.completionService = new ExecutorCompletionService<Void>(this.threadExecutor);
197178
}
198179

0 commit comments

Comments
 (0)