Java 类org.apache.hadoop.yarn.proto.YarnServiceProtos.StartContainerRequestProto 实例源码

项目:hadoop    文件:StartContainersRequestPBImpl.java   
private void addLocalRequestsToProto() {
  maybeInitBuilder();
  builder.clearStartContainerRequest();
  List<StartContainerRequestProto> protoList =
      new ArrayList<StartContainerRequestProto>();
  for (StartContainerRequest r : this.requests) {
    protoList.add(convertToProtoFormat(r));
  }
  builder.addAllStartContainerRequest(protoList);
}
项目:hadoop    文件:StartContainersRequestPBImpl.java   
private void initLocalRequests() {
  StartContainersRequestProtoOrBuilder p = viaProto ? proto : builder;
  List<StartContainerRequestProto> requestList =
      p.getStartContainerRequestList();
  this.requests = new ArrayList<StartContainerRequest>();
  for (StartContainerRequestProto r : requestList) {
    this.requests.add(convertFromProtoFormat(r));
  }
}
项目:hadoop    文件: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 {
      throw new IOException("Unexpected container state key: " + key);
    }
  }
  return rcs;
}
项目:aliyun-oss-hadoop-fs    文件:StartContainersRequestPBImpl.java   
private void addLocalRequestsToProto() {
  maybeInitBuilder();
  builder.clearStartContainerRequest();
  List<StartContainerRequestProto> protoList =
      new ArrayList<StartContainerRequestProto>();
  for (StartContainerRequest r : this.requests) {
    protoList.add(convertToProtoFormat(r));
  }
  builder.addAllStartContainerRequest(protoList);
}
项目:aliyun-oss-hadoop-fs    文件:StartContainersRequestPBImpl.java   
private void initLocalRequests() {
  StartContainersRequestProtoOrBuilder p = viaProto ? proto : builder;
  List<StartContainerRequestProto> requestList =
      p.getStartContainerRequestList();
  this.requests = new ArrayList<StartContainerRequest>();
  for (StartContainerRequestProto r : requestList) {
    this.requests.add(convertFromProtoFormat(r));
  }
}
项目: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;
}
项目:big-c    文件:StartContainersRequestPBImpl.java   
private void addLocalRequestsToProto() {
  maybeInitBuilder();
  builder.clearStartContainerRequest();
  List<StartContainerRequestProto> protoList =
      new ArrayList<StartContainerRequestProto>();
  for (StartContainerRequest r : this.requests) {
    protoList.add(convertToProtoFormat(r));
  }
  builder.addAllStartContainerRequest(protoList);
}
项目:big-c    文件:StartContainersRequestPBImpl.java   
private void initLocalRequests() {
  StartContainersRequestProtoOrBuilder p = viaProto ? proto : builder;
  List<StartContainerRequestProto> requestList =
      p.getStartContainerRequestList();
  this.requests = new ArrayList<StartContainerRequest>();
  for (StartContainerRequestProto r : requestList) {
    this.requests.add(convertFromProtoFormat(r));
  }
}
项目:big-c    文件: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 {
      throw new IOException("Unexpected container state key: " + key);
    }
  }
  return rcs;
}
项目:hadoop-2.6.0-cdh5.4.3    文件:StartContainersRequestPBImpl.java   
private void addLocalRequestsToProto() {
  maybeInitBuilder();
  builder.clearStartContainerRequest();
  List<StartContainerRequestProto> protoList =
      new ArrayList<StartContainerRequestProto>();
  for (StartContainerRequest r : this.requests) {
    protoList.add(convertToProtoFormat(r));
  }
  builder.addAllStartContainerRequest(protoList);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:StartContainersRequestPBImpl.java   
private void initLocalRequests() {
  StartContainersRequestProtoOrBuilder p = viaProto ? proto : builder;
  List<StartContainerRequestProto> requestList =
      p.getStartContainerRequestList();
  this.requests = new ArrayList<StartContainerRequest>();
  for (StartContainerRequestProto r : requestList) {
    this.requests.add(convertFromProtoFormat(r));
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件: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 {
      throw new IOException("Unexpected container state key: " + key);
    }
  }
  return rcs;
}
项目:hadoop-plus    文件:StartContainersRequestPBImpl.java   
private void addLocalRequestsToProto() {
  maybeInitBuilder();
  builder.clearStartContainerRequest();
  List<StartContainerRequestProto> protoList =
      new ArrayList<StartContainerRequestProto>();
  for (StartContainerRequest r : this.requests) {
    protoList.add(convertToProtoFormat(r));
  }
  builder.addAllStartContainerRequest(protoList);
}
项目:hadoop-plus    文件:StartContainersRequestPBImpl.java   
private void initLocalRequests() {
  StartContainersRequestProtoOrBuilder p = viaProto ? proto : builder;
  List<StartContainerRequestProto> requestList =
      p.getStartContainerRequestList();
  this.requests = new ArrayList<StartContainerRequest>();
  for (StartContainerRequestProto r : requestList) {
    this.requests.add(convertFromProtoFormat(r));
  }
}
项目:hops    文件:StartContainersRequestPBImpl.java   
private void addLocalRequestsToProto() {
  maybeInitBuilder();
  builder.clearStartContainerRequest();
  List<StartContainerRequestProto> protoList =
      new ArrayList<StartContainerRequestProto>();
  for (StartContainerRequest r : this.requests) {
    protoList.add(convertToProtoFormat(r));
  }
  builder.addAllStartContainerRequest(protoList);
}
项目:hops    文件:StartContainersRequestPBImpl.java   
private void initLocalRequests() {
  StartContainersRequestProtoOrBuilder p = viaProto ? proto : builder;
  List<StartContainerRequestProto> requestList =
      p.getStartContainerRequestList();
  this.requests = new ArrayList<StartContainerRequest>();
  for (StartContainerRequestProto r : requestList) {
    this.requests.add(convertFromProtoFormat(r));
  }
}
项目: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-TCP    文件:StartContainersRequestPBImpl.java   
private void addLocalRequestsToProto() {
  maybeInitBuilder();
  builder.clearStartContainerRequest();
  List<StartContainerRequestProto> protoList =
      new ArrayList<StartContainerRequestProto>();
  for (StartContainerRequest r : this.requests) {
    protoList.add(convertToProtoFormat(r));
  }
  builder.addAllStartContainerRequest(protoList);
}
项目:hadoop-TCP    文件:StartContainersRequestPBImpl.java   
private void initLocalRequests() {
  StartContainersRequestProtoOrBuilder p = viaProto ? proto : builder;
  List<StartContainerRequestProto> requestList =
      p.getStartContainerRequestList();
  this.requests = new ArrayList<StartContainerRequest>();
  for (StartContainerRequestProto r : requestList) {
    this.requests.add(convertFromProtoFormat(r));
  }
}
项目:hardfs    文件:StartContainersRequestPBImpl.java   
private void addLocalRequestsToProto() {
  maybeInitBuilder();
  builder.clearStartContainerRequest();
  List<StartContainerRequestProto> protoList =
      new ArrayList<StartContainerRequestProto>();
  for (StartContainerRequest r : this.requests) {
    protoList.add(convertToProtoFormat(r));
  }
  builder.addAllStartContainerRequest(protoList);
}
项目:hardfs    文件:StartContainersRequestPBImpl.java   
private void initLocalRequests() {
  StartContainersRequestProtoOrBuilder p = viaProto ? proto : builder;
  List<StartContainerRequestProto> requestList =
      p.getStartContainerRequestList();
  this.requests = new ArrayList<StartContainerRequest>();
  for (StartContainerRequestProto r : requestList) {
    this.requests.add(convertFromProtoFormat(r));
  }
}
项目:hadoop-on-lustre2    文件:StartContainersRequestPBImpl.java   
private void addLocalRequestsToProto() {
  maybeInitBuilder();
  builder.clearStartContainerRequest();
  List<StartContainerRequestProto> protoList =
      new ArrayList<StartContainerRequestProto>();
  for (StartContainerRequest r : this.requests) {
    protoList.add(convertToProtoFormat(r));
  }
  builder.addAllStartContainerRequest(protoList);
}
项目:hadoop-on-lustre2    文件:StartContainersRequestPBImpl.java   
private void initLocalRequests() {
  StartContainersRequestProtoOrBuilder p = viaProto ? proto : builder;
  List<StartContainerRequestProto> requestList =
      p.getStartContainerRequestList();
  this.requests = new ArrayList<StartContainerRequest>();
  for (StartContainerRequestProto r : requestList) {
    this.requests.add(convertFromProtoFormat(r));
  }
}
项目:hadoop    文件:StartContainerRequestPBImpl.java   
public StartContainerRequestPBImpl() {
  builder = StartContainerRequestProto.newBuilder();
}
项目:hadoop    文件:StartContainerRequestPBImpl.java   
public StartContainerRequestPBImpl(StartContainerRequestProto proto) {
  this.proto = proto;
  viaProto = true;
}
项目:hadoop    文件:StartContainerRequestPBImpl.java   
public StartContainerRequestProto getProto() {
    mergeLocalToProto();
  proto = viaProto ? proto : builder.build();
  viaProto = true;
  return proto;
}
项目:hadoop    文件:StartContainerRequestPBImpl.java   
private void maybeInitBuilder() {
  if (viaProto || builder == null) {
    builder = StartContainerRequestProto.newBuilder(proto);
  }
  viaProto = false;
}
项目:hadoop    文件:StartContainersRequestPBImpl.java   
private StartContainerRequestPBImpl convertFromProtoFormat(
    StartContainerRequestProto p) {
  return new StartContainerRequestPBImpl(p);
}
项目:hadoop    文件:StartContainersRequestPBImpl.java   
private StartContainerRequestProto convertToProtoFormat(
    StartContainerRequest t) {
  return ((StartContainerRequestPBImpl) t).getProto();
}
项目:aliyun-oss-hadoop-fs    文件:StartContainerRequestPBImpl.java   
public StartContainerRequestPBImpl() {
  builder = StartContainerRequestProto.newBuilder();
}
项目:aliyun-oss-hadoop-fs    文件:StartContainerRequestPBImpl.java   
public StartContainerRequestPBImpl(StartContainerRequestProto proto) {
  this.proto = proto;
  viaProto = true;
}
项目:aliyun-oss-hadoop-fs    文件:StartContainerRequestPBImpl.java   
public StartContainerRequestProto getProto() {
    mergeLocalToProto();
  proto = viaProto ? proto : builder.build();
  viaProto = true;
  return proto;
}
项目:aliyun-oss-hadoop-fs    文件:StartContainerRequestPBImpl.java   
private void maybeInitBuilder() {
  if (viaProto || builder == null) {
    builder = StartContainerRequestProto.newBuilder(proto);
  }
  viaProto = false;
}
项目:aliyun-oss-hadoop-fs    文件:StartContainersRequestPBImpl.java   
private StartContainerRequestPBImpl convertFromProtoFormat(
    StartContainerRequestProto p) {
  return new StartContainerRequestPBImpl(p);
}
项目:aliyun-oss-hadoop-fs    文件:StartContainersRequestPBImpl.java   
private StartContainerRequestProto convertToProtoFormat(
    StartContainerRequest t) {
  return ((StartContainerRequestPBImpl) t).getProto();
}
项目:aliyun-oss-hadoop-fs    文件:TestPBImplRecords.java   
@Test
public void testStartContainerRequestPBImpl() throws Exception {
  validatePBImplRecord(StartContainerRequestPBImpl.class,
      StartContainerRequestProto.class);
}
项目:big-c    文件:StartContainerRequestPBImpl.java   
public StartContainerRequestPBImpl() {
  builder = StartContainerRequestProto.newBuilder();
}
项目:big-c    文件:StartContainerRequestPBImpl.java   
public StartContainerRequestPBImpl(StartContainerRequestProto proto) {
  this.proto = proto;
  viaProto = true;
}
项目:big-c    文件:StartContainerRequestPBImpl.java   
public StartContainerRequestProto getProto() {
    mergeLocalToProto();
  proto = viaProto ? proto : builder.build();
  viaProto = true;
  return proto;
}
项目:big-c    文件:StartContainerRequestPBImpl.java   
private void maybeInitBuilder() {
  if (viaProto || builder == null) {
    builder = StartContainerRequestProto.newBuilder(proto);
  }
  viaProto = false;
}