-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for creating Time Series collection. #3732
Conversation
Introduce time series to CollectionOptions and add dedicated TimeSeries annotation to derive values from.
* | ||
* @return never {@literal null}. | ||
*/ | ||
String timeField(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
time field vs. time property?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Staying close to the MongoDB terminology for Time Series collections seemed to be a valid choice here.
* | ||
* @return empty {@link String} by default. | ||
*/ | ||
String metaField() default ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about just meta or meta property?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Staying close to the MongoDB terminology for Time Series collections seemed to be a valid choice here. Simply meta
does IMO not express that this is a field reference rather than a proved meta object/value.
@Retention(RetentionPolicy.RUNTIME) | ||
@Target({ ElementType.TYPE }) | ||
@Document | ||
public @interface TimeSeries { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively, we could have annotations for the timeseries field and the meta field, similar to text-indexed language for consistency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The @Language
field allows to override the defaults defined via @Document
so I do not think this is a good fit here since you may not override any of those fields on a per document basis for Time Series collections where it's rather a fixed value at collection creation time.
Rename Granularities/Granularity to Granularity and GranularityDefinition to proivide a more natural wording towards using predefined granularities. Validate presence of referenced properties through the TimeSeries annotation. Tweak Javadoc, reformat code, add unit tests. See #3731 Original pull request: #3732.
That's merged and polished now. |
Introduce time series to
CollectionOptions
and add dedicated@TimeSeries
annotation to derive values from.