Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes for javadoc and logger #4552

Closed
wants to merge 14 commits into from
Closed
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@
<Or>
<Class name="com.azure.storage.blob.BlobInputStream"/>
<Class name="com.azure.storage.blob.BlobOutputStream"/>
<Class name="com.azure.storage.queue.QueueServiceClient"/>
</Or>
<Bug pattern="NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE"/>
</Match>
Expand Down
7 changes: 6 additions & 1 deletion eng/jacoco-test-coverage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<azure-keyvault.version>4.0.0-preview.1</azure-keyvault.version>
<azure-messaging-eventhubs.version>5.0.0-preview.2</azure-messaging-eventhubs.version>
<azure-storage-blob.version>12.0.0-preview.1</azure-storage-blob.version>
<azure-storage-queue.version>12.0.0-preview.1</azure-storage-queue.version>
</properties>

<distributionManagement>
Expand Down Expand Up @@ -93,7 +94,11 @@
<!-- <artifactId>azure-storage-blob</artifactId>-->
<!-- <version>${azure-storage-blob.version}</version>-->
<!-- </dependency>-->

<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-storage-queue</artifactId>
<version>${azure-storage-queue.version}</version>
</dependency>
<!-- Tracing will be built and released separately. Removing tracing dependency
until we finalize dependency composition -->
<!-- <dependency>-->
Expand Down
7 changes: 6 additions & 1 deletion eng/spotbugs-aggregate-report/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<azure-keyvault.version>4.0.0-preview.1</azure-keyvault.version>
<azure-messaging-eventhubs.version>5.0.0-preview.2</azure-messaging-eventhubs.version>
<azure-storage.version>12.0.0-preview.1</azure-storage.version>
<azure-storage-queue.version>12.0.0-preview.1</azure-storage-queue.version>
</properties>
<distributionManagement>
<site>
Expand Down Expand Up @@ -182,7 +183,11 @@
<!-- <artifactId>azure-storage-blob</artifactId>-->
<!-- <version>${azure-storage.version}</version>-->
<!-- </dependency>-->

<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-storage-queue</artifactId>
<version>${azure-storage-queue.version}</version>
</dependency>
<!-- Added this dependency to include necessary annotations used by reactor core.
Without this dependency, javadoc throws a warning as it cannot find enum When.MAYBE
which is used in @Nullable annotation in reactor core classes -->
Expand Down
8 changes: 7 additions & 1 deletion pom.client.xml
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,10 @@
<title>Azure Storage - Blobs</title>
<packages>com.azure.storage.blob*</packages>
</group>
<group>
<title>Azure Storage - Queues</title>
<packages>com.azure.storage.queue*</packages>
</group>
</groups>
<links>
<link>https://docs.oracle.com/javase/8/docs/api/</link>
Expand Down Expand Up @@ -546,7 +550,8 @@
-snippetpath ${project.basedir}/sdk/eventhubs/azure-eventhubs/src/samples/java
-snippetpath ${project.basedir}/sdk/keyvault/azure-keyvault-keys/src/samples/java
-snippetpath ${project.basedir}/sdk/keyvault/azure-keyvault-secrets/src/samples/java
<!-- -snippetpath ${project.basedir}/storage/client/blob/src/samples/java-->
<!-- -snippetpath ${project.basedir}/storage/client/blob/src/samples/java-->
-snippetpath ${project.basedir}/storage/client/queue/src/samples/java
</additionalOptions>
</configuration>
</reportSet>
Expand Down Expand Up @@ -748,5 +753,6 @@
<!-- <module>./sdk/tracing</module>-->
<module>./sdk/identity/azure-identity</module>
<module>./storage/client/blob</module>
<module>./storage/client/queue</module>
</modules>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import com.azure.core.http.rest.Response;
import com.azure.core.http.rest.SimpleResponse;
import com.azure.core.util.Context;
import com.azure.storage.blob.implementation.AzureBlobStorageBuilder;
import com.azure.storage.blob.models.AppendBlobAccessConditions;
import com.azure.storage.blob.models.AppendBlobItem;
Expand All @@ -13,12 +14,13 @@
import com.azure.storage.blob.models.BlobRange;
import com.azure.storage.blob.models.Metadata;
import com.azure.storage.blob.models.SourceModifiedAccessConditions;
import io.netty.buffer.Unpooled;
import io.netty.buffer.ByteBuf;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

import java.net.URL;
import java.nio.ByteBuffer;

import static com.azure.storage.blob.Utility.postProcessResponse;


/**
Expand All @@ -45,8 +47,6 @@
* object through {@link Mono#toFuture()}.
*/
public final class AppendBlobAsyncClient extends BlobAsyncClient {
final AppendBlobAsyncRawClient appendBlobAsyncRawClient;

/**
* Indicates the maximum number of bytes that can be sent in a call to appendBlock.
*/
Expand All @@ -63,7 +63,6 @@ public final class AppendBlobAsyncClient extends BlobAsyncClient {
*/
AppendBlobAsyncClient(AzureBlobStorageBuilder azureBlobStorageBuilder, String snapshot) {
super(azureBlobStorageBuilder, snapshot);
appendBlobAsyncRawClient = new AppendBlobAsyncRawClient(azureBlobStorageBuilder.build());
}

/**
Expand All @@ -90,8 +89,13 @@ public Mono<Response<AppendBlobItem>> create() {
* A reactive response containing the information of the created appended blob.
*/
public Mono<Response<AppendBlobItem>> create(BlobHTTPHeaders headers, Metadata metadata, BlobAccessConditions accessConditions) {
return appendBlobAsyncRawClient
.create(headers, metadata, accessConditions)
metadata = (metadata == null) ? new Metadata() : metadata;
accessConditions = (accessConditions == null) ? new BlobAccessConditions() : accessConditions;

return postProcessResponse(this.azureBlobStorage.appendBlobs().createWithRestResponseAsync(null,
null, 0, null, metadata, null, null,
null, null, headers, accessConditions.leaseAccessConditions(),
accessConditions.modifiedAccessConditions(), Context.NONE))
.map(rb -> new SimpleResponse<>(rb, new AppendBlobItem(rb.deserializedHeaders())));
}

Expand All @@ -111,7 +115,7 @@ public Mono<Response<AppendBlobItem>> create(BlobHTTPHeaders headers, Metadata m
* @return
* A reactive response containing the information of the append blob operation.
*/
public Mono<Response<AppendBlobItem>> appendBlock(Flux<ByteBuffer> data, long length) {
public Mono<Response<AppendBlobItem>> appendBlock(Flux<ByteBuf> data, long length) {
return this.appendBlock(data, length, null);
}

Expand All @@ -133,10 +137,17 @@ public Mono<Response<AppendBlobItem>> appendBlock(Flux<ByteBuffer> data, long le
* @return
* A reactive response containing the information of the append blob operation.
*/
public Mono<Response<AppendBlobItem>> appendBlock(Flux<ByteBuffer> data, long length,
AppendBlobAccessConditions appendBlobAccessConditions) {
return appendBlobAsyncRawClient
.appendBlock(data.map(Unpooled::wrappedBuffer), length, appendBlobAccessConditions)
public Mono<Response<AppendBlobItem>> appendBlock(Flux<ByteBuf> data, long length,
AppendBlobAccessConditions appendBlobAccessConditions) {
appendBlobAccessConditions = appendBlobAccessConditions == null ? new AppendBlobAccessConditions()
: appendBlobAccessConditions;

return postProcessResponse(this.azureBlobStorage.appendBlobs().appendBlockWithRestResponseAsync(
null, null, data, length, null, null,
null, null, null, null,
appendBlobAccessConditions.leaseAccessConditions(),
appendBlobAccessConditions.appendPositionAccessConditions(),
appendBlobAccessConditions.modifiedAccessConditions(), Context.NONE))
.map(rb -> new SimpleResponse<>(rb, new AppendBlobItem(rb.deserializedHeaders())));
}

Expand Down Expand Up @@ -183,8 +194,16 @@ public Mono<Response<AppendBlobItem>> appendBlockFromUrl(URL sourceURL, BlobRang
public Mono<Response<AppendBlobItem>> appendBlockFromUrl(URL sourceURL, BlobRange sourceRange,
byte[] sourceContentMD5, AppendBlobAccessConditions destAccessConditions,
SourceModifiedAccessConditions sourceAccessConditions) {
return appendBlobAsyncRawClient
.appendBlockFromUrl(sourceURL, sourceRange, sourceContentMD5, destAccessConditions, sourceAccessConditions)
sourceRange = sourceRange == null ? new BlobRange(0) : sourceRange;
destAccessConditions = destAccessConditions == null
? new AppendBlobAccessConditions() : destAccessConditions;

return postProcessResponse(
this.azureBlobStorage.appendBlobs().appendBlockFromUrlWithRestResponseAsync(null, null,
sourceURL, 0, sourceRange.toString(), sourceContentMD5, null, null,
destAccessConditions.leaseAccessConditions(),
destAccessConditions.appendPositionAccessConditions(),
destAccessConditions.modifiedAccessConditions(), sourceAccessConditions, Context.NONE))
.map(rb -> new SimpleResponse<>(rb, new AppendBlobItem(rb.deserializedHeaders())));
}
}
Loading