Search in sources :

Example 1 with ConfigurationException

use of org.apache.flume.conf.ConfigurationException in project rocketmq-externals by apache.

the class RocketMQSource method doConfigure.

@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());
    }
}
Also used : ConfigurationException(org.apache.flume.conf.ConfigurationException) SourceCounter(org.apache.flume.instrumentation.SourceCounter)

Example 2 with ConfigurationException

use of org.apache.flume.conf.ConfigurationException in project rocketmq-externals by apache.

the class RocketMQSink method configure.

@Override
public void configure(Context context) {
    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);
    producerGroup = context.getString(PRODUCER_GROUP_CONFIG, PRODUCER_GROUP_DEFAULT);
    batchSize = context.getInteger(BATCH_SIZE_CONFIG, BATCH_SIZE_DEFAULT);
    maxProcessTime = context.getLong(MAX_PROCESS_TIME_CONFIG, MAX_PROCESS_TIME_DEFAULT);
    if (sinkCounter == null) {
        sinkCounter = new SinkCounter(getName());
    }
}
Also used : SinkCounter(org.apache.flume.instrumentation.SinkCounter) ConfigurationException(org.apache.flume.conf.ConfigurationException)

Aggregations

ConfigurationException (org.apache.flume.conf.ConfigurationException)2 SinkCounter (org.apache.flume.instrumentation.SinkCounter)1 SourceCounter (org.apache.flume.instrumentation.SourceCounter)1