Пример #1
0
        public TableMetadata(
            string tableName,
            string eplExpression,
            string statementName,
            Type[] keyTypes,
            IDictionary<string, TableMetadataColumn> tableColumns,
            TableStateRowFactory rowFactory,
            int numberMethodAggregations,
            StatementContext createTableStatementContext,
            ObjectArrayEventType internalEventType,
            ObjectArrayEventType publicEventType,
            TableMetadataInternalEventToPublic eventToPublic,
            bool queryPlanLogging)
        {
            _tableName = tableName;
            _eplExpression = eplExpression;
            _statementName = statementName;
            _keyTypes = keyTypes;
            _tableColumns = tableColumns;
            _rowFactory = rowFactory;
            _numberMethodAggregations = numberMethodAggregations;
            _statementContextCreateTable = createTableStatementContext;
            _internalEventType = internalEventType;
            _publicEventType = publicEventType;
            _eventToPublic = eventToPublic;
            _queryPlanLogging = queryPlanLogging;

            if (keyTypes.Length > 0)
            {
                var pair = TableServiceUtil.GetIndexMultikeyForKeys(tableColumns, internalEventType);
                var queryPlanIndexItem = QueryPlanIndexItem.FromIndexMultikeyTablePrimaryKey(pair.Second);
                _eventTableIndexMetadataRepo.AddIndexExplicit(true, pair.Second, tableName, queryPlanIndexItem, createTableStatementContext.StatementName);
                _tableRowKeyFactory = new TableRowKeyFactory(pair.First);
            }
        }
Пример #2
0
        public TableMetadata AddTable(
            string tableName,
            string eplExpression,
            string statementName,
            Type[] keyTypes,
            IDictionary<String, TableMetadataColumn> tableColumns,
            TableStateRowFactory tableStateRowFactory,
            int numberMethodAggregations,
            StatementContext statementContext,
            ObjectArrayEventType internalEventType,
            ObjectArrayEventType publicEventType,
            TableMetadataInternalEventToPublic eventToPublic,
            bool queryPlanLogging)
        {
            var metadata = new TableMetadata(
                tableName,
                eplExpression,
                statementName,
                keyTypes,
                tableColumns,
                tableStateRowFactory,
                numberMethodAggregations,
                statementContext,
                internalEventType,
                publicEventType,
                eventToPublic,
                queryPlanLogging);

            // determine table state factory
            TableStateFactory tableStateFactory;
            if (keyTypes.Length == 0)
            { // ungrouped
                tableStateFactory = new ProxyTableStateFactory
                {
                    ProcMakeTableState = agentInstanceContext => new TableStateInstanceUngroupedImpl(
                        metadata, agentInstanceContext, _rwLockManager),
                };
            }
            else
            {
                tableStateFactory = new ProxyTableStateFactory
                {
                    ProcMakeTableState = agentInstanceContext => new TableStateInstanceGroupedImpl(
                        metadata, agentInstanceContext, _rwLockManager),
                };
            }
            metadata.TableStateFactory = tableStateFactory;

            _tables.Put(tableName, metadata);
            return metadata;
        }
Пример #3
0
        public TableMetadata(string tableName, string eplExpression, string statementName, Type[] keyTypes, IDictionary <String, TableMetadataColumn> tableColumns, TableStateRowFactory rowFactory, int numberMethodAggregations, StatementResourceService createTableResources, string contextName, ObjectArrayEventType internalEventType, ObjectArrayEventType publicEventType, TableMetadataInternalEventToPublic eventToPublic, bool queryPlanLogging, string createTableStatementName)
        {
            _tableName               = tableName;
            _eplExpression           = eplExpression;
            _statementName           = statementName;
            KeyTypes                 = keyTypes;
            TableColumns             = tableColumns;
            RowFactory               = rowFactory;
            NumberMethodAggregations = numberMethodAggregations;
            _createTableResources    = createTableResources;
            ContextName              = contextName;
            InternalEventType        = internalEventType;
            _publicEventType         = publicEventType;
            _eventToPublic           = eventToPublic;
            _queryPlanLogging        = queryPlanLogging;

            if (keyTypes.Length > 0)
            {
                var pair = TableServiceUtil.GetIndexMultikeyForKeys(tableColumns, internalEventType);
                _eventTableIndexMetadataRepo.AddIndex(true, pair.Second, tableName, createTableStatementName, true);
                _tableRowKeyFactory = new TableRowKeyFactory(pair.First);
            }
        }
Пример #4
0
 internal TableToPublicEnumerator(TableStateInstance tableStateInstance)
 {
     _eventToPublic      = tableStateInstance.TableMetadata.EventToPublic;
     _enumerator         = tableStateInstance.EventCollection.GetEnumerator();
     _tableStateInstance = tableStateInstance;
 }