nimbusMap.put(container.getId().getContainerId(), container); supervisorMap.put(container.getId().getContainerId(), container); Long containerId = containerStatus.getContainerId().getContainerId();
@Override public void onContainerStopped(ContainerId containerId) { if (LOG.isDebugEnabled()) { LOG.debug("Succeeded to stop Container " + containerId); } if(containerId == null) { LOG.error("Container stopped callback: Empty container ID!"); throw new IllegalStateException("onContainerStopped returned null container ID!"); } serviceDiscoverer.unregisterByContainer(containerId.getContainerId() + ""); removeContainer(containerId); }
@Override public void onStopContainerError(ContainerId containerId, Throwable t) { LOG.error("Failed to stop Container " + containerId); serviceDiscoverer.unregisterByContainer(containerId.getContainerId() + ""); removeContainer(containerId); } }
@Override public void onStartContainerError(ContainerId containerId, Throwable t) { LOG.error("Failed to start Container " + containerId); serviceDiscoverer.unregisterByContainer(containerId.getContainerId() + ""); removeContainer(containerId); }
+ RunnerOptions.toArgs(RunnerOptions.CONTAINER_ID.of(container.getId().getContainerId() + "") ,RunnerOptions.ZK_QUORUM.of(zkQuorum) ,RunnerOptions.ZK_ROOT.of(zkRoot)
@Override public int hashCode() { // Generated by IntelliJ IDEA 13.1. int result = (int) (getContainerId() ^ (getContainerId() >>> 32)); result = 31 * result + getApplicationAttemptId().hashCode(); return result; }
for (int i = 0; i < request.getNumInstances(); ++i) { Container container = listener.getContainers(resource).take(); LOG.info("Found container id of " + container.getId().getContainerId()); executor.execute(new LaunchContainer(conf , zkQuorum
@Override public int hashCode() { // Generated by IntelliJ IDEA 13.1. int result = (int) (getContainerId() ^ (getContainerId() >>> 32)); result = 31 * result + getApplicationAttemptId().hashCode(); return result; }
@Override public int hashCode() { // Generated by IntelliJ IDEA 13.1. int result = (int) (getContainerId() ^ (getContainerId() >>> 32)); result = 31 * result + getApplicationAttemptId().hashCode(); return result; }
@Override public int hashCode() { // Generated by IntelliJ IDEA 13.1. int result = (int) (getContainerId() ^ (getContainerId() >>> 32)); result = 31 * result + getApplicationAttemptId().hashCode(); return result; }
@Override public int compareTo(ContainerId other) { int result = this.getApplicationAttemptId().compareTo( other.getApplicationAttemptId()); if (result == 0) { return Long.compare(getContainerId(), other.getContainerId()); } else { return result; } }
@Override public int compareTo(ContainerId other) { int result = this.getApplicationAttemptId().compareTo( other.getApplicationAttemptId()); if (result == 0) { return Long.compare(getContainerId(), other.getContainerId()); } else { return result; } }
@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 int compareTo(ContainerId other) { if (this.getApplicationAttemptId().compareTo( other.getApplicationAttemptId()) == 0) { return Long.valueOf(getContainerId()) .compareTo(Long.valueOf(other.getContainerId())); } else { return this.getApplicationAttemptId().compareTo( other.getApplicationAttemptId()); } }
@Override public int compareTo(ContainerId other) { if (this.getApplicationAttemptId().compareTo( other.getApplicationAttemptId()) == 0) { return Long.valueOf(getContainerId()) .compareTo(Long.valueOf(other.getContainerId())); } else { return this.getApplicationAttemptId().compareTo( other.getApplicationAttemptId()); } }
public Integer answer(InvocationOnMock invocation) { return Long.compare( ((RMContainer)invocation.getMock()).getContainerId() .getContainerId(), ((RMContainer)invocation.getArguments()[0]).getContainerId() .getContainerId()); } });
@SuppressWarnings("deprecation") public static ContainerId getMockContainerId(FiCaSchedulerApp application) { ContainerId containerId = mock(ContainerId.class); doReturn(application.getApplicationAttemptId()). when(containerId).getApplicationAttemptId(); long id = application.getNewContainerId(); doReturn((int)id).when(containerId).getId(); doReturn(id).when(containerId).getContainerId(); return containerId; }
@SuppressWarnings("deprecation") public static ContainerId getMockContainerId(FiCaSchedulerApp application) { ContainerId containerId = mock(ContainerId.class); doReturn(application.getApplicationAttemptId()). when(containerId).getApplicationAttemptId(); long id = application.getNewContainerId(); doReturn((int)id).when(containerId).getId(); doReturn(id).when(containerId).getContainerId(); return containerId; }
@Test public void testNodeHeartbeatResponsePBImplWithDecreasedContainers() { NodeHeartbeatResponsePBImpl original = new NodeHeartbeatResponsePBImpl(); original.addAllContainersToUpdate( Arrays.asList(getDecreasedContainer(1, 2, 2048, 2), getDecreasedContainer(2, 3, 1024, 1))); NodeHeartbeatResponsePBImpl copy = new NodeHeartbeatResponsePBImpl(original.getProto()); assertEquals(1, copy.getContainersToUpdate().get(0) .getId().getContainerId()); assertEquals(1024, copy.getContainersToUpdate().get(1) .getResource().getMemorySize()); }