Skip to content
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

Remove timeStampField parameter from DataStream constructors. #85309

Merged

Conversation

martijnvg
Copy link
Member

Timestamp field is always '@timestamp' and is already fixed to this field.
Removing this parameter from DataStream's constructors makes this clearer
and makes the code a bit cleaner too.

This change doesn't break bwc in any way or change the xcontent/binary format.
A next followup change may do this.

Followup from #85260

Timestamp field is always '@timestamp' and is already fixed to this field.
Removing this parameter from DataStream's constructors makes this clearer
and makes the code a bit cleaner too.

This change doesn't break bwc in any way or change the xcontent/binary format.
A next followup change may do this.

Followup from elastic#85260
@elasticmachine elasticmachine added the Team:Data Management Meta label for data/management team label Mar 24, 2022
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

Copy link
Contributor

@gmarouli gmarouli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with some short questions :)

@@ -73,7 +74,8 @@

private final LongSupplier timeProvider;
private final String name;
private final TimestampField timeStampField;
// This was always fixed to @timestamp with the idea that one day this field could be configurable. This idea no longer exists.
private final TimestampField timeStampField = TIMESTAMP_FIELD;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: If this is not going to be configurable, shouldn't we use the constant within the class and remove the field?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that makes sense. The constant can be returned in the getter.

@@ -589,6 +518,11 @@ public DataStream(StreamInput in) throws IOException {
);
}

static List<Index> readIndices(StreamInput in) throws IOException {
in.readString(); // timestamp field, which is always @timestamp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering why you chose to always read and ignore the timestamp field instead of using the version of ES to slowly remove the field from here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't want to change serialization logic in this PR.
I will do this in a follow up pr as part of a larger change that also changes xcontent, but that change is breaking and I wanted to discuss this internally before going ahead with this.

@martijnvg martijnvg added the auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) label Mar 28, 2022
@elasticsearchmachine elasticsearchmachine merged commit e8498dc into elastic:master Mar 28, 2022
@martijnvg martijnvg deleted the remove_timestampfield_parameter branch March 28, 2022 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) :Data Management/Data streams Data streams and their lifecycles >non-issue Team:Data Management Meta label for data/management team v8.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants