本文整理汇总了Java中org.apache.kafka.connect.source.SourceConnector类的典型用法代码示例。如果您正苦于以下问题:Java SourceConnector类的具体用法?Java SourceConnector怎么用?Java SourceConnector使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SourceConnector类属于org.apache.kafka.connect.source包,在下文中一共展示了SourceConnector类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testListConnectorPlugins
import org.apache.kafka.connect.source.SourceConnector; //导入依赖的package包/类
@Test
public void testListConnectorPlugins() throws Exception {
expectPlugins();
Set<ConnectorPluginInfo> connectorPlugins = new HashSet<>(connectorPluginsResource.listConnectorPlugins());
assertFalse(connectorPlugins.contains(newInfo(Connector.class, "0.0")));
assertFalse(connectorPlugins.contains(newInfo(SourceConnector.class, "0.0")));
assertFalse(connectorPlugins.contains(newInfo(SinkConnector.class, "0.0")));
assertFalse(connectorPlugins.contains(newInfo(VerifiableSourceConnector.class)));
assertFalse(connectorPlugins.contains(newInfo(VerifiableSinkConnector.class)));
assertFalse(connectorPlugins.contains(newInfo(MockSourceConnector.class)));
assertFalse(connectorPlugins.contains(newInfo(MockSinkConnector.class)));
assertFalse(connectorPlugins.contains(newInfo(MockConnector.class)));
assertFalse(connectorPlugins.contains(newInfo(SchemaSourceConnector.class)));
assertTrue(connectorPlugins.contains(newInfo(ConnectorPluginsResourceTestConnector.class)));
PowerMock.verifyAll();
}
示例2: before
import org.apache.kafka.connect.source.SourceConnector; //导入依赖的package包/类
@BeforeEach
public void before() throws MalformedURLException {
log.info("before() - Configuring reflections to use package '{}'", packages());
if (null == this.reflections) {
this.reflections = new Reflections(new ConfigurationBuilder()
.setUrls(ClasspathHelper.forJavaClassPath())
.forPackages(packages())
);
}
List<Class<? extends Transformation>> transformClasses = list(Transformation.class);
List<Class<? extends SourceConnector>> sourceConnectorClasses = list(SourceConnector.class);
List<Class<? extends SinkConnector>> sinkConnectorClasses = list(SinkConnector.class);
this.pluginTemplate = PluginTemplate.from(sourceConnectorClasses, sinkConnectorClasses, transformClasses);
}
示例3: from
import org.apache.kafka.connect.source.SourceConnector; //导入依赖的package包/类
public static PluginTemplate from(List<Class<? extends SourceConnector>> sourceConnectorClasses, List<Class<? extends SinkConnector>> sinkConnectorClasses, List<Class<? extends Transformation>> transformationClasses) {
final List<SourceConnectorTemplate> sourceConnectors = sourceConnectorClasses.stream()
.map(aClass -> new SourceConnectorTemplate(aClass))
.collect(Collectors.toList());
final List<SinkConnectorTemplate> sinkConnectors = sinkConnectorClasses.stream()
.map(aClass -> new SinkConnectorTemplate(aClass))
.collect(Collectors.toList());
final List<TransformationTemplate> transformations = transformationClasses.stream()
.map(aClass -> new TransformationTemplate(aClass))
.collect(Collectors.toList());
return new PluginTemplate(sourceConnectors, sinkConnectors, transformations);
}
示例4: testConnectorType
import org.apache.kafka.connect.source.SourceConnector; //导入依赖的package包/类
@Test
public void testConnectorType() {
Connector connector = new MQSourceConnector();
assertTrue(SourceConnector.class.isAssignableFrom(connector.getClass()));
}