Skip to content

Commit

Permalink
Reset changes to the patch version.
Browse files Browse the repository at this point in the history
  • Loading branch information
vcolin7 committed Jun 15, 2023
1 parent 6cb84e3 commit 4d2d3d8
Show file tree
Hide file tree
Showing 9 changed files with 620 additions and 503 deletions.
16 changes: 1 addition & 15 deletions sdk/storage/azure-storage-internal-avro/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
# Release History

## 12.8.0-beta.2 (Unreleased)

### Features Added

### Breaking Changes

### Bugs Fixed

### Other Changes

## 12.8.0-beta.1 (2023-05-30)

### Features Added
- Added support for 2023-01-03 service version.

## 12.7.1 (2023-05-23)

### Other Changes
Expand All @@ -25,6 +10,7 @@
- Upgraded `azure-core` from `1.38.0` to version `1.39.0`.
- Upgraded `azure-storage-common` from `12.21.0` to version `12.21.1`.


## 12.7.0 (2023-04-13)

### Features Added
Expand Down
103 changes: 73 additions & 30 deletions sdk/storage/azure-storage-internal-avro/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<groupId>com.azure</groupId>
<artifactId>azure-storage-internal-avro</artifactId>
<version>12.8.0-beta.2</version> <!-- {x-version-update;com.azure:azure-storage-internal-avro;current} -->
<version>12.7.1</version> <!-- {x-version-update;com.azure:azure-storage-internal-avro;current} -->

<name>Microsoft Azure internal Avro module for Storage</name>
<description>This module contains internal use only avro parser code based for Microsoft Azure Storage client libraries.</description>
Expand Down Expand Up @@ -41,19 +41,23 @@
--add-opens com.azure.storage.internal.avro/com.azure.storage.internal.avro.implementation=ALL-UNNAMED
--add-opens com.azure.storage.internal.avro/com.azure.storage.internal.avro.implementation.schema=ALL-UNNAMED
</javaModulesSurefireArgLine>
<parallelizeLiveTests>true</parallelizeLiveTests>
</properties>

<dependencies>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core</artifactId>
<version>1.40.0</version> <!-- {x-version-update;com.azure:azure-core;dependency} -->
<version>1.39.0</version> <!-- {x-version-update;com.azure:azure-core;dependency} -->
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-http-netty</artifactId>
<version>1.13.3</version> <!-- {x-version-update;com.azure:azure-core-http-netty;dependency} -->
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-storage-common</artifactId>
<version>12.21.2</version> <!-- {x-version-update;com.azure:azure-storage-common;current} -->
<version>12.21.1</version> <!-- {x-version-update;com.azure:azure-storage-common;current} -->
</dependency>

<dependency>
Expand All @@ -62,40 +66,16 @@
<version>2.13.5</version> <!-- {x-version-update;com.fasterxml.jackson.dataformat:jackson-dataformat-xml;external_dependency} -->
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.9.3</version> <!-- {x-version-update;org.junit.jupiter:junit-jupiter-api;external_dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.9.3</version> <!-- {x-version-update;org.junit.jupiter:junit-jupiter-engine;external_dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>5.9.3</version> <!-- {x-version-update;org.junit.jupiter:junit-jupiter-params;external_dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-test</artifactId>
<version>1.18.0</version> <!-- {x-version-update;com.azure:azure-core-test;dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-test</artifactId>
<version>3.4.29</version> <!-- {x-version-update;io.projectreactor:reactor-test;external_dependency} -->
<version>3.4.27</version> <!-- {x-version-update;io.projectreactor:reactor-test;external_dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-storage-common</artifactId>
<version>12.21.2</version> <!-- {x-version-update;com.azure:azure-storage-common;current} -->
<version>12.21.1</version> <!-- {x-version-update;com.azure:azure-storage-common;current} -->
<classifier>tests</classifier>
<type>test-jar</type>
<scope>test</scope>
Expand All @@ -106,6 +86,12 @@
<version>1.7.36</version> <!-- {x-version-update;org.slf4j:slf4j-simple;external_dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.spockframework</groupId>
<artifactId>spock-core</artifactId>
<version>2.4-M1-groovy-4.0</version> <!-- {x-version-update;org.spockframework:spock-core;external_dependency} -->
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -195,6 +181,63 @@
</rules>
</configuration>
</plugin>

<plugin>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<version>2.1.0</version> <!-- {x-version-update;org.codehaus.gmavenplus:gmavenplus-plugin;external_dependency} -->
<executions>
<execution>
<goals>
<goal>addTestSources</goal>
<goal>generateTestStubs</goal>
<goal>compileTests</goal>
<goal>removeTestStubs</goal>
</goals>
<phase>test-compile</phase>
</execution>
</executions>
<configuration>
<skipTests>${skipTestCompile}</skipTests>
<testSources>
<testSource>
<directory>${project.basedir}/src/test</directory>
<includes>
<include>**/*.groovy</include>
</includes>
</testSource>
</testSources>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>java9plus</id>
<activation>
<jdk>[9,)</jdk>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version> <!-- {x-version-update;org.apache.maven.plugins:maven-compiler-plugin;external_dependency} -->
<executions>
<execution>
<id>default-testCompile</id>
<phase>process-test-sources</phase>
<goals>
<goal>testCompile</goal>
</goals>
<configuration>
<failOnWarning>false</failOnWarning>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
*/
public class AvroParserState {

private final Stack<AvroSchema> stack;
private final List<ByteBuffer> cache;
private Stack<AvroSchema> stack;
private List<ByteBuffer> cache;
private long size;
private long sourceOffset; /* Keeps track of number of bytes read from the source. */

Expand All @@ -44,14 +44,6 @@ public class AvroParserState {
this.sourceOffset = sourceOffset;
}

List<ByteBuffer> getCache() {
return cache;
}

long getSize() {
return size;
}

/**
* Writes to the state's internal cache of buffers.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
package com.azure.storage.internal.avro.implementation

import com.azure.storage.internal.avro.implementation.schema.AvroSchema
import spock.lang.Specification
import spock.lang.Unroll

import java.nio.ByteBuffer

class AvroParserStateTest extends Specification {

def "constructor"() {
setup:
AvroParserState state = new AvroParserState()

expect:
state.size == 0
state.cache.isEmpty()
}

@Unroll
def "write"() {
setup:
AvroParserState state = new AvroParserState()

when:
byte[] b = new byte[size];
new Random().nextBytes(b);
state.write(ByteBuffer.wrap(b))

then:
state.size == size
AvroSchema.getBytes(state.read(size)) == b

where:
size || _
0 || _
10 || _
100 || _
1000 || _
}

@Unroll
def "readSize"() {
setup:
AvroParserState state = new AvroParserState()
ByteBuffer b1 = ByteBuffer.wrap("Hello ".getBytes())
ByteBuffer b2 = ByteBuffer.wrap("World!".getBytes())
state.write(b1)
state.write(b2)

expect:
AvroSchema.getBytes(state.read(size)) == value
state.size == remaining
state.cache.size() == buffersLeft

where:
size || remaining | value | buffersLeft
0 || 12 | [] | 2 /* 0 buffers */
3 || 9 | "Hel".getBytes() | 2 /* 1 buffer */
6 || 6 | "Hello ".getBytes() | 1 /* Exactly 1 buffer. */
7 || 5 | "Hello W".getBytes() | 1 /* 2 buffers */
12 || 0 | "Hello World!".getBytes() | 0 /* Exactly 2 buffers. */
}

def "read"() {
setup:
String word = "Hello World!"
AvroParserState state = new AvroParserState()
ByteBuffer b1 = ByteBuffer.wrap(word.substring(0, 6).getBytes())
ByteBuffer b2 = ByteBuffer.wrap(word.substring(6, 12).getBytes())
state.write(b1)
state.write(b2)

expect:
def index = 0
while (index < word.length()) {
assert state.read() == (byte) word.charAt(index)
index++
assert state.size == word.length() - index
}
}

}

This file was deleted.

Loading

0 comments on commit 4d2d3d8

Please sign in to comment.