本文整理汇总了Java中com.espertech.esper.client.Configuration.addImport方法的典型用法代码示例。如果您正苦于以下问题:Java Configuration.addImport方法的具体用法?Java Configuration.addImport怎么用?Java Configuration.addImport使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.espertech.esper.client.Configuration
的用法示例。
在下文中一共展示了Configuration.addImport方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getEngineWKafkaOutput
import com.espertech.esper.client.Configuration; //导入方法依赖的package包/类
public static EPServiceProvider getEngineWKafkaOutput(String uri, Properties pluginProperties) {
Configuration engineConfig = new Configuration();
engineConfig.addImport(KafkaOutputDefault.class);
engineConfig.getEngineDefaults().getThreading().setInternalTimerEnabled(false);
engineConfig.addPluginLoader(EsperIOKafkaOutputAdapterPlugin.class.getSimpleName(), EsperIOKafkaOutputAdapterPlugin.class.getName(), pluginProperties, null);
return EPServiceProviderManager.getProvider(uri, engineConfig);
}
示例2: registerConfiguration
import com.espertech.esper.client.Configuration; //导入方法依赖的package包/类
/**
* Inject in Esper Configuration geospatial methods and classes
* @param configuration
*/
public static void registerConfiguration(Configuration configuration) {
// Inject methods to create Geometry variables
configuration.addPlugInSingleRowFunction("polygon", Geospatial.class.getName(), "createPolygon");
configuration.addPlugInSingleRowFunction("point", Geospatial.class.getName(), "createPoint");
configuration.addPlugInSingleRowFunction("geometry", Geospatial.class.getName(), "readGeometry");
// Register Geometry class
configuration.addImport(Geometry.class.getName());
}
示例3: makeConfig
import com.espertech.esper.client.Configuration; //导入方法依赖的package包/类
private Configuration makeConfig(String typeName, boolean useBean) {
Configuration configuration = new Configuration();
configuration.addImport(FileSourceCSV.class.getPackage().getName() + ".*");
if (useBean) {
configuration.addEventType(typeName, ExampleMarketDataBean.class);
} else {
Map<String, Object> eventProperties = new HashMap<String, Object>();
eventProperties.put("symbol", String.class);
eventProperties.put("price", double.class);
eventProperties.put("volume", Integer.class);
configuration.addEventType(typeName, eventProperties);
}
return configuration;
}
示例4: testReadWritePropsBean
import com.espertech.esper.client.Configuration; //导入方法依赖的package包/类
public void testReadWritePropsBean() {
Configuration configuration = new Configuration();
configuration.addEventType("ReadWrite", ExampleMarketDataBeanReadWrite.class);
configuration.addImport(FileSourceCSV.class.getPackage().getName() + ".*");
epService = EPServiceProviderManager.getProvider("testExistingTypeNoOptions", configuration);
epService.initialize();
EPStatement stmt = epService.getEPAdministrator().createEPL("select * from ReadWrite#length(100)");
SupportUpdateListener listener = new SupportUpdateListener();
stmt.addListener(listener);
(new CSVInputAdapter(epService, new AdapterInputSource(CSV_FILENAME_ONELINE_TRADE), "ReadWrite")).start();
assertEquals(1, listener.getNewDataList().size());
EventBean eb = listener.getNewDataList().get(0)[0];
assertTrue(ExampleMarketDataBeanReadWrite.class == eb.getUnderlying().getClass());
assertEquals(55.5 * 1000, eb.get("value"));
// test graph
String graph = "create dataflow ReadCSV " +
"FileSource -> mystream<ReadWrite> { file: '" + CSV_FILENAME_ONELINE_TRADE + "', hasTitleLine: true, classpathFile: true }" +
"DefaultSupportCaptureOp(mystream) {}";
epService.getEPAdministrator().createEPL(graph);
DefaultSupportCaptureOp<Object> outputOp = new DefaultSupportCaptureOp<Object>();
EPDataFlowInstance instance = epService.getEPRuntime().getDataFlowRuntime().instantiate("ReadCSV", new EPDataFlowInstantiationOptions().operatorProvider(new DefaultSupportGraphOpProvider(outputOp)));
instance.run();
Object[] received = outputOp.getAndReset().get(0).toArray();
assertEquals(1, received.length);
assertEquals(55.5 * 1000, ((ExampleMarketDataBeanReadWrite) received[0]).getValue());
}
示例5: setUp
import com.espertech.esper.client.Configuration; //导入方法依赖的package包/类
protected void setUp() {
Configuration configuration = new Configuration();
configuration.getEngineDefaults().getThreading().setInternalTimerEnabled(false);
configuration.addImport(FileSinkFactory.class.getPackage().getName() + ".*");
configuration.addImport(DefaultSupportSourceOp.class.getName());
epService = EPServiceProviderManager.getDefaultProvider(configuration);
epService.initialize();
DefaultSupportGraphEventUtil.addTypeConfiguration(epService);
}
示例6: configure
import com.espertech.esper.client.Configuration; //导入方法依赖的package包/类
public void configure(Configuration configuration) throws Exception {
configuration.addMethodRef(MyStaticService.class, new ConfigurationMethodRef());
configuration.addImport(MyStaticService.class);
configuration.getEngineDefaults().getLogging().setEnableQueryPlan(true);
configuration.addEventType(SupportBean.class);
configuration.addEventType(SupportBean_S0.class);
configuration.addEventType(SupportBean_S1.class);
configuration.addEventType(SupportBean_S2.class);
}
示例7: configure
import com.espertech.esper.client.Configuration; //导入方法依赖的package包/类
public void configure(Configuration configuration) throws Exception {
configuration.getEngineDefaults().getLogging().setEnableQueryPlan(true);
configuration.getEngineDefaults().getLogging().setEnableCode(true);
configuration.getEngineDefaults().getByteCodeGeneration().setIncludeDebugSymbols(true);
configuration.addEventType(SupportBeanInt.class);
configuration.addImport(SupportJoinMethods.class.getName());
configuration.addVariable("var1", Integer.class, 0);
configuration.addVariable("var2", Integer.class, 0);
configuration.addVariable("var3", Integer.class, 0);
configuration.addVariable("var4", Integer.class, 0);
}
示例8: configure
import com.espertech.esper.client.Configuration; //导入方法依赖的package包/类
public void configure(Configuration configuration) throws Exception {
configuration.addEventType(SupportBeanInt.class);
configuration.addEventType(SupportBean.class);
configuration.addImport(SupportJoinMethods.class.getName());
configuration.addVariable("var1", Integer.class, 0);
configuration.addVariable("var2", Integer.class, 0);
configuration.addVariable("var3", Integer.class, 0);
configuration.addVariable("var4", Integer.class, 0);
}
示例9: configure
import com.espertech.esper.client.Configuration; //导入方法依赖的package包/类
public void configure(Configuration configuration) throws Exception {
configuration.getEngineDefaults().getThreading().setInternalTimerEnabled(true);
configuration.getEngineDefaults().getExpression().setUdfCache(false);
configuration.getEngineDefaults().getThreading().setThreadPoolRouteExec(true);
configuration.getEngineDefaults().getThreading().setThreadPoolRouteExecNumThreads(5);
configuration.addEventType("SupportBean", SupportBean.class);
configuration.addImport(SupportStaticMethodLib.class.getName());
}
示例10: configure
import com.espertech.esper.client.Configuration; //导入方法依赖的package包/类
public void configure(Configuration configuration) throws Exception {
configuration.getEngineDefaults().getThreading().setInternalTimerEnabled(false);
configuration.getEngineDefaults().getExpression().setUdfCache(false);
configuration.getEngineDefaults().getThreading().setThreadPoolTimerExec(true);
configuration.getEngineDefaults().getThreading().setThreadPoolTimerExecNumThreads(5);
configuration.addEventType("MyMap", new HashMap<>());
configuration.addImport(SupportStaticMethodLib.class.getName());
}
示例11: applyMetricsConfig
import com.espertech.esper.client.Configuration; //导入方法依赖的package包/类
protected static void applyMetricsConfig(Configuration configuration, long engineMetricInterval, long stmtMetricInterval, boolean shareViews) {
configuration.getEngineDefaults().getViewResources().setShareViews(shareViews);
configuration.getEngineDefaults().getMetricsReporting().setEnableMetricsReporting(true);
configuration.getEngineDefaults().getMetricsReporting().setThreading(false);
configuration.getEngineDefaults().getMetricsReporting().setEngineInterval(engineMetricInterval);
configuration.getEngineDefaults().getMetricsReporting().setStatementInterval(stmtMetricInterval);
configuration.addImport(MyMetricFunctions.class.getName());
configuration.addEventType("SupportBean", SupportBean.class);
}
示例12: configure
import com.espertech.esper.client.Configuration; //导入方法依赖的package包/类
public void configure(Configuration configuration) throws Exception {
configuration.addEventType("SupportBean", SupportBean.class);
configuration.addEventType("SupportBean_ST0_Container", SupportBean_ST0_Container.class);
configuration.addEventType("SupportDateTime", SupportDateTime.class);
configuration.addImport(SupportBean_ST0_Container.class);
configuration.addPlugInSingleRowFunction("makeTest", SupportBean_ST0_Container.class.getName(), "makeTest");
}
示例13: configure
import com.espertech.esper.client.Configuration; //导入方法依赖的package包/类
public void configure(Configuration configuration) throws Exception {
configuration.addEventType("SupportBean", SupportBean.class);
configuration.addEventType("SupportBean_ST0", SupportBean_ST0.class);
configuration.addEventType("SupportBean_ST0_Container", SupportBean_ST0_Container.class);
configuration.addEventType("SupportBeanComplexProps", SupportBeanComplexProps.class);
configuration.addEventType("SupportCollection", SupportCollection.class);
configuration.addImport(SupportBean_ST0_Container.class);
configuration.addPlugInSingleRowFunction("makeTest", SupportBean_ST0_Container.class.getName(), "makeTest");
}
示例14: setUp
import com.espertech.esper.client.Configuration; //导入方法依赖的package包/类
protected void setUp() {
Configuration configuration = new Configuration();
configuration.getEngineDefaults().getThreading().setInternalTimerEnabled(false);
configuration.addImport(AMQPSource.class);
configuration.addImport(AMQPSink.class);
epService = EPServiceProviderManager.getDefaultProvider(configuration);
epService.initialize();
epService.getEPRuntime().sendEvent(new TimerControlEvent(TimerControlEvent.ClockType.CLOCK_EXTERNAL));
}
示例15: configure
import com.espertech.esper.client.Configuration; //导入方法依赖的package包/类
public void configure(Configuration configuration) throws Exception {
configuration.addEventType("MyEvent", SupportRecogBean.class);
configuration.addImport(SupportStaticMethodLib.class.getName());
configuration.addImport(Hint.class.getName());
configuration.addVariable("mySleepDuration", long.class, 100); // msec
}