[ 
https://issues.apache.org/jira/browse/BEAM-5299?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16611025#comment-16611025
 ] 

Maximilian Michels commented on BEAM-5299:
------------------------------------------

Thanks for the pointer [~lcwik]. What I did was adding another EnumValueOption: 

{code:java}
extend google.protobuf.EnumValueOptions {
  string beam_urn = 185324356;
  int64 global_window_max_timestamp_millis = 185324357;
}
{code}
 
But it makes much more sense to have a string constant field. Or even to reuse 
beam_urn and make it generic:

{code:java}
extend google.protobuf.EnumValueOptions {
  string beam_constant = 185324356;
}

message Constants {
  enum Constants {
    // The minimum timestamp in milliseconds since Jan 1, 1970
    TIMESTAMP_MIN_MILLIS = 0 [(beam_constant) = "-9223372036854775"]; 
    // The maximum timestamp in milliseconds since Jan 1, 1970
    TIMESTAMP_MAX_MILLIS = 0 [(beam_constant) = "9223372036854775"]; 
    // The maximum timestamp for the global window in milliseconds since Jan 1, 
1970
    // Triggers use maxTimestamp to set timers' timestamp. Timers fires when
    // the watermark passes their timestamps. So, the timestamp needs to be
    // smaller than the TIMESTAMP_MAX_MILLIS.
    GLOBAL_WINDOW_MAX_TIMESTAMP_MILLIS = 1 [(beam_constant) = 
"9223371950454775"];
  }
}
{code}

> Define max global window as a shared value in protos like URN enums.
> --------------------------------------------------------------------
>
>                 Key: BEAM-5299
>                 URL: https://issues.apache.org/jira/browse/BEAM-5299
>             Project: Beam
>          Issue Type: Improvement
>          Components: beam-model, sdk-go, sdk-java-core, sdk-py-core
>            Reporter: Luke Cwik
>            Assignee: Maximilian Michels
>            Priority: Minor
>              Labels: portability
>
> Instead of having each language define a max timestamp themselves, define the 
> max timestamps within proto to be shared across different languages.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to