本文整理汇总了Java中org.apache.nifi.remote.client.SiteToSiteClient.Builder方法的典型用法代码示例。如果您正苦于以下问题:Java SiteToSiteClient.Builder方法的具体用法?Java SiteToSiteClient.Builder怎么用?Java SiteToSiteClient.Builder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.nifi.remote.client.SiteToSiteClient
的用法示例。
在下文中一共展示了SiteToSiteClient.Builder方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getClient
import org.apache.nifi.remote.client.SiteToSiteClient; //导入方法依赖的package包/类
private SiteToSiteClient getClient(String url, String port, boolean useCompression, SSLContext sslContext) {
SiteToSiteClient.Builder configBuilder = new SiteToSiteClient.Builder()
.url(url)
.portName(port)
.useCompression(useCompression);
if (sslContext != null) {
configBuilder = configBuilder.sslContext(sslContext);
}
final SiteToSiteClientConfig config = configBuilder.buildConfig();
final SiteToSiteClient client = new SiteToSiteClient.Builder()
.fromConfig(config)
.build();
return client;
}
示例2: populateDAG
import org.apache.nifi.remote.client.SiteToSiteClient; //导入方法依赖的package包/类
@Override
public void populateDAG(DAG dag, Configuration conf)
{
final SiteToSiteClientConfig clientConfig = new SiteToSiteClient.Builder()
.url("http://localhost:8080/nifi")
.portName("Apex")
.requestBatchCount(5)
.buildConfig();
final SiteToSiteClient.Builder builder = new SiteToSiteClient.Builder().fromConfig(clientConfig);
final WindowDataManager windowDataManager = new WindowDataManager.NoopWindowDataManager();
NiFiSinglePortInputOperator nifi = dag.addOperator("nifi", new NiFiSinglePortInputOperator(builder, windowDataManager));
ConsoleOutputOperator console = dag.addOperator("console", new ConsoleOutputOperator());
dag.addStream("nifi_console", nifi.outputPort, console.input).setLocality(null);
}
示例3: populateDAG
import org.apache.nifi.remote.client.SiteToSiteClient; //导入方法依赖的package包/类
@Override
public void populateDAG(DAG dag, Configuration conf)
{
final SiteToSiteClientConfig clientConfig = new SiteToSiteClient.Builder()
.url("http://localhost:8080/nifi")
.portName("Apex")
.buildConfig();
final int batchSize = 1;
final SiteToSiteClient.Builder builder = new SiteToSiteClient.Builder().fromConfig(clientConfig);
final NiFiDataPacketBuilder<String> dataPacketBuilder = new StringNiFiDataPacketBuilder();
final WindowDataManager windowDataManager = new WindowDataManager.NoopWindowDataManager();
RandomEventGenerator rand = dag.addOperator("rand", new RandomEventGenerator());
NiFiSinglePortOutputOperator nifi = dag.addOperator("nifi",
new NiFiSinglePortOutputOperator(builder, dataPacketBuilder, windowDataManager, batchSize));
dag.addStream("rand_nifi", rand.string_data, nifi.inputPort).setLocality(null);
}
示例4: getNiFiInput
import org.apache.nifi.remote.client.SiteToSiteClient; //导入方法依赖的package包/类
private NiFiSinglePortInputOperator getNiFiInput(DAG dag, LogLevelProperties props, WindowDataManager windowDataManager) {
final SiteToSiteClient.Builder inputConfig = new SiteToSiteClient.Builder()
.url(props.getNifiUrl())
.portName(props.getNifiInputPort())
.requestBatchCount(props.getNifiRequestBatch());
return dag.addOperator("nifi-in", new NiFiSinglePortInputOperator(inputConfig, windowDataManager));
}
示例5: getNiFiOutput
import org.apache.nifi.remote.client.SiteToSiteClient; //导入方法依赖的package包/类
private NiFiSinglePortOutputOperator getNiFiOutput(DAG dag, LogLevelProperties props, WindowDataManager windowDataManager) {
final SiteToSiteClient.Builder outputConfig = new SiteToSiteClient.Builder()
.url(props.getNifiUrl())
.portName(props.getNifiOutputPort());
final int batchSize = 1;
final NiFiDataPacketBuilder<LogLevels> dataPacketBuilder = new DictionaryBuilder(
props.getWindowMillis(), props.getLogLevelThreshold());
return dag.addOperator("nifi-out", new NiFiSinglePortOutputOperator(
outputConfig, dataPacketBuilder, windowDataManager ,batchSize));
}
示例6: AbstractNiFiOutputOperator
import org.apache.nifi.remote.client.SiteToSiteClient; //导入方法依赖的package包/类
/**
* @param siteToSiteBuilder the builder for a NiFi SiteToSiteClient
* @param dataPacketBuilder a builder to produce NiFiDataPackets from incoming data
* @param windowDataManager a WindowDataManager to save and load state for windows of tuples
*/
public AbstractNiFiOutputOperator(final SiteToSiteClient.Builder siteToSiteBuilder,
final NiFiDataPacketBuilder<T> dataPacketBuilder, final WindowDataManager windowDataManager)
{
this.siteToSiteBuilder = siteToSiteBuilder;
this.dataPacketBuilder = dataPacketBuilder;
this.windowDataManager = windowDataManager;
}
示例7: AbstractNiFiInputOperator
import org.apache.nifi.remote.client.SiteToSiteClient; //导入方法依赖的package包/类
/**
* @param siteToSiteBuilder the builder for a NiFi SiteToSiteClient
* @param windowDataManager a WindowDataManager to save and load state for windows of tuples
*/
public AbstractNiFiInputOperator(final SiteToSiteClient.Builder siteToSiteBuilder,
final WindowDataManager windowDataManager)
{
this.siteToSiteBuilder = siteToSiteBuilder;
this.windowDataManager = windowDataManager;
}
示例8: NiFiSinglePortOutputOperator
import org.apache.nifi.remote.client.SiteToSiteClient; //导入方法依赖的package包/类
/**
* @param siteToSiteBuilder the builder for a NiFi SiteToSiteClient
* @param dataPacketBuilder a builder to produce NiFiDataPackets from incoming data
* @param windowDataManager a WindowDataManager to save and load state for windows of tuples
* @param batchSize the maximum number of tuples to send to NiFi in a single transaction
*/
public NiFiSinglePortOutputOperator(
final SiteToSiteClient.Builder siteToSiteBuilder,
final NiFiDataPacketBuilder<T> dataPacketBuilder,
final WindowDataManager windowDataManager,
final int batchSize)
{
super(siteToSiteBuilder, dataPacketBuilder, windowDataManager);
this.inputPort = new BufferingInputPort(batchSize);
}
示例9: NiFiSinglePortInputOperator
import org.apache.nifi.remote.client.SiteToSiteClient; //导入方法依赖的package包/类
/**
*
* @param siteToSiteBuilder the builder for a NiFi SiteToSiteClient
* @param windowDataManager a WindowDataManager to save and load state for windows of tuples
*/
public NiFiSinglePortInputOperator(final SiteToSiteClient.Builder siteToSiteBuilder,
final WindowDataManager windowDataManager)
{
super(siteToSiteBuilder, windowDataManager);
}
示例10: AbstractNiFiSinglePortInputOperator
import org.apache.nifi.remote.client.SiteToSiteClient; //导入方法依赖的package包/类
/**
*
* @param siteToSiteBuilder the builder for a NiFi SiteToSiteClient
* @param windowDataManager a WindowDataManager to save and load state for windows of tuples
*/
public AbstractNiFiSinglePortInputOperator(final SiteToSiteClient.Builder siteToSiteBuilder,
final WindowDataManager windowDataManager)
{
super(siteToSiteBuilder, windowDataManager);
}