Skip to content
This repository was archived by the owner on Aug 26, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 7 additions & 0 deletions .github/pull.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# https://github.com/wei/pull#advanced-setup-with-config
version: "1"
rules:
- base: master
upstream: Azure:master
mergeMethod: rebase
label: "AutoPull"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Each service might have a number of libraries available from each of the followi
* [Management](#Management)

### Client: July 2019 Preview
New wave of packages that we are currently releasing in **preview**. These libraries follow the [Azure SDK Design Guidelines for Java](https://azuresdkspecs.z5.web.core.windows.net/JavaSpec.html) and share a number of core features such as HTTP retries, logging, transport protocols, authentication protocols, etc., so that once you learn how to use these features in one client library, you will know how to use them in other client libraries. You can learn about these shared features [here](core).
New wave of packages that we are currently releasing in **preview**. These libraries follow the [Azure SDK Design Guidelines for Java](https://azure.github.io/azure-sdk/java/guidelines/) and share a number of core features such as HTTP retries, logging, transport protocols, authentication protocols, etc., so that once you learn how to use these features in one client library, you will know how to use them in other client libraries. You can learn about these shared features [here](core).

These preview libraries can be easily identified by their folder, package, and namespaces names starting with `azure-`, e.g. `azure-keyvault`.

Expand Down
3 changes: 3 additions & 0 deletions eng/.docsettings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ known_content_issues:
- ['sdk/cosmos/changelog/README.md', '#3113']
- ['sdk/cosmos/microsoft-azure-cosmos-benchmark/README.md', '#3113']
- ['sdk/cosmos/README.md', '#3113']
- ['sdk/storage/azure-storage-blob/swagger/README.md', '#3113']
- ['sdk/storage/azure-storage-queue/swagger/README.md', '#3113']
- ['sdk/storage/azure-storage-file/swagger/README.md', '#3113']
package_indexing_exclusion_list:
- azure-loganalytics-sample
- azure-applicationinsights-query-sample
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Licensed under the MIT License.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package com.azure.tools.checkstyle.checks;

Expand All @@ -19,8 +19,8 @@
*/
public class OnlyFinalFieldsForImmutableClassCheck extends AbstractCheck {
private static final String IMMUTABLE_NOTATION = "Immutable";
private static final String ERROR_MSG = "The variable field ''%s'' should be final." +
"Classes annotated with @Immutable are supposed to be immutable.";
private static final String ERROR_MSG = "The variable field ''%s'' should be final."
+ "Classes annotated with @Immutable are supposed to be immutable.";

private boolean hasImmutableAnnotation;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void visitToken(DetailAST token) {
// method name has prefix 'build' but not 'build*Client' or 'build*AsyncClient'
if (!methodName.endsWith("Client")) {
log(token, String.format(
"@ServiceClientBuilder class should not have a method name, ''%s'' starting with ''build'' but not ending with ''Client''." , methodName));
"@ServiceClientBuilder class should not have a method name, ''%s'' starting with ''build'' but not ending with ''Client''.", methodName));
}
break;
default:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package com.azure.tools.checkstyle.checks;

import com.puppycrawl.tools.checkstyle.api.DetailAST;
Expand Down Expand Up @@ -39,7 +42,7 @@ protected static boolean hasIllegalCombination(DetailAST modifiers) {
Optional<DetailAST> illegalCombination = TokenUtil.findFirstTokenByPredicate(modifiers, (node) -> {
final int type = node.getType();
return INVALID_FINAL_COMBINATION.contains(node.getType()) || (TokenTypes.ANNOTATION == type
&& INVALID_FINAL_ANNOTATIONS.contains(node.findFirstToken(TokenTypes.IDENT).getText()));
&& INVALID_FINAL_ANNOTATIONS.contains(node.findFirstToken(TokenTypes.IDENT).getText()));
});

return illegalCombination.isPresent();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@
<suppress checks="com.azure.tools.checkstyle.checks.ExternalDependencyExposedCheck" files=".*[/\\]samples[/\\].*\.java"/>
<suppress checks="com.azure.tools.checkstyle.checks.HttpPipelinePolicyCheck" files=".*[/\\]samples[/\\].*\.java"/>

<!-- Don't apply custom Checkstyle rules to files under checkstyle package. -->
<suppress checks="com\.azure\.tools\.checkstyle\.checks\..+" files=".*[/\\]tools[/\\]checkstyle[/\\].*"/>

<!-- JavaPackage suppression -->
<suppress checks="JavadocPackage" files=".*[/\\]samples[/\\].*\.java"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@
<Or>
<Class name="com.microsoft.azure.keyvault.authentication.KeyVaultCredentials"/>
<Class name="com.azure.storage.blob.implementation.AzureBlobStorageBuilder"/>
<Class name="com.azure.storage.file.implementation.AzureFileStorageBuilder"/>
<Class name="com.azure.storage.queue.implementation.AzureQueueStorageBuilder"/>
</Or>
<Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE"/>
</Match>
Expand Down
10 changes: 10 additions & 0 deletions eng/pipelines/templates/jobs/archetype-sdk-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ jobs:
JavaVersion: '1.11'

steps:
- checkout: self
fetchDepth: 1

- script: |
echo "##vso[build.addbuildtag]Scheduled"
displayName: 'Tag scheduled builds'
Expand Down Expand Up @@ -87,6 +90,9 @@ jobs:
vmImage: 'ubuntu-16.04'

steps:
- checkout: self
fetchDepth: 1

- task: UsePythonVersion@0
displayName: 'Use Python 3.6'
inputs:
Expand Down Expand Up @@ -222,12 +228,16 @@ jobs:
vmImage: $(OSVmImage)

steps:
- checkout: self
fetchDepth: 1

- template: ../steps/verify-agent-os.yml
parameters:
OSName: $(OSName)

- task: Maven@3
displayName: 'Start Jetty'
condition: ne(variables['SdkType'], 'client')
inputs:
mavenPomFile: pom.client.xml
options: '$(DefaultOptions) $(ProfileFlag)'
Expand Down
4 changes: 2 additions & 2 deletions kusto/resource-manager/v2018_09_07_preview/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<parent>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-arm-parent</artifactId>
<version>1.1.0</version>
<relativePath>../../../pom.management.xml</relativePath>
<version>0.0.3-beta</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<artifactId>azure-mgmt-kusto</artifactId>
<version>1.0.0-beta</version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ public PagedList<Cluster> list() {
public Observable<Cluster> listAsync() {
ClustersInner client = this.inner();
return client.listAsync()
.flatMap(new Func1<Page<ClusterInner>, Observable<ClusterInner>>() {
.flatMap(new Func1<List<ClusterInner>, Observable<ClusterInner>>() {
@Override
public Observable<ClusterInner> call(Page<ClusterInner> innerList) {
return Observable.from(innerList.items());
public Observable<ClusterInner> call(List<ClusterInner> innerList) {
return Observable.from(innerList);
}
})
.map(new Func1<ClusterInner, Cluster>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1120,16 +1120,8 @@ private ServiceResponse<PageImpl<ClusterInner>> listByResourceGroupDelegate(Resp
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the List&lt;ClusterInner&gt; object if successful.
*/
public PagedList<ClusterInner> list() {
PageImpl<ClusterInner> page = new PageImpl<>();
page.setItems(listWithServiceResponseAsync().toBlocking().single().body());
page.setNextPageLink(null);
return new PagedList<ClusterInner>(page) {
@Override
public Page<ClusterInner> nextPage(String nextPageLink) {
return null;
}
};
public List<ClusterInner> list() {
return listWithServiceResponseAsync().toBlocking().single().body();
}

/**
Expand All @@ -1149,13 +1141,11 @@ public ServiceFuture<List<ClusterInner>> listAsync(final ServiceCallback<List<Cl
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the List&lt;ClusterInner&gt; object
*/
public Observable<Page<ClusterInner>> listAsync() {
return listWithServiceResponseAsync().map(new Func1<ServiceResponse<List<ClusterInner>>, Page<ClusterInner>>() {
public Observable<List<ClusterInner>> listAsync() {
return listWithServiceResponseAsync().map(new Func1<ServiceResponse<List<ClusterInner>>, List<ClusterInner>>() {
@Override
public Page<ClusterInner> call(ServiceResponse<List<ClusterInner>> response) {
PageImpl<ClusterInner> page = new PageImpl<>();
page.setItems(response.body());
return page;
public List<ClusterInner> call(ServiceResponse<List<ClusterInner>> response) {
return response.body();
}
});
}
Expand Down
23 changes: 15 additions & 8 deletions pom.client.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License. -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.azure</groupId>
<artifactId>azure-client-sdk-parent</artifactId>
Expand Down Expand Up @@ -164,12 +164,13 @@
</dependency>
</dependencies>
<configuration>
<effort>Max</effort>
<effort>max</effort>
<threshold>Low</threshold>
<xmlOutput>true</xmlOutput>
<spotbugsXmlOutputDirectory>${project.build.directory}/spotbugs</spotbugsXmlOutputDirectory>
<excludeFilterFile>spotbugs/spotbugs-exclude.xml</excludeFilterFile>
<failOnError>true</failOnError>
<fork>false</fork>
</configuration>
<executions>
<execution>
Expand Down Expand Up @@ -341,7 +342,6 @@
</footer>
<linksource>false</linksource>
<excludePackageNames>
com.microsoft.azure.template:
*.impl*:
*.implementation*:
com.azure.tools.checkstyle*
Expand Down Expand Up @@ -401,6 +401,10 @@
<title>Azure Storage - Queues</title>
<packages>com.azure.storage.queue*</packages>
</group>
<group>
<title>Azure Telemetry</title>
<packages>com.azure.tracing.opentelemetry*</packages>
</group>
</groups>
<links>
<link>https://docs.oracle.com/javase/8/docs/api/</link>
Expand Down Expand Up @@ -438,12 +442,13 @@
</dependency>
</dependencies>
<configuration>
<effort>Max</effort>
<effort>max</effort>
<threshold>Low</threshold>
<xmlOutput>true</xmlOutput>
<spotbugsXmlOutputDirectory>${project.build.directory}/spotbugs</spotbugsXmlOutputDirectory>
<excludeFilterFile>spotbugs/spotbugs-exclude.xml</excludeFilterFile>
<failOnError>true</failOnError>
<fork>false</fork>
</configuration>
</plugin>

Expand Down Expand Up @@ -511,12 +516,13 @@
<artifactId>spotbugs-maven-plugin</artifactId>
<version>${spotbugs.maven.version}</version>
<configuration>
<effort>Max</effort>
<effort>max</effort>
<threshold>Low</threshold>
<xmlOutput>true</xmlOutput>
<spotbugsXmlOutputDirectory>${project.build.directory}/spotbugs</spotbugsXmlOutputDirectory>
<excludeFilterFile>eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml</excludeFilterFile>
<failOnError>true</failOnError>
<fork>false</fork>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -724,12 +730,13 @@
<module>./eng/jacoco-test-coverage</module>
</modules>
</profile>

<profile>
<id>template-module</id>
<activation>
<property>
<name>include-template</name>
<name>env.ENABLETEMPLATEDOCS</name>
<value>true</value>
</property>
</activation>
<modules>
Expand Down
2 changes: 1 addition & 1 deletion pom.data.xml
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@
<module>./sdk/cosmos</module>
<module>./sdk/eventhubs/pom.data.xml</module>
<module>./sdk/keyvault/pom.data.xml</module>
<module>./sdk/servicebus/azure-servicebus</module>
<module>./sdk/servicebus/microsoft-azure-servicebus</module>
<module>./sdk/storage/microsoft-azure-storage-blob</module>
</modules>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@
* the Event Hubs namespace and offers operations for sending event data, receiving events, and inspecting the connected
* Event Hub.
*
* <p><strong>Creating an {@link EventHubAsyncClient} using Event Hubs namespace connection string</strong></p>
* <p><strong>Creating an {@link EventHubAsyncClient} using an Event Hubs namespace connection string</strong></p>
*
* {@codesnippet com.azure.messaging.eventhubs.eventhubasyncclient.connectionString#string-string}
* {@codesnippet com.azure.messaging.eventhubs.eventhubasyncclient.instantiation#string-string}
*
* <p><strong>Creating an {@link EventHubAsyncClient} using Event Hub instance connection string</strong></p>
* <p><strong>Creating an {@link EventHubAsyncClient} using an Event Hub instance connection string</strong></p>
*
* {@codesnippet com.azure.messaging.eventhubs.eventhubasyncclient.connectionstring#string}
* {@codesnippet com.azure.messaging.eventhubs.eventhubasyncclient.instantiation#string}
*
* @see EventHubClientBuilder
* @see <a href="https://docs.microsoft.com/Azure/event-hubs/event-hubs-about">About Azure Event Hubs</a>
Expand Down Expand Up @@ -236,20 +236,22 @@ public EventHubAsyncConsumer createConsumer(String consumerGroup, String partiti
* @param options The set of options to apply when creating the consumer.
* @return An new {@link EventHubAsyncConsumer} that receives events from the partition with all configured {@link
* EventHubConsumerOptions}.
* @throws NullPointerException If {@code eventPosition}, or {@code options} is {@code null}.
* @throws IllegalArgumentException If {@code consumerGroup} or {@code partitionId} is {@code null} or an
* empty string.
* @throws NullPointerException If {@code eventPosition}, {@code consumerGroup}, {@code partitionId}, or {@code
* options} is {@code null}.
* @throws IllegalArgumentException If {@code consumerGroup} or {@code partitionId} is an empty string.
*/
public EventHubAsyncConsumer createConsumer(String consumerGroup, String partitionId, EventPosition eventPosition,
EventHubConsumerOptions options) {
Objects.requireNonNull(eventPosition);
Objects.requireNonNull(options);
Objects.requireNonNull(consumerGroup);
Objects.requireNonNull(partitionId);

if (ImplUtils.isNullOrEmpty(consumerGroup)) {
throw new IllegalArgumentException("'consumerGroup' cannot be null or empty.");
throw new IllegalArgumentException("'consumerGroup' cannot be an empty string.");
}
if (ImplUtils.isNullOrEmpty(partitionId)) {
throw new IllegalArgumentException("'partitionId' cannot be null or empty.");
throw new IllegalArgumentException("'partitionId' cannot be an empty string.");
}

final EventHubConsumerOptions clonedOptions = options.clone();
Expand All @@ -268,8 +270,6 @@ public EventHubAsyncConsumer createConsumer(String consumerGroup, String partiti
return connection.createSession(entityPath).cast(EventHubSession.class);
}).flatMap(session -> {
logger.verbose("Creating consumer for path: {}", entityPath);

logger.verbose("Creating producer for {}", entityPath);
final RetryPolicy retryPolicy = RetryUtil.getRetryPolicy(clonedOptions.retry());

return session.createConsumer(linkName, entityPath, getExpression(eventPosition),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
* same partition because they all share the same {@link BatchOptions#partitionKey()}.
* <p>
* {@codesnippet com.azure.messaging.eventhubs.eventhubasyncproducer.send#eventDataBatch}
*
* @see EventHubAsyncClient#createProducer()
*/
@Immutable
Expand Down Expand Up @@ -166,10 +167,13 @@ public Mono<EventDataBatch> createBatch(BatchOptions options) {
/**
* Sends a single event to the associated Event Hub. If the size of the single event exceeds the maximum size
* allowed, an exception will be triggered and the send will fail.

* <p>
* For more information regarding the maximum event size allowed, see
* <a href="https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-quotas">Azure Event Hubs Quotas and
* Limits</a>.
* </p>
*
* @param event Event to send to the service.
*
* @return A {@link Mono} that completes when the event is pushed to the service.
Expand All @@ -183,11 +187,13 @@ public Mono<Void> send(EventData event) {
/**
* Sends a single event to the associated Event Hub with the send options. If the size of the single event exceeds
* the maximum size allowed, an exception will be triggered and the send will fail.
*
* <p>
* For more information regarding the maximum event size allowed, see
* <a href="https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-quotas">Azure Event Hubs Quotas and
* Limits</a>.
* @param event Event to send to the service.
* </p>
* @param event Event to send to the service.
* @param options The set of options to consider when sending this event.
*
* @return A {@link Mono} that completes when the event is pushed to the service.
Expand Down Expand Up @@ -217,7 +223,7 @@ public Mono<Void> send(Iterable<EventData> events) {
* Sends a set of events to the associated Event Hub using a batched approach. If the size of events exceed the
* maximum size of a single batch, an exception will be triggered and the send will fail. By default, the message
* size is the max amount allowed on the link.
* @param events Events to send to the service.
* @param events Events to send to the service.
* @param options The set of options to consider when sending this batch.
*
* @return A {@link Mono} that completes when all events are pushed to the service.
Expand Down
Loading