private void initApplicationTypes() { if (this.applicationTypes != null) { return; } GetApplicationsRequestProtoOrBuilder p = viaProto ? proto : builder; List<String> appTypeList = p.getApplicationTypesList(); this.applicationTypes = new HashSet<String>(); this.applicationTypes.addAll(appTypeList); }
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)); } }
private void initUsers() { if (this.users != null) { return; } GetApplicationsRequestProtoOrBuilder p = viaProto ? proto : builder; List<String> usersList = p.getUsersList(); this.users = new HashSet<String>(); this.users.addAll(usersList); }
private void initQueues() { if (this.queues != null) { return; } GetApplicationsRequestProtoOrBuilder p = viaProto ? proto : builder; List<String> queuesList = p.getQueuesList(); this.queues = new HashSet<String>(); this.queues.addAll(queuesList); }
private void initApplicationTags() { if (this.applicationTags != null) { return; } GetApplicationsRequestProtoOrBuilder p = viaProto ? proto : builder; this.applicationTags = new HashSet<String>(); this.applicationTags.addAll(p.getApplicationTagsList()); }
private void initScope() { if (this.scope != null) { return; } GetApplicationsRequestProtoOrBuilder p = viaProto ? proto : builder; this.scope = ProtoUtils.convertFromProtoFormat(p.getScope()); }
@Override public long getLimit() { if (this.limit == Long.MAX_VALUE) { GetApplicationsRequestProtoOrBuilder p = viaProto ? proto : builder; this.limit = p.hasLimit() ? p.getLimit() : Long.MAX_VALUE; } return this.limit; }
@Override public LongRange getStartRange() { if (this.start == null) { GetApplicationsRequestProtoOrBuilder p = viaProto ? proto: builder; if (p.hasStartBegin() || p.hasStartEnd()) { long begin = p.hasStartBegin() ? p.getStartBegin() : 0L; long end = p.hasStartEnd() ? p.getStartEnd() : Long.MAX_VALUE; this.start = new LongRange(begin, end); } } return this.start; }
@Override public LongRange getFinishRange() { if (this.finish == null) { GetApplicationsRequestProtoOrBuilder p = viaProto ? proto: builder; if (p.hasFinishBegin() || p.hasFinishEnd()) { long begin = p.hasFinishBegin() ? p.getFinishBegin() : 0L; long end = p.hasFinishEnd() ? p.getFinishEnd() : Long.MAX_VALUE; this.finish = new LongRange(begin, end); } } return this.finish; }