Search in sources :

Example 1 with SinkCounter

use of org.apache.flume.instrumentation.SinkCounter in project phoenix by apache.

the class PhoenixSink method configure.

@Override
public void configure(Context context) {
    this.setName(NAME + counter.incrementAndGet());
    this.batchSize = context.getInteger(FlumeConstants.CONFIG_BATCHSIZE, FlumeConstants.DEFAULT_BATCH_SIZE);
    final String eventSerializerType = context.getString(FlumeConstants.CONFIG_SERIALIZER);
    Preconditions.checkNotNull(eventSerializerType, "Event serializer cannot be empty, please specify in the configuration file");
    initializeSerializer(context, eventSerializerType);
    this.sinkCounter = new SinkCounter(this.getName());
}
Also used : SinkCounter(org.apache.flume.instrumentation.SinkCounter)

Example 2 with SinkCounter

use of org.apache.flume.instrumentation.SinkCounter 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

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