Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 3 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@

## Deprecations

* X behavior is deprecated and will be removed in X versions ([#X](https://github.com/apache/beam/issues/X)).
* Avro related classes are deprecated in module `beam-sdks-java-core` and will be eventually removed. Please, migrate to a new module `beam-sdks-java-extensions-avro` instead by importing the classes from `org.apache.beam.sdk.extensions.avro` package.
For the sake of migration simplicity, the relative package path and the whole class hierarchy of Avro related classes in new module is preserved the same as it was before.
For example, import `org.apache.beam.sdk.extensions.avro.coders.AvroCoder` class instead of`org.apache.beam.sdk.coders.AvroCoder`. ([#24749](https://github.com/apache/beam/issues/24749)).

## Bugfixes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,15 @@
* org.apache.beam.sdk.transforms.GroupByKey} operations.
*
* @param <T> the type of elements handled by this coder
* @deprecated Avro related classes are deprecated in module <code>beam-sdks-java-core</code> and
* will be eventually removed. Please, migrate to a new module <code>
* beam-sdks-java-extensions-avro</code> by importing <code>
* org.apache.beam.sdk.extensions.avro.coders.AvroCoder</code> instead of this one.
*/
@SuppressWarnings({
"nullness" // TODO(https://github.com/apache/beam/issues/20497)
})
@Deprecated
public class AvroCoder<T> extends CustomCoder<T> {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,15 @@
import org.apache.avro.Schema;
import org.apache.avro.generic.GenericRecord;

/** AvroCoder specialisation for GenericRecord. */
/**
* AvroCoder specialisation for GenericRecord.
*
* @deprecated Avro related classes are deprecated in module <code>beam-sdks-java-core</code> and
* will be eventually removed. Please, migrate to a new module <code>
* beam-sdks-java-extensions-avro</code> by importing <code>
* org.apache.beam.sdk.extensions.avro.coders.AvroGenericCoder</code> instead of this one.
*/
@Deprecated
public class AvroGenericCoder extends AvroCoder<GenericRecord> {
AvroGenericCoder(Schema schema) {
super(GenericRecord.class, schema);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,10 +328,16 @@
* events.apply("WriteAvros", AvroIO.<Integer>writeCustomTypeToGenericRecords()
* .to(new UserDynamicAvroDestinations(userToSchemaMap)));
* }</pre>
*
* @deprecated Avro related classes are deprecated in module <code>beam-sdks-java-core</code> and
* will be eventually removed. Please, migrate to a new module <code>
* beam-sdks-java-extensions-avro</code> by importing <code>
* org.apache.beam.sdk.extensions.avro.io.AvroIO</code> instead of this one.
*/
@SuppressWarnings({
"nullness" // TODO(https://github.com/apache/beam/issues/20497)
})
@Deprecated
public class AvroIO {
/**
* Reads records of the given type from an Avro file (or multiple Avro files matching a pattern).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,18 @@
/**
* An implementation of {@link SchemaIOProvider} for reading and writing Avro files with {@link
* AvroIO}.
*
* @deprecated Avro related classes are deprecated in module <code>beam-sdks-java-core</code> and
* will be eventually removed. Please, migrate to a new module <code>
* beam-sdks-java-extensions-avro</code> by importing <code>
* org.apache.beam.sdk.extensions.avro.io.AvroSchemaIOProvider</code> instead of this one.
*/
@Internal
@AutoService(SchemaIOProvider.class)
@SuppressWarnings({
"nullness" // TODO(https://github.com/apache/beam/issues/20497)
})
@Deprecated
public class AvroSchemaIOProvider implements SchemaIOProvider {
/** Returns an id that uniquely represents this IO. */
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,18 @@
import org.apache.beam.sdk.util.MimeTypes;
import org.checkerframework.checker.nullness.qual.Nullable;

/** A {@link FileBasedSink} for Avro files. */
/**
* A {@link FileBasedSink} for Avro files.
*
* @deprecated Avro related classes are deprecated in module <code>beam-sdks-java-core</code> and
* will be eventually removed. Please, migrate to a new module <code>
* beam-sdks-java-extensions-avro</code> by importing <code>
* org.apache.beam.sdk.extensions.avro.io.AvroSink</code> instead of this one.
*/
@SuppressWarnings({
"nullness" // TODO(https://github.com/apache/beam/issues/20497)
})
@Deprecated
public class AvroSink<UserT, DestinationT, OutputT>
extends FileBasedSink<UserT, DestinationT, OutputT> {
private final boolean genericRecords;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,17 @@
* details.
*
* @param <T> The type of records to be read from the source.
* @deprecated Avro related classes are deprecated in module <code>beam-sdks-java-core</code> and
* will be eventually removed. Please, migrate to a new module <code>
* beam-sdks-java-extensions-avro</code> by importing <code>
* org.apache.beam.sdk.extensions.avro.io.AvroSource</code> instead of this one.
*/
// CHECKSTYLE.ON: JavadocStyle
@Experimental(Kind.SOURCE_SINK)
@SuppressWarnings({
"nullness" // TODO(https://github.com/apache/beam/issues/20497)
})
@Deprecated
public class AvroSource<T> extends BlockBasedSource<T> {
// Default minimum bundle size (chosen as two default-size Avro blocks to attempt to
// ensure that every source has at least one block of records).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,18 @@
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.io.BaseEncoding;
import org.checkerframework.checker.nullness.qual.Nullable;

/** Always returns a constant {@link FilenamePolicy}, {@link Schema}, metadata, and codec. */
/**
* Always returns a constant {@link FilenamePolicy}, {@link Schema}, metadata, and codec.
*
* @deprecated Avro related classes are deprecated in module <code>beam-sdks-java-core</code> and
* will be eventually removed. Please, migrate to a new module <code>
* beam-sdks-java-extensions-avro</code> by importing <code>
* org.apache.beam.sdk.extensions.avro.io.ConstantAvroDestination</code> instead of this one.
*/
@SuppressWarnings({
"nullness" // TODO(https://github.com/apache/beam/issues/20497)
})
@Deprecated
class ConstantAvroDestination<UserT, OutputT>
extends DynamicAvroDestinations<UserT, Void, OutputT> {
private static class SchemaFunction implements Serializable, Function<String, Schema> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@
* A specialization of {@link DynamicDestinations} for {@link AvroIO}. In addition to dynamic file
* destinations, this allows specifying other AVRO properties (schema, metadata, codec, datum
* writer) per destination.
*
* @deprecated Avro related classes are deprecated in module <code>beam-sdks-java-core</code> and
* will be eventually removed. Please, migrate to a new module <code>
* beam-sdks-java-extensions-avro</code> by importing <code>
* org.apache.beam.sdk.extensions.avro.io.DynamicAvroDestinations</code> instead of this one.
*/
@Deprecated
public abstract class DynamicAvroDestinations<UserT, DestinationT, OutputT>
extends DynamicDestinations<UserT, DestinationT, OutputT> {
/** Return an AVRO schema for a given destination. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,17 @@
/**
* A wrapper that allows {@link org.apache.avro.file.CodecFactory}s to be serialized using Java's
* standard serialization mechanisms.
*
* @deprecated Avro related classes are deprecated in module <code>beam-sdks-java-core</code> and
* will be eventually removed. Please, migrate to a new module <code>
* beam-sdks-java-extensions-avro</code> by importing <code>
* org.apache.beam.sdk.extensions.avro.io.SerializableAvroCodecFactory</code> instead of this
* one.
*/
@SuppressWarnings({
"nullness" // TODO(https://github.com/apache/beam/issues/20497)
})
@Deprecated
class SerializableAvroCodecFactory implements Externalizable {
private static final long serialVersionUID = 7445324844109564303L;
private static final List<String> noOptAvroCodecs =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,16 @@
* <p>This provider infers a schema from generated SpecificRecord objects, and creates schemas and
* rows that bind to the appropriate fields. This provider also infers schemas from Java POJO
* objects, creating a schema that matches that inferred by the AVRO libraries.
*
* @deprecated Avro related classes are deprecated in module <code>beam-sdks-java-core</code> and
* will be eventually removed. Please, migrate to a new module <code>
* beam-sdks-java-extensions-avro</code> by importing <code>
* org.apache.beam.sdk.extensions.avro.schemas.AvroRecordSchema</code> instead of this one.
*/
@SuppressWarnings({
"rawtypes" // TODO(https://github.com/apache/beam/issues/20447)
})
@Deprecated
public class AvroRecordSchema extends GetterBasedSchemaProvider {
@Override
public <T> Schema schemaFor(TypeDescriptor<T> typeDescriptor) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,16 @@
import org.apache.beam.sdk.schemas.Schema;
import org.apache.beam.sdk.schemas.utils.AvroUtils;

/**
* @deprecated Avro related classes are deprecated in module <code>beam-sdks-java-core</code> and
* will be eventually removed. Please, migrate to a new module <code>
* beam-sdks-java-extensions-avro</code> by importing <code>
* org.apache.beam.sdk.extensions.avro.schemas.io.payloads.AvroPayloadSerializerProvider</code>
* instead of this one.
*/
@Internal
@Experimental(Kind.SCHEMAS)
@Deprecated
@AutoService(PayloadSerializerProvider.class)
public class AvroPayloadSerializerProvider implements PayloadSerializerProvider {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,19 @@
import org.apache.beam.sdk.values.TypeDescriptor;
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.Maps;

/**
* @deprecated Avro related classes are deprecated in module <code>beam-sdks-java-core</code> and
* will be eventually removed. Please, migrate to a new module <code>
* beam-sdks-java-extensions-avro</code> by importing <code>
* org.apache.beam.sdk.extensions.avro.schemas.utils.AvroByteBuddyUtils</code> instead of this
* one.
*/
@Experimental(Kind.SCHEMAS)
@SuppressWarnings({
"nullness", // TODO(https://github.com/apache/beam/issues/20497)
"rawtypes"
})
@Deprecated
class AvroByteBuddyUtils {
private static final ByteBuddy BYTE_BUDDY = new ByteBuddy();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,18 @@
* </pre>
*
* is used.
*
* @deprecated Avro related classes are deprecated in module <code>beam-sdks-java-core</code> and
* will be eventually removed. Please, migrate to a new module <code>
* beam-sdks-java-extensions-avro</code> by importing <code>
* org.apache.beam.sdk.extensions.avro.schemas.utils.AvroUtils</code> instead of this one.
*/
@Experimental(Kind.SCHEMAS)
@SuppressWarnings({
"nullness", // TODO(https://github.com/apache/beam/issues/20497)
"rawtypes"
})
@Deprecated
public class AvroUtils {
static {
// This works around a bug in the Avro library (AVRO-1891) around SpecificRecord's handling
Expand Down
2 changes: 1 addition & 1 deletion sdks/java/extensions/avro/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ applyJavaNature(
automaticModuleName: 'org.apache.beam.sdk.extensions.avro',
disableLintWarnings: ['rawtypes'], // Avro-generated test code has raw-type errors
publish: true,
exportJavadoc: false,
exportJavadoc: true,
)
applyAvroNature()

Expand Down