private void handleDeprecatedParameter(Context context, String newParam, String oldParam) { if (!context.containsKey(newParam) && context.containsKey(oldParam)) { context.put(newParam, context.getString(oldParam)); } }
@Override public void configure(Context context) { String searchPattern = context.getString(SEARCH_PAT_KEY); Preconditions.checkArgument(!StringUtils.isEmpty(searchPattern), "Must supply a valid search pattern " + SEARCH_PAT_KEY + " (may not be empty)"); replaceString = context.getString(REPLACE_STRING_KEY); // Empty replacement String value or if the property itself is not present // assign empty string as replacement if (replaceString == null) { replaceString = ""; } searchRegex = Pattern.compile(searchPattern); if (context.containsKey(CHARSET_KEY)) { // May throw IllegalArgumentException for unsupported charsets. charset = Charset.forName(context.getString(CHARSET_KEY)); } }
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); if (!(ctx.containsKey(BOOTSTRAP_SERVERS_CONFIG))) { String brokerList = ctx.getString(BROKER_LIST_FLUME_KEY); if (brokerList == null || brokerList.isEmpty()) { if (!(ctx.containsKey(BATCH_SIZE))) { String oldBatchSize = ctx.getString(OLD_BATCH_SIZE); if ( oldBatchSize != null && !oldBatchSize.isEmpty()) { if (!(ctx.containsKey(KAFKA_PRODUCER_PREFIX + ProducerConfig.ACKS_CONFIG))) { String requiredKey = ctx.getString( KafkaSinkConstants.REQUIRED_ACKS_FLUME_KEY); if (ctx.containsKey(KEY_SERIALIZER_KEY )) { logger.warn("{} is deprecated. Flume now uses the latest Kafka producer which implements " + "a different interface for serializers. Please use the parameter {}", if (ctx.containsKey(MESSAGE_SERIALIZER_KEY)) { logger.warn("{} is deprecated. Flume now uses the latest Kafka producer which implements " + "a different interface for serializers. Please use the parameter {}",
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); if (!(ctx.containsKey(BOOTSTRAP_SERVERS_CONFIG))) { String brokerList = ctx.getString(BROKER_LIST_FLUME_KEY); if (brokerList == null || brokerList.isEmpty()) { if (!(ctx.containsKey(KAFKA_CONSUMER_PREFIX + ConsumerConfig.GROUP_ID_CONFIG))) { String oldGroupId = ctx.getString(GROUP_ID_FLUME); if (oldGroupId != null && !oldGroupId.isEmpty()) { if (!(ctx.containsKey((KAFKA_CONSUMER_PREFIX + ConsumerConfig.AUTO_OFFSET_RESET_CONFIG)))) { Boolean oldReadSmallest = ctx.getBoolean(READ_SMALLEST_OFFSET); String auto;
private void handleDeprecatedParameter(Context context, String newParam, String oldParam) { if (!context.containsKey(newParam) && context.containsKey(oldParam)) { context.put(newParam, context.getString(oldParam)); } }
@Override public void configure(Context context) { String searchPattern = context.getString(SEARCH_PAT_KEY); Preconditions.checkArgument(!StringUtils.isEmpty(searchPattern), "Must supply a valid search pattern " + SEARCH_PAT_KEY + " (may not be empty)"); replaceString = context.getString(REPLACE_STRING_KEY); // Empty replacement String value or if the property itself is not present // assign empty string as replacement if (replaceString == null) { replaceString = ""; } searchRegex = Pattern.compile(searchPattern); if (context.containsKey(CHARSET_KEY)) { // May throw IllegalArgumentException for unsupported charsets. charset = Charset.forName(context.getString(CHARSET_KEY)); } }
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); if (!(ctx.containsKey(BOOTSTRAP_SERVERS_CONFIG))) { String brokerList = ctx.getString(BROKER_LIST_FLUME_KEY); if (brokerList == null || brokerList.isEmpty()) { if (!(ctx.containsKey(BATCH_SIZE))) { String oldBatchSize = ctx.getString(OLD_BATCH_SIZE); if ( oldBatchSize != null && !oldBatchSize.isEmpty()) { if (!(ctx.containsKey(KAFKA_PRODUCER_PREFIX + ProducerConfig.ACKS_CONFIG))) { String requiredKey = ctx.getString( KafkaSinkConstants.REQUIRED_ACKS_FLUME_KEY); if (ctx.containsKey(KEY_SERIALIZER_KEY )) { logger.warn("{} is deprecated. Flume now uses the latest Kafka producer which implements " + "a different interface for serializers. Please use the parameter {}", if (ctx.containsKey(MESSAGE_SERIALIZER_KEY)) { logger.warn("{} is deprecated. Flume now uses the latest Kafka producer which implements " + "a different interface for serializers. Please use the parameter {}",
if (!context.containsKey(CONF_OUTPUT_HEADER)) { throw new ConfigurationException( String.format("Either %s must be false or %s must be defined", CONF_OUTPUT_BODY, CONF_OUTPUT_HEADER));
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); if (!(ctx.containsKey(BOOTSTRAP_SERVERS_CONFIG))) { String brokerList = ctx.getString(BROKER_LIST_FLUME_KEY); if (brokerList == null || brokerList.isEmpty()) { if (!(ctx.containsKey(KAFKA_CONSUMER_PREFIX + ConsumerConfig.GROUP_ID_CONFIG))) { String oldGroupId = ctx.getString(GROUP_ID_FLUME); if (oldGroupId != null && !oldGroupId.isEmpty()) { if (!(ctx.containsKey((KAFKA_CONSUMER_PREFIX + ConsumerConfig.AUTO_OFFSET_RESET_CONFIG)))) { Boolean oldReadSmallest = ctx.getBoolean(READ_SMALLEST_OFFSET); String auto;