Versions Compared

Key

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

...

The proposal is to deprecate the current punctuate() method method:

Code Block
titleProcessor<K,V>
@Deprecated
void punctuate(long timestamp); // current

...

Code Block
titlePunctuator
interface Punctuator {
    void punctuate(long timestamp);
}

On ProcessorContext deprecate the current schedule method would also be deprecated and add a new variant overload taking the Punctuator added:

Code Block
titleProcessorContext
@Deprecated
void schedule(long interval); //current, stream-time semantics

void schedule(long interval, PunctuationType type, Punctuator callback); //new
// We could allow this to be called once for each value of PunctuationType to mix approaches.

where Where PunctuationType is

Code Block
titlePunctuationType
enum PunctuationType {
  STREAM_TIME,
  SYSTEM_TIME,
}

Other alternative alternatives under discussion:

(A) Change the semantics of punctuate() to be purely "time driven", instead of "part time driven, and part data-driven". That is, the punctuate function triggering will no longer be dependent whether there are new data arriving, and hence not on the timestamps of the arriving data either. Instead it will be triggered only by system wall-clock time.

...

(E) Finally, the hybrid approach (this is convenient for the use cases in Punctuate Use Cases but difficult to reason about):

 

...

Code Block
titleProcessorContext
/**
* Schedule punctuate at stream-time intervals with a system-time upper bound. 
* For

...

 pure system-time based punctuation streamTimeInterval can be set to -1 == infinite

...

 

* and systemTimeUpperBound to the desired interval
*/
schedule(Punctuator callback, long streamTimeInterval, long systemTimeUpperBound); 

...



/**
* Schedule punctuate at stream-time intervals without a system-time upper bound

...

,
* i.e. pure stream-time based

...

 punctuation
*/
schedule(Punctuator callback, long streamTimeInterval);


Punctuation is triggered when either:
- the stream time advances past the (stream time of the previous punctuation) + streamTimeInterval;
- or (iff systemTimeUpperBound is set) when the system time advances past the (system time of the previous punctuation) + systemTimeUpperBound

...