Skip to content

Commit 840a7e4

Browse files
authored
Merge pull request #281 from bgklein/update-java-0820
Update Java Samples And Change Python Default Sizes
2 parents 3926274 + dd9bd3b commit 840a7e4

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

Java/PoolAndResourceFile/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<dependency>
1818
<groupId>com.microsoft.azure</groupId>
1919
<artifactId>azure-batch</artifactId>
20-
<version>5.0.1</version>
20+
<version>7.0.0</version>
2121
</dependency>
2222
<dependency>
2323
<groupId>com.microsoft.rest</groupId>

Java/PoolAndResourceFile/src/main/java/PoolAndResourceFile.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,17 @@ private static CloudPool createPoolIfNotExists(BatchClient client, String poolId
4444
// See detail of creating IaaS pool at
4545
// https://blogs.technet.microsoft.com/windowshpc/2016/03/29/introducing-linux-support-on-azure-batch/
4646
// Get the sku image reference
47-
List<NodeAgentSku> skus = client.accountOperations().listNodeAgentSkus();
47+
List<ImageInformation> skus = client.accountOperations().listSupportedImages();
4848
String skuId = null;
4949
ImageReference imageRef = null;
5050

51-
for (NodeAgentSku sku : skus) {
51+
for (ImageInformation sku : skus) {
5252
if (sku.osType() == OSType.LINUX) {
53-
for (ImageReference imgRef : sku.verifiedImageReferences()) {
54-
if (imgRef.publisher().equalsIgnoreCase(osPublisher)
55-
&& imgRef.offer().equalsIgnoreCase(osOffer)) {
56-
imageRef = imgRef;
57-
skuId = sku.id();
53+
if (sku.verificationType() == VerificationType.VERIFIED) {
54+
if (sku.imageReference().publisher().equalsIgnoreCase(osPublisher)
55+
&& sku.imageReference().offer().equalsIgnoreCase(osOffer)) {
56+
imageRef = sku.imageReference();
57+
skuId = sku.nodeAgentSKUId();
5858
break;
5959
}
6060
}
@@ -208,7 +208,7 @@ private static void submitJobAndAddTask(BatchClient client, CloudBlobContainer c
208208
String jobId)
209209
throws BatchErrorException, IOException, StorageException, InvalidKeyException, URISyntaxException {
210210
String BLOB_FILE_NAME = "test.txt";
211-
String LOCAL_FILE_PATH = "./" + BLOB_FILE_NAME;
211+
String LOCAL_FILE_PATH = "./PoolAndResourceFile/" + BLOB_FILE_NAME;
212212

213213
// Create job run at the specified pool
214214
PoolInformation poolInfo = new PoolInformation();

0 commit comments

Comments
 (0)