本文整理汇总了Java中com.espertech.esperio.csv.CSVInputAdapter.start方法的典型用法代码示例。如果您正苦于以下问题:Java CSVInputAdapter.start方法的具体用法?Java CSVInputAdapter.start怎么用?Java CSVInputAdapter.start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.espertech.esperio.csv.CSVInputAdapter
的用法示例。
在下文中一共展示了CSVInputAdapter.start方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testConflictingPropertyOrder
import com.espertech.esperio.csv.CSVInputAdapter; //导入方法依赖的package包/类
public void testConflictingPropertyOrder() {
CSVInputAdapterSpec adapterSpec = new CSVInputAdapterSpec(new AdapterInputSource("regression/intsTitleRow.csv"), "intsTitleRowEvent");
adapterSpec.setEventsPerSec(10);
adapterSpec.setPropertyOrder(new String[]{"intTwo", "intOne"});
adapterSpec.setUsingEngineThread(true);
adapter = new CSVInputAdapter(epService, adapterSpec);
String statementText = "select * from intsTitleRowEvent#length(5)";
EPStatement statement = epService.getEPAdministrator().createEPL(statementText);
statement.addListener(listener);
adapter.start();
sendTimeEvent(100);
assertTrue(listener.getAndClearIsInvoked());
assertEquals(1, listener.getLastNewData().length);
assertEquals("1", listener.getLastNewData()[0].get("intTwo"));
assertEquals("0", listener.getLastNewData()[0].get("intOne"));
}
示例2: testNoPropertyTypes
import com.espertech.esperio.csv.CSVInputAdapter; //导入方法依赖的package包/类
public void testNoPropertyTypes() {
CSVInputAdapterSpec adapterSpec = new CSVInputAdapterSpec(new AdapterInputSource("regression/noTimestampOne.csv"), "allStringEvent");
adapterSpec.setEventsPerSec(10);
adapterSpec.setPropertyOrder(new String[]{"myInt", "myDouble", "myString"});
adapterSpec.setUsingEngineThread(true);
adapter = new CSVInputAdapter(epService, adapterSpec);
String statementText = "select * from allStringEvent#length(5)";
EPStatement statement = epService.getEPAdministrator().createEPL(statementText);
statement.addListener(listener);
adapter.start();
sendTimeEvent(100);
assertEvent("1", "1.1", "noTimestampOne.one");
sendTimeEvent(100);
assertEvent("2", "2.2", "noTimestampOne.two");
sendTimeEvent(100);
assertEvent("3", "3.3", "noTimestampOne.three");
}
示例3: testRuntimePropertyTypes
import com.espertech.esperio.csv.CSVInputAdapter; //导入方法依赖的package包/类
public void testRuntimePropertyTypes() {
CSVInputAdapterSpec adapterSpec = new CSVInputAdapterSpec(new AdapterInputSource("regression/noTimestampOne.csv"), "propertyTypeEvent");
adapterSpec.setEventsPerSec(10);
adapterSpec.setPropertyOrder(new String[]{"myInt", "myDouble", "myString"});
adapterSpec.setPropertyTypes(propertyTypes);
adapterSpec.setUsingEngineThread(true);
adapter = new CSVInputAdapter(epService, adapterSpec);
String statementText = "select * from propertyTypeEvent#length(5)";
EPStatement statement = epService.getEPAdministrator().createEPL(statementText);
statement.addListener(listener);
adapter.start();
sendTimeEvent(100);
assertEvent(1, 1.1, "noTimestampOne.one");
sendTimeEvent(100);
assertEvent(2, 2.2, "noTimestampOne.two");
sendTimeEvent(100);
assertEvent(3, 3.3, "noTimestampOne.three");
}
示例4: testUsingTimespan
import com.espertech.esperio.csv.CSVInputAdapter; //导入方法依赖的package包/类
public void testUsingTimespan() {
epService.getEPAdministrator().destroyAllStatements();
EPStatement stmt = epService.getEPAdministrator().createEPL("select current_timestamp as c0 from pattern[timer:interval(150 milliseconds)]");
stmt.addListener(listener);
CSVInputAdapterSpec adapterSpec = new CSVInputAdapterSpec(new AdapterInputSource("regression/timestampOne.csv"), eventTypeName);
adapterSpec.setUsingTimeSpanEvents(true);
adapterSpec.setTimestampColumn("timestamp");
adapterSpec.setPropertyOrder(propertyOrderTimestamps);
adapterSpec.setUsingExternalTimer(true);
adapterSpec.setUsingEngineThread(true);
adapter = new CSVInputAdapter(epService, adapterSpec);
adapter.start();
assertEquals(150L, listener.getNewDataListFlattened()[0].get("c0"));
}
示例5: startAdapter
import com.espertech.esperio.csv.CSVInputAdapter; //导入方法依赖的package包/类
private void startAdapter(String filename, int eventsPerSec, boolean isLooping, boolean usingEngineThread, String timestampColumn, String[] propertyOrder) {
CSVInputAdapterSpec adapterSpec = new CSVInputAdapterSpec(new AdapterInputSource(filename), eventTypeName);
if (eventsPerSec != -1) {
adapterSpec.setEventsPerSec(eventsPerSec);
}
adapterSpec.setLooping(isLooping);
adapterSpec.setPropertyOrder(propertyOrder);
adapterSpec.setUsingEngineThread(usingEngineThread);
adapterSpec.setTimestampColumn(timestampColumn);
adapter = new CSVInputAdapter(epService, adapterSpec);
adapter.start();
}