-
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
More error reporting and stats for ingestion tasks #5418
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
278144e
Add more indexing task status and error reporting
jon-wei bbda06b
PR comments, add support in AppenderatorDriverRealtimeIndexTask
jon-wei 9bb55f5
Merge remote-tracking branch 'upstream/master' into more_task_status
jon-wei 8867c2f
Use TaskReport instead of metrics/context
jon-wei 888fa4d
Fix tests
jon-wei 4589808
Merge WIP
jon-wei d5f1e28
Use TaskReport uploads
jon-wei 9943b27
Refactor fire department metrics retrieval
jon-wei 60beb1c
Refactor input row serde in hadoop task
jon-wei 0e0e855
Refactor hadoop task loader names
jon-wei c2c132a
Truncate error message in TaskStatus, add errorMsg to task report
jon-wei 8e36c22
PR comments
jon-wei 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Licensed to Metamarkets Group Inc. (Metamarkets) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. Metamarkets 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 io.druid.indexer; | ||
|
||
public enum IngestionState | ||
{ | ||
NOT_STARTED, | ||
DETERMINE_PARTITIONS, | ||
BUILD_SEGMENTS, | ||
COMPLETED | ||
} |
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,29 @@ | ||
/* | ||
* Licensed to Metamarkets Group Inc. (Metamarkets) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. Metamarkets 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 io.druid.indexer; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public interface TaskMetricsGetter | ||
{ | ||
List<String> getKeys(); | ||
Map<String, Number> getTotalMetrics(); | ||
} |
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,47 @@ | ||
/* | ||
* Licensed to Metamarkets Group Inc. (Metamarkets) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. Metamarkets 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 io.druid.indexer; | ||
|
||
import com.google.common.collect.Maps; | ||
|
||
import java.util.Map; | ||
|
||
public class TaskMetricsUtils | ||
{ | ||
public static final String ROWS_PROCESSED = "rowsProcessed"; | ||
public static final String ROWS_PROCESSED_WITH_ERRORS = "rowsProcessedWithErrors"; | ||
public static final String ROWS_UNPARSEABLE = "rowsUnparseable"; | ||
public static final String ROWS_THROWN_AWAY = "rowsThrownAway"; | ||
|
||
public static Map<String, Object> makeIngestionRowMetrics( | ||
long rowsProcessed, | ||
long rowsProcessedWithErrors, | ||
long rowsUnparseable, | ||
long rowsThrownAway | ||
) | ||
{ | ||
Map<String, Object> metricsMap = Maps.newHashMap(); | ||
metricsMap.put(ROWS_PROCESSED, rowsProcessed); | ||
metricsMap.put(ROWS_PROCESSED_WITH_ERRORS, rowsProcessedWithErrors); | ||
metricsMap.put(ROWS_UNPARSEABLE, rowsUnparseable); | ||
metricsMap.put(ROWS_THROWN_AWAY, rowsThrownAway); | ||
return metricsMap; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
/* | ||
* Licensed to Metamarkets Group Inc. (Metamarkets) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. Metamarkets 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 io.druid.utils; | ||
|
||
import com.google.common.base.Preconditions; | ||
|
||
/** | ||
* A circular buffer that supports random bidirectional access. | ||
* | ||
* @param <E> Type of object to be stored in the buffer | ||
*/ | ||
public class CircularBuffer<E> | ||
{ | ||
public E[] getBuffer() | ||
{ | ||
return buffer; | ||
} | ||
|
||
private final E[] buffer; | ||
|
||
private int start = 0; | ||
private int size = 0; | ||
|
||
public CircularBuffer(int capacity) | ||
{ | ||
Preconditions.checkArgument(capacity > 0, "Capacity must be greater than 0."); | ||
buffer = (E[]) new Object[capacity]; | ||
} | ||
|
||
public void add(E item) | ||
{ | ||
buffer[start++] = item; | ||
|
||
if (start >= buffer.length) { | ||
start = 0; | ||
} | ||
|
||
if (size < buffer.length) { | ||
size++; | ||
} | ||
} | ||
|
||
/** | ||
* Access object at a given index, starting from the latest entry added and moving backwards. | ||
*/ | ||
public E getLatest(int index) | ||
{ | ||
Preconditions.checkArgument(index >= 0 && index < size, "invalid index"); | ||
|
||
int bufferIndex = start - index - 1; | ||
if (bufferIndex < 0) { | ||
bufferIndex = buffer.length + bufferIndex; | ||
} | ||
return buffer[bufferIndex]; | ||
} | ||
|
||
/** | ||
* Access object at a given index, starting from the earliest entry added and moving forward. | ||
*/ | ||
public E get(int index) | ||
{ | ||
Preconditions.checkArgument(index >= 0 && index < size, "invalid index"); | ||
|
||
int bufferIndex = (start - size + index) % buffer.length; | ||
if (bufferIndex < 0) { | ||
bufferIndex += buffer.length; | ||
} | ||
return buffer[bufferIndex]; | ||
} | ||
|
||
public int size() | ||
{ | ||
return size; | ||
} | ||
} |
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
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
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.
Is this same for all types of tasks? If so, I think it's better to expand TaskState to include these new states because every task is the ingestion task and we don't have to keep two states for them.
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 decided to keep them separate, since I mean for IngestionState to be an additional qualifier on the existing states (RUNNING,FAILED,SUCCESS). For example, a task could be RUNNING and in DETERMINE_PARTITIONS, or RUNNING and in BUILD_SEGMENTS, or similarly with FAILED.
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.
Sounds good.