Example #1
0
        private void CheckCacheValid()
        {
            this.cubeInfoTable.Clear();
            ObjectMetadataCache.Discover(this.connection, CubeCollectionInternal.schemaName, this.restrictions, this.cubeInfoTable, false);
            bool flag;

            if (this.cubeInfoTable.Rows.Count <= 0)
            {
                flag = false;
            }
            else
            {
                DataRow dataRow = this.cubeInfoTable.Rows[0];
                flag = dataRow[this.currentTimeColumn].Equals(((DataRow)((IAdomdBaseObject)this.parentCube).MetadataData)[this.originalTimeColumn]);
            }
            this.lastCacheValidationTime = DateTime.Now;
            if (flag)
            {
                this.cacheState = MetadataCacheState.UpToDate;
            }
            else
            {
                this.cacheState = MetadataCacheState.Invalid;
            }
            this.EnsureValid();
        }
        internal MiningServiceCollectionInternal(AdomdConnection connection) : base(connection)
        {
            ListDictionary      restrictions = new ListDictionary();
            ObjectMetadataCache objectCache  = new ObjectMetadataCache(connection, InternalObjectType.InternalTypeMiningService, MiningServiceCollectionInternal.schemaName, restrictions);

            base.Initialize(objectCache);
        }
Example #3
0
 internal void PopulateSelf()
 {
     if (this.connection == null)
     {
         throw new NotSupportedException(SR.NotSupportedWhenConnectionMissing);
     }
     AdomdUtils.CheckConnectionOpened(this.connection);
     if (!this.IsInitialized)
     {
         this.cacheTable        = new DataTable();
         this.cacheTable.Locale = CultureInfo.InvariantCulture;
         this.cacheTable.Columns.Add("ObjectColumn_ADOMDInternal$$", typeof(object));
     }
     if (this.isNestedSchema)
     {
         ObjectMetadataCache.DiscoverNested(this.connection, this.requestType, this.restrictions, out this.cacheDataSet);
         this.cacheTable.Columns.Add("__RowIndex__", typeof(int));
         object[] array = new object[2];
         for (int i = 0; i < this.cacheDataSet.Tables[0].Rows.Count; i++)
         {
             array[0] = null;
             array[1] = i;
             this.cacheTable.Rows.Add(array);
         }
     }
     else
     {
         ObjectMetadataCache.Discover(this.connection, this.requestType, this.restrictions, this.cacheTable, !this.isInitialized);
     }
     this.cacheState    = MetadataCacheState.UpToDate;
     this.isInitialized = true;
 }
Example #4
0
        private void Populate(InternalObjectType objectType)
        {
            ObjectMetadataCache objectCache = this.GetObjectCache(objectType);
            bool isInitialized = objectCache.IsInitialized;
            bool isPopulated   = objectCache.IsPopulated;

            if (!isInitialized || !isPopulated)
            {
                objectCache.PopulateSelf();
                if (!isInitialized)
                {
                    this.CreatePrimaryKeys(objectCache.CacheTable, objectType);
                    this.cacheDataset.Tables.Add(objectCache.CacheTable);
                }
                DataTable objectsParentTable = this.GetObjectsParentTable(objectType);
                if (objectsParentTable != null)
                {
                    objectCache.Relation = this.CreateRelation(objectsParentTable, objectCache.CacheTable, objectCache.RelationColumn);
                }
                ObjectMetadataCache objectsChildObjectCache = this.GetObjectsChildObjectCache(objectType);
                if (this.GetObjectTable(objectsChildObjectCache) != null)
                {
                    objectsChildObjectCache.Relation = this.CreateRelation(objectCache.CacheTable, objectsChildObjectCache.CacheTable, objectsChildObjectCache.RelationColumn);
                }
            }
        }
Example #5
0
 private DataTable GetObjectTable(ObjectMetadataCache cache)
 {
     if (cache != null && cache.IsInitialized)
     {
         return(cache.CacheTable);
     }
     return(null);
 }
Example #6
0
        internal CubeCollectionInternal(AdomdConnection connection) : base(connection)
        {
            ListDictionary restrictions = new ListDictionary();

            AdomdUtils.AddCubeSourceRestrictionIfApplicable(connection, restrictions);
            ObjectMetadataCache objectCache = new ObjectMetadataCache(connection, InternalObjectType.InternalTypeCube, CubeCollectionInternal.schemaName, restrictions);

            base.Initialize(objectCache);
        }
        private void InternalConstructor(AdomdConnection connection, string parentModelName)
        {
            ListDictionary listDictionary = new ListDictionary();

            listDictionary.Add(MiningModelColumnCollectionInternal.modelNameRest, parentModelName);
            ObjectMetadataCache objectCache = new ObjectMetadataCache(connection, InternalObjectType.InternalTypeMiningModelColumn, MiningModelColumnCollectionInternal.schemaName, listDictionary);

            base.Initialize(objectCache);
        }
        internal MiningModelCollectionInternal(MiningStructure structure) : base(structure.ParentConnection)
        {
            ListDictionary listDictionary = new ListDictionary();

            listDictionary.Add(MiningModelCollectionInternal.structNameRest, structure.Name);
            this.parentObject = structure;
            ObjectMetadataCache objectCache = new ObjectMetadataCache(structure.ParentConnection, InternalObjectType.InternalTypeMiningModel, MiningModelCollectionInternal.schemaName, listDictionary);

            base.Initialize(objectCache);
        }
Example #9
0
 void IMetadataCache.MarkAbandoned()
 {
     this.cacheState = MetadataCacheState.Abandoned;
     ObjectMetadataCache[] array = this.objectMetadataCaches;
     for (int i = 0; i < array.Length; i++)
     {
         ObjectMetadataCache objectMetadataCache = array[i];
         objectMetadataCache.MarkAbandonedSelf();
     }
 }
Example #10
0
        internal MiningContentNodeCollectionInternal(AdomdConnection connection, MiningModel parentMiningModel, string nodeUniqueName) : base(connection)
        {
            this.parentMiningModel = parentMiningModel;
            ListDictionary listDictionary = new ListDictionary();

            listDictionary.Add(MiningContentNodeCollectionInternal.modelNameRest, parentMiningModel.Name);
            listDictionary.Add(MiningContentNodeCollectionInternal.nodeUniqueNameRest, nodeUniqueName);
            ObjectMetadataCache objectCache = new ObjectMetadataCache(connection, InternalObjectType.InternalTypeMiningContentNode, MiningContentNodeCollectionInternal.schemaName, listDictionary, true);

            base.Initialize(objectCache);
        }
        internal MiningServiceParameterCollectionInternal(AdomdConnection connection, MiningService parentService) : base(connection)
        {
            string name = parentService.Name;

            this.parentService = parentService;
            ListDictionary listDictionary = new ListDictionary();

            listDictionary.Add(MiningServiceParameterCollectionInternal.serviceNameRest, name);
            ObjectMetadataCache objectCache = new ObjectMetadataCache(connection, InternalObjectType.InternalTypeMiningServiceParameter, MiningServiceParameterCollectionInternal.schemaName, listDictionary);

            base.Initialize(objectCache);
        }
Example #12
0
        DataRow IMetadataCache.FindObjectByUniqueName(SchemaObjectType objectType, string nameUnique)
        {
            this.Populate((InternalObjectType)objectType);
            ObjectMetadataCache objectCache = this.GetObjectCache((InternalObjectType)objectType);
            string dataTableFilter          = AdomdUtils.GetDataTableFilter(this.GetUniqueNameColumn((InternalObjectType)objectType), nameUnique);

            DataRow[] filteredRows = ((IObjectCache)objectCache).GetFilteredRows(null, dataTableFilter);
            if (filteredRows.Length <= 0)
            {
                return(null);
            }
            return(filteredRows[0]);
        }
Example #13
0
        internal MiningContentNodeCollectionInternal(AdomdConnection connection, MiningContentNode parentNode, MiningNodeTreeOpType operation) : base(connection)
        {
            this.parentNode        = parentNode;
            this.parentMiningModel = parentNode.ParentMiningModel;
            this.operation         = operation;
            ListDictionary listDictionary = new ListDictionary();

            listDictionary.Add(MiningContentNodeCollectionInternal.modelNameRest, this.parentMiningModel.Name);
            listDictionary.Add(MiningContentNodeCollectionInternal.nodeUniqueNameRest, parentNode.UniqueName);
            listDictionary.Add(MiningContentNodeCollectionInternal.treeOperationRest, (int)operation);
            ObjectMetadataCache objectCache = new ObjectMetadataCache(connection, InternalObjectType.InternalTypeMiningContentNode, MiningContentNodeCollectionInternal.schemaName, listDictionary, true);

            base.Initialize(objectCache);
        }
Example #14
0
 private void Discover(DataTable destinationTable, bool doCreate)
 {
     ObjectMetadataCache.Discover(this.connection, this.requestType, this.restrictions, destinationTable, doCreate);
 }
Example #15
0
 void IObjectCache.CheckCacheIsValid()
 {
     if (this.IsPopulated)
     {
         if (this.metadataCache != null)
         {
             this.metadataCache.CheckCacheIsValid();
             return;
         }
         this.EnsureNotAbandoned();
         this.EnsureValid();
         if (this.NeedCheckForRefresh())
         {
             bool flag = true;
             if (this.cacheValidationTable == null)
             {
                 this.cacheValidationTable       = this.cacheTable.Clone();
                 this.cacheValidationColumnNames = ObjectMetadataCache.GetColumnNamesToCompareForUpdate(this.objectType);
             }
             else
             {
                 this.cacheValidationTable.Clear();
             }
             this.Discover(this.cacheValidationTable, false);
             if (this.cacheTable.Rows.Count != this.cacheValidationTable.Rows.Count)
             {
                 flag = false;
             }
             else if (this.cacheValidationColumnNames != null)
             {
                 for (int i = 0; i < this.cacheValidationTable.Rows.Count; i++)
                 {
                     DataRow  dataRow = this.cacheTable.Rows[i];
                     string[] array   = this.cacheValidationColumnNames;
                     for (int j = 0; j < array.Length; j++)
                     {
                         string columnName = array[j];
                         if (!object.Equals(dataRow[columnName], this.cacheValidationTable.Rows[i][columnName]))
                         {
                             flag = false;
                             break;
                         }
                     }
                     if (!flag)
                     {
                         break;
                     }
                 }
             }
             this.lastCacheValidationTime = DateTime.Now;
             if (!flag)
             {
                 this.cacheState = MetadataCacheState.Invalid;
             }
             else
             {
                 this.cacheState = MetadataCacheState.UpToDate;
             }
             this.EnsureValid();
         }
     }
 }
Example #16
0
        private void Refresh(InternalObjectType objectType)
        {
            ObjectMetadataCache objectCache = this.GetObjectCache(objectType);

            objectCache.RefreshSelf();
        }