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

Add streaming query handler #5717

Merged
merged 2 commits into from
Sep 9, 2020

Conversation

elonazoulay
Copy link
Contributor

Description

Add a description of your PR here.
A good description should include pointers to an issue or design document, etc.

Upgrade Notes

Does this PR prevent a zero down-time upgrade? (Assume upgrade order: Controller, Broker, Server, Minion)

  • Yes (Please label as backward-incompat, and complete the section below on Release Notes)

Does this PR fix a zero-downtime upgrade introduced earlier?

  • Yes (Please label this as backward-incompat, and complete the section below on Release Notes)

Does this PR otherwise need attention when creating release notes? Things to consider:

  • New configuration options
  • Deprecation of configurations
  • Signature changes to public methods/interfaces
  • New plugins added or old plugins removed
  • Yes (Please label this PR as release-notes and complete the section on Release Notes)

Release Notes

If you have tagged this as either backward-incompat or release-notes,
you MUST add text here that you would like to see appear in release notes of the
next release.

If you have a series of commits adding or enabling a feature, then
add this section only in final commit that marks the feature completed.
Refer to earlier release notes to see examples of text

Documentation

If you have introduced a new feature or configuration, please add it to the documentation as well.
See https://docs.pinot.apache.org/developers/developers-and-contributors/update-document

import java.util.List;


public class StreamingSelectionOnlyOperator extends BaseOperator<IntermediateResultsBlock> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please import Pinot code style in config/codestyle-intellij.xml or config/codestyle-eclipse.xml and reformat the files?

QueryContext queryContext,
List<ExpressionContext> expressions,
TransformOperator transformOperator,
StreamObserver<Server.ServerResponse> streamObserver) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's not pass the streamObserver to the segment level operator because multiple segments will be processed in parallel, but calls to streamObserver.onNext() need to be synchronized.
We should create a StreamingCombineOperator (instance level operator) to keep fetching IntermediateResultsBlock from this operator and handle the calls to streamObserver.onNext().

// TODO: implement, follow up whether to use ServerQueryRequest
}

public DataTable processQuery(ServerQueryRequest queryRequest,
Copy link
Contributor

Choose a reason for hiding this comment

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

This method should not return anything (we can directly implement submit())

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will be pushing an update for this as well.

private long _defaultTimeOutMs = CommonConstants.Server.DEFAULT_QUERY_EXECUTOR_TIMEOUT_MS;
private ServerMetrics _serverMetrics;

public synchronized void init(PinotConfiguration config, InstanceDataManager instanceDataManager,
Copy link
Contributor

Choose a reason for hiding this comment

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

It will be very hard to reuse the current QueryScheduler because that is not designed for streaming API. So for the first version we can just launch an ExecutorService within this class and use it to execute queries without introducing query scheduling.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense, will be pushing an update for this.

@elonazoulay elonazoulay force-pushed the streaming_endpoint branch 2 times, most recently from a04618e to f886794 Compare July 25, 2020 18:15
@Jackie-Jiang Jackie-Jiang force-pushed the streaming_endpoint branch 5 times, most recently from 8bc3d7b to db95533 Compare July 28, 2020 00:18
Copy link
Contributor

@xiangfu0 xiangfu0 left a comment

Choose a reason for hiding this comment

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

lgtm

@Jackie-Jiang Jackie-Jiang merged commit f88a275 into apache:master Sep 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants