@Override public <U> List<U> getInstances(String name, Class<U> xface) { return encapsulated.getInstances(name, xface); }
@Override public <U> List<U> getInstances(String name, Class<U> xface) { return encapsulated.getInstances(name, xface); }
@Override public <U> List<U> getInstances(String name, Class<U> xface) { return conf.getInstances(name, xface); }
private List<OutputFormat> getNewApiFormats(Configuration cfg) { if (newApiFormat == null) { newApiFormat = cfg.getInstances(CFG_FIELD, OutputFormat.class); } return newApiFormat; }
private List<org.apache.hadoop.mapred.OutputFormat> getOldApiFormats(Configuration cfg) { if (oldApiFormat == null) { oldApiFormat = cfg.getInstances(CFG_FIELD, org.apache.hadoop.mapred.OutputFormat.class); } return oldApiFormat; } }
private IdentityProvider parseIdentityProvider(String ns, Configuration conf) { List<IdentityProvider> providers = conf.getInstances( ns + "." + CommonConfigurationKeys.IPC_IDENTITY_PROVIDER_KEY, IdentityProvider.class); if (providers.size() < 1) { LOG.info("IdentityProvider not specified, " + "defaulting to UserIdentityProvider"); return new UserIdentityProvider(); } return providers.get(0); // use the first }
private void startPlugins(Configuration conf) { try { plugins = conf.getInstances(DFS_DATANODE_PLUGINS_KEY, ServicePlugin.class); } catch (RuntimeException e) { String pluginsValue = conf.get(DFS_DATANODE_PLUGINS_KEY); LOG.error("Unable to load DataNode plugins. " + "Specified list of plugins: {}", pluginsValue, e); throw e; } for (ServicePlugin p: plugins) { try { p.start(this); LOG.info("Started plug-in {}", p); } catch (Throwable t) { LOG.warn("ServicePlugin {} could not be started", p, t); } } }
plugins = conf.getInstances(DFS_NAMENODE_PLUGINS_KEY, ServicePlugin.class); } catch (RuntimeException e) {
protected List<ApplicationMasterServiceProcessor> getProcessorList( Configuration conf) { return conf.getInstances( YarnConfiguration.RM_APPLICATION_MASTER_SERVICE_PROCESSORS, ApplicationMasterServiceProcessor.class); }
private List<OutputFormat> getNewApiFormats(Configuration cfg) { if (newApiFormat == null) { newApiFormat = cfg.getInstances(CFG_FIELD, OutputFormat.class); } return newApiFormat; }
@Override public <U> List<U> getInstances(String name, Class<U> xface) { return encapsulated.getInstances(name, xface); }
private List<org.apache.hadoop.mapred.OutputFormat> getOldApiFormats(Configuration cfg) { if (oldApiFormat == null) { oldApiFormat = cfg.getInstances(CFG_FIELD, org.apache.hadoop.mapred.OutputFormat.class); } return oldApiFormat; } }
private List<OutputFormat> getNewApiFormats(Configuration cfg) { if (newApiFormat == null) { newApiFormat = cfg.getInstances(CFG_FIELD, OutputFormat.class); } return newApiFormat; }
private List<org.apache.hadoop.mapred.OutputFormat> getOldApiFormats(Configuration cfg) { if (oldApiFormat == null) { oldApiFormat = cfg.getInstances(CFG_FIELD, org.apache.hadoop.mapred.OutputFormat.class); } return oldApiFormat; } }
private List<OutputFormat> getNewApiFormats(Configuration cfg) { if (newApiFormat == null) { newApiFormat = cfg.getInstances(CFG_FIELD, OutputFormat.class); } return newApiFormat; }
private List<org.apache.hadoop.mapred.OutputFormat> getOldApiFormats(Configuration cfg) { if (oldApiFormat == null) { oldApiFormat = cfg.getInstances(CFG_FIELD, org.apache.hadoop.mapred.OutputFormat.class); } return oldApiFormat; } }
private IdentityProvider parseIdentityProvider(String ns, Configuration conf) { List<IdentityProvider> providers = conf.getInstances( ns + "." + CommonConfigurationKeys.IPC_CALLQUEUE_IDENTITY_PROVIDER_KEY, IdentityProvider.class); if (providers.size() < 1) { LOG.info("IdentityProvider not specified, " + "defaulting to UserIdentityProvider"); return new UserIdentityProvider(); } return providers.get(0); // use the first }
private IdentityProvider parseIdentityProvider(String ns, Configuration conf) { List<IdentityProvider> providers = conf.getInstances( ns + "." + CommonConfigurationKeys.IPC_IDENTITY_PROVIDER_KEY, IdentityProvider.class); if (providers.size() < 1) { LOG.info("IdentityProvider not specified, " + "defaulting to UserIdentityProvider"); return new UserIdentityProvider(); } return providers.get(0); // use the first }
private IdentityProvider parseIdentityProvider(String ns, Configuration conf) { List<IdentityProvider> providers = conf.getInstances( ns + "." + CommonConfigurationKeys.IPC_CALLQUEUE_IDENTITY_PROVIDER_KEY, IdentityProvider.class); if (providers.size() < 1) { LOG.info("IdentityProvider not specified, " + "defaulting to UserIdentityProvider"); return new UserIdentityProvider(); } return providers.get(0); // use the first }
@Test public void testPluggableIdentityProvider() { Configuration conf = new Configuration(); conf.set(CommonConfigurationKeys.IPC_CALLQUEUE_IDENTITY_PROVIDER_KEY, "org.apache.hadoop.ipc.UserIdentityProvider"); List<IdentityProvider> providers = conf.getInstances( CommonConfigurationKeys.IPC_CALLQUEUE_IDENTITY_PROVIDER_KEY, IdentityProvider.class); assertTrue(providers.size() == 1); IdentityProvider ip = providers.get(0); assertNotNull(ip); assertEquals(ip.getClass(), UserIdentityProvider.class); }