Example #1
0
        // Token: 0x06001BDB RID: 7131 RVA: 0x0007858C File Offset: 0x0007678C
        private void UpdateClusdbInternal(Dictionary <string, string> tmpClusdbUpdates, out string lastAttemptedOperationName)
        {
            lastAttemptedOperationName = "Preparing";
            Dictionary <string, string> clusdbUpdates = this.PrepareUpdates(tmpClusdbUpdates);

            lastAttemptedOperationName = "OpenCluster";
            using (AmCluster amCluster = AmCluster.Open())
            {
                lastAttemptedOperationName = "GetClusterKey";
                using (IDistributedStoreKey clusterKey = DistributedStore.Instance.GetClusterKey(amCluster.Handle, null, null, DxStoreKeyAccessMode.Write, false))
                {
                    lastAttemptedOperationName = "OpenAmRootKey";
                    using (IDistributedStoreKey distributedStoreKey = clusterKey.OpenKey("ExchangeActiveManager", DxStoreKeyAccessMode.Write, false, null))
                    {
                        lastAttemptedOperationName = "OpenAmRootKey";
                        using (IDistributedStoreKey distributedStoreKey2 = distributedStoreKey.OpenKey("LastLog", DxStoreKeyAccessMode.CreateIfNotExist, false, null))
                        {
                            lastAttemptedOperationName = "CreateBatch";
                            using (IDistributedStoreBatchRequest distributedStoreBatchRequest = distributedStoreKey2.CreateBatchUpdateRequest())
                            {
                                lastAttemptedOperationName = "PopulateBatch";
                                this.PopulateBatch(distributedStoreKey2, distributedStoreBatchRequest, clusdbUpdates);
                                lastAttemptedOperationName = "ExecuteBatch";
                                distributedStoreBatchRequest.Execute(null);
                            }
                        }
                    }
                }
            }
        }
        // Token: 0x06000756 RID: 1878 RVA: 0x00023E94 File Offset: 0x00022094
        private void DeleteTimeStampsInternal(AmClusterHandle clusterHandle)
        {
            using (IDistributedStoreKey clusterKey = DistributedStore.Instance.GetClusterKey(clusterHandle, null, null, DxStoreKeyAccessMode.Write, false))
            {
                using (IDistributedStoreKey distributedStoreKey = clusterKey.OpenKey("ExchangeActiveManager", DxStoreKeyAccessMode.Write, true, null))
                {
                    if (distributedStoreKey != null)
                    {
                        using (IDistributedStoreKey distributedStoreKey2 = distributedStoreKey.OpenKey("LastLog", DxStoreKeyAccessMode.Write, true, null))
                        {
                            if (distributedStoreKey2 != null)
                            {
                                using (IDistributedStoreBatchRequest distributedStoreBatchRequest = distributedStoreKey2.CreateBatchUpdateRequest())
                                {
                                    foreach (Database database in this.m_databases)
                                    {
                                        string name         = database.Name;
                                        string text         = database.Guid.ToString();
                                        string propertyName = AmDbState.ConstructLastLogTimeStampProperty(text);
                                        string value        = distributedStoreKey2.GetValue(propertyName, null, null);
                                        if (value != null)
                                        {
                                            ClusterBatchLastLogGenDeleter.Tracer.TraceDebug <string, string, string>((long)this.GetHashCode(), "LastLogGeneration time stamp for database [{0} ({1})] found with value '{2}'.", name, text, value);
                                            this.m_logger.AppendLogMessage("Deleting LastLogGeneration time stamp from cluster registry for database [{0} ({1})] with existing value: '{2}'.", new object[]
                                            {
                                                name,
                                                text,
                                                value
                                            });
                                            distributedStoreBatchRequest.DeleteValue(propertyName);
                                        }
                                        else
                                        {
                                            ClusterBatchLastLogGenDeleter.Tracer.TraceDebug <string, string>((long)this.GetHashCode(), "LastLogGeneration time stamp for database [{0} ({1})] does not exist.", name, text);
                                        }
                                    }
                                    distributedStoreBatchRequest.Execute(null);
                                    goto IL_151;
                                }
                            }
                            ClusterBatchLastLogGenDeleter.Tracer.TraceDebug <string, string>((long)this.GetHashCode(), "ActiveManager LastLog key '{0}\\{1}' does not exist in the cluster registry. Skipping deletion.", "ExchangeActiveManager", "LastLog");
IL_151:
                            goto IL_178;
                        }
                    }
                    ClusterBatchLastLogGenDeleter.Tracer.TraceDebug <string>((long)this.GetHashCode(), "ActiveManager root key '{0}' does not exist in the cluster registry. Skipping deletion.", "ExchangeActiveManager");
                    IL_178 :;
                }
            }
        }