org.apache.hadoop.yarn.api.records.impl.pb.PriorityPBImpl Java Examples

The following examples show how to use org.apache.hadoop.yarn.api.records.impl.pb.PriorityPBImpl. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ContainerStartDataPBImpl.java    From big-c with Apache License 2.0 6 votes vote down vote up
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));
  }
}
 
Example #2
Source File: ContainerStartDataPBImpl.java    From hadoop with Apache License 2.0 6 votes vote down vote up
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));
  }
}
 
Example #3
Source File: ContainerStartDataPBImpl.java    From ambari-metrics with Apache License 2.0 6 votes vote down vote up
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));
  }
}
 
Example #4
Source File: ContainerTokenIdentifier.java    From hadoop with Apache License 2.0 5 votes vote down vote up
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();
}
 
Example #5
Source File: ContainerTokenIdentifierForTest.java    From big-c with Apache License 2.0 5 votes vote down vote up
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();
}
 
Example #6
Source File: ContainerTokenIdentifierForTest.java    From hadoop with Apache License 2.0 5 votes vote down vote up
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();
}
 
Example #7
Source File: ContainerTokenIdentifierForTest.java    From hadoop with Apache License 2.0 5 votes vote down vote up
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();
}
 
Example #8
Source File: ContainerTokenIdentifierForTest.java    From big-c with Apache License 2.0 5 votes vote down vote up
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();
}
 
Example #9
Source File: ContainerTokenIdentifier.java    From big-c with Apache License 2.0 5 votes vote down vote up
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();
}
 
Example #10
Source File: ContainerStartDataPBImpl.java    From hadoop with Apache License 2.0 4 votes vote down vote up
private PriorityProto convertToProtoFormat(Priority priority) {
  return ((PriorityPBImpl) priority).getProto();
}
 
Example #11
Source File: ContainerStartDataPBImpl.java    From big-c with Apache License 2.0 4 votes vote down vote up
private PriorityPBImpl convertFromProtoFormat(PriorityProto priority) {
  return new PriorityPBImpl(priority);
}
 
Example #12
Source File: ContainerStartDataPBImpl.java    From big-c with Apache License 2.0 4 votes vote down vote up
private PriorityProto convertToProtoFormat(Priority priority) {
  return ((PriorityPBImpl) priority).getProto();
}
 
Example #13
Source File: ContainerTokenIdentifierForTest.java    From big-c with Apache License 2.0 4 votes vote down vote up
public Priority getPriority() {
  return new PriorityPBImpl(proto.getPriority());
}
 
Example #14
Source File: NMContainerStatusPBImpl.java    From big-c with Apache License 2.0 4 votes vote down vote up
private PriorityProto convertToProtoFormat(Priority t) {
  return ((PriorityPBImpl)t).getProto();
}
 
Example #15
Source File: NMContainerStatusPBImpl.java    From big-c with Apache License 2.0 4 votes vote down vote up
private PriorityPBImpl convertFromProtoFormat(PriorityProto p) {
  return new PriorityPBImpl(p);
}
 
Example #16
Source File: ContainerTokenIdentifier.java    From big-c with Apache License 2.0 4 votes vote down vote up
public Priority getPriority() {
  if (!proto.hasPriority()) {
    return null;
  }
  return new PriorityPBImpl(proto.getPriority());
}
 
Example #17
Source File: ContainerStartDataPBImpl.java    From hadoop with Apache License 2.0 4 votes vote down vote up
private PriorityPBImpl convertFromProtoFormat(PriorityProto priority) {
  return new PriorityPBImpl(priority);
}
 
Example #18
Source File: ContainerTokenIdentifierForTest.java    From hadoop with Apache License 2.0 4 votes vote down vote up
public Priority getPriority() {
  return new PriorityPBImpl(proto.getPriority());
}
 
Example #19
Source File: NMContainerStatusPBImpl.java    From hadoop with Apache License 2.0 4 votes vote down vote up
private PriorityProto convertToProtoFormat(Priority t) {
  return ((PriorityPBImpl)t).getProto();
}
 
Example #20
Source File: NMContainerStatusPBImpl.java    From hadoop with Apache License 2.0 4 votes vote down vote up
private PriorityPBImpl convertFromProtoFormat(PriorityProto p) {
  return new PriorityPBImpl(p);
}
 
Example #21
Source File: ContainerTokenIdentifier.java    From hadoop with Apache License 2.0 4 votes vote down vote up
public Priority getPriority() {
  if (!proto.hasPriority()) {
    return null;
  }
  return new PriorityPBImpl(proto.getPriority());
}
 
Example #22
Source File: ContainerStartDataPBImpl.java    From ambari-metrics with Apache License 2.0 4 votes vote down vote up
private PriorityPBImpl convertFromProtoFormat(PriorityProto priority) {
  return new PriorityPBImpl(priority);
}
 
Example #23
Source File: ContainerStartDataPBImpl.java    From ambari-metrics with Apache License 2.0 4 votes vote down vote up
private PriorityProto convertToProtoFormat(Priority priority) {
  return ((PriorityPBImpl) priority).getProto();
}