Skip to content

Commit

Permalink
Merge pull request #22 from TongchengOpenSource/dynamic_workerprofile
Browse files Browse the repository at this point in the history
[Improve][Zeta] Improve the Success Rate of Resource Allocation for Large Tasks in Dynamic Slot Mode.
  • Loading branch information
xiaochen-zhou authored Dec 9, 2024
2 parents 150d30d + 6973abd commit ea0a400
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ private void executeJob(TestContainer container, String job1, String job2)
}

@TestTemplate
@Disabled(
"[HDFS/COS/OSS/S3] is not available in CI, if you want to run this test, please set up your own environment in the test case file, hadoop_hive_conf_path_local and ip below}")
public void testFakeSinkHiveOnHDFS(TestContainer container) throws Exception {
executeJob(container, "/fake_to_hive_on_hdfs.conf", "/hive_on_hdfs_to_assert.conf");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.Optional;
Expand Down Expand Up @@ -230,7 +231,17 @@ public Optional<WorkerProfile> preCheckWorkerResource(ResourceProfile r) {
workerProfiles.stream()
.filter(WorkerProfile::isDynamicSlot)
.filter(worker -> worker.getUnassignedResource().enoughThan(r))
.findAny();
.min(
Comparator.comparing(
(WorkerProfile profile) ->
profile.getUnassignedResource()
.getHeapMemory()
.getBytes())
.thenComparing(
profile ->
profile.getUnassignedResource()
.getCpu()
.getCore()));
}

return workerProfile;
Expand Down

0 comments on commit ea0a400

Please sign in to comment.