private void initCommands() { if (this.commands != null) { return; } ContainerLaunchContextProtoOrBuilder p = viaProto ? proto : builder; List<String> list = p.getCommandList(); this.commands = new ArrayList<String>(); for (String c : list) { this.commands.add(c); } }
private void initLocalResources() { if (this.localResources != null) { return; } ContainerLaunchContextProtoOrBuilder p = viaProto ? proto : builder; List<StringLocalResourceMapProto> list = p.getLocalResourcesList(); this.localResources = new HashMap<String, LocalResource>(); for (StringLocalResourceMapProto c : list) { this.localResources.put(c.getKey(), convertFromProtoFormat(c.getValue())); } }
@Override public ByteBuffer getTokens() { ContainerLaunchContextProtoOrBuilder p = viaProto ? proto : builder; if (this.tokens != null) { return this.tokens; } if (!p.hasTokens()) { return null; } this.tokens = convertFromProtoFormat(p.getTokens()); return this.tokens; }
private void initServiceData() { if (this.serviceData != null) { return; } ContainerLaunchContextProtoOrBuilder p = viaProto ? proto : builder; List<StringBytesMapProto> list = p.getServiceDataList(); this.serviceData = new HashMap<String, ByteBuffer>(); for (StringBytesMapProto c : list) { this.serviceData.put(c.getKey(), convertFromProtoFormat(c.getValue())); } }
private void initEnv() { if (this.environment != null) { return; } ContainerLaunchContextProtoOrBuilder p = viaProto ? proto : builder; List<StringStringMapProto> list = p.getEnvironmentList(); this.environment = new HashMap<String, String>(); for (StringStringMapProto c : list) { this.environment.put(c.getKey(), c.getValue()); } }
private void initApplicationACLs() { if (this.applicationACLS != null) { return; } ContainerLaunchContextProtoOrBuilder p = viaProto ? proto : builder; List<ApplicationACLMapProto> list = p.getApplicationACLsList(); this.applicationACLS = new HashMap<ApplicationAccessType, String>(list .size()); for (ApplicationACLMapProto aclProto : list) { this.applicationACLS.put(ProtoUtils.convertFromProtoFormat(aclProto .getAccessType()), aclProto.getAcl()); } }