當前位置: 首頁>>代碼示例>>Java>>正文


Java ReliableSpoolingFileEventReader類代碼示例

本文整理匯總了Java中org.apache.flume.client.avro.ReliableSpoolingFileEventReader的典型用法代碼示例。如果您正苦於以下問題:Java ReliableSpoolingFileEventReader類的具體用法?Java ReliableSpoolingFileEventReader怎麽用?Java ReliableSpoolingFileEventReader使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ReliableSpoolingFileEventReader類屬於org.apache.flume.client.avro包,在下文中一共展示了ReliableSpoolingFileEventReader類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: start

import org.apache.flume.client.avro.ReliableSpoolingFileEventReader; //導入依賴的package包/類
@Override
public synchronized void start() {
  logger.info("SpoolDirectorySource source starting with directory: {}",
      spoolDirectory);

  executor = Executors.newSingleThreadScheduledExecutor();

  File directory = new File(spoolDirectory);
  try {
    reader = new ReliableSpoolingFileEventReader.Builder()
        .spoolDirectory(directory)
        .completedSuffix(completedSuffix)
        .includePattern(includePattern)
        .ignorePattern(ignorePattern)
        .trackerDirPath(trackerDirPath)
        .annotateFileName(fileHeader)
        .fileNameHeader(fileHeaderKey)
        .annotateBaseName(basenameHeader)
        .baseNameHeader(basenameHeaderKey)
        .deserializerType(deserializerType)
        .deserializerContext(deserializerContext)
        .deletePolicy(deletePolicy)
        .inputCharset(inputCharset)
        .decodeErrorPolicy(decodeErrorPolicy)
        .consumeOrder(consumeOrder)
        .recursiveDirectorySearch(recursiveDirectorySearch)
        .build();
  } catch (IOException ioe) {
    throw new FlumeException("Error instantiating spooling event parser",
        ioe);
  }

  Runnable runner = new SpoolDirectoryRunnable(reader, sourceCounter);
  executor.scheduleWithFixedDelay(
      runner, 0, pollDelay, TimeUnit.MILLISECONDS);

  super.start();
  logger.debug("SpoolDirectorySource source started");
  sourceCounter.start();
}
 
開發者ID:moueimei,項目名稱:flume-release-1.7.0,代碼行數:41,代碼來源:SpoolDirectorySource.java

示例2: SpoolDirectoryRunnable

import org.apache.flume.client.avro.ReliableSpoolingFileEventReader; //導入依賴的package包/類
public SpoolDirectoryRunnable(ReliableSpoolingFileEventReader reader,
                              SourceCounter sourceCounter) {
  this.reader = reader;
  this.sourceCounter = sourceCounter;
}
 
開發者ID:moueimei,項目名稱:flume-release-1.7.0,代碼行數:6,代碼來源:SpoolDirectorySource.java


注:本文中的org.apache.flume.client.avro.ReliableSpoolingFileEventReader類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。