Reference

Friday, July 22, 2016

One of the big feature of big data is to do analytics on "data in motion". In this big dynamic world change is the only constant. Similar thing happens to the data also. How to proceed ? Infosphere streams are there to encourage us.

First i have to create a constant source of data.

To create constant source of data, I look at the stock market.

This URL has stock market data.

Now i have to create the program.

In this program two important things are used Topology andTStream

package project1;

import org.jsoup.Connection;

import org.jsoup.Jsoup;

import org.jsoup.nodes.Element;

import org.jsoup.select.Elements;

import com.ibm.streamsx.topology.TStream;

import com.ibm.streamsx.topology.Topology;

import com.ibm.streamsx.topology.context.StreamsContextFactory;

publicclass StockStreaming {

/**

* The topology object contains information about the structure of our graph

* (that is, our application), including how the data is generated and

* processed

*/

privatestatic Topology topology = new Topology("stockSensor");

privatestatic Connection connection = Jsoup.connect(URL);

privatestatic Element doc = null;

privatestatic Element quoteSummary = null;

/**

* The endlessSource()method will repeatedly call the function’s overridden