private void mergeLocalToBuilder() { if (this.containerId != null && !((ContainerIdPBImpl) this.containerId).getProto().equals( builder.getContainerId())) { builder.setContainerId(convertToProtoFormat(this.containerId)); } if (this.resource != null && !((ResourcePBImpl) this.resource).getProto().equals( builder.getAllocatedResource())) { builder.setAllocatedResource(convertToProtoFormat(this.resource)); } if (this.nodeId != null && !((NodeIdPBImpl) this.nodeId).getProto().equals( builder.getAssignedNodeId())) { builder.setAssignedNodeId(convertToProtoFormat(this.nodeId)); } if (this.priority != null && !((PriorityPBImpl) this.priority).getProto().equals( builder.getPriority())) { builder.setPriority(convertToProtoFormat(this.priority)); } }
public ContainerTokenIdentifier(ContainerId containerID, String hostName, String appSubmitter, Resource r, long expiryTimeStamp, int masterKeyId, long rmIdentifier, Priority priority, long creationTime, LogAggregationContext logAggregationContext) { ContainerTokenIdentifierProto.Builder builder = ContainerTokenIdentifierProto.newBuilder(); if (containerID != null) { builder.setContainerId(((ContainerIdPBImpl)containerID).getProto()); } builder.setNmHostAddr(hostName); builder.setAppSubmitter(appSubmitter); if (r != null) { builder.setResource(((ResourcePBImpl)r).getProto()); } builder.setExpiryTimeStamp(expiryTimeStamp); builder.setMasterKeyId(masterKeyId); builder.setRmIdentifier(rmIdentifier); if (priority != null) { builder.setPriority(((PriorityPBImpl)priority).getProto()); } builder.setCreationTime(creationTime); if (logAggregationContext != null) { builder.setLogAggregationContext( ((LogAggregationContextPBImpl)logAggregationContext).getProto()); } proto = builder.build(); }
public ContainerTokenIdentifierForTest(ContainerId containerID, String hostName, String appSubmitter, Resource r, long expiryTimeStamp, int masterKeyId, long rmIdentifier, Priority priority, long creationTime, LogAggregationContext logAggregationContext) { ContainerTokenIdentifierForTestProto.Builder builder = ContainerTokenIdentifierForTestProto.newBuilder(); if (containerID != null) { builder.setContainerId(((ContainerIdPBImpl)containerID).getProto()); } builder.setNmHostAddr(hostName); builder.setAppSubmitter(appSubmitter); if (r != null) { builder.setResource(((ResourcePBImpl)r).getProto()); } builder.setExpiryTimeStamp(expiryTimeStamp); builder.setMasterKeyId(masterKeyId); builder.setRmIdentifier(rmIdentifier); if (priority != null) { builder.setPriority(((PriorityPBImpl)priority).getProto()); } builder.setCreationTime(creationTime); if (logAggregationContext != null) { builder.setLogAggregationContext( ((LogAggregationContextPBImpl)logAggregationContext).getProto()); } proto = builder.build(); }
public ContainerTokenIdentifierForTest(ContainerTokenIdentifier identifier, String message) { ContainerTokenIdentifierForTestProto.Builder builder = ContainerTokenIdentifierForTestProto.newBuilder(); ContainerIdPBImpl containerID = (ContainerIdPBImpl)identifier.getContainerID(); if (containerID != null) { builder.setContainerId(containerID.getProto()); } builder.setNmHostAddr(identifier.getNmHostAddress()); builder.setAppSubmitter(identifier.getApplicationSubmitter()); ResourcePBImpl resource = (ResourcePBImpl)identifier.getResource(); if (resource != null) { builder.setResource(resource.getProto()); } builder.setExpiryTimeStamp(identifier.getExpiryTimeStamp()); builder.setMasterKeyId(identifier.getMasterKeyId()); builder.setRmIdentifier(identifier.getRMIdentifier()); PriorityPBImpl priority = (PriorityPBImpl)identifier.getPriority(); if (priority != null) { builder.setPriority(priority.getProto()); } builder.setCreationTime(identifier.getCreationTime()); builder.setMessage(message); LogAggregationContextPBImpl logAggregationContext = (LogAggregationContextPBImpl)identifier.getLogAggregationContext(); if (logAggregationContext != null) { builder.setLogAggregationContext(logAggregationContext.getProto()); } proto = builder.build(); }
public ContainerTokenIdentifier(ContainerId containerID, String hostName, String appSubmitter, Resource r, long expiryTimeStamp, int masterKeyId, long rmIdentifier, Priority priority, long creationTime, LogAggregationContext logAggregationContext, String nodeLabelExpression, ContainerType containerType, ExecutionType executionType) { ContainerTokenIdentifierProto.Builder builder = ContainerTokenIdentifierProto.newBuilder(); if (containerID != null) { builder.setContainerId(((ContainerIdPBImpl)containerID).getProto()); } builder.setNmHostAddr(hostName); builder.setAppSubmitter(appSubmitter); if (r != null) { builder.setResource(((ResourcePBImpl)r).getProto()); } builder.setExpiryTimeStamp(expiryTimeStamp); builder.setMasterKeyId(masterKeyId); builder.setRmIdentifier(rmIdentifier); if (priority != null) { builder.setPriority(((PriorityPBImpl)priority).getProto()); } builder.setCreationTime(creationTime); if (logAggregationContext != null) { builder.setLogAggregationContext( ((LogAggregationContextPBImpl)logAggregationContext).getProto()); } if (nodeLabelExpression != null) { builder.setNodeLabelExpression(nodeLabelExpression); } builder.setContainerType(convertToProtoFormat(containerType)); builder.setExecutionType(convertToProtoFormat(executionType)); proto = builder.build(); }
public ContainerTokenIdentifier(ContainerId containerID, int containerVersion, String hostName, String appSubmitter, Resource r, long expiryTimeStamp, int masterKeyId, long rmIdentifier, Priority priority, long creationTime, LogAggregationContext logAggregationContext, String nodeLabelExpression, ContainerType containerType, String appSubmitterFolder) { ContainerTokenIdentifierProto.Builder builder = ContainerTokenIdentifierProto.newBuilder(); if (containerID != null) { builder.setContainerId(((ContainerIdPBImpl)containerID).getProto()); } builder.setVersion(containerVersion); builder.setNmHostAddr(hostName); builder.setAppSubmitter(appSubmitter); builder.setAppSubmitterFolder(appSubmitterFolder); if (r != null) { builder.setResource(((ResourcePBImpl)r).getProto()); } builder.setExpiryTimeStamp(expiryTimeStamp); builder.setMasterKeyId(masterKeyId); builder.setRmIdentifier(rmIdentifier); if (priority != null) { builder.setPriority(((PriorityPBImpl)priority).getProto()); } builder.setCreationTime(creationTime); if (logAggregationContext != null) { builder.setLogAggregationContext( ((LogAggregationContextPBImpl)logAggregationContext).getProto()); } if (nodeLabelExpression != null) { builder.setNodeLabelExpression(nodeLabelExpression); } builder.setContainerType(convertToProtoFormat(containerType)); proto = builder.build(); }
public ContainerTokenIdentifierForTest(ContainerTokenIdentifier identifier, String message) { ContainerTokenIdentifierForTestProto.Builder builder = ContainerTokenIdentifierForTestProto.newBuilder(); ContainerIdPBImpl containerID = (ContainerIdPBImpl)identifier.getContainerID(); if (containerID != null) { builder.setContainerId(containerID.getProto()); } builder.setNmHostAddr(identifier.getNmHostAddress()); builder.setAppSubmitter(identifier.getApplicationSubmitter()); builder.setAppSubmitterFolder(identifier.getApplicationSubmitterFolder()); ResourcePBImpl resource = (ResourcePBImpl)identifier.getResource(); if (resource != null) { builder.setResource(resource.getProto()); } builder.setExpiryTimeStamp(identifier.getExpiryTimeStamp()); builder.setMasterKeyId(identifier.getMasterKeyId()); builder.setRmIdentifier(identifier.getRMIdentifier()); PriorityPBImpl priority = (PriorityPBImpl)identifier.getPriority(); if (priority != null) { builder.setPriority(priority.getProto()); } builder.setCreationTime(identifier.getCreationTime()); builder.setMessage(message); LogAggregationContextPBImpl logAggregationContext = (LogAggregationContextPBImpl)identifier.getLogAggregationContext(); if (logAggregationContext != null) { builder.setLogAggregationContext(logAggregationContext.getProto()); } proto = builder.build(); }
public Priority getPriority() { if (!proto.hasPriority()) { return null; } return new PriorityPBImpl(proto.getPriority()); }
private PriorityPBImpl convertFromProtoFormat(PriorityProto p) { return new PriorityPBImpl(p); }
private PriorityProto convertToProtoFormat(Priority t) { return ((PriorityPBImpl)t).getProto(); }
public Priority getPriority() { return new PriorityPBImpl(proto.getPriority()); }
private PriorityProto convertToProtoFormat(Priority priority) { return ((PriorityPBImpl) priority).getProto(); }
private PriorityPBImpl convertFromProtoFormat(PriorityProto priority) { return new PriorityPBImpl(priority); }
private PriorityProto convertToProtoFormat(Priority t) { return ((PriorityPBImpl) t).getProto(); }
@Test public void testPriorityPBImpl() throws Exception { validatePBImplRecord(PriorityPBImpl.class, PriorityProto.class); }