package main;

import java.util.HashMap;
import java.util.Map;

import com.espertech.esper.client.Configuration;
import com.espertech.esper.client.EPServiceProvider;
import com.espertech.esper.client.EPServiceProviderManager;
import com.espertech.esper.client.EPStatement;
import com.espertech.esperio.AdapterInputSource;
import com.espertech.esperio.csv.CSVInputAdapter;
import com.espertech.esperio.csv.CSVInputAdapterSpec;

public class BoilerMain {

	public static void main(String[] args) {

        Configuration config = new Configuration();
        config.addEventType("Boiler",Boiler.class);
        
  

        EPServiceProvider epService = EPServiceProviderManager.getProvider("Kazan", config);
        String expression = "select FC062APVR, FI066APVR, FI061APVR from Boiler.win:length(50)";
        EPStatement statement = epService.getEPAdministrator().createEPL(expression);

        MyListener listener = new MyListener();
        statement.addListener(listener);


        AdapterInputSource source = new AdapterInputSource("KBS-rawm.csv");
        CSVInputAdapterSpec csvInputAdapterSpec = new CSVInputAdapterSpec(source,"Boiler");
        csvInputAdapterSpec.setEventsPerSec(10);
		CSVInputAdapter csvInputAdapter = new CSVInputAdapter(epService, csvInputAdapterSpec);
		csvInputAdapter.start();
		
	
	}

}