@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } SlotOffer slotOffer = (SlotOffer) o; return allocationId.equals(slotOffer.allocationId); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } SlotOffer slotOffer = (SlotOffer) o; return allocationId.equals(slotOffer.allocationId); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } SlotOffer slotOffer = (SlotOffer) o; return allocationId.equals(slotOffer.allocationId); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } SlotOffer slotOffer = (SlotOffer) o; return allocationId.equals(slotOffer.allocationId); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } SlotStatus that = (SlotStatus) o; if (!slotID.equals(that.slotID)) { return false; } if (!resourceProfile.equals(that.resourceProfile)) { return false; } if (allocationID != null ? !allocationID.equals(that.allocationID) : that.allocationID != null) { return false; } return jobID != null ? jobID.equals(that.jobID) : that.jobID == null; }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } SlotStatus that = (SlotStatus) o; if (!slotID.equals(that.slotID)) { return false; } if (!resourceProfile.equals(that.resourceProfile)) { return false; } if (allocationID != null ? !allocationID.equals(that.allocationID) : that.allocationID != null) { return false; } return jobID != null ? jobID.equals(that.jobID) : that.jobID == null; }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } SlotStatus that = (SlotStatus) o; if (!slotID.equals(that.slotID)) { return false; } if (!resourceProfile.equals(that.resourceProfile)) { return false; } if (allocationID != null ? !allocationID.equals(that.allocationID) : that.allocationID != null) { return false; } return jobID != null ? jobID.equals(that.jobID) : that.jobID == null; }
public boolean isAllocated(JobID jobIdToCheck, AllocationID allocationIDToCheck) { Preconditions.checkNotNull(jobIdToCheck); Preconditions.checkNotNull(allocationIDToCheck); return jobIdToCheck.equals(jobId) && allocationIDToCheck.equals(allocationId) && (TaskSlotState.ACTIVE == state || TaskSlotState.ALLOCATED == state); }
public boolean isActive(JobID activeJobId, AllocationID activeAllocationId) { Preconditions.checkNotNull(activeJobId); Preconditions.checkNotNull(activeAllocationId); return TaskSlotState.ACTIVE == state && activeJobId.equals(jobId) && activeAllocationId.equals(allocationId); }
public boolean isAllocated(JobID jobIdToCheck, AllocationID allocationIDToCheck) { Preconditions.checkNotNull(jobIdToCheck); Preconditions.checkNotNull(allocationIDToCheck); return jobIdToCheck.equals(jobId) && allocationIDToCheck.equals(allocationId) && (TaskSlotState.ACTIVE == state || TaskSlotState.ALLOCATED == state); }
public boolean isActive(JobID activeJobId, AllocationID activeAllocationId) { Preconditions.checkNotNull(activeJobId); Preconditions.checkNotNull(activeAllocationId); return TaskSlotState.ACTIVE == state && activeJobId.equals(jobId) && activeAllocationId.equals(allocationId); }
public boolean isAllocated(JobID jobIdToCheck, AllocationID allocationIDToCheck) { Preconditions.checkNotNull(jobIdToCheck); Preconditions.checkNotNull(allocationIDToCheck); return jobIdToCheck.equals(jobId) && allocationIDToCheck.equals(allocationId) && (TaskSlotState.ACTIVE == state || TaskSlotState.ALLOCATED == state); }
public boolean isActive(JobID activeJobId, AllocationID activeAllocationId) { Preconditions.checkNotNull(activeJobId); Preconditions.checkNotNull(activeAllocationId); return TaskSlotState.ACTIVE == state && activeJobId.equals(jobId) && activeAllocationId.equals(allocationId); }
public boolean isAllocated(JobID jobIdToCheck, AllocationID allocationIDToCheck) { Preconditions.checkNotNull(jobIdToCheck); Preconditions.checkNotNull(allocationIDToCheck); return jobIdToCheck.equals(jobId) && allocationIDToCheck.equals(allocationId) && (TaskSlotState.ACTIVE == state || TaskSlotState.ALLOCATED == state); }
public boolean isActive(JobID activeJobId, AllocationID activeAllocationId) { Preconditions.checkNotNull(activeJobId); Preconditions.checkNotNull(activeAllocationId); return TaskSlotState.ACTIVE == state && activeJobId.equals(jobId) && activeAllocationId.equals(allocationId); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } SlotStatus that = (SlotStatus) o; if (!slotID.equals(that.slotID)) { return false; } if (!resourceProfile.equals(that.resourceProfile)) { return false; } if (allocationID != null ? !allocationID.equals(that.allocationID) : that.allocationID != null) { return false; } if (allocationResourceProfile != null ? !allocationResourceProfile.equals(that.allocationResourceProfile) : that.allocationResourceProfile != null) { return false; } if (version != that.version) { return false; } return jobID != null ? jobID.equals(that.jobID) : that.jobID == null; }
/** * Add the given task to the task slot. This is only possible if there is not already another * task with the same execution attempt id added to the task slot. In this case, the method * returns true. Otherwise the task slot is left unchanged and false is returned. * * <p>In case that the task slot state is not active an {@link IllegalStateException} is thrown. * In case that the task's job id and allocation id don't match with the job id and allocation * id for which the task slot has been allocated, an {@link IllegalArgumentException} is thrown. * * @param task to be added to the task slot * @throws IllegalStateException if the task slot is not in state active * @return true if the task was added to the task slot; otherwise false */ public boolean add(Task task) { // Check that this slot has been assigned to the job sending this task Preconditions.checkArgument(task.getJobID().equals(jobId), "The task's job id does not match the " + "job id for which the slot has been allocated."); Preconditions.checkArgument(task.getAllocationId().equals(allocationId), "The task's allocation " + "id does not match the allocation id for which the slot has been allocated."); Preconditions.checkState(TaskSlotState.ACTIVE == state, "The task slot is not in state active."); Task oldTask = tasks.put(task.getExecutionId(), task); if (oldTask != null) { tasks.put(task.getExecutionId(), oldTask); return false; } else { return true; } }
/** * Add the given task to the task slot. This is only possible if there is not already another * task with the same execution attempt id added to the task slot. In this case, the method * returns true. Otherwise the task slot is left unchanged and false is returned. * * In case that the task slot state is not active an {@link IllegalStateException} is thrown. * In case that the task's job id and allocation id don't match with the job id and allocation * id for which the task slot has been allocated, an {@link IllegalArgumentException} is thrown. * * @param task to be added to the task slot * @throws IllegalStateException if the task slot is not in state active * @return true if the task was added to the task slot; otherwise false */ public boolean add(Task task) { // Check that this slot has been assigned to the job sending this task Preconditions.checkArgument(task.getJobID().equals(jobId), "The task's job id does not match the " + "job id for which the slot has been allocated."); Preconditions.checkArgument(task.getAllocationId().equals(allocationId), "The task's allocation " + "id does not match the allocation id for which the slot has been allocated."); Preconditions.checkState(TaskSlotState.ACTIVE == state, "The task slot is not in state active."); Task oldTask = tasks.put(task.getExecutionId(), task); if (oldTask != null) { tasks.put(task.getExecutionId(), oldTask); return false; } else { return true; } }
/** * Add the given task to the task slot. This is only possible if there is not already another * task with the same execution attempt id added to the task slot. In this case, the method * returns true. Otherwise the task slot is left unchanged and false is returned. * * <p>In case that the task slot state is not active an {@link IllegalStateException} is thrown. * In case that the task's job id and allocation id don't match with the job id and allocation * id for which the task slot has been allocated, an {@link IllegalArgumentException} is thrown. * * @param task to be added to the task slot * @throws IllegalStateException if the task slot is not in state active * @return true if the task was added to the task slot; otherwise false */ public boolean add(Task task) { // Check that this slot has been assigned to the job sending this task Preconditions.checkArgument(task.getJobID().equals(jobId), "The task's job id does not match the " + "job id for which the slot has been allocated."); Preconditions.checkArgument(task.getAllocationId().equals(allocationId), "The task's allocation " + "id does not match the allocation id for which the slot has been allocated."); Preconditions.checkState(TaskSlotState.ACTIVE == state, "The task slot is not in state active."); Task oldTask = tasks.put(task.getExecutionId(), task); if (oldTask != null) { tasks.put(task.getExecutionId(), oldTask); return false; } else { return true; } }
/** * Allocate the task slot for the given job and allocation id. If the slot could be allocated, * or is already allocated/active for the given job and allocation id, then the method returns * true. Otherwise it returns false. * * <p>A slot can only be allocated if it's current state is free. * * @param newJobId to allocate the slot for * @param newAllocationId to identify the slot allocation * @return True if the slot was allocated for the given job and allocation id; otherwise false */ public boolean allocate(JobID newJobId, AllocationID newAllocationId) { if (TaskSlotState.FREE == state) { // sanity checks Preconditions.checkState(allocationId == null); Preconditions.checkState(jobId == null); this.jobId = Preconditions.checkNotNull(newJobId); this.allocationId = Preconditions.checkNotNull(newAllocationId); state = TaskSlotState.ALLOCATED; return true; } else if (TaskSlotState.ALLOCATED == state || TaskSlotState.ACTIVE == state) { Preconditions.checkNotNull(newJobId); Preconditions.checkNotNull(newAllocationId); return newJobId.equals(jobId) && newAllocationId.equals(allocationId); } else { return false; } }