private async Task <bool> IsPartitionBackupSuspended(StatefulService statefulService, string processQueueTypeTrace) { var suspendStore = await SuspendStore.CreateOrGetSuspendStatusStore(statefulService); var fabricKey = UtilityHelper.GetBackupMappingKey(this.ServiceUri, this.PartitionId); var containsSuspension = await suspendStore.GetValueAsync(fabricKey) ?? await suspendStore.GetValueAsync(ServiceUri) ?? await suspendStore.GetValueAsync(UtilityHelper.GetApplicationUriFromServiceUri(ServiceUri)); BackupRestoreTrace.TraceSource.WriteInfo(processQueueTypeTrace, "IsPartition Suspended {0}", containsSuspension != null); return(containsSuspension != null); }
internal static async Task <SuspendStore> CreateOrGetSuspendStatusStore(StatefulService statefulService) { if (Store == null) { BackupRestoreTrace.TraceSource.WriteInfo(TraceRestoreStoreType, "Creating a Suspend Store"); IReliableDictionary <string, string> reliableDictionary = await statefulService.StateManager.GetOrAddAsync <IReliableDictionary <string, string> >(SuspendBackupStoreName); Store = new SuspendStore(reliableDictionary, statefulService); BackupRestoreTrace.TraceSource.WriteInfo(TraceRestoreStoreType, "Created a Suspend Store successfully"); } return(Store); }