Java 类org.apache.hadoop.yarn.proto.YarnProtos.ResourceProto 实例源码

项目:aliyun-oss-hadoop-fs    文件:NMLeveldbStateStoreService.java   
private RecoveredContainerState loadContainerState(ContainerId containerId,
    LeveldbIterator iter, String keyPrefix) throws IOException {
  RecoveredContainerState rcs = new RecoveredContainerState();
  rcs.status = RecoveredContainerStatus.REQUESTED;
  while (iter.hasNext()) {
    Entry<byte[],byte[]> entry = iter.peekNext();
    String key = asString(entry.getKey());
    if (!key.startsWith(keyPrefix)) {
      break;
    }
    iter.next();

    String suffix = key.substring(keyPrefix.length()-1);  // start with '/'
    if (suffix.equals(CONTAINER_REQUEST_KEY_SUFFIX)) {
      rcs.startRequest = new StartContainerRequestPBImpl(
          StartContainerRequestProto.parseFrom(entry.getValue()));
    } else if (suffix.equals(CONTAINER_DIAGS_KEY_SUFFIX)) {
      rcs.diagnostics = asString(entry.getValue());
    } else if (suffix.equals(CONTAINER_LAUNCHED_KEY_SUFFIX)) {
      if (rcs.status == RecoveredContainerStatus.REQUESTED) {
        rcs.status = RecoveredContainerStatus.LAUNCHED;
      }
    } else if (suffix.equals(CONTAINER_KILLED_KEY_SUFFIX)) {
      rcs.killed = true;
    } else if (suffix.equals(CONTAINER_EXIT_CODE_KEY_SUFFIX)) {
      rcs.status = RecoveredContainerStatus.COMPLETED;
      rcs.exitCode = Integer.parseInt(asString(entry.getValue()));
    } else if (suffix.equals(CONTAINER_RESOURCE_CHANGED_KEY_SUFFIX)) {
      rcs.capability = new ResourcePBImpl(
          ResourceProto.parseFrom(entry.getValue()));
    } else {
      throw new IOException("Unexpected container state key: " + key);
    }
  }
  return rcs;
}
项目:hops    文件:NMLeveldbStateStoreService.java   
private RecoveredContainerState loadContainerState(ContainerId containerId,
    LeveldbIterator iter, String keyPrefix) throws IOException {
  RecoveredContainerState rcs = new RecoveredContainerState();
  rcs.status = RecoveredContainerStatus.REQUESTED;
  while (iter.hasNext()) {
    Entry<byte[],byte[]> entry = iter.peekNext();
    String key = asString(entry.getKey());
    if (!key.startsWith(keyPrefix)) {
      break;
    }
    iter.next();

    String suffix = key.substring(keyPrefix.length()-1);  // start with '/'
    if (suffix.equals(CONTAINER_REQUEST_KEY_SUFFIX)) {
      rcs.startRequest = new StartContainerRequestPBImpl(
          StartContainerRequestProto.parseFrom(entry.getValue()));
    } else if (suffix.equals(CONTAINER_VERSION_KEY_SUFFIX)) {
      rcs.version = Integer.parseInt(asString(entry.getValue()));
    } else if (suffix.equals(CONTAINER_DIAGS_KEY_SUFFIX)) {
      rcs.diagnostics = asString(entry.getValue());
    } else if (suffix.equals(CONTAINER_LAUNCHED_KEY_SUFFIX)) {
      if (rcs.status == RecoveredContainerStatus.REQUESTED) {
        rcs.status = RecoveredContainerStatus.LAUNCHED;
      }
    } else if (suffix.equals(CONTAINER_KILLED_KEY_SUFFIX)) {
      rcs.killed = true;
    } else if (suffix.equals(CONTAINER_EXIT_CODE_KEY_SUFFIX)) {
      rcs.status = RecoveredContainerStatus.COMPLETED;
      rcs.exitCode = Integer.parseInt(asString(entry.getValue()));
    } else if (suffix.equals(CONTAINER_RESOURCE_CHANGED_KEY_SUFFIX)) {
      rcs.capability = new ResourcePBImpl(
          ResourceProto.parseFrom(entry.getValue()));
    } else {
      throw new IOException("Unexpected container state key: " + key);
    }
  }
  return rcs;
}
项目:hadoop    文件:RegisterApplicationMasterResponsePBImpl.java   
private Resource convertFromProtoFormat(ResourceProto resource) {
  return new ResourcePBImpl(resource);
}
项目:hadoop    文件:RegisterApplicationMasterResponsePBImpl.java   
private ResourceProto convertToProtoFormat(Resource resource) {
  return ((ResourcePBImpl)resource).getProto();
}
项目:hadoop    文件:GetNewApplicationResponsePBImpl.java   
private Resource convertFromProtoFormat(ResourceProto resource) {
 return new ResourcePBImpl(resource);
}
项目:hadoop    文件:GetNewApplicationResponsePBImpl.java   
private ResourceProto convertToProtoFormat(Resource resource) {
 return ((ResourcePBImpl)resource).getProto();
}
项目:hadoop    文件:AllocateResponsePBImpl.java   
private synchronized ResourcePBImpl convertFromProtoFormat(ResourceProto p) {
  return new ResourcePBImpl(p);
}
项目:hadoop    文件:AllocateResponsePBImpl.java   
private synchronized ResourceProto convertToProtoFormat(Resource r) {
  return ((ResourcePBImpl) r).getProto();
}
项目:hadoop    文件:ContainerResourceIncreaseRequestPBImpl.java   
private Resource convertFromProtoFormat(ResourceProto p) {
  return new ResourcePBImpl(p);
}
项目:hadoop    文件:ContainerResourceIncreaseRequestPBImpl.java   
private ResourceProto convertToProtoFormat(Resource t) {
  return ((ResourcePBImpl) t).getProto();
}
项目:hadoop    文件:ContainerPBImpl.java   
private ResourcePBImpl convertFromProtoFormat(ResourceProto p) {
  return new ResourcePBImpl(p);
}
项目:hadoop    文件:ContainerPBImpl.java   
private ResourceProto convertToProtoFormat(Resource t) {
  return ((ResourcePBImpl)t).getProto();
}
项目:hadoop    文件:NodeReportPBImpl.java   
private ResourcePBImpl convertFromProtoFormat(ResourceProto p) {
  return new ResourcePBImpl(p);
}
项目:hadoop    文件:NodeReportPBImpl.java   
private ResourceProto convertToProtoFormat(Resource r) {
  return ((ResourcePBImpl) r).getProto();
}
项目:hadoop    文件:ResourcePBImpl.java   
public ResourcePBImpl() {
  builder = ResourceProto.newBuilder();
}
项目:hadoop    文件:ResourcePBImpl.java   
public ResourcePBImpl(ResourceProto proto) {
  this.proto = proto;
  viaProto = true;
}
项目:hadoop    文件:ResourcePBImpl.java   
public ResourceProto getProto() {
  proto = viaProto ? proto : builder.build();
  viaProto = true;
  return proto;
}
项目:hadoop    文件:ResourcePBImpl.java   
private void maybeInitBuilder() {
  if (viaProto || builder == null) {
    builder = ResourceProto.newBuilder(proto);
  }
  viaProto = false;
}
项目:hadoop    文件:ResourceOptionPBImpl.java   
private ResourceProto convertToProtoFormat(
    Resource resource) {
  return ((ResourcePBImpl)resource).getProto();
}
项目:hadoop    文件:ResourceOptionPBImpl.java   
private ResourcePBImpl convertFromProtoFormat(
    ResourceProto p) {
  return new ResourcePBImpl(p);
}
项目:hadoop    文件:ApplicationResourceUsageReportPBImpl.java   
private ResourcePBImpl convertFromProtoFormat(ResourceProto p) {
  return new ResourcePBImpl(p);
}
项目:hadoop    文件:ApplicationResourceUsageReportPBImpl.java   
private ResourceProto convertToProtoFormat(Resource t) {
  return ((ResourcePBImpl)t).getProto();
}
项目:hadoop    文件:ResourceRequestPBImpl.java   
private ResourcePBImpl convertFromProtoFormat(ResourceProto p) {
  return new ResourcePBImpl(p);
}
项目:hadoop    文件:ResourceRequestPBImpl.java   
private ResourceProto convertToProtoFormat(Resource t) {
  return ((ResourcePBImpl)t).getProto();
}
项目:hadoop    文件:ReservationRequestPBImpl.java   
private ResourcePBImpl convertFromProtoFormat(ResourceProto p) {
  return new ResourcePBImpl(p);
}
项目:hadoop    文件:ReservationRequestPBImpl.java   
private ResourceProto convertToProtoFormat(Resource t) {
  return ((ResourcePBImpl) t).getProto();
}
项目:hadoop    文件:ApplicationSubmissionContextPBImpl.java   
private ResourcePBImpl convertFromProtoFormat(ResourceProto p) {
  return new ResourcePBImpl(p);
}
项目:hadoop    文件:ApplicationSubmissionContextPBImpl.java   
private ResourceProto convertToProtoFormat(Resource t) {
  return ((ResourcePBImpl)t).getProto();
}
项目:hadoop    文件:ContainerResourceDecreasePBImpl.java   
private Resource convertFromProtoFormat(ResourceProto p) {
  return new ResourcePBImpl(p);
}
项目:hadoop    文件:ContainerResourceDecreasePBImpl.java   
private ResourceProto convertToProtoFormat(Resource t) {
  return ((ResourcePBImpl) t).getProto();
}
项目:hadoop    文件:ContainerReportPBImpl.java   
private ResourcePBImpl convertFromProtoFormat(ResourceProto p) {
  return new ResourcePBImpl(p);
}
项目:hadoop    文件:ContainerReportPBImpl.java   
private ResourceProto convertToProtoFormat(Resource t) {
  return ((ResourcePBImpl) t).getProto();
}
项目:hadoop    文件:ContainerResourceIncreasePBImpl.java   
private Resource convertFromProtoFormat(ResourceProto p) {
  return new ResourcePBImpl(p);
}
项目:hadoop    文件:ContainerResourceIncreasePBImpl.java   
private ResourceProto convertToProtoFormat(Resource t) {
  return ((ResourcePBImpl) t).getProto();
}
项目:hadoop    文件:NMContainerStatusPBImpl.java   
private ResourcePBImpl convertFromProtoFormat(ResourceProto p) {
  return new ResourcePBImpl(p);
}
项目:hadoop    文件:NMContainerStatusPBImpl.java   
private ResourceProto convertToProtoFormat(Resource t) {
  return ((ResourcePBImpl) t).getProto();
}
项目:hadoop    文件:RegisterNodeManagerRequestPBImpl.java   
private ResourcePBImpl convertFromProtoFormat(ResourceProto p) {
  return new ResourcePBImpl(p);
}
项目:hadoop    文件:RegisterNodeManagerRequestPBImpl.java   
private ResourceProto convertToProtoFormat(Resource t) {
  return ((ResourcePBImpl)t).getProto();
}
项目:hadoop    文件:ContainerStartDataPBImpl.java   
private ResourceProto convertToProtoFormat(Resource resource) {
  return ((ResourcePBImpl) resource).getProto();
}
项目:hadoop    文件:ContainerStartDataPBImpl.java   
private ResourcePBImpl convertFromProtoFormat(ResourceProto resource) {
  return new ResourcePBImpl(resource);
}