Rework on serialization and deserialization#252
Closed
Yury-Fridlyand wants to merge 9 commits intointeg-pagination-p1from
Closed
Rework on serialization and deserialization#252Yury-Fridlyand wants to merge 9 commits intointeg-pagination-p1from
Yury-Fridlyand wants to merge 9 commits intointeg-pagination-p1from
Conversation
18 tasks
Yury-Fridlyand
commented
Mar 24, 2023
core/src/main/java/org/opensearch/sql/planner/physical/PaginateOperator.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/opensearch/sql/planner/physical/ProjectOperator.java
Outdated
Show resolved
Hide resolved
Yury-Fridlyand
commented
Mar 24, 2023
...earch/src/main/java/org/opensearch/sql/opensearch/storage/scan/OpenSearchPagedIndexScan.java
Outdated
Show resolved
Hide resolved
6 tasks
7a9d285 to
ef44600
Compare
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
This comment was marked as spam.
This comment was marked as spam.
MaxKsyunz
reviewed
Mar 31, 2023
core/src/main/java/org/opensearch/sql/planner/SerializablePlan.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/opensearch/sql/planner/SerializablePlan.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/opensearch/sql/executor/pagination/PaginatedPlanCache.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
MaxKsyunz
approved these changes
Apr 4, 2023
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
MaxKsyunz
reviewed
Apr 5, 2023
| return new Cursor(CURSOR_PREFIX | ||
| + serialize(((SerializablePlan) plan).getPlanForSerialization())); | ||
| // ClassCastException thrown when a plan in the tree doesn't implement SerializablePlan | ||
| } catch (ClassCastException | NoCursorException e) { |
There was a problem hiding this comment.
When can ClassCastException be thrown?
Author
There was a problem hiding this comment.
We are always trying to convert a plan tree to a cursor in
If tree contains a plan which doesn't implement
SerializablePlan, there would be a ClassCastException somewhere, e.g. in
Author
There was a problem hiding this comment.
I don't serialize PaginateOperator (to reduce cursor size), so I can't check plan instanceof PaginateOperator here as it was before.
That means I have to do another protection here. The incoming tree could be
ProjectOperator -> ResourceMonitorPlan -> PrometheusIndexScan or ProjectOperator -> ValuesOperator.
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
This was referenced Apr 5, 2023
Author
|
Superseded by opensearch-project#1498 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Rework
PhysicalPlantree serialization and deserialization. Make it scalable and extendable.If a new plan should be serialized (a new feature is becoming supported by pagination) - it should properly overload
SerializablePlan::writeExternalonly.The plan tree will be recovered in deserialization the same way it was before serialization.
New mechanism can also skip plans from serialization - for example, it skips
ResourceMonitorPlan.Issues Resolved
opensearch-project#1483
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.