@Test public void testNoneFarzoneJobAssignment() { List<ResourcePoolAssignment> result = resolver.resolve(newJob("regularZone")); assertThat(result).hasSize(0); }
@Override public List<ResourcePoolAssignment> resolve(Job<?> job) { return KubeUtil.findFarzoneId(configuration, job).map(farzone -> { String resourcePoolName = PodResourcePoolResolvers.RESOURCE_POOL_ELASTIC_FARZONE_PREFIX + farzone; return Collections.singletonList(ResourcePoolAssignment.newBuilder() .withResourcePoolName(resourcePoolName) .withRule(String.format("Farzone %s assigned to resource pool %s", farzone, resourcePoolName)) .build() ); } ).orElse(Collections.emptyList()); }
FarzonePodResourcePoolResolver implements PodResourcePoolResolver { @Override public List<ResourcePoolAssignment> resolve(Job<?> job) { return KubeUtil.findFarzoneId(configuration, job).map(farzone -> { String resourcePoolName = PodResourcePoolResolvers.RESOURCE_POOL_ELASTIC_FARZONE_PREFIX + farzone; return Collections.singletonList(ResourcePoolAssignment.newBuilder() .withResourcePoolName(resourcePoolName) .withRule(String.format("Farzone %s assigned to resource pool %s", farzone, resourcePoolName)) .build() ); } ).orElse(Collections.emptyList()); } }
FarzonePodResourcePoolResolver implements PodResourcePoolResolver { @Override public List<ResourcePoolAssignment> resolve(Job<?> job) { return KubeUtil.findFarzoneId(configuration, job).map(farzone -> { String resourcePoolName = PodResourcePoolResolvers.RESOURCE_POOL_ELASTIC_FARZONE_PREFIX + farzone; return Collections.singletonList(ResourcePoolAssignment.newBuilder() .withResourcePoolName(resourcePoolName) .withRule(String.format("Farzone %s assigned to resource pool %s", farzone, resourcePoolName)) .build() ); } ).orElse(Collections.emptyList()); } FarzonePodResourcePoolResolver(DirectKubeConfiguration configuration); }
FarzonePodResourcePoolResolver implements PodResourcePoolResolver { @Override public List<ResourcePoolAssignment> resolve(Job<?> job) { return KubeUtil.findFarzoneId(configuration, job).map(farzone -> { String resourcePoolName = PodResourcePoolResolvers.RESOURCE_POOL_ELASTIC_FARZONE_PREFIX + farzone; return Collections.singletonList(ResourcePoolAssignment.newBuilder() .withResourcePoolName(resourcePoolName) .withRule(String.format("Farzone %s assigned to resource pool %s", farzone, resourcePoolName)) .build() ); } ).orElse(Collections.emptyList()); } FarzonePodResourcePoolResolver(DirectKubeConfiguration configuration); @Override List<ResourcePoolAssignment> resolve(Job<?> job); }
FarzonePodResourcePoolResolver implements PodResourcePoolResolver { @Override public List<ResourcePoolAssignment> resolve(Job<?> job) { return KubeUtil.findFarzoneId(configuration, job).map(farzone -> { String resourcePoolName = PodResourcePoolResolvers.RESOURCE_POOL_ELASTIC_FARZONE_PREFIX + farzone; return Collections.singletonList(ResourcePoolAssignment.newBuilder() .withResourcePoolName(resourcePoolName) .withRule(String.format("Farzone %s assigned to resource pool %s", farzone, resourcePoolName)) .build() ); } ).orElse(Collections.emptyList()); } FarzonePodResourcePoolResolver(DirectKubeConfiguration configuration); @Override List<ResourcePoolAssignment> resolve(Job<?> job);  }