-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Worker retry for MSQ task #13353
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
Merged
Merged
Worker retry for MSQ task #13353
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
41bb660
Initial commit.
cryptoe 4957b01
Merge things
cryptoe 1930b3b
Fixing error message in retry exceeded exception
cryptoe 1ed9346
Cleaning up some code
cryptoe 14d8c60
Adding some test cases.
cryptoe f8943d3
Adding java docs.
cryptoe 74fa66f
Merge things
cryptoe c92b217
Finishing up state test cases.
cryptoe 58da3cf
Adding some more java docs and fixing spot bugs, intellij inspections
cryptoe 7b90edc
Fixing intellij inspections and added tests
cryptoe 111c599
Merge things
cryptoe deafdf8
Documenting error codes
cryptoe edfd5b6
Migrate current integration batch tests to equivalent MSQ tests (#13374)
abhagraw 4d1a3b1
Adding ITTest which kills the worker abruptly
cryptoe ecb1942
Review comments phase one
cryptoe 48c844a
Adding doc changes
cryptoe ac41754
Adjusting for single threaded execution.
cryptoe 29b0c6e
Merge remote-tracking branch 'apache/master' into controller_state_retry
cryptoe 7c31923
Adding Sequential Merge PR state handling
cryptoe 2000965
Merge remote-tracking branch 'apache/master' into controller_state_retry
cryptoe d32397a
Merge things
cryptoe a286480
Fixing checkstyle.
cryptoe bf25675
Adding new context param for fault tolerance.
cryptoe a78ee50
Merge remote-tracking branch 'apache/master' into controller_state_retry
cryptoe e674cac
Merge things
cryptoe 9e0b455
Merge remote-tracking branch 'apache/master' into controller_state_retry
0c22ce8
Merge things
a4f974c
Adding parameterized tests
cryptoe 87d39dc
Adding missed files
cryptoe 2de05f8
Review comments and fixing tests.
cryptoe 85843de
Documentation things.
cryptoe 791e2cb
Fixing IT
cryptoe 820b5b7
Controller impl fix.
cryptoe dd9a6a2
Fixing racy WorkerSketchFetcherTest.java exception handling.
cryptoe 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 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
60 changes: 60 additions & 0 deletions
60
core/src/main/java/org/apache/druid/java/util/common/function/TriConsumer.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| /* | ||
| * 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.java.util.common.function; | ||
|
|
||
| import java.util.Objects; | ||
|
|
||
| /** | ||
| * Based on {@link java.util.function.BiConsumer} | ||
| */ | ||
| @FunctionalInterface | ||
| public interface TriConsumer<T, U, V> | ||
| { | ||
| /** | ||
| * Performs this operation on the given arguments. | ||
| * | ||
| * @param t the first input argument | ||
| * @param u the second input argument | ||
| * @param v the third input argument | ||
| */ | ||
| void accept(T t, U u, V v); | ||
|
|
||
| /** | ||
| * Returns a composed {@code TriConsumer} that performs, in sequence, this | ||
| * operation followed by the {@code after} operation. If performing either | ||
| * operation throws an exception, it is relayed to the caller of the | ||
| * composed operation. If performing this operation throws an exception, | ||
| * the {@code after} operation will not be performed. | ||
| * | ||
| * @param after the operation to perform after this operation | ||
| * @return a composed {@code TriConsumer} that performs in sequence this | ||
| * operation followed by the {@code after} operation | ||
| * @throws NullPointerException if {@code after} is null | ||
| */ | ||
| default TriConsumer<T, U, V> andThen(TriConsumer<? super T, ? super U, ? super V> after) | ||
| { | ||
| Objects.requireNonNull(after); | ||
|
|
||
| return (t, u, v) -> { | ||
| accept(t, u, v); | ||
| after.accept(t, u, v); | ||
| }; | ||
| } | ||
| } |
45 changes: 45 additions & 0 deletions
45
core/src/test/java/org/apache/druid/java/util/common/function/TriConsumerTest.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| /* | ||
| * 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.java.util.common.function; | ||
|
|
||
| import org.junit.Assert; | ||
| import org.junit.Test; | ||
|
|
||
| import java.util.HashSet; | ||
| import java.util.Set; | ||
|
|
||
| public class TriConsumerTest | ||
| { | ||
|
|
||
| @Test | ||
| public void sanityTest() | ||
| { | ||
| Set<Integer> sumSet = new HashSet<>(); | ||
| TriConsumer<Integer, Integer, Integer> consumerA = (arg1, arg2, arg3) -> { | ||
| sumSet.add(arg1 + arg2 + arg3); | ||
| }; | ||
| TriConsumer<Integer, Integer, Integer> consumerB = (arg1, arg2, arg3) -> { | ||
| sumSet.remove(arg1 + arg2 + arg3); | ||
| }; | ||
| consumerA.andThen(consumerB).accept(1, 2, 3); | ||
|
|
||
| Assert.assertTrue(sumSet.isEmpty()); | ||
| } | ||
| } | ||
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
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
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
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
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.
I think there should be a test where the
consumerAthrows an exception after adding to the set, and then we should see ifconsumerBruns or not.