private static Token<?> getDelegationTokenFromHS(HSClientProtocol hsProxy, Configuration conf) throws IOException { GetDelegationTokenRequest request = RecordFactoryProvider.getRecordFactory(null).newRecordInstance(GetDelegationTokenRequest.class); request.setRenewer(Master.getMasterPrincipal(conf)); org.apache.hadoop.yarn.api.records.Token mrDelegationToken; mrDelegationToken = hsProxy.getDelegationToken(request).getDelegationToken(); return ConverterUtils.convertFromYarn(mrDelegationToken, hsProxy.getConnectAddress()); }
public static RecordFactory getRecordFactory(Configuration conf) { if (conf == null) { //Assuming the default configuration has the correct factories set. //Users can specify a particular factory by providing a configuration. conf = defaultConf; } String recordFactoryClassName = conf.get( YarnConfiguration.IPC_RECORD_FACTORY_CLASS, YarnConfiguration.DEFAULT_IPC_RECORD_FACTORY_CLASS); return (RecordFactory) getFactoryClassInstance(recordFactoryClassName); }
@Inject public ApplicationBlock(Context nmContext, Configuration conf) { this.conf = conf; this.nmContext = nmContext; this.recordFactory = RecordFactoryProvider.getRecordFactory(this.conf); }
public static RecordFactory getRecordFactory(Configuration conf) { if (conf == null) { //Assuming the default configuration has the correct factories set. //Users can specify a particular factory by providing a configuration. conf = defaultConf; } String recordFactoryClassName = conf.get( YarnConfiguration.IPC_RECORD_FACTORY_CLASS, YarnConfiguration.DEFAULT_IPC_RECORD_FACTORY_CLASS); return (RecordFactory) getFactoryClassInstance(recordFactoryClassName); }
@Inject public ApplicationBlock(Context nmContext, Configuration conf) { this.conf = conf; this.nmContext = nmContext; this.recordFactory = RecordFactoryProvider.getRecordFactory(this.conf); }
public static RecordFactory getRecordFactory(Configuration conf) { if (conf == null) { //Assuming the default configuration has the correct factories set. //Users can specify a particular factory by providing a configuration. conf = defaultConf; } String recordFactoryClassName = conf.get( YarnConfiguration.IPC_RECORD_FACTORY_CLASS, YarnConfiguration.DEFAULT_IPC_RECORD_FACTORY_CLASS); return (RecordFactory) getFactoryClassInstance(recordFactoryClassName); }
@Inject public ApplicationBlock(Context nmContext, Configuration conf) { this.conf = conf; this.nmContext = nmContext; this.recordFactory = RecordFactoryProvider.getRecordFactory(this.conf); }
public static RecordFactory getRecordFactory(Configuration conf) { if (conf == null) { //Assuming the default configuration has the correct factories set. //Users can specify a particular factory by providing a configuration. conf = defaultConf; } String recordFactoryClassName = conf.get( YarnConfiguration.IPC_RECORD_FACTORY_CLASS, YarnConfiguration.DEFAULT_IPC_RECORD_FACTORY_CLASS); return (RecordFactory) getFactoryClassInstance(recordFactoryClassName); }
@Inject public ApplicationBlock(Context nmContext, Configuration conf) { this.conf = conf; this.nmContext = nmContext; this.recordFactory = RecordFactoryProvider.getRecordFactory(this.conf); }
public static org.apache.hadoop.yarn.api.records.Priority create(int prio) { org.apache.hadoop.yarn.api.records.Priority priority = RecordFactoryProvider.getRecordFactory(null).newRecordInstance(org.apache.hadoop.yarn.api.records.Priority.class); priority.setPriority(prio); return priority; }
public static org.apache.hadoop.yarn.api.records.Priority create(int prio) { org.apache.hadoop.yarn.api.records.Priority priority = RecordFactoryProvider.getRecordFactory(null).newRecordInstance(org.apache.hadoop.yarn.api.records.Priority.class); priority.setPriority(prio); return priority; }
public static URL getYarnUrlFromURI(URI uri) { URL url = RecordFactoryProvider.getRecordFactory(null).newRecordInstance(URL.class); if (uri.getHost() != null) { url.setHost(uri.getHost()); } if (uri.getUserInfo() != null) { url.setUserInfo(uri.getUserInfo()); } url.setPort(uri.getPort()); url.setScheme(uri.getScheme()); url.setFile(uri.getPath()); return url; }
public static URL getYarnUrlFromURI(URI uri) { URL url = RecordFactoryProvider.getRecordFactory(null).newRecordInstance(URL.class); if (uri.getHost() != null) { url.setHost(uri.getHost()); } if (uri.getUserInfo() != null) { url.setUserInfo(uri.getUserInfo()); } url.setPort(uri.getPort()); url.setScheme(uri.getScheme()); url.setFile(uri.getPath()); return url; }
/** * @param resource the local resource that contains the original remote path * @param localPath the path in the local filesystem where the resource is * localized * @param fs the filesystem of the shared cache * @param localFs the local filesystem */ public SharedCacheUploader(LocalResource resource, Path localPath, String user, Configuration conf, SCMUploaderProtocol scmClient, FileSystem fs, FileSystem localFs) { this.resource = resource; this.localPath = localPath; this.user = user; this.conf = conf; this.scmClient = scmClient; this.fs = fs; this.sharedCacheRootDir = conf.get(YarnConfiguration.SHARED_CACHE_ROOT, YarnConfiguration.DEFAULT_SHARED_CACHE_ROOT); this.nestedLevel = SharedCacheUtil.getCacheDepth(conf); this.checksum = SharedCacheChecksumFactory.getChecksum(conf); this.localFs = localFs; this.recordFactory = RecordFactoryProvider.getRecordFactory(null); }
/** * @param resource the local resource that contains the original remote path * @param localPath the path in the local filesystem where the resource is * localized * @param fs the filesystem of the shared cache * @param localFs the local filesystem */ public SharedCacheUploader(LocalResource resource, Path localPath, String user, Configuration conf, SCMUploaderProtocol scmClient, FileSystem fs, FileSystem localFs) { this.resource = resource; this.localPath = localPath; this.user = user; this.conf = conf; this.scmClient = scmClient; this.fs = fs; this.sharedCacheRootDir = conf.get(YarnConfiguration.SHARED_CACHE_ROOT, YarnConfiguration.DEFAULT_SHARED_CACHE_ROOT); this.nestedLevel = SharedCacheUtil.getCacheDepth(conf); this.checksum = SharedCacheChecksumFactory.getChecksum(conf); this.localFs = localFs; this.recordFactory = RecordFactoryProvider.getRecordFactory(null); }
/** * @param resource the local resource that contains the original remote path * @param localPath the path in the local filesystem where the resource is * localized * @param fs the filesystem of the shared cache * @param localFs the local filesystem */ public SharedCacheUploader(LocalResource resource, Path localPath, String user, Configuration conf, SCMUploaderProtocol scmClient, FileSystem fs, FileSystem localFs) { this.resource = resource; this.localPath = localPath; this.user = user; this.conf = conf; this.scmClient = scmClient; this.fs = fs; this.sharedCacheRootDir = conf.get(YarnConfiguration.SHARED_CACHE_ROOT, YarnConfiguration.DEFAULT_SHARED_CACHE_ROOT); this.nestedLevel = SharedCacheUtil.getCacheDepth(conf); this.checksum = SharedCacheChecksumFactory.getChecksum(conf); this.localFs = localFs; this.recordFactory = RecordFactoryProvider.getRecordFactory(null); }
new ContainerLocalizer(FileContext.getLocalFSFileContext(), user, appId, locId, localDirs, RecordFactoryProvider.getRecordFactory(null)); int nRet = localizer.runLocalization(nmAddr); if (LOG.isDebugEnabled()) {
@Private @VisibleForTesting public static URL fromURI(URI uri, Configuration conf) { URL url = RecordFactoryProvider.getRecordFactory(conf).newRecordInstance( URL.class); if (uri.getHost() != null) { url.setHost(uri.getHost()); } if (uri.getUserInfo() != null) { url.setUserInfo(uri.getUserInfo()); } url.setPort(uri.getPort()); url.setScheme(uri.getScheme()); url.setFile(uri.getPath()); return url; }
/** * @param resource the local resource that contains the original remote path * @param localPath the path in the local filesystem where the resource is * localized * @param fs the filesystem of the shared cache * @param localFs the local filesystem */ public SharedCacheUploader(LocalResource resource, Path localPath, String user, Configuration conf, SCMUploaderProtocol scmClient, FileSystem fs, FileSystem localFs) { this.resource = resource; this.localPath = localPath; this.user = user; this.conf = conf; this.scmClient = scmClient; this.fs = fs; this.sharedCacheRootDir = conf.get(YarnConfiguration.SHARED_CACHE_ROOT, YarnConfiguration.DEFAULT_SHARED_CACHE_ROOT); this.nestedLevel = SharedCacheUtil.getCacheDepth(conf); this.checksum = SharedCacheChecksumFactory.getChecksum(conf); this.localFs = localFs; this.recordFactory = RecordFactoryProvider.getRecordFactory(null); }
new ContainerLocalizer(FileContext.getLocalFSFileContext(), user, appId, locId, localDirs, RecordFactoryProvider.getRecordFactory(null), userFolder); localizer.runLocalization(nmAddr); return;