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

Commit dfd1842

Browse files
author
jofriedm-msft
authored
Merge pull request #94 from wastore/dev
Dev
2 parents 12d81c9 + 3ee9a87 commit dfd1842

File tree

4 files changed

+51
-25
lines changed

4 files changed

+51
-25
lines changed

CONTRIBUTING.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
If you intend to contribute to the project, please make sure you've followed the instructions provided in the [Azure Projects Contribution Guidelines](http://azure.github.io/guidelines/).
22
## Project Setup
3-
The Azure Storage development team uses Eclipse so instructions will be tailored to that preference. However, any preferred IDE or other toolset should be usable.
3+
The Azure Storage development team uses Intellij. However, any preferred IDE or other toolset should be usable.
44

55
### Install
66
* Java SE 6+
7-
* [Eclipse](https://eclipse.org/downloads/)
8-
* [Maven plugin for Eclipse](http://www.eclipse.org/m2e/index.html). Some Eclipse packages (ex Eclipse IDE for Java Developers) may come with this plugin already installed.
97
* [Maven](https://maven.apache.org/install.html)
108
* Clone the source code from GitHub
119

12-
### Open Solution
13-
Open the project from Eclipse using File->Import->Maven->Existing Maven Projects and navigating to the azure-storage-java folder. Select the listed pom. This imports the source and the test files and downloads the required dependencies via Maven. If you'd like to import the samples, follow the same procedure but navigate to the azure-storage-java\microsoft-azure-storage-samples folder and select that pom. Both projects can be opened at the same time and will be shown in the Package Explorer.
10+
#### IntelliJ Installation
11+
* [IntelliJ](https://www.jetbrains.com/idea/download)
12+
* [Importing project from Maven for IntelliJ](https://www.jetbrains.com/help/idea//2017.1/importing-project-from-maven-model.html)
13+
14+
#### Eclipse Installation
15+
* [Eclipse](https://eclipse.org/downloads/)
16+
* [Maven plugin for Eclipse](http://www.eclipse.org/m2e/index.html). Some Eclipse packages (ex Eclipse IDE for Java Developers) may come with this plugin already installed.
17+
* Open the project from Eclipse using File->Import->Maven->Existing Maven Projects and navigating to the azure-storage-java folder. Select the listed pom. This imports the source and the test files and downloads the required dependencies via Maven. If you'd like to import the samples, follow the same procedure but navigate to the azure-storage-java\microsoft-azure-storage-samples folder and select that pom. Both projects can be opened at the same time and will be shown in the Package Explorer.
1418

1519
## Tests
1620

@@ -38,7 +42,7 @@ The following are the minimum requirements for any pull request that must be met
3842
* Thoroughly test your feature
3943

4044
### Branching Policy
41-
Changes should be based on the **dev** branch, not master as master is considered publicly released code. If after discussion with us breaking changes are considered for the library, we will create a **dev_breaking** branch based on dev which can be used to store these changes until the next breaking release. Each breaking change should be recorded in [BreakingChanges.md](BreakingChanges.md).
45+
Changes should be based on the **dev** branch for non-breaking changes and **dev_breaking** for breaking changes. Do not submit pull requests against master as master is considered publicly released code. Each breaking change should be recorded in [BreakingChanges.md](BreakingChanges.md).
4246

4347
### Adding Features for Java 6+
4448
We strive to release each new feature in a backward compatible manner. Therefore, we ask that all contributions be written to work in Java 6, 7 and 8.

microsoft-azure-storage/src/com/microsoft/azure/storage/ServicePropertiesHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public static ServiceProperties readServicePropertiesFromStream(final InputStrea
5858
IOException, ParserConfigurationException {
5959
SAXParser saxParser = Utility.getSAXParser();
6060
ServicePropertiesHandler handler = new ServicePropertiesHandler();
61-
handler.props.setCors(null);
61+
handler.props.setLogging(null);
6262
handler.props.setHourMetrics(null);
6363
handler.props.setMinuteMetrics(null);
6464
handler.props.setCors(null);

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

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,8 @@
2727
import java.util.HashSet;
2828
import java.util.Set;
2929
import java.util.UUID;
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;
30+
import java.util.concurrent.*;
31+
import java.util.concurrent.atomic.AtomicInteger;
3732

3833
import com.microsoft.azure.storage.AccessCondition;
3934
import com.microsoft.azure.storage.Constants;
@@ -51,6 +46,29 @@
5146
*/
5247
final class BlobOutputStreamInternal extends BlobOutputStream {
5348

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+
5472
/**
5573
* Holds the {@link AccessCondition} object that represents the access conditions for the blob.
5674
*/
@@ -171,9 +189,10 @@ private BlobOutputStreamInternal(final CloudBlob parentBlob, final AccessConditi
171189
this.threadExecutor = new ThreadPoolExecutor(
172190
this.options.getConcurrentRequestCount(),
173191
this.options.getConcurrentRequestCount(),
174-
10,
192+
10,
175193
TimeUnit.SECONDS,
176-
new LinkedBlockingQueue<Runnable>());
194+
new LinkedBlockingQueue<Runnable>(),
195+
new BlobOutputStreamThreadFactory());
177196
this.completionService = new ExecutorCompletionService<Void>(this.threadExecutor);
178197
}
179198

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

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,32 +77,35 @@ public enum PremiumPageBlobTier {
7777
*
7878
* @return A <code>PremiumPageBlobTier</code> value that represents the premium page blob tier.
7979
*/
80-
protected static PremiumPageBlobTier parse(final String premiumBlobTierString) {
80+
protected static PremiumPageBlobTier parse(String premiumBlobTierString) {
81+
8182
if (Utility.isNullOrEmpty(premiumBlobTierString)) {
8283
return UNKNOWN;
8384
}
84-
else if ("p4".equals(premiumBlobTierString.toLowerCase(Locale.US))) {
85+
86+
premiumBlobTierString = premiumBlobTierString.toLowerCase(Locale.US);
87+
if ("p4".equals(premiumBlobTierString)) {
8588
return P4;
8689
}
87-
else if ("p6".equals(premiumBlobTierString.toLowerCase(Locale.US))) {
90+
else if ("p6".equals(premiumBlobTierString)) {
8891
return P6;
8992
}
90-
else if ("p10".equals(premiumBlobTierString.toLowerCase(Locale.US))) {
93+
else if ("p10".equals(premiumBlobTierString)) {
9194
return P10;
9295
}
93-
else if ("p20".equals(premiumBlobTierString.toLowerCase(Locale.US))) {
96+
else if ("p20".equals(premiumBlobTierString)) {
9497
return P20;
9598
}
96-
else if ("p30".equals(premiumBlobTierString.toLowerCase(Locale.US))) {
99+
else if ("p30".equals(premiumBlobTierString)) {
97100
return P30;
98101
}
99-
else if ("p40".equals(premiumBlobTierString.toLowerCase(Locale.US))) {
102+
else if ("p40".equals(premiumBlobTierString)) {
100103
return P40;
101104
}
102-
else if ("p50".equals(premiumBlobTierString.toLowerCase(Locale.US))) {
105+
else if ("p50".equals(premiumBlobTierString)) {
103106
return P50;
104107
}
105-
else if ("p60".equals(premiumBlobTierString.toLowerCase(Locale.US))) {
108+
else if ("p60".equals(premiumBlobTierString)) {
106109
return P60;
107110
}
108111
else {

0 commit comments

Comments
 (0)