當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。