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

项目:hadoop    文件:TestContainerResourceIncreaseRequest.java   
@Test
public void ContainerResourceIncreaseRequest() {
  ContainerId containerId = ContainerId
      .newContainerId(ApplicationAttemptId.newInstance(
          ApplicationId.newInstance(1234, 3), 3), 7);
  Resource resource = Resource.newInstance(1023, 3, 4);
  ContainerResourceIncreaseRequest context = ContainerResourceIncreaseRequest
      .newInstance(containerId, resource);

  // to proto and get it back
  ContainerResourceIncreaseRequestProto proto = 
      ((ContainerResourceIncreaseRequestPBImpl) context).getProto();
  ContainerResourceIncreaseRequest contextRecover = 
      new ContainerResourceIncreaseRequestPBImpl(proto);

  // check value
  Assert.assertEquals(contextRecover.getContainerId(), containerId);
  Assert.assertEquals(contextRecover.getCapability(), resource);
}
项目:big-c    文件:TestContainerResourceIncreaseRequest.java   
@Test
public void ContainerResourceIncreaseRequest() {
  ContainerId containerId = ContainerId
      .newContainerId(ApplicationAttemptId.newInstance(
          ApplicationId.newInstance(1234, 3), 3), 7);
  Resource resource = Resource.newInstance(1023, 3);
  ContainerResourceIncreaseRequest context = ContainerResourceIncreaseRequest
      .newInstance(containerId, resource);

  // to proto and get it back
  ContainerResourceIncreaseRequestProto proto = 
      ((ContainerResourceIncreaseRequestPBImpl) context).getProto();
  ContainerResourceIncreaseRequest contextRecover = 
      new ContainerResourceIncreaseRequestPBImpl(proto);

  // check value
  Assert.assertEquals(contextRecover.getContainerId(), containerId);
  Assert.assertEquals(contextRecover.getCapability(), resource);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestContainerResourceIncreaseRequest.java   
@Test
public void ContainerResourceIncreaseRequest() {
  ContainerId containerId = ContainerId
      .newContainerId(ApplicationAttemptId.newInstance(
          ApplicationId.newInstance(1234, 3), 3), 7);
  Resource resource = Resource.newInstance(1023, 3);
  ContainerResourceIncreaseRequest context = ContainerResourceIncreaseRequest
      .newInstance(containerId, resource);

  // to proto and get it back
  ContainerResourceIncreaseRequestProto proto = 
      ((ContainerResourceIncreaseRequestPBImpl) context).getProto();
  ContainerResourceIncreaseRequest contextRecover = 
      new ContainerResourceIncreaseRequestPBImpl(proto);

  // check value
  Assert.assertEquals(contextRecover.getContainerId(), containerId);
  Assert.assertEquals(contextRecover.getCapability(), resource);
}
项目:hadoop-on-lustre2    文件:TestContainerResourceIncreaseRequest.java   
@Test
public void ContainerResourceIncreaseRequest() {
  ContainerId containerId = ContainerId
      .newInstance(ApplicationAttemptId.newInstance(
          ApplicationId.newInstance(1234, 3), 3), 7);
  Resource resource = Resource.newInstance(1023, 3);
  ContainerResourceIncreaseRequest context = ContainerResourceIncreaseRequest
      .newInstance(containerId, resource);

  // to proto and get it back
  ContainerResourceIncreaseRequestProto proto = 
      ((ContainerResourceIncreaseRequestPBImpl) context).getProto();
  ContainerResourceIncreaseRequest contextRecover = 
      new ContainerResourceIncreaseRequestPBImpl(proto);

  // check value
  Assert.assertEquals(contextRecover.getContainerId(), containerId);
  Assert.assertEquals(contextRecover.getCapability(), resource);
}
项目:hadoop    文件:AllocateRequestPBImpl.java   
private void initIncreaseRequests() {
  if (this.increaseRequests != null) {
    return;
  }
  AllocateRequestProtoOrBuilder p = viaProto ? proto : builder;
  List<ContainerResourceIncreaseRequestProto> list =
      p.getIncreaseRequestList();
  this.increaseRequests = new ArrayList<ContainerResourceIncreaseRequest>();

  for (ContainerResourceIncreaseRequestProto c : list) {
    this.increaseRequests.add(convertFromProtoFormat(c));
  }
}
项目:hadoop    文件:AllocateRequestPBImpl.java   
private void addIncreaseRequestsToProto() {
  maybeInitBuilder();
  builder.clearIncreaseRequest();
  if (increaseRequests == null) {
    return;
  }
  Iterable<ContainerResourceIncreaseRequestProto> iterable =
      new Iterable<ContainerResourceIncreaseRequestProto>() {
        @Override
        public Iterator<ContainerResourceIncreaseRequestProto> iterator() {
          return new Iterator<ContainerResourceIncreaseRequestProto>() {

            Iterator<ContainerResourceIncreaseRequest> iter =
                increaseRequests.iterator();

            @Override
            public boolean hasNext() {
              return iter.hasNext();
            }

            @Override
            public ContainerResourceIncreaseRequestProto next() {
              return convertToProtoFormat(iter.next());
            }

            @Override
            public void remove() {
              throw new UnsupportedOperationException();
            }
          };

        }
      };
  builder.addAllIncreaseRequest(iterable);
}
项目:hadoop    文件:TestContainerResourceIncreaseRequest.java   
@Test
public void testResourceChangeContextWithNullField() {
  ContainerResourceIncreaseRequest context = ContainerResourceIncreaseRequest
      .newInstance(null, null);

  // to proto and get it back
  ContainerResourceIncreaseRequestProto proto = 
      ((ContainerResourceIncreaseRequestPBImpl) context).getProto();
  ContainerResourceIncreaseRequest contextRecover = 
      new ContainerResourceIncreaseRequestPBImpl(proto);

  // check value
  Assert.assertNull(contextRecover.getContainerId());
  Assert.assertNull(contextRecover.getCapability());
}
项目:big-c    文件:AllocateRequestPBImpl.java   
private void initIncreaseRequests() {
  if (this.increaseRequests != null) {
    return;
  }
  AllocateRequestProtoOrBuilder p = viaProto ? proto : builder;
  List<ContainerResourceIncreaseRequestProto> list =
      p.getIncreaseRequestList();
  this.increaseRequests = new ArrayList<ContainerResourceIncreaseRequest>();

  for (ContainerResourceIncreaseRequestProto c : list) {
    this.increaseRequests.add(convertFromProtoFormat(c));
  }
}
项目:big-c    文件:AllocateRequestPBImpl.java   
private void addIncreaseRequestsToProto() {
  maybeInitBuilder();
  builder.clearIncreaseRequest();
  if (increaseRequests == null) {
    return;
  }
  Iterable<ContainerResourceIncreaseRequestProto> iterable =
      new Iterable<ContainerResourceIncreaseRequestProto>() {
        @Override
        public Iterator<ContainerResourceIncreaseRequestProto> iterator() {
          return new Iterator<ContainerResourceIncreaseRequestProto>() {

            Iterator<ContainerResourceIncreaseRequest> iter =
                increaseRequests.iterator();

            @Override
            public boolean hasNext() {
              return iter.hasNext();
            }

            @Override
            public ContainerResourceIncreaseRequestProto next() {
              return convertToProtoFormat(iter.next());
            }

            @Override
            public void remove() {
              throw new UnsupportedOperationException();
            }
          };

        }
      };
  builder.addAllIncreaseRequest(iterable);
}
项目:big-c    文件:TestContainerResourceIncreaseRequest.java   
@Test
public void testResourceChangeContextWithNullField() {
  ContainerResourceIncreaseRequest context = ContainerResourceIncreaseRequest
      .newInstance(null, null);

  // to proto and get it back
  ContainerResourceIncreaseRequestProto proto = 
      ((ContainerResourceIncreaseRequestPBImpl) context).getProto();
  ContainerResourceIncreaseRequest contextRecover = 
      new ContainerResourceIncreaseRequestPBImpl(proto);

  // check value
  Assert.assertNull(contextRecover.getContainerId());
  Assert.assertNull(contextRecover.getCapability());
}
项目:hadoop-2.6.0-cdh5.4.3    文件:AllocateRequestPBImpl.java   
private void initIncreaseRequests() {
  if (this.increaseRequests != null) {
    return;
  }
  AllocateRequestProtoOrBuilder p = viaProto ? proto : builder;
  List<ContainerResourceIncreaseRequestProto> list =
      p.getIncreaseRequestList();
  this.increaseRequests = new ArrayList<ContainerResourceIncreaseRequest>();

  for (ContainerResourceIncreaseRequestProto c : list) {
    this.increaseRequests.add(convertFromProtoFormat(c));
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:AllocateRequestPBImpl.java   
private void addIncreaseRequestsToProto() {
  maybeInitBuilder();
  builder.clearIncreaseRequest();
  if (increaseRequests == null) {
    return;
  }
  Iterable<ContainerResourceIncreaseRequestProto> iterable =
      new Iterable<ContainerResourceIncreaseRequestProto>() {
        @Override
        public Iterator<ContainerResourceIncreaseRequestProto> iterator() {
          return new Iterator<ContainerResourceIncreaseRequestProto>() {

            Iterator<ContainerResourceIncreaseRequest> iter =
                increaseRequests.iterator();

            @Override
            public boolean hasNext() {
              return iter.hasNext();
            }

            @Override
            public ContainerResourceIncreaseRequestProto next() {
              return convertToProtoFormat(iter.next());
            }

            @Override
            public void remove() {
              throw new UnsupportedOperationException();
            }
          };

        }
      };
  builder.addAllIncreaseRequest(iterable);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestContainerResourceIncreaseRequest.java   
@Test
public void testResourceChangeContextWithNullField() {
  ContainerResourceIncreaseRequest context = ContainerResourceIncreaseRequest
      .newInstance(null, null);

  // to proto and get it back
  ContainerResourceIncreaseRequestProto proto = 
      ((ContainerResourceIncreaseRequestPBImpl) context).getProto();
  ContainerResourceIncreaseRequest contextRecover = 
      new ContainerResourceIncreaseRequestPBImpl(proto);

  // check value
  Assert.assertNull(contextRecover.getContainerId());
  Assert.assertNull(contextRecover.getCapability());
}
项目:hadoop-on-lustre2    文件:AllocateRequestPBImpl.java   
private void initIncreaseRequests() {
  if (this.increaseRequests != null) {
    return;
  }
  AllocateRequestProtoOrBuilder p = viaProto ? proto : builder;
  List<ContainerResourceIncreaseRequestProto> list =
      p.getIncreaseRequestList();
  this.increaseRequests = new ArrayList<ContainerResourceIncreaseRequest>();

  for (ContainerResourceIncreaseRequestProto c : list) {
    this.increaseRequests.add(convertFromProtoFormat(c));
  }
}
项目:hadoop-on-lustre2    文件:AllocateRequestPBImpl.java   
private void addIncreaseRequestsToProto() {
  maybeInitBuilder();
  builder.clearIncreaseRequest();
  if (increaseRequests == null) {
    return;
  }
  Iterable<ContainerResourceIncreaseRequestProto> iterable =
      new Iterable<ContainerResourceIncreaseRequestProto>() {
        @Override
        public Iterator<ContainerResourceIncreaseRequestProto> iterator() {
          return new Iterator<ContainerResourceIncreaseRequestProto>() {

            Iterator<ContainerResourceIncreaseRequest> iter =
                increaseRequests.iterator();

            @Override
            public boolean hasNext() {
              return iter.hasNext();
            }

            @Override
            public ContainerResourceIncreaseRequestProto next() {
              return convertToProtoFormat(iter.next());
            }

            @Override
            public void remove() {
              throw new UnsupportedOperationException();
            }
          };

        }
      };
  builder.addAllIncreaseRequest(iterable);
}
项目:hadoop-on-lustre2    文件:TestContainerResourceIncreaseRequest.java   
@Test
public void testResourceChangeContextWithNullField() {
  ContainerResourceIncreaseRequest context = ContainerResourceIncreaseRequest
      .newInstance(null, null);

  // to proto and get it back
  ContainerResourceIncreaseRequestProto proto = 
      ((ContainerResourceIncreaseRequestPBImpl) context).getProto();
  ContainerResourceIncreaseRequest contextRecover = 
      new ContainerResourceIncreaseRequestPBImpl(proto);

  // check value
  Assert.assertNull(contextRecover.getContainerId());
  Assert.assertNull(contextRecover.getCapability());
}
项目:hadoop    文件:AllocateRequestPBImpl.java   
private ContainerResourceIncreaseRequestPBImpl convertFromProtoFormat(
    ContainerResourceIncreaseRequestProto p) {
  return new ContainerResourceIncreaseRequestPBImpl(p);
}
项目:hadoop    文件:AllocateRequestPBImpl.java   
private ContainerResourceIncreaseRequestProto convertToProtoFormat(
    ContainerResourceIncreaseRequest t) {
  return ((ContainerResourceIncreaseRequestPBImpl) t).getProto();
}
项目:hadoop    文件:ContainerResourceIncreaseRequestPBImpl.java   
public ContainerResourceIncreaseRequestPBImpl() {
  builder = ContainerResourceIncreaseRequestProto.newBuilder();
}
项目:hadoop    文件:ContainerResourceIncreaseRequestPBImpl.java   
public ContainerResourceIncreaseRequestPBImpl(
    ContainerResourceIncreaseRequestProto proto) {
  this.proto = proto;
  viaProto = true;
}
项目:hadoop    文件:ContainerResourceIncreaseRequestPBImpl.java   
public ContainerResourceIncreaseRequestProto getProto() {
  mergeLocalToProto();
  proto = viaProto ? proto : builder.build();
  viaProto = true;
  return proto;
}
项目:hadoop    文件:ContainerResourceIncreaseRequestPBImpl.java   
private void maybeInitBuilder() {
  if (viaProto || builder == null) {
    builder = ContainerResourceIncreaseRequestProto.newBuilder(proto);
  }
  viaProto = false;
}
项目:big-c    文件:AllocateRequestPBImpl.java   
private ContainerResourceIncreaseRequestPBImpl convertFromProtoFormat(
    ContainerResourceIncreaseRequestProto p) {
  return new ContainerResourceIncreaseRequestPBImpl(p);
}
项目:big-c    文件:AllocateRequestPBImpl.java   
private ContainerResourceIncreaseRequestProto convertToProtoFormat(
    ContainerResourceIncreaseRequest t) {
  return ((ContainerResourceIncreaseRequestPBImpl) t).getProto();
}
项目:big-c    文件:ContainerResourceIncreaseRequestPBImpl.java   
public ContainerResourceIncreaseRequestPBImpl() {
  builder = ContainerResourceIncreaseRequestProto.newBuilder();
}
项目:big-c    文件:ContainerResourceIncreaseRequestPBImpl.java   
public ContainerResourceIncreaseRequestPBImpl(
    ContainerResourceIncreaseRequestProto proto) {
  this.proto = proto;
  viaProto = true;
}
项目:big-c    文件:ContainerResourceIncreaseRequestPBImpl.java   
public ContainerResourceIncreaseRequestProto getProto() {
  mergeLocalToProto();
  proto = viaProto ? proto : builder.build();
  viaProto = true;
  return proto;
}
项目:big-c    文件:ContainerResourceIncreaseRequestPBImpl.java   
private void maybeInitBuilder() {
  if (viaProto || builder == null) {
    builder = ContainerResourceIncreaseRequestProto.newBuilder(proto);
  }
  viaProto = false;
}
项目:hadoop-2.6.0-cdh5.4.3    文件:AllocateRequestPBImpl.java   
private ContainerResourceIncreaseRequestPBImpl convertFromProtoFormat(
    ContainerResourceIncreaseRequestProto p) {
  return new ContainerResourceIncreaseRequestPBImpl(p);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:AllocateRequestPBImpl.java   
private ContainerResourceIncreaseRequestProto convertToProtoFormat(
    ContainerResourceIncreaseRequest t) {
  return ((ContainerResourceIncreaseRequestPBImpl) t).getProto();
}
项目:hadoop-2.6.0-cdh5.4.3    文件:ContainerResourceIncreaseRequestPBImpl.java   
public ContainerResourceIncreaseRequestPBImpl() {
  builder = ContainerResourceIncreaseRequestProto.newBuilder();
}
项目:hadoop-2.6.0-cdh5.4.3    文件:ContainerResourceIncreaseRequestPBImpl.java   
public ContainerResourceIncreaseRequestPBImpl(
    ContainerResourceIncreaseRequestProto proto) {
  this.proto = proto;
  viaProto = true;
}
项目:hadoop-2.6.0-cdh5.4.3    文件:ContainerResourceIncreaseRequestPBImpl.java   
public ContainerResourceIncreaseRequestProto getProto() {
  mergeLocalToProto();
  proto = viaProto ? proto : builder.build();
  viaProto = true;
  return proto;
}
项目:hadoop-2.6.0-cdh5.4.3    文件:ContainerResourceIncreaseRequestPBImpl.java   
private void maybeInitBuilder() {
  if (viaProto || builder == null) {
    builder = ContainerResourceIncreaseRequestProto.newBuilder(proto);
  }
  viaProto = false;
}
项目:hops    文件:ContainerResourceIncreaseRequestPBImpl.java   
public ContainerResourceIncreaseRequestPBImpl() {
  builder = ContainerResourceIncreaseRequestProto.newBuilder();
}
项目:hops    文件:ContainerResourceIncreaseRequestPBImpl.java   
public ContainerResourceIncreaseRequestPBImpl(
    ContainerResourceIncreaseRequestProto proto) {
  this.proto = proto;
  viaProto = true;
}
项目:hops    文件:ContainerResourceIncreaseRequestPBImpl.java   
public ContainerResourceIncreaseRequestProto getProto() {
  mergeLocalToProto();
  proto = viaProto ? proto : builder.build();
  viaProto = true;
  return proto;
}
项目:hops    文件:ContainerResourceIncreaseRequestPBImpl.java   
private void maybeInitBuilder() {
  if (viaProto || builder == null) {
    builder = ContainerResourceIncreaseRequestProto.newBuilder(proto);
  }
  viaProto = false;
}
项目:hadoop-on-lustre2    文件:AllocateRequestPBImpl.java   
private ContainerResourceIncreaseRequestPBImpl convertFromProtoFormat(
    ContainerResourceIncreaseRequestProto p) {
  return new ContainerResourceIncreaseRequestPBImpl(p);
}
项目:hadoop-on-lustre2    文件:AllocateRequestPBImpl.java   
private ContainerResourceIncreaseRequestProto convertToProtoFormat(
    ContainerResourceIncreaseRequest t) {
  return ((ContainerResourceIncreaseRequestPBImpl) t).getProto();
}