Java Code Examples for org.apache.hadoop.yarn.proto.YarnProtos.ContainerIdProto

The following examples show how to use org.apache.hadoop.yarn.proto.YarnProtos.ContainerIdProto. These examples are extracted from open source projects. 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 Project: hadoop   Source File: StopContainersResponsePBImpl.java    License: Apache License 2.0 5 votes vote down vote up
private void addSucceededRequestsToProto() {
  maybeInitBuilder();
  builder.clearSucceededRequests();
  if (this.succeededRequests == null) {
    return;
  }
  Iterable<ContainerIdProto> iterable = new Iterable<ContainerIdProto>() {
    @Override
    public Iterator<ContainerIdProto> iterator() {
      return new Iterator<ContainerIdProto>() {

        Iterator<ContainerId> iter = succeededRequests.iterator();

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

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

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

        }
      };
    }
  };
  builder.addAllSucceededRequests(iterable);
}
 
Example 2
Source Project: hadoop   Source File: StopContainersResponsePBImpl.java    License: Apache License 2.0 5 votes vote down vote up
private void initSucceededRequests() {
  if (this.succeededRequests != null)
    return;
  StopContainersResponseProtoOrBuilder p = viaProto ? proto : builder;
  List<ContainerIdProto> list = p.getSucceededRequestsList();
  this.succeededRequests = new ArrayList<ContainerId>();
  for (ContainerIdProto c : list) {
    this.succeededRequests.add(convertFromProtoFormat(c));
  }
}
 
Example 3
Source Project: hadoop   Source File: AllocateRequestPBImpl.java    License: Apache License 2.0 5 votes vote down vote up
private void initReleases() {
  if (this.release != null) {
    return;
  }
  AllocateRequestProtoOrBuilder p = viaProto ? proto : builder;
  List<ContainerIdProto> list = p.getReleaseList();
  this.release = new ArrayList<ContainerId>();

  for (ContainerIdProto c : list) {
    this.release.add(convertFromProtoFormat(c));
  }
}
 
Example 4
Source Project: hadoop   Source File: AllocateRequestPBImpl.java    License: Apache License 2.0 5 votes vote down vote up
private void addReleasesToProto() {
  maybeInitBuilder();
  builder.clearRelease();
  if (release == null)
    return;
  Iterable<ContainerIdProto> iterable = new Iterable<ContainerIdProto>() {
    @Override
    public Iterator<ContainerIdProto> iterator() {
      return new Iterator<ContainerIdProto>() {

        Iterator<ContainerId> iter = release.iterator();

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

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

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

        }
      };

    }
  };
  builder.addAllRelease(iterable);
}
 
Example 5
Source Project: hadoop   Source File: StartContainersResponsePBImpl.java    License: Apache License 2.0 5 votes vote down vote up
private void addSucceededContainersToProto() {
  maybeInitBuilder();
  builder.clearSucceededRequests();
  if (this.succeededContainers == null) {
    return;
  }
  Iterable<ContainerIdProto> iterable = new Iterable<ContainerIdProto>() {
    @Override
    public Iterator<ContainerIdProto> iterator() {
      return new Iterator<ContainerIdProto>() {

        Iterator<ContainerId> iter = succeededContainers.iterator();

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

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

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

        }
      };
    }
  };
  builder.addAllSucceededRequests(iterable);
}
 
Example 6
Source Project: hadoop   Source File: StartContainersResponsePBImpl.java    License: Apache License 2.0 5 votes vote down vote up
private void initSucceededContainers() {
  if (this.succeededContainers != null)
    return;
  StartContainersResponseProtoOrBuilder p = viaProto ? proto : builder;
  List<ContainerIdProto> list = p.getSucceededRequestsList();
  this.succeededContainers = new ArrayList<ContainerId>();
  for (ContainerIdProto c : list) {
    this.succeededContainers.add(convertFromProtoFormat(c));
  }
}
 
Example 7
Source Project: big-c   Source File: NodeHeartbeatResponsePBImpl.java    License: Apache License 2.0 5 votes vote down vote up
private void addContainersToCleanupToProto() {
  maybeInitBuilder();
  builder.clearContainersToCleanup();
  if (containersToCleanup == null)
    return;
  Iterable<ContainerIdProto> iterable = new Iterable<ContainerIdProto>() {

    @Override
    public Iterator<ContainerIdProto> iterator() {
      return new Iterator<ContainerIdProto>() {

        Iterator<ContainerId> iter = containersToCleanup.iterator();

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

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

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

        }
      };

    }
  };
  builder.addAllContainersToCleanup(iterable);
}
 
Example 8
Source Project: big-c   Source File: StartContainersResponsePBImpl.java    License: Apache License 2.0 5 votes vote down vote up
private void initSucceededContainers() {
  if (this.succeededContainers != null)
    return;
  StartContainersResponseProtoOrBuilder p = viaProto ? proto : builder;
  List<ContainerIdProto> list = p.getSucceededRequestsList();
  this.succeededContainers = new ArrayList<ContainerId>();
  for (ContainerIdProto c : list) {
    this.succeededContainers.add(convertFromProtoFormat(c));
  }
}
 
Example 9
Source Project: hadoop   Source File: NodeHeartbeatResponsePBImpl.java    License: Apache License 2.0 5 votes vote down vote up
private void initContainersToCleanup() {
  if (this.containersToCleanup != null) {
    return;
  }
  NodeHeartbeatResponseProtoOrBuilder p = viaProto ? proto : builder;
  List<ContainerIdProto> list = p.getContainersToCleanupList();
  this.containersToCleanup = new ArrayList<ContainerId>();

  for (ContainerIdProto c : list) {
    this.containersToCleanup.add(convertFromProtoFormat(c));
  }
}
 
Example 10
Source Project: big-c   Source File: StartContainersResponsePBImpl.java    License: Apache License 2.0 5 votes vote down vote up
private void addSucceededContainersToProto() {
  maybeInitBuilder();
  builder.clearSucceededRequests();
  if (this.succeededContainers == null) {
    return;
  }
  Iterable<ContainerIdProto> iterable = new Iterable<ContainerIdProto>() {
    @Override
    public Iterator<ContainerIdProto> iterator() {
      return new Iterator<ContainerIdProto>() {

        Iterator<ContainerId> iter = succeededContainers.iterator();

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

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

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

        }
      };
    }
  };
  builder.addAllSucceededRequests(iterable);
}
 
Example 11
Source Project: big-c   Source File: NodeHeartbeatResponsePBImpl.java    License: Apache License 2.0 5 votes vote down vote up
private void addContainersToBeRemovedFromNMToProto() {
  maybeInitBuilder();
  builder.clearContainersToBeRemovedFromNm();
  if (containersToBeRemovedFromNM == null)
    return;
  Iterable<ContainerIdProto> iterable = new Iterable<ContainerIdProto>() {

    @Override
    public Iterator<ContainerIdProto> iterator() {
      return new Iterator<ContainerIdProto>() {

        Iterator<ContainerId> iter = containersToBeRemovedFromNM.iterator();

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

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

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

        }
      };

    }
  };
  builder.addAllContainersToBeRemovedFromNm(iterable);
}
 
Example 12
Source Project: hadoop   Source File: NodeHeartbeatResponsePBImpl.java    License: Apache License 2.0 5 votes vote down vote up
private void addContainersToBeRemovedFromNMToProto() {
  maybeInitBuilder();
  builder.clearContainersToBeRemovedFromNm();
  if (containersToBeRemovedFromNM == null)
    return;
  Iterable<ContainerIdProto> iterable = new Iterable<ContainerIdProto>() {

    @Override
    public Iterator<ContainerIdProto> iterator() {
      return new Iterator<ContainerIdProto>() {

        Iterator<ContainerId> iter = containersToBeRemovedFromNM.iterator();

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

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

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

        }
      };

    }
  };
  builder.addAllContainersToBeRemovedFromNm(iterable);
}
 
Example 13
Source Project: big-c   Source File: GetContainerStatusesRequestPBImpl.java    License: Apache License 2.0 5 votes vote down vote up
private void addLocalContainerIdsToProto() {
  maybeInitBuilder();
  builder.clearContainerId();
  if (this.containerIds == null)
    return;
  List<ContainerIdProto> protoList = new ArrayList<ContainerIdProto>();
  for (ContainerId id : containerIds) {
    protoList.add(convertToProtoFormat(id));
  }
  builder.addAllContainerId(protoList);
}
 
Example 14
Source Project: big-c   Source File: StopContainersRequestPBImpl.java    License: Apache License 2.0 5 votes vote down vote up
private void addLocalContainerIdsToProto() {
  maybeInitBuilder();
  builder.clearContainerId();
  if (this.containerIds == null)
    return;
  List<ContainerIdProto> protoList = new ArrayList<ContainerIdProto>();
  for (ContainerId id : containerIds) {
    protoList.add(convertToProtoFormat(id));
  }
  builder.addAllContainerId(protoList);
}
 
Example 15
Source Project: big-c   Source File: AllocateRequestPBImpl.java    License: Apache License 2.0 5 votes vote down vote up
private void initReleases() {
  if (this.release != null) {
    return;
  }
  AllocateRequestProtoOrBuilder p = viaProto ? proto : builder;
  List<ContainerIdProto> list = p.getReleaseList();
  this.release = new ArrayList<ContainerId>();

  for (ContainerIdProto c : list) {
    this.release.add(convertFromProtoFormat(c));
  }
}
 
Example 16
Source Project: big-c   Source File: AllocateRequestPBImpl.java    License: Apache License 2.0 5 votes vote down vote up
private void addReleasesToProto() {
  maybeInitBuilder();
  builder.clearRelease();
  if (release == null)
    return;
  Iterable<ContainerIdProto> iterable = new Iterable<ContainerIdProto>() {
    @Override
    public Iterator<ContainerIdProto> iterator() {
      return new Iterator<ContainerIdProto>() {

        Iterator<ContainerId> iter = release.iterator();

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

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

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

        }
      };

    }
  };
  builder.addAllRelease(iterable);
}
 
Example 17
Source Project: ambari-metrics   Source File: ContainerFinishDataPBImpl.java    License: Apache License 2.0 4 votes vote down vote up
private ContainerIdProto convertToProtoFormat(ContainerId containerId) {
  return ((ContainerIdPBImpl) containerId).getProto();
}
 
Example 18
Source Project: ambari-metrics   Source File: ContainerFinishDataPBImpl.java    License: Apache License 2.0 4 votes vote down vote up
private ContainerIdPBImpl
    convertFromProtoFormat(ContainerIdProto containerId) {
  return new ContainerIdPBImpl(containerId);
}
 
Example 19
Source Project: big-c   Source File: ContainerResourceIncreasePBImpl.java    License: Apache License 2.0 4 votes vote down vote up
private ContainerIdProto convertToProtoFormat(ContainerId t) {
  return ((ContainerIdPBImpl) t).getProto();
}
 
Example 20
Source Project: ambari-metrics   Source File: ContainerStartDataPBImpl.java    License: Apache License 2.0 4 votes vote down vote up
private ContainerIdPBImpl
    convertFromProtoFormat(ContainerIdProto containerId) {
  return new ContainerIdPBImpl(containerId);
}
 
Example 21
private ContainerIdPBImpl
    convertFromProtoFormat(ContainerIdProto containerId) {
  return new ContainerIdPBImpl(containerId);
}
 
Example 22
private ContainerIdProto convertToProtoFormat(ContainerId masterContainerId) {
  return ((ContainerIdPBImpl) masterContainerId).getProto();
}
 
Example 23
Source Project: big-c   Source File: ApplicationAttemptReportPBImpl.java    License: Apache License 2.0 4 votes vote down vote up
private ContainerIdProto convertToProtoFormat(ContainerId amContainerId) {
  return ((ContainerIdPBImpl) amContainerId).getProto();
}
 
Example 24
Source Project: big-c   Source File: TaskAttemptReportPBImpl.java    License: Apache License 2.0 4 votes vote down vote up
private ContainerIdPBImpl convertFromProtoFormat(ContainerIdProto p) {
  return new ContainerIdPBImpl(p);
}
 
Example 25
Source Project: hadoop   Source File: GetContainerStatusesRequestPBImpl.java    License: Apache License 2.0 4 votes vote down vote up
private ContainerIdProto convertToProtoFormat(ContainerId t) {
  return ((ContainerIdPBImpl) t).getProto();
}
 
Example 26
Source Project: hadoop   Source File: StopContainersResponsePBImpl.java    License: Apache License 2.0 4 votes vote down vote up
private ContainerIdPBImpl convertFromProtoFormat(ContainerIdProto p) {
  return new ContainerIdPBImpl(p);
}
 
Example 27
Source Project: hadoop   Source File: StopContainersResponsePBImpl.java    License: Apache License 2.0 4 votes vote down vote up
private ContainerIdProto convertToProtoFormat(ContainerId t) {
  return ((ContainerIdPBImpl) t).getProto();
}
 
Example 28
Source Project: big-c   Source File: NodeContainerUpdatePBImpl.java    License: Apache License 2.0 4 votes vote down vote up
private ContainerIdProto convertToProtoFormat(ContainerId t) {
	    return ((ContainerIdPBImpl)t).getProto();
}
 
Example 29
Source Project: hadoop   Source File: StopContainersRequestPBImpl.java    License: Apache License 2.0 4 votes vote down vote up
private ContainerIdPBImpl convertFromProtoFormat(ContainerIdProto p) {
  return new ContainerIdPBImpl(p);
}
 
Example 30
Source Project: hadoop   Source File: StopContainersRequestPBImpl.java    License: Apache License 2.0 4 votes vote down vote up
private ContainerIdProto convertToProtoFormat(ContainerId t) {
  return ((ContainerIdPBImpl) t).getProto();
}