-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
MSQ worker: Support in-memory shuffles. #16790
Merged
Merged
Changes from 6 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
faacd2f
MSQ worker: Support in-memory shuffles.
gianm b6016a2
Updates for static checks, test coverage.
gianm b1445ff
Fixes.
gianm b22b30e
Remove exception.
gianm 4d8d1a0
Changes from review.
gianm aa3d3bf
Address static check.
gianm 11ea1aa
Changes from review.
gianm 61c337b
Improvements to docs and method names.
gianm 112bd71
Update comments, add test.
gianm 193be9e
Additional javadocs.
gianm f9f9321
Fix throws.
gianm ac49b8e
Fix worker stopping in tests.
gianm ff34ede
Fix stuck test.
gianm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
74 changes: 74 additions & 0 deletions
74
...ti-stage-query/src/main/java/org/apache/druid/msq/exec/ListeningOutputChannelFactory.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.apache.druid.msq.exec; | ||
|
||
import org.apache.druid.frame.processor.OutputChannel; | ||
import org.apache.druid.frame.processor.OutputChannelFactory; | ||
import org.apache.druid.frame.processor.PartitionedOutputChannel; | ||
|
||
import java.io.IOException; | ||
|
||
/** | ||
* Decorator for {@link OutputChannelFactory} that notifies a {@link Listener} whenever a channel is opened. | ||
*/ | ||
public class ListeningOutputChannelFactory implements OutputChannelFactory | ||
{ | ||
private final OutputChannelFactory delegate; | ||
private final Listener listener; | ||
|
||
public ListeningOutputChannelFactory(final OutputChannelFactory delegate, final Listener listener) | ||
{ | ||
this.delegate = delegate; | ||
this.listener = listener; | ||
} | ||
|
||
@Override | ||
public OutputChannel openChannel(final int partitionNumber) throws IOException | ||
{ | ||
return notifyListener(delegate.openChannel(partitionNumber)); | ||
} | ||
|
||
|
||
@Override | ||
public OutputChannel openNilChannel(final int partitionNumber) | ||
{ | ||
return notifyListener(delegate.openNilChannel(partitionNumber)); | ||
} | ||
|
||
@Override | ||
public PartitionedOutputChannel openPartitionedChannel( | ||
final String name, | ||
final boolean deleteAfterRead | ||
) | ||
{ | ||
throw new UnsupportedOperationException("Listening to partitioned channels is not supported"); | ||
} | ||
|
||
private OutputChannel notifyListener(OutputChannel channel) | ||
{ | ||
listener.channelOpened(channel); | ||
return channel; | ||
} | ||
|
||
public interface Listener | ||
{ | ||
void channelOpened(OutputChannel channel); | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
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.
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.
nit: lets add javadoc here, even though it wasn't present in the original code.
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.
Added javadoc.