Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

We need to add following method to public API.

Some of the old methods become deprecated. Other can be replaced, because they are not released, yet.

Method that proposed for replacement added in 

Jira
serverASF JIRA
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyKAFKA-7222
(KIP-328, commit cc8fc7c ):

Code Block
languagejava
firstline0
titlePublic API changes
Windows { {
	//Existing methods. Will be deprecated.
	public abstract long size();


	//Existing methods. Will be deprecatedremoved.
	public Windows<W> untilgrace(final long durationMs) throws IllegalArgumentException;
	public long maintainMs(millisAfterWindowEnd);
	public abstract long sizegracePeriodMs();

	//New methods.
	publicabstract Windows<W>Duration untilsize(final Duration duration) throws IllegalArgumentException;
	publicWindows<W> grace(final Duration maintain(afterWindowEnd);
	public abstract Duration sizegracePeriod();

}

class Window {
	//Existing methods. Will be deprecated.
	public Window(final long startMs, final long endMs) throws IllegalArgumentException;
	public long start();
	public long end();

	//New methods.
	public Window(final Instant start, final Instant end) throws IllegalArgumentException;
	public LocalDateTime start();
	public LocalDateTime end();
}

JoinWindows {
    //Existing methods. Will be deprecated.
    public static JoinWindows of(final long timeDifferenceMs) throws IllegalArgumentException;
    public JoinWindows before(final long timeDifferenceMs) throws IllegalArgumentException;
    public JoinWindows after(final long timeDifferenceMs) throws IllegalArgumentException;
    public JoinWindows until(final long durationMs) throws IllegalArgumentException;

	//Existing method. Will be  publicremoved.
	JoinWindows grace(final long maintainMs(millisAfterWindowEnd);


    //New methods.
    public static JoinWindows of(final Duration timeDifference) throws IllegalArgumentException;
    JoinWindows before(final Duration timeDifference) throws IllegalArgumentException;
   public JoinWindows beforeafter(final Duration timeDifference) throws IllegalArgumentException;
    JoinWindows  public JoinWindows afteruntil(final Duration duration) throws IllegalArgumentException;	
	JoinWindows grace(final Duration timeDifference) throws IllegalArgumentException;
    public JoinWindows until(final Duration duration) throws IllegalArgumentException;
    public Duration maintain();
}afterWindowEnd);

}

Materialized {
	//Existing method. Will be removed.
	Materialized<K, V, S> withRetention(final long retentionMs);


	//New method.
	Materialized<K, V, S> withRetention(final Duration retention);
}


SessionWindows {
	//Existing methods. Will be deprecated.
    public static SessionWindows with(final long inactivityGapMs);
    public SessionWindowslong untilinactivityGap(final long durationMs) throws IllegalArgumentException;


	//Existing methods. Will be  publicremoved.
	SessionWindows grace(final long inactivityGap(millisAfterWindowEnd);
    public 	long maintainMsgracePeriodMs();


	//New methods.
    public static SessionWindows with(final Duration inactivityGap);
    publicDuration SessionWindows until(final Duration duration) throws IllegalArgumentException;
    public Duration inactivityGap();
    public Duration maintaininactivityGap();
	SessionWindows grace(final Duration afterWindowEnd);
	Duration gracePeriod();
}

TimeWindowedDeserializer {
	//Existing methods. Will be deprecated.
	public TimeWindowedDeserializer(final Deserializer<T> inner, final long windowSizeMs);
	public Long getWindowSize();

	//New methods.
	public TimeWindowedDeserializer(final Deserializer<T> inner, final Duration windowSize);
	public Duration getWindowSize();
}

TimeWindows {
	//Existing methods. Will be deprecated.
	public static TimeWindows of(final long sizeMs) throws IllegalArgumentException;
	public TimeWindows advanceBy(final long advanceMs);
	public Map<Long, TimeWindow> windowsFor(final long timestamp);
    public long size();
    public TimeWindows until(finalpublic long durationMs) throws IllegalArgumentException;
    public long maintainMs(size();


	//Existing method. Will be removed.
	TimeWindows grace(final long millisAfterWindowEnd);

	//New methods.
	public static TimeWindows of(final Duration size) throws IllegalArgumentException;
	public TimeWindows advanceBy(final Duration advance);
	public Map<Long, TimeWindow> windowsFor(final Instant timestamp);
    public Duration size();
    public TimeWindows until(final Duration duration) throws IllegalArgumentExceptionsize();
    public	TimeWindows grace(final Duration maintain(afterWindowEnd);
}

UnlimitedWindows {
	//Existing methods. Will be deprecated.
    public UnlimitedWindows startOn(final long startMs) throws IllegalArgumentException;
    public Map<Long, UnlimitedWindow> windowsFor(final long timestamp);
	public long size();
	public

	//Existing method. Will be removed.
	UnlimitedWindows grace(final long maintainMs(millisAfterWindowEnd);


	//New methods.
    public UnlimitedWindows startOn(final Instant start) throws IllegalArgumentException;
    public Map<Long, UnlimitedWindow> windowsFor(final Instant timestamp);
	public Duration size();
	publicUnlimitedWindows grace(final Duration maintain(afterWindowEnd);
}

ProcessorContext {
    //Existing method. Will be deprecated.
    Cancellable schedule(final long intervalMs,
                         final PunctuationType type,
                         final Punctuator callback);

	//New method.
    Cancellable schedule(final Duration interval,
                         final PunctuationType type,
                         final Punctuator callback);
}

ReadOnlyWindowStore<K, V> {
    //Existing methods. Will be deprecated.
    WindowStoreIterator<V> fetch(K key, long timeFromMs, long timeToMs);
    KeyValueIterator<Windowed<K>, V> fetch(K from, K to, long timeFromMs, long timeToMs);
    KeyValueIterator<Windowed<K>, V> fetchAll(long timeFromMs, long timeToMs);

	//New methods.
    WindowStoreIterator<V> fetch(K key, Instant from, Duration duration);
    KeyValueIterator<Windowed<K>, V> fetch(K from, K to, Instant from, Duration duration);
    KeyValueIterator<Windowed<K>, V> fetchAll(Instant from, Duration duration);
}

SessionBytesStoreSupplier {
    //Existing methods. Will be deprecated.
    long segmentIntervalMs();
    long retentionPeriod();

    //New methods. 
    Duration segmentInterval();
    Duration retentionPeriod();
}

SessionStore {
	//Existing methods. Will be deprecated.
	KeyValueIterator<Windowed<K>, AGG> findSessions(final K key, long earliestSessionEndTimeMs, final long latestSessionStartTimeMs);
	KeyValueIterator<Windowed<K>, AGG> findSessions(final K keyFrom, final K keyTo, long earliestSessionEndTimeMs, final long latestSessionStartTimeMs);

	//New methods.
	KeyValueIterator<Windowed<K>, AGG> findSessions(final K key, Instant earliestSessionEnd, final Instant latestSessionStart);
	KeyValueIterator<Windowed<K>, AGG> findSessions(final K keyFrom, final K keyTo, Instant earliestSessionEnd, final Instant latestSessionStart);
}

Stores {
	//Existing methods. Will be deprecated.
	public static WindowBytesStoreSupplier persistentWindowStore(final String name,
    	                                                         final long retentionPeriodMs,
        	                                                     final long windowSizeMs,
            	                                                 final boolean retainDuplicates);

	public static WindowBytesStoreSupplier persistentWindowStore(final String name,
    	                                                         final long retentionPeriodMs,
        	                                                     final long windowSizeMs,
            	                                                 final boolean retainDuplicates,
                	                                             final long segmentIntervalMs);

	public static SessionBytesStoreSupplier persistentSessionStore(final String name,
    	                                                           final long retentionPeriodMs);

	//New methods.
	public static WindowBytesStoreSupplier persistentWindowStore(final String name,
    	                                                         final Duration retentionPeriod,
        	                                                     final Duration windowSize,
            	                                                 final boolean retainDuplicates);

	public static WindowBytesStoreSupplier persistentWindowStore(final String name,
    	                                                         final Duration retentionPeriod,
        	                                                     final Duration windowSize,
            	                                                 final boolean retainDuplicates,
                	                                             final Duration segmentInterval);

	public static SessionBytesStoreSupplier persistentSessionStore(final String name,
    	                                                           final Duration retentionPeriod);
}

WindowBytesStoreSupplier {
    //Existing methods. Will be deprecated.
    long segmentIntervalMs();
    long windowSize();
    long retentionPeriod();

	//New methods.
    Duration segmentInterval();
    Duration windowSize();
    Duration retentionPeriod();
}

KafkaStreams {
	//Existing method. Will be deprecated.
	public synchronized boolean close(final long timeout, final TimeUnit timeUnit);

	//New method
	public synchronized boolean close(final Duration timeout)
}

StreamsMetrics {
	//Existing method. Will be deprecated.
	void recordLatency(final Sensor sensor,
    	               final long startNs,
        	           final long endNs);

	//New method.
	void recordLatency(final Sensor sensor,
    	               final Instant start,
        	           final Duration recDuration);
}

...