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

The following examples show how to use org.apache.hadoop.yarn.proto.YarnProtos.YarnApplicationStateProto. 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: GetApplicationsRequestPBImpl.java    License: Apache License 2.0 5 votes vote down vote up
private void initApplicationStates() {
  if (this.applicationStates != null) {
    return;
  }
  GetApplicationsRequestProtoOrBuilder p = viaProto ? proto : builder;
  List<YarnApplicationStateProto> appStatesList =
      p.getApplicationStatesList();
  this.applicationStates = EnumSet.noneOf(YarnApplicationState.class);

  for (YarnApplicationStateProto c : appStatesList) {
    this.applicationStates.add(ProtoUtils.convertFromProtoFormat(c));
  }
}
 
Example 2
Source Project: big-c   Source File: GetApplicationsRequestPBImpl.java    License: Apache License 2.0 5 votes vote down vote up
private void initApplicationStates() {
  if (this.applicationStates != null) {
    return;
  }
  GetApplicationsRequestProtoOrBuilder p = viaProto ? proto : builder;
  List<YarnApplicationStateProto> appStatesList =
      p.getApplicationStatesList();
  this.applicationStates = EnumSet.noneOf(YarnApplicationState.class);

  for (YarnApplicationStateProto c : appStatesList) {
    this.applicationStates.add(ProtoUtils.convertFromProtoFormat(c));
  }
}
 
Example 3
private YarnApplicationStateProto convertToProtoFormat(
    YarnApplicationState state) {
  return ProtoUtils.convertToProtoFormat(state);
}
 
Example 4
private YarnApplicationState convertFromProtoFormat(
    YarnApplicationStateProto yarnApplicationState) {
  return ProtoUtils.convertFromProtoFormat(yarnApplicationState);
}
 
Example 5
Source Project: hadoop   Source File: GetApplicationsRequestPBImpl.java    License: Apache License 2.0 4 votes vote down vote up
private void mergeLocalToBuilder() {
  if (applicationTypes != null && !applicationTypes.isEmpty()) {
    builder.clearApplicationTypes();
    builder.addAllApplicationTypes(applicationTypes);
  }
  if (applicationStates != null && !applicationStates.isEmpty()) {
    builder.clearApplicationStates();
    builder.addAllApplicationStates(Iterables.transform(applicationStates,
        new Function<YarnApplicationState, YarnApplicationStateProto>() {
          @Override
          public YarnApplicationStateProto apply(YarnApplicationState input) {
            return ProtoUtils.convertToProtoFormat(input);
          }
        }));
  }
  if (applicationTags != null && !applicationTags.isEmpty()) {
    builder.clearApplicationTags();
    builder.addAllApplicationTags(this.applicationTags);
  }
  if (scope != null) {
    builder.setScope(ProtoUtils.convertToProtoFormat(scope));
  }
  if (start != null) {
    builder.setStartBegin(start.getMinimumLong());
    builder.setStartEnd(start.getMaximumLong());
  }
  if (finish != null) {
    builder.setFinishBegin(finish.getMinimumLong());
    builder.setFinishEnd(finish.getMaximumLong());
  }
  if (limit != Long.MAX_VALUE) {
    builder.setLimit(limit);
  }
  if (users != null && !users.isEmpty()) {
    builder.clearUsers();
    builder.addAllUsers(users);
  }
  if (queues != null && !queues.isEmpty()) {
    builder.clearQueues();
    builder.addAllQueues(queues);
  }
}
 
Example 6
Source Project: hadoop   Source File: ProtoUtils.java    License: Apache License 2.0 4 votes vote down vote up
public static YarnApplicationStateProto convertToProtoFormat(YarnApplicationState e) {
  return YarnApplicationStateProto.valueOf(e.name());
}
 
Example 7
Source Project: hadoop   Source File: ProtoUtils.java    License: Apache License 2.0 4 votes vote down vote up
public static YarnApplicationState convertFromProtoFormat(YarnApplicationStateProto e) {
  return YarnApplicationState.valueOf(e.name());
}
 
Example 8
Source Project: hadoop   Source File: ApplicationReportPBImpl.java    License: Apache License 2.0 4 votes vote down vote up
private YarnApplicationState convertFromProtoFormat(YarnApplicationStateProto s) {
  return ProtoUtils.convertFromProtoFormat(s);
}
 
Example 9
Source Project: hadoop   Source File: ApplicationReportPBImpl.java    License: Apache License 2.0 4 votes vote down vote up
private YarnApplicationStateProto convertToProtoFormat(YarnApplicationState s) {
  return ProtoUtils.convertToProtoFormat(s);
}
 
Example 10
Source Project: hadoop   Source File: ApplicationFinishDataPBImpl.java    License: Apache License 2.0 4 votes vote down vote up
private YarnApplicationStateProto convertToProtoFormat(
    YarnApplicationState state) {
  return ProtoUtils.convertToProtoFormat(state);
}
 
Example 11
Source Project: hadoop   Source File: ApplicationFinishDataPBImpl.java    License: Apache License 2.0 4 votes vote down vote up
private YarnApplicationState convertFromProtoFormat(
    YarnApplicationStateProto yarnApplicationState) {
  return ProtoUtils.convertFromProtoFormat(yarnApplicationState);
}
 
Example 12
Source Project: big-c   Source File: GetApplicationsRequestPBImpl.java    License: Apache License 2.0 4 votes vote down vote up
private void mergeLocalToBuilder() {
  if (applicationTypes != null && !applicationTypes.isEmpty()) {
    builder.clearApplicationTypes();
    builder.addAllApplicationTypes(applicationTypes);
  }
  if (applicationStates != null && !applicationStates.isEmpty()) {
    builder.clearApplicationStates();
    builder.addAllApplicationStates(Iterables.transform(applicationStates,
        new Function<YarnApplicationState, YarnApplicationStateProto>() {
          @Override
          public YarnApplicationStateProto apply(YarnApplicationState input) {
            return ProtoUtils.convertToProtoFormat(input);
          }
        }));
  }
  if (applicationTags != null && !applicationTags.isEmpty()) {
    builder.clearApplicationTags();
    builder.addAllApplicationTags(this.applicationTags);
  }
  if (scope != null) {
    builder.setScope(ProtoUtils.convertToProtoFormat(scope));
  }
  if (start != null) {
    builder.setStartBegin(start.getMinimumLong());
    builder.setStartEnd(start.getMaximumLong());
  }
  if (finish != null) {
    builder.setFinishBegin(finish.getMinimumLong());
    builder.setFinishEnd(finish.getMaximumLong());
  }
  if (limit != Long.MAX_VALUE) {
    builder.setLimit(limit);
  }
  if (users != null && !users.isEmpty()) {
    builder.clearUsers();
    builder.addAllUsers(users);
  }
  if (queues != null && !queues.isEmpty()) {
    builder.clearQueues();
    builder.addAllQueues(queues);
  }
}
 
Example 13
Source Project: big-c   Source File: ProtoUtils.java    License: Apache License 2.0 4 votes vote down vote up
public static YarnApplicationStateProto convertToProtoFormat(YarnApplicationState e) {
  return YarnApplicationStateProto.valueOf(e.name());
}
 
Example 14
Source Project: big-c   Source File: ProtoUtils.java    License: Apache License 2.0 4 votes vote down vote up
public static YarnApplicationState convertFromProtoFormat(YarnApplicationStateProto e) {
  return YarnApplicationState.valueOf(e.name());
}
 
Example 15
Source Project: big-c   Source File: ApplicationReportPBImpl.java    License: Apache License 2.0 4 votes vote down vote up
private YarnApplicationState convertFromProtoFormat(YarnApplicationStateProto s) {
  return ProtoUtils.convertFromProtoFormat(s);
}
 
Example 16
Source Project: big-c   Source File: ApplicationReportPBImpl.java    License: Apache License 2.0 4 votes vote down vote up
private YarnApplicationStateProto convertToProtoFormat(YarnApplicationState s) {
  return ProtoUtils.convertToProtoFormat(s);
}
 
Example 17
Source Project: big-c   Source File: ApplicationFinishDataPBImpl.java    License: Apache License 2.0 4 votes vote down vote up
private YarnApplicationStateProto convertToProtoFormat(
    YarnApplicationState state) {
  return ProtoUtils.convertToProtoFormat(state);
}
 
Example 18
Source Project: big-c   Source File: ApplicationFinishDataPBImpl.java    License: Apache License 2.0 4 votes vote down vote up
private YarnApplicationState convertFromProtoFormat(
    YarnApplicationStateProto yarnApplicationState) {
  return ProtoUtils.convertFromProtoFormat(yarnApplicationState);
}