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


Java CSVInputAdapter.start方法代码示例

本文整理汇总了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"));
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:21,代码来源:TestCSVAdapter.java

示例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");
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:23,代码来源:TestCSVAdapter.java

示例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");
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:24,代码来源:TestCSVAdapter.java

示例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"));
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:18,代码来源:TestCSVAdapter.java

示例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();
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:14,代码来源:TestCSVAdapter.java


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