sinkName, config, ComponentType.SINK); if (sinkConf != null) { sinkConf.configure(sinkContext); if (!channelSet.contains(sinkConf.getChannel())) { throw new ConfigurationException("Channel " + sinkConf.getChannel() + " not in active set."); if ((configSpecified && sinkConf.isNotFoundConfigClass()) || !configSpecified) { newContextMap.put(sinkName, sinkContext); sinkConfigMap.put(sinkName, sinkConf); if (sinkConf != null) errorList.addAll(sinkConf.getErrors()); } catch (ConfigurationException e) { iter.remove(); if (sinkConf != null) errorList.addAll(sinkConf.getErrors()); LOGGER.warn( "Could not configure sink {} due to: {}",
@SuppressWarnings("unchecked") public SinkConfiguration getConfiguration(String name) throws ConfigurationException { if (this == OTHER) { return new SinkConfiguration(name); } Class<? extends SinkConfiguration> clazz; SinkConfiguration instance = null; try { if (sinkConfigurationName != null) { clazz = (Class<? extends SinkConfiguration>) Class .forName(sinkConfigurationName); instance = clazz.getConstructor(String.class).newInstance(name); } else { return new SinkConfiguration(name); } } catch (ClassNotFoundException e) { // Could not find the configuration stub, do basic validation instance = new SinkConfiguration(name); // Let the caller know that this was created because of this exception. instance.setNotFoundConfigClass(); } catch (Exception e) { throw new ConfigurationException("Couldn't create configuration", e); } return instance; }
public void configure(Context context) throws ConfigurationException { super.configure(context); this.channel = context.getString("channel"); if (this.channel == null || this.channel.isEmpty()) { errors .add(new FlumeConfigurationError(componentName, "channel", FlumeConfigurationErrorType.PROPERTY_VALUE_NULL, ErrorOrWarning.ERROR)); throw new ConfigurationException("No channel configured for sink: " + this.getComponentName()); } }
try { Configurables.configure(sink, config); ChannelComponent channelComponent = channelComponentMap.get(config.getChannel()); if (channelComponent == null) { String msg = String.format("Sink %s is not connected to a " +
try { Configurables.configure(sink, config); ChannelComponent channelComponent = channelComponentMap.get(config.getChannel()); if (channelComponent == null) { String msg = String.format("Sink %s is not connected to a " +
sinkName, config, ComponentType.SINK); if (sinkConf != null) { sinkConf.configure(sinkContext); if (!channelSet.contains(sinkConf.getChannel())) { throw new ConfigurationException("Channel " + sinkConf.getChannel() + " not in active set."); if ((configSpecified && sinkConf.isNotFoundConfigClass()) || !configSpecified) { newContextMap.put(sinkName, sinkContext); sinkConfigMap.put(sinkName, sinkConf); if (sinkConf != null) errorList.addAll(sinkConf.getErrors()); } catch (ConfigurationException e) { iter.remove(); if (sinkConf != null) errorList.addAll(sinkConf.getErrors()); LOGGER.warn( "Could not configure sink {} due to: {}",
@SuppressWarnings("unchecked") public SinkConfiguration getConfiguration(String name) throws ConfigurationException { if (this == OTHER) { return new SinkConfiguration(name); } Class<? extends SinkConfiguration> clazz; SinkConfiguration instance = null; try { if (sinkConfigurationName != null) { clazz = (Class<? extends SinkConfiguration>) Class .forName(sinkConfigurationName); instance = clazz.getConstructor(String.class).newInstance(name); } else { return new SinkConfiguration(name); } } catch (ClassNotFoundException e) { // Could not find the configuration stub, do basic validation instance = new SinkConfiguration(name); // Let the caller know that this was created because of this exception. instance.setNotFoundConfigClass(); } catch (Exception e) { throw new ConfigurationException("Couldn't create configuration", e); } return instance; }
public void configure(Context context) throws ConfigurationException { super.configure(context); this.channel = context.getString("channel"); if (this.channel == null || this.channel.isEmpty()) { errors .add(new FlumeConfigurationError(componentName, "channel", FlumeConfigurationErrorType.PROPERTY_VALUE_NULL, ErrorOrWarning.ERROR)); throw new ConfigurationException("No channel configured for sink: " + this.getComponentName()); } }