private static void publishContainerStartEvent( final TimelineClient timelineClient, Container container, String domainId, UserGroupInformation ugi) { final TimelineEntity entity = new TimelineEntity(); entity.setEntityId(container.getId().toString()); entity.setEntityType(DSEntity.DS_CONTAINER.toString()); entity.setDomainId(domainId); entity.addPrimaryFilter(JOYConstants.USER, ugi.getShortUserName()); TimelineEvent event = new TimelineEvent(); event.setTimestamp(System.currentTimeMillis()); event.setEventType(DSEvent.DS_CONTAINER_START.toString()); event.addEventInfo(JOYConstants.NODE, container.getNodeId().toString()); event.addEventInfo(JOYConstants.RESOURCES, container.getResource().toString()); entity.addEvent(event); try { ugi.doAs(new PrivilegedExceptionAction<TimelinePutResponse>() { @Override public TimelinePutResponse run() throws Exception { return timelineClient.putEntities(entity); } }); } catch (Exception e) { LOG.error("Container start event could not be published for " + container.getId().toString(), e instanceof UndeclaredThrowableException ? e.getCause() : e); } }
public void publishContainerStartEvent( final TimelineClient timelineClient, Container container, String domainId, UserGroupInformation ugi) { final TimelineEntity entity = new TimelineEntity(); entity.setEntityId("" + container.getId()); entity.setEntityType(ApplicationMaster.DSEntity.DS_CONTAINER.toString()); entity.setDomainId(domainId); entity.addPrimaryFilter("user", ugi.getShortUserName()); TimelineEvent event = new TimelineEvent(); event.setTimestamp(System.currentTimeMillis()); event.setEventType(ContainerEvents.CONTAINER_START.toString()); event.addEventInfo("Node", container.getNodeId().toString()); event.addEventInfo("Resources", container.getResource().toString()); entity.addEvent(event); try { ugi.doAs(new PrivilegedExceptionAction<TimelinePutResponse>() { @Override public TimelinePutResponse run() throws Exception { return timelineClient.putEntities(entity); } }); } catch (Exception e) { LOG.error("Container start event could not be published for " + container.getId().toString(), e instanceof UndeclaredThrowableException ? e.getCause() : e); } } }
public synchronized void setNodeId(NodeId nodeId) { nodeHostAddr = nodeId.toString(); LOG.info("Updating node address : " + nodeHostAddr); } }
public synchronized void setNodeId(NodeId nodeId) { nodeHostAddr = nodeId.toString(); LOG.info("Updating node address : " + nodeHostAddr); } }
/** * Converts a nodeId to a form used in the app log file name. * @param nodeId * @return the node string to be used to construct the file name. */ @VisibleForTesting public static String getNodeString(NodeId nodeId) { return nodeId.toString().replace(":", "_"); }
@Override public String getAssignedContainerMgrAddress() { readLock.lock(); try { return containerNodeId.toString(); } finally { readLock.unlock(); } }
/** * Converts a nodeId to a form used in the app log file name. * @param nodeId the nodeId * @return the node string to be used to construct the file name. */ @VisibleForTesting public static String getNodeString(NodeId nodeId) { return nodeId.toString().replace(":", "_"); }
void startNodeUpdateRecording(NodeId nodeID) { if (recordNextAvailableNode) { recordNextNodeUpdateActivities(nodeID.toString()); } if (activeRecordedNodes.contains(nodeID)) { List<NodeAllocation> nodeAllocation = new ArrayList<>(); recordingNodesAllocation.put(nodeID, nodeAllocation); } }
@Override public String getAssignedContainerMgrAddress() { readLock.lock(); try { return container == null ? null : StringInterner.weakIntern(container .getNodeId().toString()); } finally { readLock.unlock(); } }
@Override public String getAssignedContainerMgrAddress() { readLock.lock(); try { return container == null ? null : StringInterner.weakIntern(container .getNodeId().toString()); } finally { readLock.unlock(); } }
@Override public String getAssignedContainerMgrAddress() { readLock.lock(); try { return container == null ? null : StringInterner.weakIntern(container .getNodeId().toString()); } finally { readLock.unlock(); } }
@Override public String toString() { return "<container=" + getContainerId() + ", targetCapacity=" + targetCapacity + ", node=" + getNodeId().toString() + ">"; } }
public static TaskTrackerInfo fromYarn(NodeReport node) { TaskTrackerInfo taskTracker = new TaskTrackerInfo(TT_NAME_PREFIX + node.getNodeId().toString()); return taskTracker; }
public static TaskTrackerInfo fromYarn(NodeReport node) { TaskTrackerInfo taskTracker = new TaskTrackerInfo(TT_NAME_PREFIX + node.getNodeId().toString()); return taskTracker; }
private class NextKeyActivator extends TimerTask { @Override public void run() { // Activation will happen after an absolute time interval. It will be good // if we can force activation after an NM updates and acknowledges a // roll-over. But that is only possible when we move to per-NM keys. TODO: activateNextMasterKey(); } }
public NMContainerLogsInfo(final Context nmContext, final ContainerId containerId, String remoteUser, ContainerLogAggregationType logType) throws YarnException { this.logType = logType.toString(); this.containerId = containerId.toString(); this.nodeId = nmContext.getNodeId().toString(); this.containerLogsInfo = getContainerLogsInfo( containerId, remoteUser, nmContext); }
public ContainerRemoteLaunchEvent(TaskAttemptId taskAttemptID, ContainerLaunchContext containerLaunchContext, Container allocatedContainer, Task remoteTask) { super(taskAttemptID, allocatedContainer.getId(), StringInterner .weakIntern(allocatedContainer.getNodeId().toString()), allocatedContainer.getContainerToken(), ContainerLauncher.EventType.CONTAINER_REMOTE_LAUNCH); this.allocatedContainer = allocatedContainer; this.containerLaunchContext = containerLaunchContext; this.task = remoteTask; }
public ContainerRemoteLaunchEvent(TaskAttemptId taskAttemptID, ContainerLaunchContext containerLaunchContext, Container allocatedContainer, Task remoteTask) { super(taskAttemptID, allocatedContainer.getId(), StringInterner .weakIntern(allocatedContainer.getNodeId().toString()), allocatedContainer.getContainerToken(), ContainerLauncher.EventType.CONTAINER_REMOTE_LAUNCH); this.allocatedContainer = allocatedContainer; this.containerLaunchContext = containerLaunchContext; this.task = remoteTask; }
@SuppressWarnings("unchecked") private static void sendContainerCompleted(TaskAttemptImpl taskAttempt) { taskAttempt.eventHandler.handle(new ContainerLauncherEvent( taskAttempt.attemptId, taskAttempt.container.getId(), StringInterner .weakIntern(taskAttempt.container.getNodeId().toString()), taskAttempt.container.getContainerToken(), ContainerLauncher.EventType.CONTAINER_COMPLETED)); }
public TaskAttemptStartedProto toProto() { TaskAttemptStartedProto.Builder builder = TaskAttemptStartedProto.newBuilder(); builder.setTaskAttemptId(taskAttemptId.toString()) .setStartTime(launchTime) .setContainerId(containerId.toString()) .setNodeId(nodeId.toString()); return builder.build(); }