當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。