Esempio n. 1
0
        public static void ReserveLocalForestResources(ReservationContext reservation, WorkloadType workloadType, MRSRequestType requestType, RequestFlags requestFlags, Guid archiveGuid, Guid exchangeGuid, Guid sourceExchangeGuid, Guid targetExchangeGuid, TenantPartitionHint partitionHint, ADObjectId sourceDatabase, ADObjectId sourceArchiveDatabase, ADObjectId targetDatabase, ADObjectId targetArchiveDatabase, Guid sourceDatabaseGuid, Guid sourceArchiveDatabaseGuid, Guid targetDatabaseGuid, Guid targetArchiveDatabaseGuid)
        {
            ReservationFlags reservationFlags;
            Guid             guid;
            Guid             guid2;

            if (requestType == MRSRequestType.Move || requestType == MRSRequestType.MailboxRelocation)
            {
                reservationFlags = ReservationFlags.Move;
                if (requestFlags.HasFlag(RequestFlags.MoveOnlyArchiveMailbox) && archiveGuid != Guid.Empty)
                {
                    guid = archiveGuid;
                }
                else
                {
                    guid = exchangeGuid;
                }
                guid2 = guid;
            }
            else
            {
                reservationFlags = ReservationFlags.Merge;
                guid             = sourceExchangeGuid;
                guid2            = targetExchangeGuid;
            }
            if (workloadType != Microsoft.Exchange.WorkloadManagement.WorkloadType.MailboxReplicationServiceHighPriority)
            {
                switch (workloadType)
                {
                case Microsoft.Exchange.WorkloadManagement.WorkloadType.MailboxReplicationServiceInternalMaintenance:
                    reservationFlags |= ReservationFlags.InternalMaintenance;
                    break;

                case Microsoft.Exchange.WorkloadManagement.WorkloadType.MailboxReplicationServiceInteractive:
                    reservationFlags |= ReservationFlags.Interactive;
                    break;
                }
            }
            else
            {
                reservationFlags |= ReservationFlags.HighPriority;
            }
            reservation.ReserveResource((guid2 == Guid.Empty) ? guid : guid2, partitionHint, MRSResource.Id, reservationFlags);
            if (targetDatabaseGuid != Guid.Empty)
            {
                reservation.ReserveResource(guid2, partitionHint, targetDatabase, reservationFlags | ReservationFlags.Write);
            }
            if (targetArchiveDatabaseGuid != Guid.Empty && targetArchiveDatabaseGuid != targetDatabaseGuid && archiveGuid != Guid.Empty)
            {
                reservation.ReserveResource(archiveGuid, partitionHint, targetArchiveDatabase, reservationFlags | ReservationFlags.Write | ReservationFlags.Archive);
            }
            if (sourceDatabaseGuid != Guid.Empty)
            {
                reservation.ReserveResource(guid, partitionHint, sourceDatabase, reservationFlags | ReservationFlags.Read);
            }
            if (sourceArchiveDatabaseGuid != Guid.Empty && sourceArchiveDatabaseGuid != sourceDatabaseGuid && archiveGuid != Guid.Empty)
            {
                reservation.ReserveResource(archiveGuid, partitionHint, sourceArchiveDatabase, reservationFlags | ReservationFlags.Read | ReservationFlags.Archive);
            }
        }
Esempio n. 2
0
 private bool GetRequestFlag(WebStatsRequestFlags flag)
 {
     return(RequestFlags.HasFlag(flag));
 }
Esempio n. 3
0
 private bool GetRequestFlag(ReqFlags flag)
 {
     return(RequestFlags.HasFlag(flag));
 }