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


Java SiteToSiteClient类代码示例

本文整理汇总了Java中org.apache.nifi.remote.client.SiteToSiteClient的典型用法代码示例。如果您正苦于以下问题:Java SiteToSiteClient类的具体用法?Java SiteToSiteClient怎么用?Java SiteToSiteClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SiteToSiteClient类属于org.apache.nifi.remote.client包,在下文中一共展示了SiteToSiteClient类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
 
开发者ID:jfrazee,项目名称:nifi-put-site-to-site-bundle,代码行数:19,代码来源:PutSiteToSite.java

示例2: main

import org.apache.nifi.remote.client.SiteToSiteClient; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
	StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

	SiteToSiteClientConfig clientConfig = new SiteToSiteClient.Builder()
			.url("http://localhost:8080/nifi")
			.portName("Data for Flink")
			.requestBatchCount(5)
			.buildConfig();

	SourceFunction<NiFiDataPacket> nifiSource = new NiFiSource(clientConfig);
	DataStream<NiFiDataPacket> streamSource = env.addSource(nifiSource).setParallelism(2);

	DataStream<String> dataStream = streamSource.map(new MapFunction<NiFiDataPacket, String>() {
		@Override
		public String map(NiFiDataPacket value) throws Exception {
			return new String(value.getContent(), Charset.defaultCharset());
		}
	});

	dataStream.print();
	env.execute();
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:23,代码来源:NiFiSourceTopologyExample.java

示例3: main

import org.apache.nifi.remote.client.SiteToSiteClient; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
	StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

	SiteToSiteClientConfig clientConfig = new SiteToSiteClient.Builder()
			.url("http://localhost:8080/nifi")
			.portName("Data from Flink")
			.buildConfig();

	DataStreamSink<String> dataStream = env.fromElements("one", "two", "three", "four", "five", "q")
			.addSink(new NiFiSink<>(clientConfig, new NiFiDataPacketBuilder<String>() {
				@Override
				public NiFiDataPacket createNiFiDataPacket(String s, RuntimeContext ctx) {
					return new StandardNiFiDataPacket(s.getBytes(ConfigConstants.DEFAULT_CHARSET),
						new HashMap<String, String>());
				}
			}));

	env.execute();
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:20,代码来源:NiFiSinkTopologyExample.java

示例4: main

import org.apache.nifi.remote.client.SiteToSiteClient; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
	StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

	SiteToSiteClientConfig clientConfig = new SiteToSiteClient.Builder()
			.url("http://localhost:8080/nifi")
			.portName("Data from Flink")
			.buildConfig();

	DataStreamSink<String> dataStream = env.fromElements("one", "two", "three", "four", "five", "q")
			.addSink(new NiFiSink<>(clientConfig, new NiFiDataPacketBuilder<String>() {
				@Override
				public NiFiDataPacket createNiFiDataPacket(String s, RuntimeContext ctx) {
					return new StandardNiFiDataPacket(s.getBytes(), new HashMap<String,String>());
				}
			}));

	env.execute();
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:19,代码来源:NiFiSinkTopologyExample.java

示例5: 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);
}
 
开发者ID:apache,项目名称:apex-malhar,代码行数:18,代码来源:TestNiFiInputApplication.java

示例6: 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);
}
 
开发者ID:apache,项目名称:apex-malhar,代码行数:21,代码来源:TestNiFiOutputApplication.java

示例7: NifiPublisher

import org.apache.nifi.remote.client.SiteToSiteClient; //导入依赖的package包/类
public NifiPublisher(final SiteToSiteClient client, List<ILoggingEvent> messagesList, int pushInterval,
		Fallback fallbackForError) {
	this.client = client;
	this.messagesList = messagesList;
	this.pushInterval = pushInterval;
	this.fallbackForError = fallbackForError;
}
 
开发者ID:pradeepmvn,项目名称:logback-nifi-appender,代码行数:8,代码来源:NifiPublisher.java

示例8: start

import org.apache.nifi.remote.client.SiteToSiteClient; //导入依赖的package包/类
@Override
public void start() {
	//validate configuration
	if (!isConfigurationValid())
		return;

	client = new SiteToSiteClient.Builder().url(getUrl()).portIdentifier(getReceiverPortId())
			.portName(getReceiverPortName()).transportProtocol(getSiteToSiteTransportProtocol()).build();
	messagesList = new ArrayList<ILoggingEvent>();
	new Thread(new NifiPublisher(client, messagesList,getPushInterval(),new DefaultFallBackImpl())).start();
	super.start();
}
 
开发者ID:pradeepmvn,项目名称:logback-nifi-appender,代码行数:13,代码来源:NifiAppender.java

示例9: getSourceConfig

import org.apache.nifi.remote.client.SiteToSiteClient; //导入依赖的package包/类
private static SiteToSiteClientConfig getSourceConfig(WindowLogLevelCountProps props) {
    return new SiteToSiteClient.Builder()
            .url(props.getNifiUrl())
            .portName(props.getNifiInputPort())
            .requestBatchCount(props.getNifiRequestBatch())
            .buildConfig();
}
 
开发者ID:bbende,项目名称:nifi-streaming-examples,代码行数:8,代码来源:WindowLogLevelCount.java

示例10: 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));
}
 
开发者ID:bbende,项目名称:nifi-streaming-examples,代码行数:9,代码来源:LogLevelApplication.java

示例11: 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));
}
 
开发者ID:bbende,项目名称:nifi-streaming-examples,代码行数:13,代码来源:LogLevelApplication.java

示例12: getSourceConfig

import org.apache.nifi.remote.client.SiteToSiteClient; //导入依赖的package包/类
private static SiteToSiteClientConfig getSourceConfig(LogLevelCountProperties props) {
    return new SiteToSiteClient.Builder()
            .url(props.getNifiUrl())
            .portName(props.getNifiInputPort())
            .requestBatchCount(props.getNifiRequestBatch())
            .buildConfig();
}
 
开发者ID:bbende,项目名称:nifi-streaming-examples,代码行数:8,代码来源:LogLevelCountTopology.java

示例13: 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;
}
 
开发者ID:apache,项目名称:apex-malhar,代码行数:13,代码来源:AbstractNiFiOutputOperator.java

示例14: 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;
}
 
开发者ID:apache,项目名称:apex-malhar,代码行数:11,代码来源:AbstractNiFiInputOperator.java

示例15: 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);
}
 
开发者ID:apache,项目名称:apex-malhar,代码行数:16,代码来源:NiFiSinglePortOutputOperator.java


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