当前位置: 首页>>代码示例>>Java>>正文


Java CreateIndexDesc类代码示例

本文整理汇总了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);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:23,代码来源:ASTIndexHelper.java

示例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);
    }
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:15,代码来源:VirtualDWViewImpl.java

示例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);
    }
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:10,代码来源:VirtualDWViewImpl.java

示例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;
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:10,代码来源:StatementAgentInstanceFactoryCreateIndex.java

示例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);
    }
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:16,代码来源:VirtualDWViewImpl.java

示例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);
    }
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:11,代码来源:VirtualDWViewImpl.java

示例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);
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:32,代码来源:EPStatementStartMethodCreateIndex.java

示例8: handleStartIndex

import com.espertech.esper.epl.spec.CreateIndexDesc; //导入依赖的package包/类
public void handleStartIndex(CreateIndexDesc spec); 
开发者ID:espertechinc,项目名称:esper,代码行数:2,代码来源:VirtualDWView.java

示例9: handleStopIndex

import com.espertech.esper.epl.spec.CreateIndexDesc; //导入依赖的package包/类
public void handleStopIndex(CreateIndexDesc spec); 
开发者ID:espertechinc,项目名称:esper,代码行数:2,代码来源:VirtualDWView.java


注:本文中的com.espertech.esper.epl.spec.CreateIndexDesc类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。