SAMZA-1334: fix pre-condition for ContainerAllocator to work properly
authorYi Pan (Data Infrastructure) <nickpan47@gmail.com>
Tue, 20 Jun 2017 15:35:39 +0000 (08:35 -0700)
committerYi Pan (Data Infrastructure) <nickpan47@gmail.com>
Tue, 20 Jun 2017 15:35:39 +0000 (08:35 -0700)
commit8aa75467e1d4cc7eb606f63dfe6cb667c4a58460
tree1e125a43cc6285ee0ef31edadf9d7777843a2eec
parente827d150fc12c81bb64788d28e07488c42a93687
SAMZA-1334: fix pre-condition for ContainerAllocator to work properly

We have observed issues when the LocalityManager reports the container locality mapping while the host-affinity is disabled in ContainerAllocator, in which the ContainerAllocator failed to release extra containers.

Hence, fix is in the form of make sure the pre-condition is met for the ContainerAllocator w/o host-affinity: the localityMap from the JobModel should contain no preferred host info.

Author: Yi Pan (Data Infrastructure) <nickpan47@gmail.com>

Reviewers: Jagadish <jagadish1989@gmail.com>

Closes #228 from nickpan47/SAMZA-1334 and squashes the following commits:

ad3320f [Yi Pan (Data Infrastructure)] SAMZA-1334: fix the pre-conditions for ContainerAllocator to work properly. Make sure JobModel is generated w/o LocalityManager if host-affinity is disabled
f76fff1 [Yi Pan (Data Infrastructure)] WIP: SAMZA-1334 fix
samza-core/src/main/java/org/apache/samza/job/model/JobModel.java
samza-core/src/main/scala/org/apache/samza/coordinator/JobModelManager.scala
samza-core/src/test/java/org/apache/samza/clustermanager/TestContainerAllocator.java
samza-core/src/test/java/org/apache/samza/clustermanager/TestContainerProcessManager.java
samza-core/src/test/java/org/apache/samza/clustermanager/TestHostAwareContainerAllocator.java
samza-core/src/test/java/org/apache/samza/coordinator/JobModelManagerTestUtil.java [new file with mode: 0644]
samza-core/src/test/java/org/apache/samza/coordinator/TestJobModelManager.java [new file with mode: 0644]
samza-core/src/test/java/org/apache/samza/testUtils/MockHttpServer.java [moved from samza-core/src/test/java/org/apache/samza/clustermanager/MockHttpServer.java with 97% similarity]