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_r303528698
##########
File path:
samza-core/src/main/java/org/apache/samza/clustermanager/AbstractContainerAllocator.java
##########
@@ -175,20 +176,23 @@ protected void runStreamProcessor(SamzaResourceRequest
request, String preferred
public abstract void requestResources(Map<String, String>
processorToHostMapping);
/**
- * Checks if this allocator has a pending resource request.
+ * Checks if this allocator has a pending resource request with a request
timestamp equal to or earlier than the current
+ * timestamp.
* @return {@code true} if there is a pending request, {@code false}
otherwise.
*/
- protected final boolean hasPendingRequest() {
- return peekPendingRequest() != null;
+ protected final boolean hasReadyPendingRequest() {
+ SamzaResourceRequest pending = peekReadyPendingRequest();
+ return pending != null;
}
/**
* Retrieves, but does not remove, the next pending request in the queue.
*
* @return the pending request or {@code null} if there is no pending
request.
*/
- protected final SamzaResourceRequest peekPendingRequest() {
- return resourceRequestState.peekPendingRequest();
+ protected final SamzaResourceRequest peekReadyPendingRequest() {
Review comment:
Code nitpick:
Perhaps use Optional<SamzaResourceRequest>
----------------------------------------------------------------
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