@Override public boolean equals(Object o) { if (! (o instanceof SchedulerApplicationAttempt)) { return false; } SchedulerApplicationAttempt other = (SchedulerApplicationAttempt) o; return (this == other || this.getApplicationAttemptId().equals(other.getApplicationAttemptId())); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; ContainerId other = (ContainerId) obj; if (!this.getApplicationAttemptId().equals(other.getApplicationAttemptId())) return false; if (this.getContainerId() != other.getContainerId()) return false; return true; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; ContainerId other = (ContainerId) obj; if (!this.getApplicationAttemptId().equals(other.getApplicationAttemptId())) return false; if (this.getContainerId() != other.getContainerId()) return false; return true; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; ContainerId other = (ContainerId) obj; if (!this.getApplicationAttemptId().equals(other.getApplicationAttemptId())) return false; if (this.getContainerId() != other.getContainerId()) return false; return true; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; ContainerId other = (ContainerId) obj; if (!this.getApplicationAttemptId().equals(other.getApplicationAttemptId())) return false; if (this.getContainerId() != other.getContainerId()) return false; return true; }
public AggregateAppResourceUsage getAggregateAppResourceUsage() { long memorySeconds = finishedMemorySeconds.get(); long vcoreSeconds = finishedVcoreSeconds.get(); // Only add in the running containers if this is the active attempt. RMAppAttempt currentAttempt = rmContext.getRMApps() .get(attemptId.getApplicationId()).getCurrentAppAttempt(); if (currentAttempt.getAppAttemptId().equals(attemptId)) { ApplicationResourceUsageReport appResUsageReport = rmContext .getScheduler().getAppResourceUsageReport(attemptId); if (appResUsageReport != null) { memorySeconds += appResUsageReport.getMemorySeconds(); vcoreSeconds += appResUsageReport.getVcoreSeconds(); } } return new AggregateAppResourceUsage(memorySeconds, vcoreSeconds); }
protected void validateIds(ApplicationId appId, ApplicationAttemptId appAttemptId, ContainerId containerId) { if (!appAttemptId.getApplicationId().equals(appId)) { throw new NotFoundException("appId and appAttemptId don't match"); } if (containerId != null && !containerId.getApplicationAttemptId().equals(appAttemptId)) { throw new NotFoundException("appAttemptId and containerId don't match"); } }
public AggregateAppResourceUsage getAggregateAppResourceUsage() { long memorySeconds = finishedMemorySeconds.get(); long vcoreSeconds = finishedVcoreSeconds.get(); // Only add in the running containers if this is the active attempt. RMAppAttempt currentAttempt = rmContext.getRMApps() .get(attemptId.getApplicationId()).getCurrentAppAttempt(); if (currentAttempt.getAppAttemptId().equals(attemptId)) { ApplicationResourceUsageReport appResUsageReport = rmContext .getScheduler().getAppResourceUsageReport(attemptId); if (appResUsageReport != null) { memorySeconds += appResUsageReport.getMemorySeconds(); vcoreSeconds += appResUsageReport.getVcoreSeconds(); } } return new AggregateAppResourceUsage(memorySeconds, vcoreSeconds); }
protected void validateIds(ApplicationId appId, ApplicationAttemptId appAttemptId, ContainerId containerId) { if (!appAttemptId.getApplicationId().equals(appId)) { throw new NotFoundException("appId and appAttemptId don't match"); } if (containerId != null && !containerId.getApplicationAttemptId().equals(appAttemptId)) { throw new NotFoundException("appAttemptId and containerId don't match"); } }
protected void validateIds(ApplicationId appId, ApplicationAttemptId appAttemptId, ContainerId containerId) { if (!appAttemptId.getApplicationId().equals(appId)) { throw new NotFoundException("appId and appAttemptId don't match"); } if (containerId != null && !containerId.getApplicationAttemptId().equals(appAttemptId)) { throw new NotFoundException("appAttemptId and containerId don't match"); } }
public void checkNumberOfPreemptionCandidateFromApp( ProportionalCapacityPreemptionPolicy policy, int expected, ApplicationAttemptId attemptId) { int total = 0; for (RMContainer rmContainer : policy.getToPreemptContainers().keySet()) { if (rmContainer.getApplicationAttemptId().equals(attemptId)) { ++ total; } } Assert.assertEquals(expected, total); } }
private ApplicationAttemptStateData createAttemptState(String itemName, byte[] data) throws IOException { ApplicationAttemptId attemptId = ApplicationAttemptId.fromString(itemName); ApplicationAttemptStateDataPBImpl attemptState = new ApplicationAttemptStateDataPBImpl( ApplicationAttemptStateDataProto.parseFrom(data)); if (!attemptId.equals(attemptState.getAttemptId())) { throw new YarnRuntimeException("The database entry for " + attemptId + " contains data for " + attemptState.getAttemptId()); } return attemptState; }
private ApplicationAttemptStateData createAttemptState(String itemName, byte[] data) throws IOException { ApplicationAttemptId attemptId = ConverterUtils.toApplicationAttemptId(itemName); ApplicationAttemptStateDataPBImpl attemptState = new ApplicationAttemptStateDataPBImpl( ApplicationAttemptStateDataProto.parseFrom(data)); if (!attemptId.equals(attemptState.getAttemptId())) { throw new YarnRuntimeException("The database entry for " + attemptId + " contains data for " + attemptState.getAttemptId()); } return attemptState; }
private ApplicationAttemptStateData createAttemptState(String itemName, byte[] data) throws IOException { ApplicationAttemptId attemptId = ConverterUtils.toApplicationAttemptId(itemName); ApplicationAttemptStateDataPBImpl attemptState = new ApplicationAttemptStateDataPBImpl( ApplicationAttemptStateDataProto.parseFrom(data)); if (!attemptId.equals(attemptState.getAttemptId())) { throw new YarnRuntimeException("The database entry for " + attemptId + " contains data for " + attemptState.getAttemptId()); } return attemptState; }
@Override public synchronized void unreserveResource( SchedulerApplicationAttempt application) { // Cannot unreserve for wrong application... ApplicationAttemptId reservedApplication = getReservedContainer().getContainer().getId().getApplicationAttemptId(); if (!reservedApplication.equals( application.getApplicationAttemptId())) { throw new IllegalStateException("Trying to unreserve " + " for application " + application.getApplicationId() + " when currently reserved " + " for application " + reservedApplication.getApplicationId() + " on node " + this); } setReservedContainer(null); this.reservedAppSchedulable = null; }
@Override public synchronized void unreserveResource( SchedulerApplicationAttempt application) { // Cannot unreserve for wrong application... ApplicationAttemptId reservedApplication = getReservedContainer().getContainer().getId() .getApplicationAttemptId(); if (!reservedApplication.equals( application.getApplicationAttemptId())) { throw new IllegalStateException("Trying to unreserve " + " for application " + application.getApplicationId() + " when currently reserved " + " for application " + reservedApplication.getApplicationId() + " on node " + this); } setReservedContainer(null); this.reservedAppSchedulable = null; }
@Override public boolean matches(Object o) { return appAttId.equals(((ContainerPreemptEvent)o).getAppId()) && type.equals(((ContainerPreemptEvent)o).getType()); } @Override
@Override public synchronized void unreserveResource( SchedulerApplicationAttempt application) { // Cannot unreserve for wrong application... ApplicationAttemptId reservedApplication = getReservedContainer().getContainer().getId().getApplicationAttemptId(); if (!reservedApplication.equals( application.getApplicationAttemptId())) { throw new IllegalStateException("Trying to unreserve " + " for application " + application.getApplicationId() + " when currently reserved " + " for application " + reservedApplication.getApplicationId() + " on node " + this); } setReservedContainer(null); this.reservedAppSchedulable = null; }
@Override public boolean matches(Object o) { return appAttId.equals(((ContainerPreemptEvent)o).getAppId()) && type.equals(((ContainerPreemptEvent)o).getType()); } @Override
@Override public boolean matches(Object o) { ContainerPreemptEvent cpe = (ContainerPreemptEvent)o; return appAttId.equals(cpe.getAppId()) && queueName.equals(cpe.getContainer().getQueueName()) && nodeId.equals(cpe.getContainer().getAllocatedNode()); } @Override