Exemple #1
0
 public EventTableFactoryCustomIndex(string indexName, int indexedStreamNum, EventType eventType, bool unique, EventAdvancedIndexProvisionDesc advancedIndexProvisionDesc)
 {
     this.eventType = eventType;
     this.advancedIndexProvisionDesc = advancedIndexProvisionDesc;
     string[] expressions = ExprNodeUtility.ToExpressionStringMinPrecedenceAsArray(advancedIndexProvisionDesc.IndexDesc.IndexedExpressions);
     this.organization = new EventTableOrganization(indexName, unique, false, indexedStreamNum, expressions, EventTableOrganizationType.APPLICATION);
 }
 public EventTableQuadTreePointRegionImpl(EventTableOrganization organization,
                                          AdvancedIndexConfigStatementPointRegionQuadtree config, PointRegionQuadTree <Object> quadTree)
 {
     _organization = organization;
     _config       = config;
     _quadTree     = quadTree;
 }
 public EventTableQuadTreeMXCIFImpl(
     EventTableOrganization organization,
     AdvancedIndexConfigStatementMXCIFQuadtree config,
     MXCIFQuadTree <Object> quadTree)
 {
     _organization = organization;
     _config       = config;
     _quadTree     = quadTree;
 }
Exemple #4
0
 public EventTableQuadTreeMXCIFImpl(
     EventTableOrganization organization,
     AdvancedIndexConfigStatementMXCIFQuadtree config,
     MXCIFQuadTree quadTree)
 {
     this.organization = organization;
     this.config = config;
     this.quadTree = quadTree;
 }
Exemple #5
0
 public override EventTable GetIndex(string indexName)
 {
     if (indexName.Equals(TableMetadata.TableName))
     {
         var org = new EventTableOrganization(TableMetadata.TableName,
                                              true, false, 0, new string[0], EventTableOrganization.EventTableOrganizationType.UNORGANIZED);
         return(new SingleReferenceEventTable(org, _eventReference));
     }
     throw new IllegalStateException("Invalid index requested '" + indexName + "'");
 }
 public AdvancedIndexConfigContextPartition ConfigureContextPartition(
     EventType eventType,
     AdvancedIndexDesc indexDesc,
     ExprEvaluator[] parameters,
     ExprEvaluatorContext exprEvaluatorContext,
     EventTableOrganization organization,
     EventAdvancedIndexConfigStatement advancedIndexConfigStatement)
 {
     return(AdvancedIndexFactoryProviderQuadTree.ConfigureQuadTree(organization.IndexName, parameters, exprEvaluatorContext));
 }
Exemple #7
0
        public override EventTable Make(
            EventAdvancedIndexConfigStatement configStatement,
            AdvancedIndexConfigContextPartition configCP,
            EventTableOrganization organization)
        {
            var qt       = (AdvancedIndexConfigContextPartitionQuadTree)configCP;
            var quadTree = PointRegionQuadTreeFactory <object> .Make(qt.X, qt.Y, qt.Width, qt.Height, qt.LeafCapacity, qt.MaxTreeHeight);

            return(new EventTableQuadTreePointRegionImpl(organization, (AdvancedIndexConfigStatementPointRegionQuadtree)configStatement, quadTree));
        }
Exemple #8
0
 public VirtualDWEventTable(
     bool unique,
     IList <VirtualDataWindowLookupFieldDesc> hashAccess,
     IList <VirtualDataWindowLookupFieldDesc> btreeAccess,
     EventTableOrganization organization)
 {
     _unique       = unique;
     _hashAccess   = hashAccess.AsReadOnlyList();
     _btreeAccess  = btreeAccess.AsReadOnlyList();
     _organization = organization;
 }
Exemple #9
0
 public AdvancedIndexConfigContextPartition ConfigureContextPartition(
     AgentInstanceContext agentInstanceContext,
     EventType eventType,
     EventAdvancedIndexProvisionRuntime advancedIndexProvisionDesc,
     EventTableOrganization organization)
 {
     return AdvancedIndexFactoryProviderQuadTree.ConfigureQuadTree(
         organization.IndexName,
         advancedIndexProvisionDesc.ParameterEvaluators,
         agentInstanceContext);
 }
Exemple #10
0
 public VirtualDWEventTable(
     bool unique,
     IList<VirtualDataWindowLookupFieldDesc> hashAccess,
     IList<VirtualDataWindowLookupFieldDesc> btreeAccess,
     EventTableOrganization organization)
 {
     IsUnique = unique;
     HashAccess = Collections.ReadonlyList(hashAccess);
     BtreeAccess = Collections.ReadonlyList(btreeAccess);
     Organization = organization;
 }
 public EventTableFactoryCustomIndex(
     string indexName,
     int indexedStreamNum,
     EventType eventType,
     bool unique,
     EventAdvancedIndexProvisionRuntime advancedIndexProvisionDesc)
 {
     this.eventType = eventType;
     this.advancedIndexProvisionDesc = advancedIndexProvisionDesc;
     this.organization = new EventTableOrganization(
         indexName,
         unique,
         false,
         indexedStreamNum,
         advancedIndexProvisionDesc.IndexExpressionTexts,
         EventTableOrganizationType.APPLICATION);
 }
        public TableStateInstanceGroupedImpl(
            TableMetadata tableMetadata,
            AgentInstanceContext agentInstanceContext,
            IReaderWriterLockManager rwLockManager)
            : base(tableMetadata, agentInstanceContext, rwLockManager)
        {
            IList <EventPropertyGetter> indexGetters = new List <EventPropertyGetter>();
            IList <string> keyNames = new List <string>();

            foreach (var entry in tableMetadata.TableColumns)
            {
                if (entry.Value.IsKey)
                {
                    keyNames.Add(entry.Key);
                    indexGetters.Add(tableMetadata.InternalEventType.GetGetter(entry.Key));
                }
            }

            var tableName    = "primary-" + tableMetadata.TableName;
            var organization = new EventTableOrganization(tableName, true, false, 0, Collections.GetEmptyList <string>(), EventTableOrganizationType.HASH);

            EventTable table;

            if (indexGetters.Count == 1)
            {
                var tableMap = new TransformDictionary <object, EventBean, object, ObjectArrayBackedEventBean>(
                    _rows, k => k, v => v, k => k, v => v as ObjectArrayBackedEventBean);
                table = new PropertyIndexedEventTableSingleUnique(indexGetters[0], organization, tableMap);
            }
            else
            {
                var getters  = indexGetters.ToArrayOrNull();
                var tableMap = new TransformDictionary <MultiKeyUntyped, EventBean, object, ObjectArrayBackedEventBean>(
                    _rows, k => k as MultiKeyUntyped, v => v, k => k, v => v as ObjectArrayBackedEventBean);
                table = new PropertyIndexedEventTableUnique(getters, organization, tableMap);
            }

            var pair = TableServiceUtil.GetIndexMultikeyForKeys(tableMetadata.TableColumns, tableMetadata.InternalEventType);

            _primaryIndexKey = pair.Second;
            _indexRepository.AddIndex(_primaryIndexKey, new EventTableIndexRepositoryEntry(tableName, table));
        }
        public EventTable[] Index(
            IList<EventBean> pollResult,
            bool isActiveCache,
            AgentInstanceContext agentInstanceContext)
        {
            if (!isActiveCache) {
                return new EventTable[] {new UnindexedEventTableList(pollResult, StreamNum)};
            }

            var tables = new EventTable[IndexingStrategies.Length];
            for (var i = 0; i < IndexingStrategies.Length; i++) {
                tables[i] = IndexingStrategies[i].Index(pollResult, isActiveCache, agentInstanceContext)[0];
            }

            var organization = new EventTableOrganization(
                null,
                false,
                false,
                StreamNum,
                null,
                EventTableOrganizationType.MULTIINDEX);
            return new EventTable[] {new MultiIndexEventTable(tables, organization)};
        }
 public abstract EventTable Make(EventAdvancedIndexConfigStatement configStatement,
                                 AdvancedIndexConfigContextPartition configContextPartition, EventTableOrganization organization);