-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Remove timeStampField parameter from DataStream constructors. #85309
Conversation
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
Pinging @elastic/es-data-management (Team:Data Management) |
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.
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; |
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.
Nitpick: If this is not going to be configurable, shouldn't we use the constant within the class and remove the field?
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.
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 |
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.
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.
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.
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.
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