Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

Commit

Permalink
Merge pull request #183 from fabiokung/vm-ids
Browse files Browse the repository at this point in the history
Provide machine ids to SchedulingEventListeners
  • Loading branch information
fabiokung authored Aug 20, 2019
2 parents 3c1d8fc + 96ee7b8 commit 4fb3ff9
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 21 deletions.
16 changes: 10 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
language: java
jdk:
- oraclejdk8
- openjdk8
install: ./installViaTravis.sh
script: ./buildViaTravis.sh
env:
global:
- secure: OO0HHH0uw2t6o34On5M8YBoh6/bGsrLuxSOEQCA+aR38ky6YHzMdgxMeJ5InlcgpohdoqGDAay+YIkJikBE5JsAa6NhRLBkkGTf8TWb85g8TyqOaZM/EIcxJzKxn4JF8x5qq1izzXBlTzRbodyVwsLQwAULy6y7QAxbki4K5QXEpcF51Z1oWitcwlntUjieSBI8cDzn8Ak5aJ9/KE+MHBtAbcwO8mNDww7kuUveaSkO9MKYvxLN7Iw/X7VDCdDetPCil4ZNZtw408KUN0FFfZgKUap5DzMK98XD8UVKNTlF7dKN73R78Z/KHTGTwYIUV5vEAnZImX8wdgnS+xEoQyemJMwTXDHp8qYzjyXyBY1eM1IwmX5uy5r7xWq/q9Gif4R62nCdlvrD3lIsBN0fVRvmKMAGyW1Wo0yWe321lAhPDC0myQ3IneCY3nBNxqMZ0jUd38EhleVAMoWuy90ctXgdX5KpZkM62FtTAQYYiJRmYBtPRuILVTIv3iTSOVM0F7r4YsVpsHIXbnp9sorviO44jYWj2/YuzGYvLwE2LpwBQA0Ss4ilCfu6hxv1esymVpecWyQZvgegJgLkGbKYZdzOiGvJa0nnkec1t17FZreMMKXzkvAiTlXsxfqsUuoDSSDIpPPIMNhzPqY0mwOZPMuY5JTf8F+6xpKDLHg1SU1o=
- secure: HguzfzZywJia6r9+8dW0z6Z1tM5lmvr3crFlAKAaBZTxHxNU7m5jjjUr1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znjZ0KG7a/XM2JUnpSeltVSwh6pcFagWc8LLPXZc2XiYhBnTl/NKfvnvHcEdXgoQDd1O+mWDS0wEuc8Zfj8Uc74rAanclH/Sd02P1XqakRkfKTcXOxtyHgdu6Ti+ojk8D/EwvEemG11tqRY+6uSP9Budt7ybrSkfCwZdi2x1o0Pp89J1IJNek/Y6qMr/UzWaaKnfebTeJggiqSt18yFwi0zEVcTPHpMZ+g0Y1UHkzHonTKrEiTtAFGVE6VudH/UQKs0yiykant7D+K2gpJVkULDcEBGje4rcIREhfnY5tjrPz72fD/J3CZoHg7q9f3IOFfzvtmJ8S5Hsi5xzkhASOFvJkIKyfE3LJb2FBh2vV+o4yl94gLAr3mL25qrmQYGqzPNhLW9LOx42zygYFCY8TpC37HqvhJ/tE+P6mB/GFwkWn+Ey762Uc=
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
- $HOME/.gradle/caches
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public ResAsgmntResult(List<AssignmentFailure> failures, double fitness) {
private static final Logger logger = LoggerFactory.getLogger(AssignableVirtualMachine.class);
private final ConcurrentMap<String, String> leaseIdToHostnameMap;
private final ConcurrentMap<String, String> vmIdToHostnameMap;
private String currVMId =null;
private volatile String currVMId =null;
private final TaskTracker taskTracker;
private volatile long disabledUntil=0L;
// This may have to be configurable, but, for now weight the job's soft constraints more than system wide fitness calculators
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,21 @@
*/
public class TaskAssignmentResult {
@JsonIgnore
final private AssignableVirtualMachine avm;
private final AssignableVirtualMachine avm;
@JsonIgnore
final private TaskRequest request;
final private String taskId;
final private String hostname;
final private List<Integer> assignedPorts;
final private List<PreferentialNamedConsumableResourceSet.ConsumeResult> rSets;
final private boolean successful;
final private List<AssignmentFailure> failures;
final private ConstraintFailure constraintFailure;
final private double fitness;
private final TaskRequest request;
private final String taskId;
private final String hostname;
private final String vmId;
private final List<Integer> assignedPorts;
private final List<PreferentialNamedConsumableResourceSet.ConsumeResult> rSets;
private final boolean successful;
private final List<AssignmentFailure> failures;
private final ConstraintFailure constraintFailure;
private final double fitness;

@JsonCreator
@JsonIgnoreProperties(ignoreUnknown=true)
@JsonIgnoreProperties(ignoreUnknown = true)
TaskAssignmentResult(@JsonProperty("avm") AssignableVirtualMachine avm,
@JsonProperty("request") TaskRequest request,
@JsonProperty("successful") boolean successful,
Expand All @@ -52,7 +53,8 @@ public class TaskAssignmentResult {
this.avm = avm;
this.request = request;
this.taskId = request.getId();
this.hostname = avm==null? "":avm.getHostname();
this.hostname = avm == null ? "" : avm.getHostname();
this.vmId = avm == null ? null : avm.getCurrVMId();
this.successful = successful;
this.failures = failures;
this.constraintFailure = constraintFailure;
Expand All @@ -79,6 +81,16 @@ public String getHostname() {
return hostname;
}

/**
* Returns the identifier of the host machine at the time when this task was assigned to it, which can be
* <tt>null</tt> when not provided by {@link VirtualMachineLease machine leases}.
*
* @return the identifier of the machine
*/
public String getVMId() {
return vmId;
}

void assignResult() {
avm.assignResult(this);
}
Expand Down Expand Up @@ -128,7 +140,7 @@ public boolean isSuccessful() {
* the host did not succeed because of insufficient resources.
*
* @return a list of reasons why the task could not be assigned to the host because of insufficient
* resources
* resources
*/
public List<AssignmentFailure> getFailures() {
return failures;
Expand All @@ -147,7 +159,7 @@ public ConstraintFailure getConstraintFailure() {
* Get the result of the fitness calculation applied to this host for this task.
*
* @return a number between 0.0 (indicating that the host is completely unfit for this task) to 1.0
* (indicating that the host is a perfect fit for this task)
* (indicating that the host is a perfect fit for this task)
*/
public double getFitness() {
return fitness;
Expand Down

0 comments on commit 4fb3ff9

Please sign in to comment.