rmatharu commented on a change in pull request #1104: SAMZA-2266: Introduce a
backoff when there are repeated failures for host-affinity allocations
URL: https://github.com/apache/samza/pull/1104#discussion_r309810213
##########
File path:
samza-core/src/main/java/org/apache/samza/clustermanager/ProcessorFailure.java
##########
@@ -19,30 +19,44 @@
package org.apache.samza.clustermanager;
+import java.time.Duration;
+import java.time.Instant;
+
+
/**
* A ProcessorFailure instance encapsulates information related to a Samza
processor failure.
* It keeps track of the time of the last failure, the number of failures.
*/
-public class ProcessorFailure {
+class ProcessorFailure {
/**
* Number of times a processor has failed
*/
private final int count;
/**
* Latest failure time of the processor
*/
- private final Long lastFailure;
+ private final Instant lastFailure;
- public ProcessorFailure(int count, Long lastFailure) {
+ /**
+ * The delay added to the retry attempt of the last failure
+ */
+ private final Duration lastRetryDelay;
+
+ public ProcessorFailure(int count, Instant lastFailure, Duration
lastRetryDelay) {
this.count = count;
this.lastFailure = lastFailure;
+ this.lastRetryDelay = lastRetryDelay;
}
public int getCount() {
return count;
}
- public Long getLastFailure() {
+ public Instant getLastFailure() {
Review comment:
+1, thanks for this
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services