Skip to content

Commit f4c7cc7

Browse files
author
Liudmila Molkova
committed
regen
1 parent 536631a commit f4c7cc7

17 files changed

+865
-325
lines changed

sdk/storage/azure-storage-blob-v2/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<dependency>
3232
<groupId>io.clientcore</groupId>
3333
<artifactId>core</artifactId>
34-
<version>1.0.0-beta.5</version>
34+
<version>1.0.0-beta.6</version>
3535
</dependency>
3636
<dependency>
3737
<groupId>com.azure</groupId>

sdk/storage/azure-storage-blob-v2/src/main/java/com/azure/v2/storage/blob/AppendBlobClient.java

Lines changed: 44 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import io.clientcore.core.annotations.ServiceClient;
1515
import io.clientcore.core.http.models.RequestOptions;
1616
import io.clientcore.core.http.models.Response;
17+
import io.clientcore.core.instrumentation.Instrumentation;
1718
import io.clientcore.core.models.binarydata.BinaryData;
1819
import java.time.OffsetDateTime;
1920
import java.util.Map;
@@ -26,14 +27,18 @@ public final class AppendBlobClient {
2627
@Metadata(generated = true)
2728
private final AppendBlobsImpl serviceClient;
2829

30+
private final Instrumentation instrumentation;
31+
2932
/**
3033
* Initializes an instance of AppendBlobClient class.
3134
*
3235
* @param serviceClient the service client implementation.
36+
* @param instrumentation the instrumentation instance.
3337
*/
3438
@Metadata(generated = true)
35-
AppendBlobClient(AppendBlobsImpl serviceClient) {
39+
AppendBlobClient(AppendBlobsImpl serviceClient, Instrumentation instrumentation) {
3640
this.serviceClient = serviceClient;
41+
this.instrumentation = instrumentation;
3742
}
3843

3944
/**
@@ -81,10 +86,11 @@ public Response<Void> createWithResponse(String containerName, String blob, long
8186
OffsetDateTime immutabilityPolicyExpiry, BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold,
8287
BlobHttpHeaders blobHttpHeaders, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam,
8388
RequestOptions requestOptions) {
84-
return this.serviceClient.createWithResponse(containerName, blob, contentLength, timeout, metadata, leaseId,
85-
ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, blobTagsString,
86-
immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold, blobHttpHeaders, cpkInfo, encryptionScopeParam,
87-
requestOptions);
89+
return this.instrumentation.instrument("AppendBlob_Create", requestOptions,
90+
updatedOptions -> this.serviceClient.createWithResponse(containerName, blob, contentLength, timeout,
91+
metadata, leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId,
92+
blobTagsString, immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold, blobHttpHeaders, cpkInfo,
93+
encryptionScopeParam, updatedOptions));
8894
}
8995

9096
/**
@@ -129,9 +135,11 @@ public void create(String containerName, String blob, long contentLength, Intege
129135
String ifMatch, String ifNoneMatch, String ifTags, String requestId, String blobTagsString,
130136
OffsetDateTime immutabilityPolicyExpiry, BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold,
131137
BlobHttpHeaders blobHttpHeaders, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) {
132-
this.serviceClient.create(containerName, blob, contentLength, timeout, metadata, leaseId, ifModifiedSince,
133-
ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, blobTagsString, immutabilityPolicyExpiry,
134-
immutabilityPolicyMode, legalHold, blobHttpHeaders, cpkInfo, encryptionScopeParam);
138+
this.instrumentation.instrument("AppendBlob_Create", null,
139+
updatedOptions -> this.serviceClient.create(containerName, blob, contentLength, timeout, metadata, leaseId,
140+
ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, blobTagsString,
141+
immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold, blobHttpHeaders, cpkInfo,
142+
encryptionScopeParam));
135143
}
136144

137145
/**
@@ -185,10 +193,11 @@ public Response<Void> appendBlockWithResponse(String containerName, String blob,
185193
OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId,
186194
String structuredBodyType, Long structuredContentLength, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam,
187195
RequestOptions requestOptions) {
188-
return this.serviceClient.appendBlockWithResponse(containerName, blob, contentLength, body, timeout,
189-
transactionalContentMD5, transactionalContentCrc64, leaseId, maxSize, appendPosition, ifModifiedSince,
190-
ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, structuredBodyType, structuredContentLength,
191-
cpkInfo, encryptionScopeParam, requestOptions);
196+
return this.instrumentation.instrument("AppendBlob_AppendBlock", requestOptions,
197+
updatedOptions -> this.serviceClient.appendBlockWithResponse(containerName, blob, contentLength, body,
198+
timeout, transactionalContentMD5, transactionalContentCrc64, leaseId, maxSize, appendPosition,
199+
ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, structuredBodyType,
200+
structuredContentLength, cpkInfo, encryptionScopeParam, updatedOptions));
192201
}
193202

194203
/**
@@ -239,9 +248,11 @@ public void appendBlock(String containerName, String blob, long contentLength, B
239248
Long appendPosition, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch,
240249
String ifNoneMatch, String ifTags, String requestId, String structuredBodyType, Long structuredContentLength,
241250
CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) {
242-
this.serviceClient.appendBlock(containerName, blob, contentLength, body, timeout, transactionalContentMD5,
243-
transactionalContentCrc64, leaseId, maxSize, appendPosition, ifModifiedSince, ifUnmodifiedSince, ifMatch,
244-
ifNoneMatch, ifTags, requestId, structuredBodyType, structuredContentLength, cpkInfo, encryptionScopeParam);
251+
this.instrumentation.instrument("AppendBlob_AppendBlock", null,
252+
updatedOptions -> this.serviceClient.appendBlock(containerName, blob, contentLength, body, timeout,
253+
transactionalContentMD5, transactionalContentCrc64, leaseId, maxSize, appendPosition, ifModifiedSince,
254+
ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, structuredBodyType, structuredContentLength,
255+
cpkInfo, encryptionScopeParam));
245256
}
246257

247258
/**
@@ -303,11 +314,12 @@ public Response<Void> appendBlockFromUrlWithResponse(String containerName, Strin
303314
String ifTags, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince,
304315
String sourceIfMatch, String sourceIfNoneMatch, String requestId, String copySourceAuthorization,
305316
CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, RequestOptions requestOptions) {
306-
return this.serviceClient.appendBlockFromUrlWithResponse(containerName, blob, sourceUrl, contentLength,
307-
sourceRange, sourceContentMD5, sourceContentcrc64, timeout, transactionalContentMD5, leaseId, maxSize,
308-
appendPosition, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, sourceIfModifiedSince,
309-
sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, requestId, copySourceAuthorization, cpkInfo,
310-
encryptionScopeParam, requestOptions);
317+
return this.instrumentation.instrument("AppendBlob_AppendBlockFromUrl", requestOptions,
318+
updatedOptions -> this.serviceClient.appendBlockFromUrlWithResponse(containerName, blob, sourceUrl,
319+
contentLength, sourceRange, sourceContentMD5, sourceContentcrc64, timeout, transactionalContentMD5,
320+
leaseId, maxSize, appendPosition, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags,
321+
sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, requestId,
322+
copySourceAuthorization, cpkInfo, encryptionScopeParam, updatedOptions));
311323
}
312324

313325
/**
@@ -367,11 +379,12 @@ public void appendBlockFromUrl(String containerName, String blob, String sourceU
367379
String ifTags, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince,
368380
String sourceIfMatch, String sourceIfNoneMatch, String requestId, String copySourceAuthorization,
369381
CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) {
370-
this.serviceClient.appendBlockFromUrl(containerName, blob, sourceUrl, contentLength, sourceRange,
371-
sourceContentMD5, sourceContentcrc64, timeout, transactionalContentMD5, leaseId, maxSize, appendPosition,
372-
ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, sourceIfModifiedSince,
373-
sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, requestId, copySourceAuthorization, cpkInfo,
374-
encryptionScopeParam);
382+
this.instrumentation.instrument("AppendBlob_AppendBlockFromUrl", null,
383+
updatedOptions -> this.serviceClient.appendBlockFromUrl(containerName, blob, sourceUrl, contentLength,
384+
sourceRange, sourceContentMD5, sourceContentcrc64, timeout, transactionalContentMD5, leaseId, maxSize,
385+
appendPosition, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, sourceIfModifiedSince,
386+
sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, requestId, copySourceAuthorization, cpkInfo,
387+
encryptionScopeParam));
375388
}
376389

377390
/**
@@ -406,8 +419,9 @@ public void appendBlockFromUrl(String containerName, String blob, String sourceU
406419
public Response<Void> sealWithResponse(String containerName, String blob, Integer timeout, String requestId,
407420
String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch,
408421
String ifNoneMatch, Long appendPosition, RequestOptions requestOptions) {
409-
return this.serviceClient.sealWithResponse(containerName, blob, timeout, requestId, leaseId, ifModifiedSince,
410-
ifUnmodifiedSince, ifMatch, ifNoneMatch, appendPosition, requestOptions);
422+
return this.instrumentation.instrument("AppendBlob_Seal", requestOptions,
423+
updatedOptions -> this.serviceClient.sealWithResponse(containerName, blob, timeout, requestId, leaseId,
424+
ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, appendPosition, updatedOptions));
411425
}
412426

413427
/**
@@ -440,7 +454,8 @@ public Response<Void> sealWithResponse(String containerName, String blob, Intege
440454
public void seal(String containerName, String blob, Integer timeout, String requestId, String leaseId,
441455
OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch,
442456
Long appendPosition) {
443-
this.serviceClient.seal(containerName, blob, timeout, requestId, leaseId, ifModifiedSince, ifUnmodifiedSince,
444-
ifMatch, ifNoneMatch, appendPosition);
457+
this.instrumentation.instrument("AppendBlob_Seal", null,
458+
updatedOptions -> this.serviceClient.seal(containerName, blob, timeout, requestId, leaseId, ifModifiedSince,
459+
ifUnmodifiedSince, ifMatch, ifNoneMatch, appendPosition));
445460
}
446461
}

sdk/storage/azure-storage-blob-v2/src/main/java/com/azure/v2/storage/blob/AzureBlobStorageBuilder.java

Lines changed: 53 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
import io.clientcore.core.http.pipeline.HttpRedirectPolicy;
1919
import io.clientcore.core.http.pipeline.HttpRetryOptions;
2020
import io.clientcore.core.http.pipeline.HttpRetryPolicy;
21+
import io.clientcore.core.instrumentation.Instrumentation;
22+
import io.clientcore.core.instrumentation.LibraryInstrumentationOptions;
2123
import io.clientcore.core.traits.ConfigurationTrait;
2224
import io.clientcore.core.traits.HttpTrait;
2325
import io.clientcore.core.traits.ProxyTrait;
@@ -31,7 +33,7 @@
3133
*/
3234
@ServiceClientBuilder(
3335
serviceClients = {
34-
StorageServiceClient.class,
36+
ServiceClient.class,
3537
ContainerClient.class,
3638
BlobClient.class,
3739
PageBlobClient.class,
@@ -45,6 +47,10 @@ public final class AzureBlobStorageBuilder implements HttpTrait<AzureBlobStorage
4547
@Metadata(generated = true)
4648
private static final String SDK_VERSION = "version";
4749

50+
@Metadata(generated = true)
51+
private static final LibraryInstrumentationOptions LIBRARY_INSTRUMENTATION_OPTIONS
52+
= new LibraryInstrumentationOptions("");
53+
4854
@Metadata(generated = true)
4955
private final List<HttpPipelinePolicy> pipelinePolicies;
5056

@@ -187,7 +193,7 @@ public AzureBlobStorageBuilder configuration(Configuration configuration) {
187193

188194
/**
189195
* Sets The URL of the service account, container, or blob that is the target of the desired operation.
190-
*
196+
*
191197
* @param url the url value.
192198
* @return the AzureBlobStorageBuilder.
193199
*/
@@ -205,7 +211,7 @@ public AzureBlobStorageBuilder url(String url) {
205211

206212
/**
207213
* Sets Specifies the version of the operation to use for this request.
208-
*
214+
*
209215
* @param version the version value.
210216
* @return the AzureBlobStorageBuilder.
211217
*/
@@ -217,7 +223,7 @@ public AzureBlobStorageBuilder version(String version) {
217223

218224
/**
219225
* Builds an instance of AzureBlobStorageImpl with the provided parameters.
220-
*
226+
*
221227
* @return an instance of AzureBlobStorageImpl.
222228
*/
223229
@Metadata(generated = true)
@@ -255,61 +261,91 @@ private HttpPipeline createHttpPipeline() {
255261

256262
/**
257263
* Builds an instance of ServiceClient class.
258-
*
264+
*
259265
* @return an instance of ServiceClient.
260266
*/
261267
@Metadata(generated = true)
262-
public StorageServiceClient buildServiceClient() {
263-
return new StorageServiceClient(buildInnerClient().getServices());
268+
public ServiceClient buildServiceClient() {
269+
HttpInstrumentationOptions localHttpInstrumentationOptions = this.httpInstrumentationOptions == null
270+
? new HttpInstrumentationOptions()
271+
: this.httpInstrumentationOptions;
272+
Instrumentation instrumentation
273+
= Instrumentation.create(localHttpInstrumentationOptions, LIBRARY_INSTRUMENTATION_OPTIONS, this.endpoint);
274+
return new ServiceClient(buildInnerClient().getServices(), instrumentation);
264275
}
265276

266277
/**
267278
* Builds an instance of ContainerClient class.
268-
*
279+
*
269280
* @return an instance of ContainerClient.
270281
*/
271282
@Metadata(generated = true)
272283
public ContainerClient buildContainerClient() {
273-
return new ContainerClient(buildInnerClient().getContainers());
284+
HttpInstrumentationOptions localHttpInstrumentationOptions = this.httpInstrumentationOptions == null
285+
? new HttpInstrumentationOptions()
286+
: this.httpInstrumentationOptions;
287+
Instrumentation instrumentation
288+
= Instrumentation.create(localHttpInstrumentationOptions, LIBRARY_INSTRUMENTATION_OPTIONS, this.endpoint);
289+
return new ContainerClient(buildInnerClient().getContainers(), instrumentation);
274290
}
275291

276292
/**
277293
* Builds an instance of BlobClient class.
278-
*
294+
*
279295
* @return an instance of BlobClient.
280296
*/
281297
@Metadata(generated = true)
282298
public BlobClient buildBlobClient() {
283-
return new BlobClient(buildInnerClient().getBlobs());
299+
HttpInstrumentationOptions localHttpInstrumentationOptions = this.httpInstrumentationOptions == null
300+
? new HttpInstrumentationOptions()
301+
: this.httpInstrumentationOptions;
302+
Instrumentation instrumentation
303+
= Instrumentation.create(localHttpInstrumentationOptions, LIBRARY_INSTRUMENTATION_OPTIONS, this.endpoint);
304+
return new BlobClient(buildInnerClient().getBlobs(), instrumentation);
284305
}
285306

286307
/**
287308
* Builds an instance of PageBlobClient class.
288-
*
309+
*
289310
* @return an instance of PageBlobClient.
290311
*/
291312
@Metadata(generated = true)
292313
public PageBlobClient buildPageBlobClient() {
293-
return new PageBlobClient(buildInnerClient().getPageBlobs());
314+
HttpInstrumentationOptions localHttpInstrumentationOptions = this.httpInstrumentationOptions == null
315+
? new HttpInstrumentationOptions()
316+
: this.httpInstrumentationOptions;
317+
Instrumentation instrumentation
318+
= Instrumentation.create(localHttpInstrumentationOptions, LIBRARY_INSTRUMENTATION_OPTIONS, this.endpoint);
319+
return new PageBlobClient(buildInnerClient().getPageBlobs(), instrumentation);
294320
}
295321

296322
/**
297323
* Builds an instance of AppendBlobClient class.
298-
*
324+
*
299325
* @return an instance of AppendBlobClient.
300326
*/
301327
@Metadata(generated = true)
302328
public AppendBlobClient buildAppendBlobClient() {
303-
return new AppendBlobClient(buildInnerClient().getAppendBlobs());
329+
HttpInstrumentationOptions localHttpInstrumentationOptions = this.httpInstrumentationOptions == null
330+
? new HttpInstrumentationOptions()
331+
: this.httpInstrumentationOptions;
332+
Instrumentation instrumentation
333+
= Instrumentation.create(localHttpInstrumentationOptions, LIBRARY_INSTRUMENTATION_OPTIONS, this.endpoint);
334+
return new AppendBlobClient(buildInnerClient().getAppendBlobs(), instrumentation);
304335
}
305336

306337
/**
307338
* Builds an instance of BlockBlobClient class.
308-
*
339+
*
309340
* @return an instance of BlockBlobClient.
310341
*/
311342
@Metadata(generated = true)
312343
public BlockBlobClient buildBlockBlobClient() {
313-
return new BlockBlobClient(buildInnerClient().getBlockBlobs());
344+
HttpInstrumentationOptions localHttpInstrumentationOptions = this.httpInstrumentationOptions == null
345+
? new HttpInstrumentationOptions()
346+
: this.httpInstrumentationOptions;
347+
Instrumentation instrumentation
348+
= Instrumentation.create(localHttpInstrumentationOptions, LIBRARY_INSTRUMENTATION_OPTIONS, this.endpoint);
349+
return new BlockBlobClient(buildInnerClient().getBlockBlobs(), instrumentation);
314350
}
315351
}

0 commit comments

Comments
 (0)