Skip to content

Commit

Permalink
[FLINK-22357][core] Upgrades API stability of unified source API to @…
Browse files Browse the repository at this point in the history
…public (= stable).
  • Loading branch information
StephanEwen committed Sep 9, 2021
1 parent 76ee66f commit e4b0008
Show file tree
Hide file tree
Showing 16 changed files with 32 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@

package org.apache.flink.api.connector.source;

import org.apache.flink.annotation.PublicEvolving;
import org.apache.flink.annotation.Public;

/**
* The boundedness of a stream. A stream could either be "bounded" (a stream with finite records) or
* "unbounded" (a stream with infinite records).
*/
@PublicEvolving
@Public
public enum Boundedness {
/**
* A BOUNDED stream is a stream with finite records.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@

package org.apache.flink.api.connector.source;

import org.apache.flink.annotation.PublicEvolving;
import org.apache.flink.annotation.Public;

import java.io.Serializable;
import java.util.Objects;

/** A container class hosting the information of a {@link SourceReader}. */
@PublicEvolving
@Public
public final class ReaderInfo implements Serializable {

private static final long serialVersionUID = 1L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

package org.apache.flink.api.connector.source;

import org.apache.flink.annotation.PublicEvolving;
import org.apache.flink.annotation.Public;
import org.apache.flink.api.common.eventtime.TimestampAssigner;
import org.apache.flink.api.common.eventtime.Watermark;

Expand All @@ -38,7 +38,7 @@
* ReaderOutput#createOutputForSplit(String)} method, using the Source Split's ID. Make sure to
* release the output again once the source has finished processing that split.
*/
@PublicEvolving
@Public
public interface ReaderOutput<T> extends SourceOutput<T> {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

package org.apache.flink.api.connector.source;

import org.apache.flink.annotation.PublicEvolving;
import org.apache.flink.annotation.Public;
import org.apache.flink.core.io.SimpleVersionedSerializer;

import java.io.Serializable;
Expand All @@ -31,7 +31,7 @@
* @param <SplitT> The type of splits handled by the source.
* @param <EnumChkT> The type of the enumerator checkpoints.
*/
@PublicEvolving
@Public
public interface Source<T, SplitT extends SourceSplit, EnumChkT> extends Serializable {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@

package org.apache.flink.api.connector.source;

import org.apache.flink.annotation.PublicEvolving;
import org.apache.flink.annotation.Public;

import java.io.Serializable;

/** An base class for the events passed between the SourceReaders and Enumerators. */
@PublicEvolving
@Public
public interface SourceEvent extends Serializable {}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

package org.apache.flink.api.connector.source;

import org.apache.flink.annotation.PublicEvolving;
import org.apache.flink.annotation.Public;
import org.apache.flink.api.common.eventtime.TimestampAssigner;
import org.apache.flink.api.common.eventtime.WatermarkOutput;

Expand All @@ -30,7 +30,7 @@
* Splits</i>. That way, streams of events from different splits can be identified and treated
* separately, for example for watermark generation, or event-time skew handling.
*/
@PublicEvolving
@Public
public interface SourceOutput<T> extends WatermarkOutput {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

package org.apache.flink.api.connector.source;

import org.apache.flink.annotation.PublicEvolving;
import org.apache.flink.annotation.Public;
import org.apache.flink.api.common.state.CheckpointListener;
import org.apache.flink.core.io.InputStatus;
import org.apache.flink.metrics.Gauge;
Expand All @@ -45,7 +45,7 @@
* @param <T> The type of the record emitted by this source reader.
* @param <SplitT> The type of the the source splits.
*/
@PublicEvolving
@Public
public interface SourceReader<T, SplitT extends SourceSplit>
extends AutoCloseable, CheckpointListener {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@

package org.apache.flink.api.connector.source;

import org.apache.flink.annotation.PublicEvolving;
import org.apache.flink.annotation.Public;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.metrics.groups.SourceReaderMetricGroup;
import org.apache.flink.util.UserCodeClassLoader;

/** The class that expose some context from runtime to the {@link SourceReader}. */
@PublicEvolving
@Public
public interface SourceReaderContext {

/** @return The metric group this source belongs to. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@

package org.apache.flink.api.connector.source;

import org.apache.flink.annotation.PublicEvolving;
import org.apache.flink.annotation.Public;

/** An interface for all the Split types to extend. */
@PublicEvolving
@Public
public interface SourceSplit {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

package org.apache.flink.api.connector.source;

import org.apache.flink.annotation.PublicEvolving;
import org.apache.flink.annotation.Public;
import org.apache.flink.api.common.state.CheckpointListener;

import javax.annotation.Nullable;
Expand All @@ -30,7 +30,7 @@
* A interface of a split enumerator responsible for the followings: 1. discover the splits for the
* {@link SourceReader} to read. 2. assign the splits to the source reader.
*/
@PublicEvolving
@Public
public interface SplitEnumerator<SplitT extends SourceSplit, CheckpointT>
extends AutoCloseable, CheckpointListener {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

package org.apache.flink.api.connector.source;

import org.apache.flink.annotation.PublicEvolving;
import org.apache.flink.annotation.Public;
import org.apache.flink.metrics.groups.SplitEnumeratorMetricGroup;

import java.util.Map;
Expand All @@ -33,7 +33,7 @@
*
* @param <SplitT> the type of the splits.
*/
@PublicEvolving
@Public
public interface SplitEnumeratorContext<SplitT extends SourceSplit> {

SplitEnumeratorMetricGroup metricGroup();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

package org.apache.flink.api.connector.source;

import org.apache.flink.annotation.PublicEvolving;
import org.apache.flink.annotation.Public;

import java.util.Collections;
import java.util.HashMap;
Expand All @@ -31,7 +31,7 @@
* <p>The assignment is always incremental. In another word, splits in the assignment are simply
* added to the existing assignment.
*/
@PublicEvolving
@Public
public final class SplitsAssignment<SplitT extends SourceSplit> {

private final Map<Integer, List<SplitT>> assignment;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

package org.apache.flink.api.connector.source.lib;

import org.apache.flink.annotation.Public;
import org.apache.flink.api.common.typeinfo.TypeInformation;
import org.apache.flink.api.common.typeinfo.Types;
import org.apache.flink.api.connector.source.Boundedness;
Expand Down Expand Up @@ -57,6 +58,7 @@
* long integer values), user may want to consider executing the application in a streaming manner,
* because, despite the fact that the produced stream is bounded, the end bound is pretty far away.
*/
@Public
public class NumberSequenceSource
implements Source<
Long,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

package org.apache.flink.api.connector.source.lib.util;

import org.apache.flink.annotation.Public;
import org.apache.flink.api.connector.source.SplitEnumerator;
import org.apache.flink.api.connector.source.SplitEnumeratorContext;

Expand All @@ -36,6 +37,7 @@
*
* @param <SplitT> The type of the splits used by the source.
*/
@Public
public class IteratorSourceEnumerator<SplitT extends IteratorSourceSplit<?, ?>>
implements SplitEnumerator<SplitT, Collection<SplitT>> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

package org.apache.flink.api.connector.source.lib.util;

import org.apache.flink.annotation.Public;
import org.apache.flink.api.connector.source.ReaderOutput;
import org.apache.flink.api.connector.source.SourceReader;
import org.apache.flink.api.connector.source.SourceReaderContext;
Expand Down Expand Up @@ -48,6 +49,7 @@
* @param <SplitT> The concrete type of the {@code IteratorSourceSplit} that creates and converts
* the iterator that produces this reader's elements.
*/
@Public
public class IteratorSourceReader<
E, IterT extends Iterator<E>, SplitT extends IteratorSourceSplit<E, IterT>>
implements SourceReader<E, SplitT> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

package org.apache.flink.api.connector.source.lib.util;

import org.apache.flink.annotation.Public;
import org.apache.flink.api.connector.source.SourceSplit;

import java.util.Iterator;
Expand All @@ -28,6 +29,7 @@
*
* @param <E> The type of the elements returned by the iterator.
*/
@Public
public interface IteratorSourceSplit<E, IterT extends Iterator<E>> extends SourceSplit {

/** Gets the iterator over the elements of this split. */
Expand Down

0 comments on commit e4b0008

Please sign in to comment.