@Test(expected = IOException.class) public void setup_exception() throws Exception { Configuration conf = new Configuration(); RuntimeResourceManager manager = new RuntimeResourceManager(conf) { @Override protected List<RuntimeResource> load() throws IOException { return Arrays.asList(new RuntimeResource() { @Override public void setup(ResourceConfiguration configuration) throws IOException { throw new IOException(); } }); } }; manager.setup(); }
public void setup() throws IOException, InterruptedException { if (LOG.isDebugEnabled()) { LOG.debug("Loading runtime plugins"); } List<? extends RuntimeResource> loaded = load(); this.resources = new ArrayList<>(); for (RuntimeResource resource : loaded) { if (LOG.isDebugEnabled()) { LOG.debug(MessageFormat.format( "Activating runtime plugin: {0}", resource.getClass().getName())); } resource.setup(configuration); resources.add(resource); } if (LOG.isDebugEnabled()) { LOG.debug(MessageFormat.format( "Loaded {0} runtime plugins", resources.size())); } }
RuntimeResourceManager extends Configured { public void setup() throws IOException, InterruptedException { if (LOG.isDebugEnabled()) { LOG.debug("Loading runtime plugins"); } List<? extends RuntimeResource> loaded = load(); this.resources = new ArrayList<>(); for (RuntimeResource resource : loaded) { if (LOG.isDebugEnabled()) { LOG.debug(MessageFormat.format( "Activating runtime plugin: {0}", resource.getClass().getName())); } resource.setup(configuration); resources.add(resource); } if (LOG.isDebugEnabled()) { LOG.debug(MessageFormat.format( "Loaded {0} runtime plugins", resources.size())); } } }
RuntimeResourceManager extends Configured { public void setup() throws IOException, InterruptedException { if (LOG.isDebugEnabled()) { LOG.debug("Loading runtime plugins"); } List<? extends RuntimeResource> loaded = load(); this.resources = new ArrayList<>(); for (RuntimeResource resource : loaded) { if (LOG.isDebugEnabled()) { LOG.debug(MessageFormat.format( "Activating runtime plugin: {0}", resource.getClass().getName())); } resource.setup(configuration); resources.add(resource); } if (LOG.isDebugEnabled()) { LOG.debug(MessageFormat.format( "Loaded {0} runtime plugins", resources.size())); } } RuntimeResourceManager(Configuration configuration); }
RuntimeResourceManager extends Configured { public void setup() throws IOException, InterruptedException { if (LOG.isDebugEnabled()) { LOG.debug("Loading runtime plugins"); } List<? extends RuntimeResource> loaded = load(); this.resources = new ArrayList<>(); for (RuntimeResource resource : loaded) { if (LOG.isDebugEnabled()) { LOG.debug(MessageFormat.format( "Activating runtime plugin: {0}", resource.getClass().getName())); } resource.setup(configuration); resources.add(resource); } if (LOG.isDebugEnabled()) { LOG.debug(MessageFormat.format( "Loaded {0} runtime plugins", resources.size())); } } RuntimeResourceManager(Configuration configuration); void setup(); void cleanup(); }
RuntimeResourceManager extends Configured { public void setup() throws IOException, InterruptedException { if (LOG.isDebugEnabled()) { LOG.debug("Loading runtime plugins"); } List<? extends RuntimeResource> loaded = load(); this.resources = new ArrayList<>(); for (RuntimeResource resource : loaded) { if (LOG.isDebugEnabled()) { LOG.debug(MessageFormat.format( "Activating runtime plugin: {0}", resource.getClass().getName())); } resource.setup(configuration); resources.add(resource); } if (LOG.isDebugEnabled()) { LOG.debug(MessageFormat.format( "Loaded {0} runtime plugins", resources.size())); } } RuntimeResourceManager(Configuration configuration); void setup(); void cleanup(); static final String CONFIGURATION_FILE_NAME; static final String CONFIGURATION_FILE_PATH; }