-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Add errors and state to stream supervisor status API endpoint #7428
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
clintropolis
merged 28 commits into
apache:master
from
justinborromeo:7217-Supervisor-Error-Endpoint-v4
Jun 1, 2019
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
b35c2b1
Add state and error tracking for seekable stream supervisors
justinborromeo 0f0e950
Fixed nits in docs
justinborromeo 6f44ff7
Made inner class static and updated spec test with jackson inject
justinborromeo 0f13b0e
Merge branch 'master' into 7217-Supervisor-Error-Endpoint-v4
justinborromeo f8d3532
Review changes
justinborromeo 7ad9858
Remove redundant config param in supervisor
justinborromeo 8632a23
Style
justinborromeo 9e5a20d
Applied some of Jon's recommendations
justinborromeo 46e200c
Add transience field
justinborromeo 68dfcde
write test
dclim 086ead4
Merge branch 'master' into 7217-Supervisor-Error-Endpoint-v4
dclim d986232
implement code review changes except for reconsidering logic of markR…
dclim 128edad
remove transience reporting and fix SeekableStreamSupervisorStateMana…
dclim f686d2a
move call to stateManager.markRunFinished() from RunNotice to runInte…
dclim 5519d4c
remove stateHistory because it wasn't adding much value, some fixes, …
dclim aab44c1
fix tests
dclim 34b0861
code review changes and add HTTP health check status
dclim 413af77
fix test failure
dclim 58d0870
refactor to split into a generic SupervisorStateManager and a specifi…
dclim 90053cc
Merge remote-tracking branch 'upstream/master' into 7217-Supervisor-E…
dclim d13aba1
fixup after merge
dclim f40758d
Merge remote-tracking branch 'upstream/master' into 7217-Supervisor-E…
dclim 02dbec2
code review changes - add additional docs
dclim 0db0b7e
Merge remote-tracking branch 'upstream/master' into 7217-Supervisor-E…
dclim 73c4385
Merge remote-tracking branch 'upstream/master' into 7217-Supervisor-E…
dclim c515a3a
cleanup KafkaIndexTaskTest
dclim 17c0184
add additional documentation for Kinesis indexing
dclim e7b492d
remove unused throws class
dclim 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
93 changes: 93 additions & 0 deletions
93
core/src/test/java/org/apache/druid/utils/CircularBufferTest.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,93 @@ | ||
| /* | ||
| * 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.utils; | ||
|
|
||
| import org.junit.Assert; | ||
| import org.junit.Test; | ||
|
|
||
|
|
||
| public class CircularBufferTest | ||
| { | ||
| @Test | ||
| public void testCircularBufferGetLatest() | ||
| { | ||
| CircularBuffer<Integer> buff = new CircularBuffer(4); | ||
|
|
||
| for (int i = 1; i <= 9; i++) { | ||
| buff.add(i); // buffer should contain [9, 6, 7, 8] | ||
| } | ||
| for (int i = 0; i < 4; i++) { | ||
| Assert.assertEquals((Integer) (9 - i), buff.getLatest(i)); | ||
| } | ||
| } | ||
|
|
||
| @Test | ||
| public void testCircularBufferGet() | ||
| { | ||
| CircularBuffer<Integer> circularBuffer = new CircularBuffer<>( | ||
| 3); | ||
|
|
||
| circularBuffer.add(1); | ||
| Assert.assertEquals(1, circularBuffer.size()); | ||
| Assert.assertEquals(1, (int) circularBuffer.get(0)); | ||
|
|
||
| circularBuffer.add(2); | ||
| Assert.assertEquals(2, circularBuffer.size()); | ||
| for (int i = 0; i < circularBuffer.size(); i++) { | ||
| Assert.assertEquals(i + 1, (int) circularBuffer.get(i)); | ||
| } | ||
|
|
||
| circularBuffer.add(3); | ||
| Assert.assertEquals(3, circularBuffer.size()); | ||
| for (int i = 0; i < circularBuffer.size(); i++) { | ||
| Assert.assertEquals(i + 1, (int) circularBuffer.get(i)); | ||
| } | ||
|
|
||
| circularBuffer.add(4); | ||
| Assert.assertEquals(3, circularBuffer.size()); | ||
| for (int i = 0; i < circularBuffer.size(); i++) { | ||
| Assert.assertEquals(i + 2, (int) circularBuffer.get(i)); | ||
| } | ||
|
|
||
| circularBuffer.add(5); | ||
| Assert.assertEquals(3, circularBuffer.size()); | ||
| for (int i = 0; i < circularBuffer.size(); i++) { | ||
| Assert.assertEquals(i + 3, (int) circularBuffer.get(i)); | ||
| } | ||
|
|
||
| circularBuffer.add(6); | ||
| Assert.assertEquals(3, circularBuffer.size()); | ||
| for (int i = 0; i < circularBuffer.size(); i++) { | ||
| Assert.assertEquals(i + 4, (int) circularBuffer.get(i)); | ||
| } | ||
|
|
||
| circularBuffer.add(7); | ||
| Assert.assertEquals(3, circularBuffer.size()); | ||
| for (int i = 0; i < circularBuffer.size(); i++) { | ||
| Assert.assertEquals(i + 5, (int) circularBuffer.get(i)); | ||
| } | ||
|
|
||
| circularBuffer.add(8); | ||
| Assert.assertEquals(3, circularBuffer.size()); | ||
| for (int i = 0; i < circularBuffer.size(); i++) { | ||
| Assert.assertEquals(i + 6, (int) circularBuffer.get(i)); | ||
| } | ||
| } | ||
| } | ||
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.
There's also a
ChangeRequestHistoryTesttest suite that has a test for CircularBuffer, can you move that test here now that you've added a separate test suite?