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


Java QueryPlanIndexItem类代码示例

本文整理汇总了Java中com.espertech.esper.epl.join.plan.QueryPlanIndexItem的典型用法代码示例。如果您正苦于以下问题:Java QueryPlanIndexItem类的具体用法?Java QueryPlanIndexItem怎么用?Java QueryPlanIndexItem使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


QueryPlanIndexItem类属于com.espertech.esper.epl.join.plan包,在下文中一共展示了QueryPlanIndexItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: TableMetadata

import com.espertech.esper.epl.join.plan.QueryPlanIndexItem; //导入依赖的package包/类
public TableMetadata(String tableName, String eplExpression, String statementName, Class[] keyTypes, Map<String, TableMetadataColumn> tableColumns, TableStateRowFactory rowFactory, int numberMethodAggregations, StatementContext createTableStatementContext, ObjectArrayEventType internalEventType, ObjectArrayEventType publicEventType, TableMetadataInternalEventToPublic eventToPublic, boolean queryPlanLogging)
        throws ExprValidationException {
    this.tableName = tableName;
    this.eplExpression = eplExpression;
    this.statementName = statementName;
    this.keyTypes = keyTypes;
    this.tableColumns = tableColumns;
    this.rowFactory = rowFactory;
    this.numberMethodAggregations = numberMethodAggregations;
    this.statementContextCreateTable = createTableStatementContext;
    this.internalEventType = internalEventType;
    this.publicEventType = publicEventType;
    this.eventToPublic = eventToPublic;
    this.queryPlanLogging = queryPlanLogging;

    if (keyTypes.length > 0) {
        Pair<int[], IndexMultiKey> pair = TableServiceUtil.getIndexMultikeyForKeys(tableColumns, internalEventType);
        QueryPlanIndexItem queryPlanIndexItem = QueryPlanIndexItem.fromIndexMultikeyTablePrimaryKey(pair.getSecond());
        eventTableIndexMetadataRepo.addIndexExplicit(true, pair.getSecond(), tableName, queryPlanIndexItem, createTableStatementContext.getStatementName());
        tableRowKeyFactory = new TableRowKeyFactory(pair.getFirst());
    }
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:23,代码来源:TableMetadata.java

示例2: assertJoinOneStreamAndReset

import com.espertech.esper.epl.join.plan.QueryPlanIndexItem; //导入依赖的package包/类
public static void assertJoinOneStreamAndReset(boolean unique) {
    Assert.assertTrue(JOINS.size() == 1);
    QueryPlan join = JOINS.get(0);
    QueryPlanIndex first = join.getIndexSpecs()[1];
    TableLookupIndexReqKey firstName = first.getItems().keySet().iterator().next();
    QueryPlanIndexItem index = first.getItems().get(firstName);
    Assert.assertEquals(unique, index.isUnique());
    reset();
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:10,代码来源:SupportQueryPlanIndexHook.java

示例3: assertJoinAllStreamsAndReset

import com.espertech.esper.epl.join.plan.QueryPlanIndexItem; //导入依赖的package包/类
public static void assertJoinAllStreamsAndReset(boolean unique) {
    Assert.assertTrue(JOINS.size() == 1);
    QueryPlan join = JOINS.get(0);
    for (QueryPlanIndex index : join.getIndexSpecs()) {
        TableLookupIndexReqKey firstName = index.getItems().keySet().iterator().next();
        QueryPlanIndexItem indexDesc = index.getItems().get(firstName);
        Assert.assertEquals(unique, indexDesc.isUnique());
    }
    reset();
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:11,代码来源:SupportQueryPlanIndexHook.java

示例4: EventTableIndexMetadataEntry

import com.espertech.esper.epl.join.plan.QueryPlanIndexItem; //导入依赖的package包/类
public EventTableIndexMetadataEntry(String optionalIndexName, boolean primary, QueryPlanIndexItem queryPlanIndexItem, String explicitIndexNameIfExplicit) {
    super(optionalIndexName);
    this.primary = primary;
    this.queryPlanIndexItem = queryPlanIndexItem;
    referencedByStmt = primary ? null : new HashSet<String>();
    this.explicitIndexNameIfExplicit = explicitIndexNameIfExplicit;
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:8,代码来源:EventTableIndexMetadataEntry.java

示例5: validateCompileExplicitIndex

import com.espertech.esper.epl.join.plan.QueryPlanIndexItem; //导入依赖的package包/类
public static QueryPlanIndexItem validateCompileExplicitIndex(String indexName, boolean unique, List<CreateIndexItem> columns, EventType eventType, StatementContext statementContext)
        throws ExprValidationException {

    List<IndexedPropDesc> hashProps = new ArrayList<IndexedPropDesc>();
    List<IndexedPropDesc> btreeProps = new ArrayList<IndexedPropDesc>();
    Set<String> indexedColumns = new HashSet<String>();
    EventAdvancedIndexProvisionDesc advancedIndexProvisionDesc = null;

    for (CreateIndexItem columnDesc : columns) {
        String indexType = columnDesc.getType().toLowerCase(Locale.ENGLISH).trim();
        if (indexType.equals(CreateIndexType.HASH.getNameLower()) || indexType.equals(CreateIndexType.BTREE.getNameLower())) {
            validateBuiltin(columnDesc, eventType, hashProps, btreeProps, indexedColumns);
        } else {
            if (advancedIndexProvisionDesc != null) {
                throw new ExprValidationException("Nested advanced-type indexes are not supported");
            }
            advancedIndexProvisionDesc = validateAdvanced(indexName, indexType, columnDesc, eventType, statementContext);
        }
    }

    if (unique && !btreeProps.isEmpty()) {
        throw new ExprValidationException("Combination of unique index with btree (range) is not supported");
    }
    if ((!btreeProps.isEmpty() || !hashProps.isEmpty()) && advancedIndexProvisionDesc != null) {
        throw new ExprValidationException("Combination of hash/btree columns an advanced-type indexes is not supported");
    }
    return new QueryPlanIndexItem(hashProps, btreeProps, unique, advancedIndexProvisionDesc);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:29,代码来源:EventTableIndexUtil.java

示例6: addIndexExplicit

import com.espertech.esper.epl.join.plan.QueryPlanIndexItem; //导入依赖的package包/类
public void addIndexExplicit(boolean isPrimary, IndexMultiKey indexMultiKey, String explicitIndexName, QueryPlanIndexItem explicitIndexDesc, String statementName)
        throws ExprValidationException {
    if (getIndexByName(explicitIndexName) != null) {
        throw new ExprValidationException("An index by name '" + explicitIndexName + "' already exists");
    }
    if (indexes.containsKey(indexMultiKey)) {
        throw new ExprValidationException("An index for the same columns already exists");
    }
    EventTableIndexMetadataEntry entry = new EventTableIndexMetadataEntry(explicitIndexName, isPrimary, explicitIndexDesc, explicitIndexName);
    entry.addReferringStatement(statementName);
    indexes.put(indexMultiKey, entry);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:13,代码来源:EventTableIndexMetadata.java

示例7: addIndexNonExplicit

import com.espertech.esper.epl.join.plan.QueryPlanIndexItem; //导入依赖的package包/类
public void addIndexNonExplicit(IndexMultiKey indexMultiKey, String statementName, QueryPlanIndexItem queryPlanIndexItem)
        throws ExprValidationException {
    if (indexes.containsKey(indexMultiKey)) {
        return;
    }
    EventTableIndexMetadataEntry entry = new EventTableIndexMetadataEntry(null, false, queryPlanIndexItem, null);
    entry.addReferringStatement(statementName);
    indexes.put(indexMultiKey, entry);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:10,代码来源:EventTableIndexMetadata.java

示例8: validateAddExplicitIndex

import com.espertech.esper.epl.join.plan.QueryPlanIndexItem; //导入依赖的package包/类
public void validateAddExplicitIndex(String explicitIndexName, QueryPlanIndexItem explicitIndexDesc, EventType eventType, Iterable<EventBean> dataWindowContents, AgentInstanceContext agentInstanceContext, boolean allowIndexExists, Object optionalSerde)
        throws ExprValidationException {
    if (explicitIndexes.containsKey(explicitIndexName)) {
        if (allowIndexExists) {
            return;
        }
        throw new ExprValidationException("Index by name '" + explicitIndexName + "' already exists");
    }

    addExplicitIndex(explicitIndexName, explicitIndexDesc, eventType, dataWindowContents, agentInstanceContext, optionalSerde);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:12,代码来源:EventTableIndexRepository.java

示例9: addIndex

import com.espertech.esper.epl.join.plan.QueryPlanIndexItem; //导入依赖的package包/类
private Pair<IndexMultiKey, EventTableAndNamePair> addIndex(boolean unique, List<IndexedPropDesc> hashProps, List<IndexedPropDesc> btreeProps, EventAdvancedIndexProvisionDesc advancedIndexProvisionDesc, Iterable<EventBean> prefilledEvents, EventType indexedType, String indexName, boolean mustCoerce, AgentInstanceContext agentInstanceContext, Object optionalSerde) {

        // not resolved as full match and not resolved as unique index match, allocate
        IndexMultiKey indexPropKey = new IndexMultiKey(unique, hashProps, btreeProps, advancedIndexProvisionDesc == null ? null : advancedIndexProvisionDesc.getIndexDesc());

        IndexedPropDesc[] indexedPropDescs = hashProps.toArray(new IndexedPropDesc[hashProps.size()]);
        String[] indexProps = IndexedPropDesc.getIndexProperties(indexedPropDescs);
        Class[] indexCoercionTypes = IndexedPropDesc.getCoercionTypes(indexedPropDescs);
        if (!mustCoerce) {
            indexCoercionTypes = null;
        }

        IndexedPropDesc[] rangePropDescs = btreeProps.toArray(new IndexedPropDesc[btreeProps.size()]);
        String[] rangeProps = IndexedPropDesc.getIndexProperties(rangePropDescs);
        Class[] rangeCoercionTypes = IndexedPropDesc.getCoercionTypes(rangePropDescs);

        QueryPlanIndexItem indexItem = new QueryPlanIndexItem(indexProps, indexCoercionTypes, rangeProps, rangeCoercionTypes, unique, advancedIndexProvisionDesc);
        EventTable table = EventTableUtil.buildIndex(agentInstanceContext, 0, indexItem, indexedType, true, unique, indexName, optionalSerde, false);

        // fill table since its new
        EventBean[] events = new EventBean[1];
        for (EventBean prefilledEvent : prefilledEvents) {
            events[0] = prefilledEvent;
            table.add(events, agentInstanceContext);
        }

        // add table
        tables.add(table);

        // add index, reference counted
        tableIndexesRefCount.put(indexPropKey, new EventTableIndexRepositoryEntry(indexName, table));

        return new Pair<IndexMultiKey, EventTableAndNamePair>(indexPropKey, new EventTableAndNamePair(table, indexName));
    }
 
开发者ID:espertechinc,项目名称:esper,代码行数:35,代码来源:EventTableIndexRepository.java

示例10: StatementAgentInstanceFactoryCreateIndex

import com.espertech.esper.epl.join.plan.QueryPlanIndexItem; //导入依赖的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

示例11: assertJoinOneStreamAndReset

import com.espertech.esper.epl.join.plan.QueryPlanIndexItem; //导入依赖的package包/类
public static void assertJoinOneStreamAndReset(boolean unique) {
    Assert.assertTrue(joins.size() == 1);
    QueryPlan join = joins.get(0);
    QueryPlanIndex first = join.getIndexSpecs()[1];
    TableLookupIndexReqKey firstName = first.getItems().keySet().iterator().next();
    QueryPlanIndexItem index = first.getItems().get(firstName);
    Assert.assertEquals(unique, index.isUnique());
    reset();
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:10,代码来源:SupportQueryPlanIndexHook.java

示例12: assertJoinAllStreamsAndReset

import com.espertech.esper.epl.join.plan.QueryPlanIndexItem; //导入依赖的package包/类
public static void assertJoinAllStreamsAndReset(boolean unique) {
    Assert.assertTrue(joins.size() == 1);
    QueryPlan join = joins.get(0);
    for (QueryPlanIndex index : join.getIndexSpecs()) {
        TableLookupIndexReqKey firstName = index.getItems().keySet().iterator().next();
        QueryPlanIndexItem indexDesc = index.getItems().get(firstName);
        Assert.assertEquals(unique, indexDesc.isUnique());
    }
    reset();
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:11,代码来源:SupportQueryPlanIndexHook.java

示例13: addIndex

import com.espertech.esper.epl.join.plan.QueryPlanIndexItem; //导入依赖的package包/类
private Pair<IndexMultiKey, EventTableAndNamePair> addIndex(boolean unique, List<IndexedPropDesc> hashProps, List<IndexedPropDesc> btreeProps, Iterable<EventBean> prefilledEvents, EventType indexedType, String indexName, boolean mustCoerce) {

        // not resolved as full match and not resolved as unique index match, allocate
        IndexMultiKey indexPropKey = new IndexMultiKey(unique, hashProps, btreeProps);

        IndexedPropDesc[] indexedPropDescs = hashProps.toArray(new IndexedPropDesc[hashProps.size()]);
        String[] indexProps = IndexedPropDesc.getIndexProperties(indexedPropDescs);
        Class[] indexCoercionTypes = IndexedPropDesc.getCoercionTypes(indexedPropDescs);
        if (!mustCoerce) {
            indexCoercionTypes = null;
        }

        IndexedPropDesc[] rangePropDescs = btreeProps.toArray(new IndexedPropDesc[btreeProps.size()]);
        String[] rangeProps = IndexedPropDesc.getIndexProperties(rangePropDescs);
        Class[] rangeCoercionTypes = IndexedPropDesc.getCoercionTypes(rangePropDescs);

        QueryPlanIndexItem indexItem = new QueryPlanIndexItem(indexProps, indexCoercionTypes, rangeProps, rangeCoercionTypes, false);
        EventTable table = EventTableUtil.buildIndex(0, indexItem, indexedType, true, unique, indexName);

        // fill table since its new
        EventBean[] events = new EventBean[1];
        for (EventBean prefilledEvent : prefilledEvents)
        {
            events[0] = prefilledEvent;
            table.add(events);
        }

        // add table
        tables.add(table);

        // add index, reference counted
        tableIndexesRefCount.put(indexPropKey, new NamedWindowIndexRepEntry(table, indexName, 1));

        return new Pair<IndexMultiKey, EventTableAndNamePair>(indexPropKey, new EventTableAndNamePair(table, indexName));
    }
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:36,代码来源:NamedWindowIndexRepository.java

示例14: assertJoinOneStreamAndReset

import com.espertech.esper.epl.join.plan.QueryPlanIndexItem; //导入依赖的package包/类
public static void assertJoinOneStreamAndReset(boolean unique) {
    Assert.assertTrue(joins.size() == 1);
    QueryPlan join = joins.get(0);
    QueryPlanIndex first = join.getIndexSpecs()[1];
    String firstName = first.getItems().keySet().iterator().next();
    QueryPlanIndexItem index = first.getItems().get(firstName);
    Assert.assertEquals(unique, index.isUnique());
    reset();
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:10,代码来源:SupportQueryPlanIndexHook.java

示例15: assertJoinAllStreamsAndReset

import com.espertech.esper.epl.join.plan.QueryPlanIndexItem; //导入依赖的package包/类
public static void assertJoinAllStreamsAndReset(boolean unique) {
    Assert.assertTrue(joins.size() == 1);
    QueryPlan join = joins.get(0);
    for (QueryPlanIndex index : join.getIndexSpecs()) {
        String firstName = index.getItems().keySet().iterator().next();
        QueryPlanIndexItem indexDesc = index.getItems().get(firstName);
        Assert.assertEquals(unique, indexDesc.isUnique());
    }
    reset();
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:11,代码来源:SupportQueryPlanIndexHook.java


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