本文整理汇总了Java中com.espertech.esper.epl.spec.CreateIndexDesc类的典型用法代码示例。如果您正苦于以下问题:Java CreateIndexDesc类的具体用法?Java CreateIndexDesc怎么用?Java CreateIndexDesc使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CreateIndexDesc类属于com.espertech.esper.epl.spec包,在下文中一共展示了CreateIndexDesc类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: walk
import com.espertech.esper.epl.spec.CreateIndexDesc; //导入依赖的package包/类
public static CreateIndexDesc walk(EsperEPL2GrammarParser.CreateIndexExprContext ctx, Map<Tree, ExprNode> astExprNodeMap) {
String indexName = ctx.n.getText();
String windowName = ctx.w.getText();
boolean unique = false;
if (ctx.u != null) {
String ident = ctx.u.getText();
if (ident.toLowerCase(Locale.ENGLISH).trim().equals("unique")) {
unique = true;
} else {
throw ASTWalkException.from("Invalid keyword '" + ident + "' in create-index encountered, expected 'unique'");
}
}
List<CreateIndexItem> columns = new ArrayList<>();
List<EsperEPL2GrammarParser.CreateIndexColumnContext> cols = ctx.createIndexColumnList().createIndexColumn();
for (EsperEPL2GrammarParser.CreateIndexColumnContext col : cols) {
CreateIndexItem item = walk(col, astExprNodeMap);
columns.add(item);
}
return new CreateIndexDesc(unique, indexName, windowName, columns);
}
示例2: handleStartIndex
import com.espertech.esper.epl.spec.CreateIndexDesc; //导入依赖的package包/类
public void handleStartIndex(CreateIndexDesc spec) {
try {
List<VirtualDataWindowEventStartIndex.VDWCreateIndexField> fields = new ArrayList<VirtualDataWindowEventStartIndex.VDWCreateIndexField>();
for (CreateIndexItem col : spec.getColumns()) {
fields.add(new VirtualDataWindowEventStartIndex.VDWCreateIndexField(col.getExpressions(), col.getType(), col.getParameters()));
}
VirtualDataWindowEventStartIndex create = new VirtualDataWindowEventStartIndex(spec.getWindowName(), spec.getIndexName(), fields, spec.isUnique());
dataExternal.handleEvent(create);
} catch (Exception ex) {
String message = "Exception encountered invoking virtual data window handle start-index event for window '" + namedWindowName + "': " + ex.getMessage();
log.warn(message, ex);
throw new EPException(message, ex);
}
}
示例3: handleStopIndex
import com.espertech.esper.epl.spec.CreateIndexDesc; //导入依赖的package包/类
public void handleStopIndex(CreateIndexDesc spec) {
try {
VirtualDataWindowEventStopIndex theEvent = new VirtualDataWindowEventStopIndex(spec.getWindowName(), spec.getIndexName());
dataExternal.handleEvent(theEvent);
} catch (Exception ex) {
String message = "Exception encountered invoking virtual data window handle stop-index event for window '" + namedWindowName + "': " + ex.getMessage();
log.warn(message, ex);
}
}
示例4: StatementAgentInstanceFactoryCreateIndex
import com.espertech.esper.epl.spec.CreateIndexDesc; //导入依赖的package包/类
public StatementAgentInstanceFactoryCreateIndex(EPServicesContext services, CreateIndexDesc spec, Viewable finalView, NamedWindowProcessor namedWindowProcessor, String tableName, String contextName, QueryPlanIndexItem explicitIndexDesc) {
this.services = services;
this.spec = spec;
this.finalView = finalView;
this.namedWindowProcessor = namedWindowProcessor;
this.tableName = tableName;
this.contextName = contextName;
this.explicitIndexDesc = explicitIndexDesc;
}
示例5: handleStartIndex
import com.espertech.esper.epl.spec.CreateIndexDesc; //导入依赖的package包/类
public void handleStartIndex(CreateIndexDesc spec) {
try {
List<VirtualDataWindowEventStartIndex.VDWCreateIndexField> fields = new ArrayList<VirtualDataWindowEventStartIndex.VDWCreateIndexField>();
for (CreateIndexItem col : spec.getColumns()) {
fields.add(new VirtualDataWindowEventStartIndex.VDWCreateIndexField(col.getName(), col.getType() == CreateIndexType.HASH));
}
VirtualDataWindowEventStartIndex create = new VirtualDataWindowEventStartIndex(spec.getWindowName(), spec.getIndexName(), fields, spec.isUnique());
dataExternal.handleEvent(create);
}
catch (Exception ex) {
String message = "Exception encountered invoking virtual data window handle start-index event for window '" + namedWindowName + "': " + ex.getMessage();
log.warn(message, ex);
throw new EPException(message, ex);
}
}
示例6: handleStopIndex
import com.espertech.esper.epl.spec.CreateIndexDesc; //导入依赖的package包/类
public void handleStopIndex(CreateIndexDesc spec) {
try {
VirtualDataWindowEventStopIndex theEvent = new VirtualDataWindowEventStopIndex(spec.getWindowName(), spec.getIndexName());
dataExternal.handleEvent(theEvent);
}
catch (Exception ex) {
String message = "Exception encountered invoking virtual data window handle stop-index event for window '" + namedWindowName + "': " + ex.getMessage();
log.warn(message, ex);
}
}
示例7: startInternal
import com.espertech.esper.epl.spec.CreateIndexDesc; //导入依赖的package包/类
public EPStatementStartResult startInternal(EPServicesContext services, StatementContext statementContext, boolean isNewStatement, boolean isRecoveringStatement, boolean isRecoveringResilient) throws ExprValidationException, ViewProcessingException {
final CreateIndexDesc spec = statementSpec.getCreateIndexDesc();
final NamedWindowProcessor processor = services.getNamedWindowService().getProcessor(spec.getWindowName());
if (processor == null) {
throw new ExprValidationException("A named window by name '" + spec.getWindowName() + "' does not exist");
}
final NamedWindowProcessorInstance processorInstance = processor.getProcessorInstance(getDefaultAgentInstanceContext(statementContext));
EPStatementStopMethod stopMethod;
if (processor.isVirtualDataWindow()) {
final VirtualDWView virtualDWView = processorInstance.getRootViewInstance().getVirtualDataWindow();
virtualDWView.handleStartIndex(spec);
stopMethod = new EPStatementStopMethod() {
public void stop() {
virtualDWView.handleStopIndex(spec);
}
};
}
else {
processorInstance.getRootViewInstance().addExplicitIndex(spec.isUnique(), spec.getWindowName(), spec.getIndexName(), spec.getColumns());
stopMethod = new EPStatementStopMethod() {
public void stop()
{
processorInstance.getRootViewInstance().removeExplicitIndex(spec.getIndexName());
}
};
}
Viewable viewable = new ViewableDefaultImpl(processor.getNamedWindowType());
return new EPStatementStartResult(viewable, stopMethod, null);
}
示例8: handleStartIndex
import com.espertech.esper.epl.spec.CreateIndexDesc; //导入依赖的package包/类
public void handleStartIndex(CreateIndexDesc spec);
示例9: handleStopIndex
import com.espertech.esper.epl.spec.CreateIndexDesc; //导入依赖的package包/类
public void handleStopIndex(CreateIndexDesc spec);