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

The following examples show how to use org.apache.hadoop.yarn.proto.YarnProtos.ApplicationIdProto. 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: NodeHeartbeatResponsePBImpl.java    License: Apache License 2.0 5 votes vote down vote up
private void initApplicationsToCleanup() {
  if (this.applicationsToCleanup != null) {
    return;
  }
  NodeHeartbeatResponseProtoOrBuilder p = viaProto ? proto : builder;
  List<ApplicationIdProto> list = p.getApplicationsToCleanupList();
  this.applicationsToCleanup = new ArrayList<ApplicationId>();

  for (ApplicationIdProto c : list) {
    this.applicationsToCleanup.add(convertFromProtoFormat(c));
  }
}
 
Example 2
Source Project: hadoop   Source File: NodeHeartbeatResponsePBImpl.java    License: Apache License 2.0 5 votes vote down vote up
private void addApplicationsToCleanupToProto() {
  maybeInitBuilder();
  builder.clearApplicationsToCleanup();
  if (applicationsToCleanup == null)
    return;
  Iterable<ApplicationIdProto> iterable = new Iterable<ApplicationIdProto>() {

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

        Iterator<ApplicationId> iter = applicationsToCleanup.iterator();

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

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

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

        }
      };

    }
  };
  builder.addAllApplicationsToCleanup(iterable);
}
 
Example 3
Source Project: hadoop   Source File: RegisterNodeManagerRequestPBImpl.java    License: Apache License 2.0 5 votes vote down vote up
private void initRunningApplications() {
  if (this.runningApplications != null) {
    return;
  }
  RegisterNodeManagerRequestProtoOrBuilder p = viaProto ? proto : builder;
  List<ApplicationIdProto> list = p.getRunningApplicationsList();
  this.runningApplications = new ArrayList<ApplicationId>();
  for (ApplicationIdProto c : list) {
    this.runningApplications.add(convertFromProtoFormat(c));
  }
}
 
Example 4
Source Project: hadoop   Source File: RegisterNodeManagerRequestPBImpl.java    License: Apache License 2.0 5 votes vote down vote up
private void addRunningApplicationsToProto() {
  maybeInitBuilder();
  builder.clearRunningApplications();
  if (runningApplications == null) {
    return;
  }
  Iterable<ApplicationIdProto> it = new Iterable<ApplicationIdProto>() {
    
    @Override
    public Iterator<ApplicationIdProto> iterator() {
      return new Iterator<ApplicationIdProto>() {
        Iterator<ApplicationId> iter = runningApplications.iterator();
        
        @Override
        public boolean hasNext() {
          return iter.hasNext();
        }
        
        @Override
        public ApplicationIdProto next() {
          return convertToProtoFormat(iter.next());  
        }
        
        @Override
        public void remove() {
          throw new UnsupportedOperationException();
        }
      };
    }
  };
  builder.addAllRunningApplications(it);
}
 
Example 5
Source Project: hadoop   Source File: NodeStatusPBImpl.java    License: Apache License 2.0 5 votes vote down vote up
private synchronized void addKeepAliveApplicationsToProto() {
  maybeInitBuilder();
  builder.clearKeepAliveApplications();
  if (keepAliveApplications == null)
    return;
  Iterable<ApplicationIdProto> iterable = new Iterable<ApplicationIdProto>() {
    @Override
    public Iterator<ApplicationIdProto> iterator() {
      return new Iterator<ApplicationIdProto>() {

        Iterator<ApplicationId> iter = keepAliveApplications.iterator();

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

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

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

        }
      };

    }
  };
  builder.addAllKeepAliveApplications(iterable);
}
 
Example 6
Source Project: hadoop   Source File: NodeStatusPBImpl.java    License: Apache License 2.0 5 votes vote down vote up
private synchronized void initKeepAliveApplications() {
  if (this.keepAliveApplications != null) {
    return;
  }
  NodeStatusProtoOrBuilder p = viaProto ? proto : builder;
  List<ApplicationIdProto> list = p.getKeepAliveApplicationsList();
  this.keepAliveApplications = new ArrayList<ApplicationId>();

  for (ApplicationIdProto c : list) {
    this.keepAliveApplications.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 initApplicationsToCleanup() {
  if (this.applicationsToCleanup != null) {
    return;
  }
  NodeHeartbeatResponseProtoOrBuilder p = viaProto ? proto : builder;
  List<ApplicationIdProto> list = p.getApplicationsToCleanupList();
  this.applicationsToCleanup = new ArrayList<ApplicationId>();

  for (ApplicationIdProto c : list) {
    this.applicationsToCleanup.add(convertFromProtoFormat(c));
  }
}
 
Example 8
Source Project: big-c   Source File: NodeHeartbeatResponsePBImpl.java    License: Apache License 2.0 5 votes vote down vote up
private void addApplicationsToCleanupToProto() {
  maybeInitBuilder();
  builder.clearApplicationsToCleanup();
  if (applicationsToCleanup == null)
    return;
  Iterable<ApplicationIdProto> iterable = new Iterable<ApplicationIdProto>() {

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

        Iterator<ApplicationId> iter = applicationsToCleanup.iterator();

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

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

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

        }
      };

    }
  };
  builder.addAllApplicationsToCleanup(iterable);
}
 
Example 9
Source Project: big-c   Source File: RegisterNodeManagerRequestPBImpl.java    License: Apache License 2.0 5 votes vote down vote up
private void initRunningApplications() {
  if (this.runningApplications != null) {
    return;
  }
  RegisterNodeManagerRequestProtoOrBuilder p = viaProto ? proto : builder;
  List<ApplicationIdProto> list = p.getRunningApplicationsList();
  this.runningApplications = new ArrayList<ApplicationId>();
  for (ApplicationIdProto c : list) {
    this.runningApplications.add(convertFromProtoFormat(c));
  }
}
 
Example 10
Source Project: big-c   Source File: RegisterNodeManagerRequestPBImpl.java    License: Apache License 2.0 5 votes vote down vote up
private void addRunningApplicationsToProto() {
  maybeInitBuilder();
  builder.clearRunningApplications();
  if (runningApplications == null) {
    return;
  }
  Iterable<ApplicationIdProto> it = new Iterable<ApplicationIdProto>() {
    
    @Override
    public Iterator<ApplicationIdProto> iterator() {
      return new Iterator<ApplicationIdProto>() {
        Iterator<ApplicationId> iter = runningApplications.iterator();
        
        @Override
        public boolean hasNext() {
          return iter.hasNext();
        }
        
        @Override
        public ApplicationIdProto next() {
          return convertToProtoFormat(iter.next());  
        }
        
        @Override
        public void remove() {
          throw new UnsupportedOperationException();
        }
      };
    }
  };
  builder.addAllRunningApplications(it);
}
 
Example 11
Source Project: big-c   Source File: NodeStatusPBImpl.java    License: Apache License 2.0 5 votes vote down vote up
private synchronized void addKeepAliveApplicationsToProto() {
  maybeInitBuilder();
  builder.clearKeepAliveApplications();
  if (keepAliveApplications == null)
    return;
  Iterable<ApplicationIdProto> iterable = new Iterable<ApplicationIdProto>() {
    @Override
    public Iterator<ApplicationIdProto> iterator() {
      return new Iterator<ApplicationIdProto>() {

        Iterator<ApplicationId> iter = keepAliveApplications.iterator();

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

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

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

        }
      };

    }
  };
  builder.addAllKeepAliveApplications(iterable);
}
 
Example 12
Source Project: big-c   Source File: ApplicationFinishDataPBImpl.java    License: Apache License 2.0 4 votes vote down vote up
private ApplicationIdPBImpl convertFromProtoFormat(
    ApplicationIdProto applicationId) {
  return new ApplicationIdPBImpl(applicationId);
}
 
Example 13
Source Project: ambari-metrics   Source File: ApplicationStartDataPBImpl.java    License: Apache License 2.0 4 votes vote down vote up
private ApplicationIdPBImpl convertFromProtoFormat(
    ApplicationIdProto applicationId) {
  return new ApplicationIdPBImpl(applicationId);
}
 
Example 14
private ApplicationIdProto convertToProtoFormat(ApplicationId applicationId) {
  return ((ApplicationIdPBImpl) applicationId).getProto();
}
 
Example 15
private ApplicationIdPBImpl convertFromProtoFormat(
    ApplicationIdProto applicationId) {
  return new ApplicationIdPBImpl(applicationId);
}
 
Example 16
Source Project: big-c   Source File: ApplicationFinishDataPBImpl.java    License: Apache License 2.0 4 votes vote down vote up
private ApplicationIdProto convertToProtoFormat(ApplicationId applicationId) {
  return ((ApplicationIdPBImpl) applicationId).getProto();
}
 
Example 17
Source Project: hadoop   Source File: GetApplicationReportRequestPBImpl.java    License: Apache License 2.0 4 votes vote down vote up
private ApplicationIdProto convertToProtoFormat(ApplicationId t) {
  return ((ApplicationIdPBImpl)t).getProto();
}
 
Example 18
private ApplicationIdPBImpl convertFromProtoFormat(ApplicationIdProto p) {
  return new ApplicationIdPBImpl(p);
}
 
Example 19
private ApplicationIdProto convertToProtoFormat(ApplicationId t) {
  return ((ApplicationIdPBImpl)t).getProto();
}
 
Example 20
Source Project: hadoop   Source File: GetNewApplicationResponsePBImpl.java    License: Apache License 2.0 4 votes vote down vote up
private ApplicationIdPBImpl convertFromProtoFormat(ApplicationIdProto p) {
  return new ApplicationIdPBImpl(p);
}
 
Example 21
Source Project: hadoop   Source File: GetNewApplicationResponsePBImpl.java    License: Apache License 2.0 4 votes vote down vote up
private ApplicationIdProto convertToProtoFormat(ApplicationId t) {
  return ((ApplicationIdPBImpl)t).getProto();
}
 
Example 22
private ApplicationIdPBImpl convertFromProtoFormat(ApplicationIdProto p) {
  return new ApplicationIdPBImpl(p);
}
 
Example 23
private ApplicationIdProto convertToProtoFormat(ApplicationId t) {
  return ((ApplicationIdPBImpl) t).getProto();
}
 
Example 24
private ApplicationIdPBImpl convertFromProtoFormat(ApplicationIdProto p) {
  return new ApplicationIdPBImpl(p);
}
 
Example 25
private ApplicationIdProto convertToProtoFormat(ApplicationId t) {
  return ((ApplicationIdPBImpl) t).getProto();
}
 
Example 26
Source Project: hadoop   Source File: KillApplicationRequestPBImpl.java    License: Apache License 2.0 4 votes vote down vote up
private ApplicationIdPBImpl convertFromProtoFormat(ApplicationIdProto p) {
  return new ApplicationIdPBImpl(p);
}
 
Example 27
Source Project: hadoop   Source File: KillApplicationRequestPBImpl.java    License: Apache License 2.0 4 votes vote down vote up
private ApplicationIdProto convertToProtoFormat(ApplicationId t) {
  return ((ApplicationIdPBImpl)t).getProto();
}
 
Example 28
private ApplicationIdPBImpl convertFromProtoFormat(ApplicationIdProto p) {
  return new ApplicationIdPBImpl(p);
}
 
Example 29
private ApplicationIdProto convertToProtoFormat(ApplicationId t) {
  return ((ApplicationIdPBImpl) t).getProto();
}
 
Example 30
Source Project: hadoop   Source File: ApplicationIdPBImpl.java    License: Apache License 2.0 4 votes vote down vote up
public ApplicationIdPBImpl() {
  builder = ApplicationIdProto.newBuilder();
}