Refine search
@Override public void configure(Context context) { this.pollFrequency = context.getInteger(this.CONF_POLL_FREQUENCY, 60); String localHosts = context.getString(this.CONF_HOSTS); if (localHosts == null || localHosts.isEmpty()) { throw new ConfigurationException("Hosts list cannot be empty."); } this.hosts = this.getHostsFromString(localHosts); this.isGanglia3 = context.getBoolean(this.CONF_ISGANGLIA3, false); }
boolean configSpecified = false; if (srcContext != null) { SourceType srcType = getKnownSource(srcContext.getString( BasicConfigurationConstants.CONFIG_TYPE)); if (srcType == null) { config = srcContext.getString( CONFIG_CONFIG); if (config == null || config.isEmpty()) { throw new ConfigurationException( "No Channels configured for " + sourceName); srcContext.put(CONFIG_CHANNELS, this.getSpaceDelimitedList(channels)); LOGGER.warn( "Could not configure source {} due to: {}", new Object[]{sourceName, e.getMessage(), e} );
addError(sinkgroupName, CONFIG_ERROR, ERROR); if (conf != null) errorList.addAll(conf.getErrors()); throw new ConfigurationException( "No available sinks for sinkgroup: " + sinkgroupName + ". Sinkgroup will be removed"); LOGGER.warn( "Could not configure sink group {} due to: {}", new Object[]{sinkgroupName, e.getMessage(), e} );
String config = null; boolean configSpecified = false; SinkType sinkType = getKnownSink(sinkContext.getString( BasicConfigurationConstants.CONFIG_TYPE)); if (sinkType == null) { config = sinkContext.getString( CONFIG_CONFIG); if (config == null || config.isEmpty()) { throw new ConfigurationException("Channel " + sinkConf.getChannel() + " not in active set."); LOGGER.warn( "Could not configure sink {} due to: {}", new Object[]{sinkName, e.getMessage(), e} );
public void configure(Context context) { if (!HBaseVersionCheck.hasVersionLessThan2(logger)) { throw new ConfigurationException( "HBase major version number must be less than 2 for hbase-sink."); tableName = context.getString(HBaseSinkConfigurationConstants.CONFIG_TABLE); String cf = context.getString( HBaseSinkConfigurationConstants.CONFIG_COLUMN_FAMILY); batchSize = context.getLong( HBaseSinkConfigurationConstants.CONFIG_BATCHSIZE, new Long(100)); serializerContext = new Context();
private void translateOldProps(Context ctx) { if (!(ctx.containsKey(TOPIC_CONFIG))) { ctx.put(TOPIC_CONFIG, ctx.getString("topic")); logger.warn("{} is deprecated. Please use the parameter {}", "topic", TOPIC_CONFIG); String brokerList = ctx.getString(BROKER_LIST_FLUME_KEY); if (brokerList == null || brokerList.isEmpty()) { throw new ConfigurationException("Bootstrap Servers must be specified"); } else { ctx.put(BOOTSTRAP_SERVERS_CONFIG, brokerList);
@Override protected void doConfigure(Context context) throws FlumeException { nameServer = context.getString(NAME_SERVER_CONFIG); if (nameServer == null) { throw new ConfigurationException("NameServer must not be null"); } topic = context.getString(TOPIC_CONFIG, TOPIC_DEFAULT); tag = context.getString(TAG_CONFIG, TAG_DEFAULT); consumerGroup = context.getString(CONSUMER_GROUP_CONFIG, CONSUMER_GROUP_DEFAULT); messageModel = context.getString(MESSAGE_MODEL_CONFIG, MESSAGE_MODEL_DEFAULT); batchSize = context.getInteger(BATCH_SIZE_CONFIG, BATCH_SIZE_DEFAULT); if (sourceCounter == null) { sourceCounter = new SourceCounter(getName()); } }
public void configure(Context context) throws ConfigurationException { super.configure(context); try { String channelList = context.getString( BasicConfigurationConstants.CONFIG_CHANNELS); if (channelList != null) { FlumeConfigurationErrorType.PROPERTY_VALUE_NULL, ErrorOrWarning.ERROR)); throw new ConfigurationException("No channels set for " + this.getComponentName()); Map<String, String> selectorParams = context.getSubProperties( BasicConfigurationConstants.CONFIG_SOURCE_CHANNELSELECTOR_PREFIX); String selType; Context selectorContext = new Context(); selectorContext.putAll(selectorParams); String config = null; FlumeConfigurationErrorType.CONFIG_ERROR, ErrorOrWarning.ERROR)); throw new ConfigurationException("Failed to configure component!", e);
public void configure(Context context) throws ConfigurationException { failIfConfigured(); String confType = context.getString( BasicConfigurationConstants.CONFIG_TYPE); if (confType != null && !confType.isEmpty()) { this.type = confType; } // Type can be set by child class constructors, so check if it was. if (this.type == null || this.type.isEmpty()) { errors.add(new FlumeConfigurationError(componentName, BasicConfigurationConstants.CONFIG_TYPE, FlumeConfigurationErrorType.ATTRS_MISSING, ErrorOrWarning.ERROR)); throw new ConfigurationException( "Component has no type. Cannot configure. " + componentName); } }
ConfigFilterType chType = getKnownConfigFilter(configFilterContext.getString( BasicConfigurationConstants.CONFIG_TYPE)); boolean configSpecified = false; config = configFilterContext.getString(CONFIG_CONFIG); if (config == null || config.isEmpty()) { config = "OTHER"; LOGGER.warn( "Could not configure configfilter {} due to: {}", new Object[]{configFilterName, e.getMessage(), e} );
@Override public void configure(Context context) { this.maxBlobLength = context.getInteger(MAX_BLOB_LENGTH_KEY, MAX_BLOB_LENGTH_DEFAULT); if (this.maxBlobLength <= 0) { throw new ConfigurationException("Configuration parameter " + MAX_BLOB_LENGTH_KEY + " must be greater than zero: " + maxBlobLength); } }
protected void failIfConfigured() throws ConfigurationException { if (configured) { throw new ConfigurationException("Already configured component." + componentName); } }
public void configure(Context context) { if (!this.hasVersionAtLeast2()) { throw new ConfigurationException( "HBase major version number must be at least 2 for hbase2sink"); tableName = context.getString(HBase2SinkConfigurationConstants.CONFIG_TABLE); String cf = context.getString( HBase2SinkConfigurationConstants.CONFIG_COLUMN_FAMILY); batchSize = context.getLong( HBase2SinkConfigurationConstants.CONFIG_BATCHSIZE, 100L); Context serializerContext = new Context();
private void translateOldProps(Context ctx) { if (!(ctx.containsKey(TOPIC_CONFIG))) { ctx.put(TOPIC_CONFIG, ctx.getString("topic")); logger.warn("{} is deprecated. Please use the parameter {}", "topic", TOPIC_CONFIG); String brokerList = ctx.getString(BROKER_LIST_FLUME_KEY); if (brokerList == null || brokerList.isEmpty()) { throw new ConfigurationException("Bootstrap Servers must be specified"); } else { ctx.put(BOOTSTRAP_SERVERS_CONFIG, brokerList);
public void configure(Context context) { this.context = context; this.batchUpperLimit = context.getInteger("batchSize", Integer.valueOf(1000)).intValue(); this.timeUpperLimit = context.getInteger("batchDurationMillis", Integer.valueOf(1000)).intValue(); this.topic = context.getString("topic"); if(this.topic == null) { throw new ConfigurationException("Kafka topic must be specified."); } else { this.kafkaProps = KafkaSourceUtil.getKafkaProperties(context); this.consumerTimeout = Integer.parseInt(this.kafkaProps.getProperty("consumer.timeout.ms")); this.kafkaAutoCommitEnabled = Boolean.parseBoolean(this.kafkaProps.getProperty("auto.commit.enable")); if(this.counter == null) { this.counter = new KafkaSourceCounter(this.getName()); } } }
public void configure(Context context) throws ConfigurationException { super.configure(context); try { String channelList = context.getString( BasicConfigurationConstants.CONFIG_CHANNELS); if (channelList != null) { FlumeConfigurationErrorType.PROPERTY_VALUE_NULL, ErrorOrWarning.ERROR)); throw new ConfigurationException("No channels set for " + this.getComponentName()); Map<String, String> selectorParams = context.getSubProperties( BasicConfigurationConstants.CONFIG_SOURCE_CHANNELSELECTOR_PREFIX); String selType; Context selectorContext = new Context(); selectorContext.putAll(selectorParams); String config = null; FlumeConfigurationErrorType.CONFIG_ERROR, ErrorOrWarning.ERROR)); throw new ConfigurationException("Failed to configure component!", e);
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()); } }
ChannelType chType = getKnownChannel(channelContext.getString( BasicConfigurationConstants.CONFIG_TYPE)); boolean configSpecified = false; config = channelContext.getString(CONFIG_CONFIG); if (config == null || config.isEmpty()) { config = "OTHER"; LOGGER.warn( "Could not configure channel {} due to: {}", new Object[]{channelName, e.getMessage(), e} );
protected BlobDeserializer(Context context, ResettableInputStream in) { this.in = in; this.maxBlobLength = context.getInteger(MAX_BLOB_LENGTH_KEY, MAX_BLOB_LENGTH_DEFAULT); if (this.maxBlobLength <= 0) { throw new ConfigurationException("Configuration parameter " + MAX_BLOB_LENGTH_KEY + " must be greater than zero: " + maxBlobLength); } this.isOpen = true; }
String config = null; boolean configSpecified = false; SinkType sinkType = getKnownSink(sinkContext.getString( BasicConfigurationConstants.CONFIG_TYPE)); if (sinkType == null) { config = sinkContext.getString( CONFIG_CONFIG); if (config == null || config.isEmpty()) { throw new ConfigurationException("Channel " + sinkConf.getChannel() + " not in active set."); LOGGER.warn( "Could not configure sink {} due to: {}", new Object[]{sinkName, e.getMessage(), e} );