本文整理汇总了Java中com.espertech.esper.event.EventTypeMetadata.createAnonymous方法的典型用法代码示例。如果您正苦于以下问题:Java EventTypeMetadata.createAnonymous方法的具体用法?Java EventTypeMetadata.createAnonymous怎么用?Java EventTypeMetadata.createAnonymous使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.espertech.esper.event.EventTypeMetadata
的用法示例。
在下文中一共展示了EventTypeMetadata.createAnonymous方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupInsert
import com.espertech.esper.event.EventTypeMetadata; //导入方法依赖的package包/类
private TableOnMergeActionIns setupInsert(TableMetadata tableMetadata, InternalEventRouter internalEventRouter, int selectClauseNumber, OnTriggerMergeActionInsert desc, EventType triggeringEventType, String triggeringStreamName, StatementContext statementContext)
throws ExprValidationException {
// Compile insert-into info
String streamName = desc.getOptionalStreamName() != null ? desc.getOptionalStreamName() : tableMetadata.getTableName();
InsertIntoDesc insertIntoDesc = InsertIntoDesc.fromColumns(streamName, desc.getColumns());
EventType insertIntoTargetType = streamName.equals(tableMetadata.getTableName()) ? tableMetadata.getInternalEventType() : null;
// rewrite any wildcards to use "stream.wildcard"
if (triggeringStreamName == null) {
triggeringStreamName = UuidGenerator.generate();
}
List<SelectClauseElementCompiled> selectNoWildcard = NamedWindowOnMergeHelper.compileSelectNoWildcard(triggeringStreamName, desc.getSelectClauseCompiled());
// Set up event types for select-clause evaluation: The first type does not contain anything as its the named window row which is not present for insert
EventType dummyTypeNoProperties = new MapEventType(EventTypeMetadata.createAnonymous("merge_named_window_insert", EventTypeMetadata.ApplicationType.MAP), "merge_named_window_insert", 0, null, Collections.<String, Object>emptyMap(), null, null, null);
EventType[] eventTypes = new EventType[]{dummyTypeNoProperties, triggeringEventType};
String[] streamNames = new String[]{UuidGenerator.generate(), triggeringStreamName};
StreamTypeService streamTypeService = new StreamTypeServiceImpl(eventTypes, streamNames, new boolean[1], statementContext.getEngineURI(), false, false);
// Get select expr processor
SelectExprEventTypeRegistry selectExprEventTypeRegistry = new SelectExprEventTypeRegistry(statementContext.getStatementName(), statementContext.getStatementEventTypeRef());
ExprEvaluatorContextStatement exprEvaluatorContext = new ExprEvaluatorContextStatement(statementContext, false);
SelectExprProcessorForge insertHelperForge = SelectExprProcessorFactory.getProcessor(Collections.singleton(selectClauseNumber),
selectNoWildcard.toArray(new SelectClauseElementCompiled[selectNoWildcard.size()]), false, insertIntoDesc, insertIntoTargetType, null, streamTypeService,
statementContext.getEventAdapterService(), statementContext.getStatementResultService(), statementContext.getValueAddEventService(), selectExprEventTypeRegistry,
statementContext.getEngineImportService(), exprEvaluatorContext, statementContext.getVariableService(), statementContext.getTableService(), statementContext.getTimeProvider(), statementContext.getEngineURI(), statementContext.getStatementId(), statementContext.getStatementName(), statementContext.getAnnotations(), statementContext.getContextDescriptor(), statementContext.getConfigSnapshot(), null, statementContext.getNamedWindowMgmtService(), null, null,
statementContext.getStatementExtensionServicesContext());
SelectExprProcessor insertHelper = SelectExprProcessorCompiler.allocateSelectExprEvaluator(statementContext.getEventAdapterService(), insertHelperForge, statementContext.getEngineImportService(), TableOnMergeHelper.class, false, statementContext.getStatementName());
ExprEvaluator filterEval = desc.getOptionalWhereClause() == null ? null : ExprNodeCompiler.allocateEvaluator(desc.getOptionalWhereClause().getForge(), statementContext.getEngineImportService(), this.getClass(), false, statementContext.getStatementName());
InternalEventRouter routerToUser = streamName.equals(tableMetadata.getTableName()) ? null : internalEventRouter;
boolean audit = AuditEnum.INSERT.getAudit(statementContext.getAnnotations()) != null;
return new TableOnMergeActionIns(filterEval, insertHelper, routerToUser, statementContext.getEpStatementHandle(), statementContext.getInternalEventEngineRouteDest(), audit, tableMetadata.getRowFactory());
}
示例2: setupInsert
import com.espertech.esper.event.EventTypeMetadata; //导入方法依赖的package包/类
private NamedWindowOnMergeActionIns setupInsert(String namedWindowName, InternalEventRouter internalEventRouter, EventTypeSPI eventTypeNamedWindow, int selectClauseNumber, OnTriggerMergeActionInsert desc, EventType triggeringEventType, String triggeringStreamName, StatementContext statementContext)
throws ExprValidationException {
// Compile insert-into info
String streamName = desc.getOptionalStreamName() != null ? desc.getOptionalStreamName() : eventTypeNamedWindow.getName();
InsertIntoDesc insertIntoDesc = InsertIntoDesc.fromColumns(streamName, desc.getColumns());
// rewrite any wildcards to use "stream.wildcard"
if (triggeringStreamName == null) {
triggeringStreamName = UuidGenerator.generate();
}
List<SelectClauseElementCompiled> selectNoWildcard = compileSelectNoWildcard(triggeringStreamName, desc.getSelectClauseCompiled());
// Set up event types for select-clause evaluation: The first type does not contain anything as its the named window row which is not present for insert
EventType dummyTypeNoProperties = new MapEventType(EventTypeMetadata.createAnonymous("merge_named_window_insert", EventTypeMetadata.ApplicationType.MAP), "merge_named_window_insert", 0, null, Collections.<String, Object>emptyMap(), null, null, null);
EventType[] eventTypes = new EventType[]{dummyTypeNoProperties, triggeringEventType};
String[] streamNames = new String[]{UuidGenerator.generate(), triggeringStreamName};
StreamTypeService streamTypeService = new StreamTypeServiceImpl(eventTypes, streamNames, new boolean[1], statementContext.getEngineURI(), false, false);
// Get select expr processor
SelectExprEventTypeRegistry selectExprEventTypeRegistry = new SelectExprEventTypeRegistry(statementContext.getStatementName(), statementContext.getStatementEventTypeRef());
ExprEvaluatorContextStatement exprEvaluatorContext = new ExprEvaluatorContextStatement(statementContext, false);
SelectExprProcessorForge insertHelperForge = SelectExprProcessorFactory.getProcessor(Collections.singleton(selectClauseNumber),
selectNoWildcard.toArray(new SelectClauseElementCompiled[selectNoWildcard.size()]), false, insertIntoDesc, null, null, streamTypeService,
statementContext.getEventAdapterService(), statementContext.getStatementResultService(), statementContext.getValueAddEventService(), selectExprEventTypeRegistry,
statementContext.getEngineImportService(), exprEvaluatorContext, statementContext.getVariableService(), statementContext.getTableService(), statementContext.getTimeProvider(), statementContext.getEngineURI(), statementContext.getStatementId(), statementContext.getStatementName(), statementContext.getAnnotations(), statementContext.getContextDescriptor(), statementContext.getConfigSnapshot(), null, statementContext.getNamedWindowMgmtService(), null, null,
statementContext.getStatementExtensionServicesContext());
SelectExprProcessor insertHelper = SelectExprProcessorCompiler.allocateSelectExprEvaluator(statementContext.getEventAdapterService(), insertHelperForge, statementContext.getEngineImportService(), NamedWindowOnMergeHelper.class, false, statementContext.getStatementName());
ExprEvaluator filterEval = desc.getOptionalWhereClause() == null ? null : ExprNodeCompiler.allocateEvaluator(desc.getOptionalWhereClause().getForge(), statementContext.getEngineImportService(), this.getClass(), false, statementContext.getStatementName());
InternalEventRouter routerToUser = streamName.equals(namedWindowName) ? null : internalEventRouter;
boolean audit = AuditEnum.INSERT.getAudit(statementContext.getAnnotations()) != null;
String insertIntoTableName = null;
if (statementContext.getTableService().getTableMetadata(insertIntoDesc.getEventTypeName()) != null) {
insertIntoTableName = insertIntoDesc.getEventTypeName();
}
return new NamedWindowOnMergeActionIns(filterEval, insertHelper, routerToUser, insertIntoTableName, statementContext.getTableService(), statementContext.getEpStatementHandle(), statementContext.getInternalEventEngineRouteDest(), audit);
}
示例3: setupInsert
import com.espertech.esper.event.EventTypeMetadata; //导入方法依赖的package包/类
private NamedWindowOnMergeActionIns setupInsert(String namedWindowName, InternalEventRouter internalEventRouter, EventTypeSPI eventTypeNamedWindow, int selectClauseNumber, OnTriggerMergeActionInsert desc, EventType triggeringEventType, String triggeringStreamName, StatementContext statementContext)
throws ExprValidationException {
// Compile insert-into info
String streamName = desc.getOptionalStreamName() != null ? desc.getOptionalStreamName() : eventTypeNamedWindow.getName();
List<SelectClauseElementCompiled> selectClause = desc.getSelectClauseCompiled();
InsertIntoDesc insertIntoDesc = new InsertIntoDesc(SelectClauseStreamSelectorEnum.ISTREAM_ONLY, streamName);
for (String col : desc.getColumns()) {
insertIntoDesc.add(col);
}
// rewrite any wildcards to use "stream.wildcard"
if (triggeringStreamName == null) {
triggeringStreamName = UuidGenerator.generate();
}
List<SelectClauseElementCompiled> selectNoWildcard = new ArrayList<SelectClauseElementCompiled>();
for (SelectClauseElementCompiled element : selectClause)
{
if (!(element instanceof SelectClauseElementWildcard))
{
selectNoWildcard.add(element);
continue;
}
SelectClauseStreamCompiledSpec streamSelect = new SelectClauseStreamCompiledSpec(triggeringStreamName, null);
streamSelect.setStreamNumber(1);
selectNoWildcard.add(streamSelect);
}
// Set up event types for select-clause evaluation: The first type does not contain anything as its the named window row which is not present for insert
EventType dummyTypeNoProperties = new MapEventType(EventTypeMetadata.createAnonymous("merge_named_window_insert"), "merge_named_window_insert", 0, null, Collections.<String, Object>emptyMap(), null, null, null);
EventType[] eventTypes = new EventType[] {dummyTypeNoProperties, triggeringEventType};
String[] streamNames = new String[] {UuidGenerator.generate(), triggeringStreamName};
StreamTypeService streamTypeService = new StreamTypeServiceImpl(eventTypes, streamNames, new boolean[1], statementContext.getEngineURI(), false);
// Get select expr processor
SelectExprEventTypeRegistry selectExprEventTypeRegistry = new SelectExprEventTypeRegistry(statementContext.getDynamicReferenceEventTypes());
ExprEvaluatorContextStatement exprEvaluatorContext = new ExprEvaluatorContextStatement(statementContext);
SelectExprProcessor insertHelper = SelectExprProcessorFactory.getProcessor(Collections.singleton(selectClauseNumber), selectNoWildcard, false, insertIntoDesc, null, streamTypeService,
statementContext.getEventAdapterService(), statementContext.getStatementResultService(), statementContext.getValueAddEventService(), selectExprEventTypeRegistry,
statementContext.getMethodResolutionService(), exprEvaluatorContext, statementContext.getVariableService(), statementContext.getTimeProvider(), statementContext.getEngineURI(), statementContext.getStatementId(), statementContext.getStatementName(), statementContext.getAnnotations(), statementContext.getContextDescriptor(), statementContext.getConfigSnapshot(), null);
ExprEvaluator filterEval = desc.getOptionalWhereClause() == null ? null : desc.getOptionalWhereClause().getExprEvaluator();
InternalEventRouter routerToUser = streamName.equals(namedWindowName) ? null : internalEventRouter;
boolean audit = AuditEnum.INSERT.getAudit(statementContext.getAnnotations()) != null;
return new NamedWindowOnMergeActionIns(filterEval, insertHelper, routerToUser, statementContext.getEpStatementHandle(), statementContext.getInternalEventEngineRouteDest(), audit);
}
示例4: makeTransientOAType
import com.espertech.esper.event.EventTypeMetadata; //导入方法依赖的package包/类
public static ObjectArrayEventType makeTransientOAType(String enumMethod, String propertyName, Class type) {
Map<String, Object> propsResult = new HashMap<String, Object>();
propsResult.put(propertyName, type);
String typeName = enumMethod + "__" + propertyName;
return new ObjectArrayEventType(EventTypeMetadata.createAnonymous(typeName), typeName, 0, null, propsResult, null, null, null);
}