Esempio n. 1
0
        public void AddIndexExplicit(
            bool isPrimary,
            IndexMultiKey indexMultiKey,
            string explicitIndexName,
            string explicitIndexModuleName,
            QueryPlanIndexItem explicitIndexDesc,
            string deploymentId)
        {
            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");
            }

            var entry = new EventTableIndexMetadataEntry(
                explicitIndexName,
                explicitIndexModuleName,
                isPrimary,
                explicitIndexDesc,
                explicitIndexName,
                explicitIndexModuleName,
                deploymentId);
            entry.AddReferringDeployment(deploymentId);
            Indexes.Put(indexMultiKey, entry);
        }
Esempio n. 2
0
        public void AddIndexNonExplicit(
            IndexMultiKey indexMultiKey,
            string deploymentId,
            QueryPlanIndexItem queryPlanIndexItem)
        {
            if (indexMultiKey == null) {
                throw new ArgumentException("Null index multikey");
            }

            if (Indexes.ContainsKey(indexMultiKey)) {
                return;
            }

            var entry = new EventTableIndexMetadataEntry(
                null,
                null,
                false,
                queryPlanIndexItem,
                null,
                null,
                deploymentId);
            entry.AddReferringDeployment(deploymentId);
            Indexes.Put(indexMultiKey, entry);
        }