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


Java AbstractSource类代码示例

本文整理汇总了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;
}
 
开发者ID:javiroman,项目名称:flume-taildirectory-source,代码行数:18,代码来源:FileSet.java

示例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);
}
 
开发者ID:frankyaorenjie,项目名称:flume-ng-kafka-source,代码行数:22,代码来源:KafkaSourceTest.java

示例3: getSource

import org.apache.flume.source.AbstractSource; //导入依赖的package包/类
public AbstractSource getSource() {
  return source;
}
 
开发者ID:javiroman,项目名称:flume-taildirectory-source,代码行数:4,代码来源:FileSet.java

示例4: setSource

import org.apache.flume.source.AbstractSource; //导入依赖的package包/类
public void setSource(AbstractSource source) {
  this.source = source;
}
 
开发者ID:javiroman,项目名称:flume-taildirectory-source,代码行数:4,代码来源:FileSet.java

示例5: WorkerRunnable

import org.apache.flume.source.AbstractSource; //导入依赖的package包/类
private WorkerRunnable(AbstractSource source) {
  this.source = source;
}
 
开发者ID:javiroman,项目名称:flume-taildirectory-source,代码行数:4,代码来源:DirectoryTailSource.java


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