本文整理汇总了Java中org.apache.flume.source.AbstractSource类的典型用法代码示例。如果您正苦于以下问题:Java AbstractSource类的具体用法?Java AbstractSource怎么用?Java AbstractSource使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AbstractSource类属于org.apache.flume.source包,在下文中一共展示了AbstractSource类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: FileSet
import org.apache.flume.source.AbstractSource; //导入依赖的package包/类
public FileSet(AbstractSource source, FileObject fileObject)
throws IOException {
this.source = source;
this.fileObject = fileObject;
this.bufferList = new ArrayList<String>();
File f = new File(fileObject.getName().getPath());
rReader = new RandomAccessFile(f, "r");
rReader.seek(f.length());
bufferList = new ArrayList<String>();
headers = new HashMap<String, String>();
logger.debug("FileSet has been created " + fileObject.getName().getPath());
this.seq = 0L;
}
示例2: setup
import org.apache.flume.source.AbstractSource; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Before
public void setup() throws Exception {
mockIt = mock(ConsumerIterator.class);
mockMessageAndMetadata = mock(MessageAndMetadata.class);
mockChannelProcessor = mock(ChannelProcessor.class);
mockBuffer = mock(ByteBuffer.class);
mockMessage = mock(Message.class);
mockKafkaSource = new KafkaSource();
when(mockMessage.payload()).thenReturn(mockBuffer);
when(mockMessageAndMetadata.message()).thenReturn(mockMessage);
Field field = AbstractSource.class.getDeclaredField("channelProcessor");
field.setAccessible(true);
field.set(mockKafkaSource, mockChannelProcessor);
field = KafkaSource.class.getDeclaredField("it");
field.setAccessible(true);
field.set(mockKafkaSource, mockIt);
}
示例3: getSource
import org.apache.flume.source.AbstractSource; //导入依赖的package包/类
public AbstractSource getSource() {
return source;
}
示例4: setSource
import org.apache.flume.source.AbstractSource; //导入依赖的package包/类
public void setSource(AbstractSource source) {
this.source = source;
}
示例5: WorkerRunnable
import org.apache.flume.source.AbstractSource; //导入依赖的package包/类
private WorkerRunnable(AbstractSource source) {
this.source = source;
}