本文整理匯總了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();
}
示例2: SpoolDirectoryRunnable
import org.apache.flume.client.avro.ReliableSpoolingFileEventReader; //導入依賴的package包/類
public SpoolDirectoryRunnable(ReliableSpoolingFileEventReader reader,
SourceCounter sourceCounter) {
this.reader = reader;
this.sourceCounter = sourceCounter;
}