当前位置: 首页>>代码示例>>Java>>正文


Java SourceCounter类代码示例

本文整理汇总了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);
}
 
开发者ID:moueimei,项目名称:flume-release-1.7.0,代码行数:17,代码来源:MultiportSyslogTCPSource.java

示例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);
  }
}
 
开发者ID:ggear,项目名称:cloudera-framework,代码行数:24,代码来源:MqttSource.java

示例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;
}
 
开发者ID:moueimei,项目名称:flume-release-1.7.0,代码行数:15,代码来源:ExecSource.java

示例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());
}
 
开发者ID:gmr,项目名称:rabbitmq-flume-plugin,代码行数:28,代码来源:RabbitMQSource.java

示例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();
}
 
开发者ID:paypal,项目名称:cbflume,代码行数:9,代码来源:CBFlumeSource.java

示例6: getSourceCounter

import org.apache.flume.instrumentation.SourceCounter; //导入依赖的package包/类
@VisibleForTesting
SourceCounter getSourceCounter() {
  return sourceCounter;
}
 
开发者ID:moueimei,项目名称:flume-release-1.7.0,代码行数:5,代码来源:SyslogUDPSource.java

示例7: getSourceCounter

import org.apache.flume.instrumentation.SourceCounter; //导入依赖的package包/类
@VisibleForTesting
protected SourceCounter getSourceCounter() {
  return sourceCounter;
}
 
开发者ID:moueimei,项目名称:flume-release-1.7.0,代码行数:5,代码来源:SpoolDirectorySource.java

示例8: SpoolDirectoryRunnable

import org.apache.flume.instrumentation.SourceCounter; //导入依赖的package包/类
public SpoolDirectoryRunnable(ReliableSpoolingFileEventReader reader,
                              SourceCounter sourceCounter) {
  this.reader = reader;
  this.sourceCounter = sourceCounter;
}
 
开发者ID:moueimei,项目名称:flume-release-1.7.0,代码行数:6,代码来源:SpoolDirectorySource.java

示例9: SpoolFileRunnable

import org.apache.flume.instrumentation.SourceCounter; //导入依赖的package包/类
public SpoolFileRunnable(ReliableSpoolFileEventReader reader, SourceCounter sourceCounter) {
    this.reader = reader;
    this.sourceCounter = sourceCounter;
}
 
开发者ID:yanghua,项目名称:flume-customized,代码行数:5,代码来源:SpoolFileSource.java

示例10: getSourceCounter

import org.apache.flume.instrumentation.SourceCounter; //导入依赖的package包/类
@VisibleForTesting
protected SourceCounter getSourceCounter() {
	return sourceCounter;
}
 
开发者ID:cerndb,项目名称:flume-ng-audit-db,代码行数:5,代码来源:SpoolDirectorySource.java

示例11: SpoolDirectoryRunnable

import org.apache.flume.instrumentation.SourceCounter; //导入依赖的package包/类
public SpoolDirectoryRunnable(ReliableSpoolingFileEventReader reader, SourceCounter sourceCounter) {
	this.reader = reader;
	this.sourceCounter = sourceCounter;
}
 
开发者ID:cerndb,项目名称:flume-ng-audit-db,代码行数:5,代码来源:SpoolDirectorySource.java

示例12: getCounters

import org.apache.flume.instrumentation.SourceCounter; //导入依赖的package包/类
@VisibleForTesting
public SourceCounter getCounters(){
	return sourceCounter;
}
 
开发者ID:cerndb,项目名称:flume-ng-audit-db,代码行数:5,代码来源:LogFileSource.java

示例13: SpoolDirectoryTailFileRunnable

import org.apache.flume.instrumentation.SourceCounter; //导入依赖的package包/类
public SpoolDirectoryTailFileRunnable(ReliableSpoolDirectoryTailFileEventReader reader, SourceCounter sourceCounter) {
	this.reader = reader;
	this.sourceCounter = sourceCounter;
}
 
开发者ID:feiyuyitiao,项目名称:flume-ng-extends,代码行数:5,代码来源:SpoolDirectoryTailFileSource.java

示例14: setSourceCounter

import org.apache.flume.instrumentation.SourceCounter; //导入依赖的package包/类
public Consumer setSourceCounter(SourceCounter sourceCounter) {
    this.sourceCounter = sourceCounter;
    return this;
}
 
开发者ID:gmr,项目名称:rabbitmq-flume-plugin,代码行数:5,代码来源:Consumer.java

示例15: getSourceCounter

import org.apache.flume.instrumentation.SourceCounter; //导入依赖的package包/类
@VisibleForTesting
protected SourceCounter getSourceCounter() {
    return sourceCounter;
}
 
开发者ID:Stratio,项目名称:ingestion,代码行数:5,代码来源:SNMPSource.java


注:本文中的org.apache.flume.instrumentation.SourceCounter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。