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_r303529411
##########
File path:
samza-core/src/main/java/org/apache/samza/clustermanager/AbstractContainerAllocator.java
##########
@@ -198,12 +202,20 @@ protected final SamzaResourceRequest
peekPendingRequest() {
* @param preferredHost name of the host that you prefer to run the
processor on
*/
public final void requestResource(String processorId, String preferredHost) {
- SamzaResourceRequest request = getResourceRequest(processorId,
preferredHost);
+ requestResourceWithDelay(processorId, preferredHost, Duration.ZERO);
+ }
+
+ public final void requestResourceWithDelay(String processorId, String
preferredHost, Duration delay) {
+ SamzaResourceRequest request = getResourceRequestWithDelay(processorId,
preferredHost, delay);
issueResourceRequest(request);
}
public final SamzaResourceRequest getResourceRequest(String processorId,
String preferredHost) {
- return new SamzaResourceRequest(this.containerNumCpuCores,
this.containerMemoryMb, preferredHost, processorId);
+ return getResourceRequestWithDelay(processorId, preferredHost,
Duration.ZERO);
+ }
+
+ public final SamzaResourceRequest getResourceRequestWithDelay(String
processorId, String preferredHost, Duration delay) {
Review comment:
Code nitpick:
Maybe add
/**
Create a resource request with a timestamp = current-timestamp + delay.
*/
----------------------------------------------------------------
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