本文整理汇总了Java中com.espertech.esper.client.ConfigurationPlugInAggregationMultiFunction类的典型用法代码示例。如果您正苦于以下问题:Java ConfigurationPlugInAggregationMultiFunction类的具体用法?Java ConfigurationPlugInAggregationMultiFunction怎么用?Java ConfigurationPlugInAggregationMultiFunction使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ConfigurationPlugInAggregationMultiFunction类属于com.espertech.esper.client包,在下文中一共展示了ConfigurationPlugInAggregationMultiFunction类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: runAssertionPlugInAccess_RefCountedMap
import com.espertech.esper.client.ConfigurationPlugInAggregationMultiFunction; //导入依赖的package包/类
private void runAssertionPlugInAccess_RefCountedMap(EPServiceProvider epService) {
ConfigurationPlugInAggregationMultiFunction config = new ConfigurationPlugInAggregationMultiFunction(
"referenceCountedMap,referenceCountLookup".split(","), ReferenceCountedMapMultiValueFactory.class.getName());
epService.getEPAdministrator().getConfiguration().addPlugInAggregationMultiFunction(config);
epService.getEPAdministrator().createEPL("create table varaggRCM (wordCount referenceCountedMap(string))");
epService.getEPAdministrator().createEPL("into table varaggRCM select referenceCountedMap(theString) as wordCount from SupportBean#length(3)");
SupportUpdateListener listener = new SupportUpdateListener();
epService.getEPAdministrator().createEPL("select varaggRCM.wordCount.referenceCountLookup(p00) as c0 from SupportBean_S0").addListener(listener);
String words = "the,house,is,green";
sendWordAssert(epService, listener, "the", words, new Integer[]{1, null, null, null});
sendWordAssert(epService, listener, "house", words, new Integer[]{1, 1, null, null});
sendWordAssert(epService, listener, "the", words, new Integer[]{2, 1, null, null});
sendWordAssert(epService, listener, "green", words, new Integer[]{1, 1, null, 1});
sendWordAssert(epService, listener, "is", words, new Integer[]{1, null, 1, 1});
}
示例2: getTableExprChainable
import com.espertech.esper.client.ConfigurationPlugInAggregationMultiFunction; //导入依赖的package包/类
public static Pair<ExprTableAccessNode, List<ExprChainedSpec>> getTableExprChainable(
EngineImportService engineImportService,
LazyAllocatedMap<ConfigurationPlugInAggregationMultiFunction, PlugInAggregationMultiFunctionFactory> plugInAggregations,
String engineURI,
String tableName,
List<ExprChainedSpec> chain) {
// handle just "variable[...].sub"
String subpropName = chain.get(0).getName();
if (chain.size() == 1) {
chain.remove(0);
ExprTableAccessNodeSubprop tableNode = new ExprTableAccessNodeSubprop(tableName, subpropName);
return new Pair<ExprTableAccessNode, List<ExprChainedSpec>>(tableNode, chain);
}
// we have a chain "variable[...].sub.xyz"
return handleTable(engineImportService, plugInAggregations, engineURI,
tableName, subpropName, chain);
}
示例3: handleTable
import com.espertech.esper.client.ConfigurationPlugInAggregationMultiFunction; //导入依赖的package包/类
private static Pair<ExprTableAccessNode, List<ExprChainedSpec>> handleTable(
EngineImportService engineImportService,
LazyAllocatedMap<ConfigurationPlugInAggregationMultiFunction, PlugInAggregationMultiFunctionFactory> plugInAggregations,
String engineURI,
String tableName,
String sub,
List<ExprChainedSpec> chain) {
ExprTableAccessNode node = new ExprTableAccessNodeSubprop(tableName, sub);
List<ExprChainedSpec> subchain = chain.subList(1, chain.size());
String candidateAccessor = subchain.get(0).getName();
ExprAggregateNodeBase exprNode = (ExprAggregateNodeBase) ASTAggregationHelper.tryResolveAsAggregation(engineImportService, false, candidateAccessor, plugInAggregations, engineURI);
if (exprNode != null) {
node = new ExprTableAccessNodeSubpropAccessor(tableName, sub, exprNode);
exprNode.addChildNodes(subchain.get(0).getParameters());
subchain.remove(0);
}
return new Pair<ExprTableAccessNode, List<ExprChainedSpec>>(node, subchain);
}
示例4: PlugInAggregationMultiFunctionValidationContext
import com.espertech.esper.client.ConfigurationPlugInAggregationMultiFunction; //导入依赖的package包/类
public PlugInAggregationMultiFunctionValidationContext(String functionName, EventType[] eventTypes, ExprNode[] parameterExpressions, String engineURI, String statementName, ExprValidationContext validationContext, ConfigurationPlugInAggregationMultiFunction config, TableMetadataColumnAggregation optionalTableColumnAccessed, ExprNode[] allParameterExpressions) {
this.functionName = functionName;
this.eventTypes = eventTypes;
this.parameterExpressions = parameterExpressions;
this.engineURI = engineURI;
this.statementName = statementName;
this.validationContext = validationContext;
this.config = config;
this.optionalTableColumnAccessed = optionalTableColumnAccessed;
this.allParameterExpressions = allParameterExpressions;
}
示例5: checkTableNameGetLibFunc
import com.espertech.esper.client.ConfigurationPlugInAggregationMultiFunction; //导入依赖的package包/类
public static Pair<ExprTableAccessNode, List<ExprChainedSpec>> checkTableNameGetLibFunc(
TableService tableService,
EngineImportService engineImportService,
LazyAllocatedMap<ConfigurationPlugInAggregationMultiFunction, PlugInAggregationMultiFunctionFactory> plugInAggregations,
String engineURI,
String classIdent,
List<ExprChainedSpec> chain) {
int index = StringValue.unescapedIndexOfDot(classIdent);
// handle special case "table.keys()" function
if (index == -1) {
if (tableService.getTableMetadata(classIdent) == null) {
return null; // not a table
}
String funcName = chain.get(1).getName();
if (funcName.toLowerCase(Locale.ENGLISH).equals("keys")) {
List<ExprChainedSpec> subchain = chain.subList(2, chain.size());
ExprTableAccessNodeKeys node = new ExprTableAccessNodeKeys(classIdent);
return new Pair<ExprTableAccessNode, List<ExprChainedSpec>>(node, subchain);
} else {
throw ASTWalkException.from("Invalid use of variable '" + classIdent + "', unrecognized use of function '" + funcName + "', expected 'keys()'");
}
}
// Handle "table.property" (without the variable[...] syntax since this is ungrouped use)
String tableName = ASTUtil.unescapeDot(classIdent.substring(0, index));
if (tableService.getTableMetadata(tableName) == null) {
return null;
}
// this is a table access expression
String sub = classIdent.substring(index + 1, classIdent.length());
return handleTable(engineImportService, plugInAggregations, engineURI, tableName, sub, chain);
}
示例6: tryAssertionUngroupedAggAdditionalAndPlugin
import com.espertech.esper.client.ConfigurationPlugInAggregationMultiFunction; //导入依赖的package包/类
private void tryAssertionUngroupedAggAdditionalAndPlugin(EPServiceProvider epService) {
epService.getEPAdministrator().getConfiguration().addPlugInAggregationFunctionFactory("concatstring", MyConcatAggregationFunctionFactory.class.getName());
ConfigurationPlugInAggregationMultiFunction mfAggConfig = new ConfigurationPlugInAggregationMultiFunction(SupportAggMFFunc.getFunctionNames(), SupportAggMFFactory.class.getName());
epService.getEPAdministrator().getConfiguration().addPlugInAggregationMultiFunction(mfAggConfig);
String[] cols = "c0,c1,c2,c3,c4,c5,c8,c9,c10,c11,c12,c13".split(",");
String epl = "select intPrimitive, " +
" countever(*, intPrimitive>0, group_by:(theString)) as c0," +
" countever(*, intPrimitive>0, group_by:()) as c1," +
" countever(*, group_by:(theString)) as c2," +
" countever(*, group_by:()) as c3," +
" concatstring(Integer.toString(intPrimitive), group_by:(theString)) as c4," +
" concatstring(Integer.toString(intPrimitive), group_by:()) as c5," +
" sc(intPrimitive, group_by:(theString)) as c6," +
" sc(intPrimitive, group_by:()) as c7," +
" leaving(group_by:(theString)) as c8," +
" leaving(group_by:()) as c9," +
" rate(3, group_by:(theString)) as c10," +
" rate(3, group_by:()) as c11," +
" nth(intPrimitive, 1, group_by:(theString)) as c12," +
" nth(intPrimitive, 1, group_by:()) as c13" +
" from SupportBean as sb";
SupportUpdateListener listener = new SupportUpdateListener();
epService.getEPAdministrator().createEPL(epl).addListener(listener);
makeSendEvent(epService, "E1", 10);
assertScalarColl(listener.getLastNewData()[0], new Integer[]{10}, new Integer[]{10});
EPAssertionUtil.assertProps(listener.assertOneGetNewAndReset(), cols, new Object[]{1L, 1L, 1L, 1L, "10", "10", false, false,
null, null, null, null});
makeSendEvent(epService, "E2", 20);
assertScalarColl(listener.getLastNewData()[0], new Integer[]{20}, new Integer[]{10, 20});
EPAssertionUtil.assertProps(listener.assertOneGetNewAndReset(), cols, new Object[]{1L, 2L, 1L, 2L, "20", "10 20", false, false,
null, null, null, 10});
makeSendEvent(epService, "E1", -1);
assertScalarColl(listener.getLastNewData()[0], new Integer[]{10, -1}, new Integer[]{10, 20, -1});
EPAssertionUtil.assertProps(listener.assertOneGetNewAndReset(), cols, new Object[]{1L, 2L, 2L, 3L, "10 -1", "10 20 -1", false, false,
null, null, 10, 20});
makeSendEvent(epService, "E2", 30);
assertScalarColl(listener.getLastNewData()[0], new Integer[]{20, 30}, new Integer[]{10, 20, -1, 30});
EPAssertionUtil.assertProps(listener.assertOneGetNewAndReset(), cols, new Object[]{2L, 3L, 2L, 4L, "20 30", "10 20 -1 30", false, false,
null, null, 20, -1});
// plug-in aggregation function can also take other parameters
epService.getEPAdministrator().createEPL("select sc(intPrimitive, dummy:1)," +
"concatstring(Integer.toString(intPrimitive), dummy2:(1,2,3)) from SupportBean");
epService.getEPAdministrator().destroyAllStatements();
}
示例7: getPlugInAggregations
import com.espertech.esper.client.ConfigurationPlugInAggregationMultiFunction; //导入依赖的package包/类
public LazyAllocatedMap<ConfigurationPlugInAggregationMultiFunction, PlugInAggregationMultiFunctionFactory> getPlugInAggregations() {
return plugInAggregations;
}
示例8: ExprPlugInAggMultiFunctionNode
import com.espertech.esper.client.ConfigurationPlugInAggregationMultiFunction; //导入依赖的package包/类
public ExprPlugInAggMultiFunctionNode(boolean distinct, ConfigurationPlugInAggregationMultiFunction config, PlugInAggregationMultiFunctionFactory pluginAggregationMultiFunctionFactory, String functionName) {
super(distinct);
this.pluginAggregationMultiFunctionFactory = pluginAggregationMultiFunctionFactory;
this.functionName = functionName;
this.config = config;
}
示例9: setPlugInAggregationMultiFunction
import com.espertech.esper.client.ConfigurationPlugInAggregationMultiFunction; //导入依赖的package包/类
public void setPlugInAggregationMultiFunction(List<ConfigurationPlugInAggregationMultiFunction> aggregatnmultifunctns){
for(ConfigurationPlugInAggregationMultiFunction aggrefn:aggregatnmultifunctns){
m_esperconfig.addPlugInAggregationMultiFunction(aggrefn);
}
}
示例10: getPlugInAggregationMultiFunctions
import com.espertech.esper.client.ConfigurationPlugInAggregationMultiFunction; //导入依赖的package包/类
@Override
public List<ConfigurationPlugInAggregationMultiFunction> getPlugInAggregationMultiFunctions() {
return m_esperconfig.getPlugInAggregationMultiFunctions();
}
示例11: addPlugInAggregationMultiFunction
import com.espertech.esper.client.ConfigurationPlugInAggregationMultiFunction; //导入依赖的package包/类
@Override
public void addPlugInAggregationMultiFunction(ConfigurationPlugInAggregationMultiFunction config)
throws ConfigurationException {
m_esperconfig.addPlugInAggregationMultiFunction(config);
}
示例12: PlugInAggregationMultiFunctionDeclarationContext
import com.espertech.esper.client.ConfigurationPlugInAggregationMultiFunction; //导入依赖的package包/类
/**
* Ctor.
*
* @param functionName provides the aggregation multi-function name
* @param distinct flag whether the "distinct" keyword was provided.
* @param engineURI the engine URI
* @param configuration the configuration provided when the aggregation multi-functions where registered
*/
public PlugInAggregationMultiFunctionDeclarationContext(String functionName, boolean distinct, String engineURI, ConfigurationPlugInAggregationMultiFunction configuration) {
this.functionName = functionName;
this.distinct = distinct;
this.engineURI = engineURI;
this.configuration = configuration;
}
示例13: getConfiguration
import com.espertech.esper.client.ConfigurationPlugInAggregationMultiFunction; //导入依赖的package包/类
/**
* Returns the configuration provided when the aggregation multi-functions where registered.
*
* @return configuration
*/
public ConfigurationPlugInAggregationMultiFunction getConfiguration() {
return configuration;
}
示例14: getConfig
import com.espertech.esper.client.ConfigurationPlugInAggregationMultiFunction; //导入依赖的package包/类
/**
* Returns the original configuration object for the aggregation multi-function
*
* @return config
*/
public ConfigurationPlugInAggregationMultiFunction getConfig() {
return config;
}