本文整理汇总了Java中org.apache.flume.instrumentation.SourceCounter类的典型用法代码示例。如果您正苦于以下问题:Java SourceCounter类的具体用法?Java SourceCounter怎么用?Java SourceCounter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SourceCounter类属于org.apache.flume.instrumentation包,在下文中一共展示了SourceCounter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: MultiportSyslogHandler
import org.apache.flume.instrumentation.SourceCounter; //导入依赖的package包/类
public MultiportSyslogHandler(int maxEventSize, int batchSize,
ChannelProcessor cp, SourceCounter ctr, String portHeader,
ThreadSafeDecoder defaultDecoder,
ConcurrentMap<Integer, ThreadSafeDecoder> portCharsets,
Set<String> keepFields) {
channelProcessor = cp;
sourceCounter = ctr;
this.maxEventSize = maxEventSize;
this.batchSize = batchSize;
this.portHeader = portHeader;
this.defaultDecoder = defaultDecoder;
this.portCharsets = portCharsets;
this.keepFields = keepFields;
syslogParser = new SyslogParser();
lineSplitter = new LineSplitter(maxEventSize);
}
示例2: doConfigure
import org.apache.flume.instrumentation.SourceCounter; //导入依赖的package包/类
@Override
protected void doConfigure(Context context) throws FlumeException {
sourceCounter = new SourceCounter(getName());
journalDir = context.getString(CONFIG_JOURNAL_DIR, CONFIG_JOURNAL_DIR_DEFAULT).trim();
providerUrl = context.getString(CONFIG_PROVIDER_URL, CONFIG_PROVIDER_URL_DEFAULT).trim();
destinationName = context.getString(CONFIG_DESTINATION_NAME, CONFIG_DESTINATION_NAME_DEFAULT).trim();
String brokerAccess = context.getString(CONFIG_BROKER_ACCESS, CONFIG_BROKER_ACCESS_DEFAULT).trim();
String brokerSecret = context.getString(CONFIG_BROKER_SECRET, CONFIG_BROKER_SECRET_DEFAULT).trim();
try {
clientOptions = new MqttConnectOptions();
if (!brokerAccess.isEmpty()) {
clientOptions.setUserName(brokerAccess);
}
if (!brokerSecret.isEmpty()) {
clientOptions.setPassword(brokerSecret.toCharArray());
}
clientOptions.setCleanSession(false);
clientOptions.setAutomaticReconnect(false);
clientOptions.setConnectionTimeout(Math.toIntExact(getBackOffSleepIncrement() / 2000));
} catch (Exception e) {
throw new FlumeException("MQTT client configure failed with [" + providerUrl + "/" + destinationName + "]", e);
}
}
示例3: ExecRunnable
import org.apache.flume.instrumentation.SourceCounter; //导入依赖的package包/类
public ExecRunnable(String shell, String command, ChannelProcessor channelProcessor,
SourceCounter sourceCounter, boolean restart, long restartThrottle,
boolean logStderr, int bufferCount, long batchTimeout, Charset charset) {
this.command = command;
this.channelProcessor = channelProcessor;
this.sourceCounter = sourceCounter;
this.restartThrottle = restartThrottle;
this.bufferCount = bufferCount;
this.batchTimeout = batchTimeout;
this.restart = restart;
this.logStderr = logStderr;
this.charset = charset;
this.shell = shell;
}
示例4: configure
import org.apache.flume.instrumentation.SourceCounter; //导入依赖的package包/类
@Override
public void configure(Context context) {
// Only the queue name does not have a default value
Configurables.ensureRequiredNonNull(context, QUEUE_KEY);
// Assign all of the configured values
hostname = context.getString(HOST_KEY, ConnectionFactory.DEFAULT_HOST);
port = context.getInteger(PORT_KEY, ConnectionFactory.DEFAULT_AMQP_PORT);
enableSSL = context.getBoolean(SSL_KEY, false);
virtualHost = context.getString(VHOST_KEY, ConnectionFactory.DEFAULT_VHOST);
username = context.getString(USER_KEY, ConnectionFactory.DEFAULT_USER);
password = context.getString(PASSWORD_KEY, ConnectionFactory.DEFAULT_PASS);
queue = context.getString(QUEUE_KEY, null);
autoAck = context.getBoolean(AUTOACK_KEY, false);
requeuing = context.getBoolean(REQUEUING, false);
prefetchCount = context.getInteger(PREFETCH_COUNT_KEY, 0);
timeout = context.getInteger(TIMEOUT_KEY, -1);
consumerThreads = context.getInteger(THREAD_COUNT_KEY, 1);
// Ensure that Flume can connect to RabbitMQ
testRabbitMQConnection();
// Create and configure the counters
sourceCounter = new SourceCounter(getName());
counterGroup = new CounterGroup();
counterGroup.setName(getName());
}
示例5: doConfigure
import org.apache.flume.instrumentation.SourceCounter; //导入依赖的package包/类
@Override
protected void doConfigure(Context context) throws FlumeException {
log("::DoConfigure-------");
sourceCounter = new SourceCounter(getName());
this.context=context;
consumer=createConsumer();
}
示例6: getSourceCounter
import org.apache.flume.instrumentation.SourceCounter; //导入依赖的package包/类
@VisibleForTesting
SourceCounter getSourceCounter() {
return sourceCounter;
}
示例7: getSourceCounter
import org.apache.flume.instrumentation.SourceCounter; //导入依赖的package包/类
@VisibleForTesting
protected SourceCounter getSourceCounter() {
return sourceCounter;
}
示例8: SpoolDirectoryRunnable
import org.apache.flume.instrumentation.SourceCounter; //导入依赖的package包/类
public SpoolDirectoryRunnable(ReliableSpoolingFileEventReader reader,
SourceCounter sourceCounter) {
this.reader = reader;
this.sourceCounter = sourceCounter;
}
示例9: SpoolFileRunnable
import org.apache.flume.instrumentation.SourceCounter; //导入依赖的package包/类
public SpoolFileRunnable(ReliableSpoolFileEventReader reader, SourceCounter sourceCounter) {
this.reader = reader;
this.sourceCounter = sourceCounter;
}
示例10: getSourceCounter
import org.apache.flume.instrumentation.SourceCounter; //导入依赖的package包/类
@VisibleForTesting
protected SourceCounter getSourceCounter() {
return sourceCounter;
}
示例11: SpoolDirectoryRunnable
import org.apache.flume.instrumentation.SourceCounter; //导入依赖的package包/类
public SpoolDirectoryRunnable(ReliableSpoolingFileEventReader reader, SourceCounter sourceCounter) {
this.reader = reader;
this.sourceCounter = sourceCounter;
}
示例12: getCounters
import org.apache.flume.instrumentation.SourceCounter; //导入依赖的package包/类
@VisibleForTesting
public SourceCounter getCounters(){
return sourceCounter;
}
示例13: SpoolDirectoryTailFileRunnable
import org.apache.flume.instrumentation.SourceCounter; //导入依赖的package包/类
public SpoolDirectoryTailFileRunnable(ReliableSpoolDirectoryTailFileEventReader reader, SourceCounter sourceCounter) {
this.reader = reader;
this.sourceCounter = sourceCounter;
}
示例14: setSourceCounter
import org.apache.flume.instrumentation.SourceCounter; //导入依赖的package包/类
public Consumer setSourceCounter(SourceCounter sourceCounter) {
this.sourceCounter = sourceCounter;
return this;
}
示例15: getSourceCounter
import org.apache.flume.instrumentation.SourceCounter; //导入依赖的package包/类
@VisibleForTesting
protected SourceCounter getSourceCounter() {
return sourceCounter;
}