lucasbru commented on code in PR #24427:
URL: https://github.com/apache/kafka/pull/24427#discussion_r4736102274
##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/TaskExecutionMetadata.java:
##########
@@ -36,67 +33,37 @@
* shared between all StreamThreads.
*/
public class TaskExecutionMetadata {
- // TODO: implement exponential backoff, for now we just wait 5s
- private static final long CONSTANT_BACKOFF_MS = 5_000L;
private static final long NOT_READY_LOG_INTERVAL_MS = 120_000L; // Log
interval of not being ready (2 minutes)
- private final boolean hasNamedTopologies;
private final Set<String> pausedTopologies;
private final ProcessingMode processingMode;
- private final Collection<Task> successfullyProcessed = new HashSet<>();
- // map of topologies experiencing errors/currently under backoff
- private final ConcurrentHashMap<String, NamedTopologyMetadata>
topologyNameToErrorMetadata = new ConcurrentHashMap<>();
// map of task to last not ready logging time (not present means ready, >=
0 means not ready and tracks last log time)
private final ConcurrentHashMap<TaskId, Long> taskToLastNotReadyLogTime =
new ConcurrentHashMap<>();
private final Logger log;
- public TaskExecutionMetadata(final Set<String> allTopologyNames,
- final Set<String> pausedTopologies,
+ public TaskExecutionMetadata(final Set<String> pausedTopologies,
final ProcessingMode processingMode) {
- this.hasNamedTopologies = !(allTopologyNames.size() == 1 &&
allTopologyNames.contains(UNNAMED_TOPOLOGY));
this.pausedTopologies = pausedTopologies;
this.processingMode = processingMode;
this.log = new LogContext("").logger(TaskExecutionMetadata.class);
}
- public boolean hasNamedTopologies() {
- return hasNamedTopologies;
- }
-
public ProcessingMode processingMode() {
return processingMode;
}
public boolean canProcessTask(final Task task, final long now) {
- final String topologyName = task.id().topologyName();
final boolean taskWasReady =
!taskToLastNotReadyLogTime.containsKey(task.id());
- final boolean canProcess;
+ // TODO implement error handling/backoff for non-named topologies
(needs KIP)
Review Comment:
Non-named topologies doesn't make sense anymore. And we don't usually put
TODOs in the code, but rather create tickets. But I'm not convinced we even
need this todo anymore. I think it refers to the code that made sure that one
failing topology doesn't block the whole instance, but if we only have one
topology that seems not very useful?
I'd just remove the TODO.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]